htmlIsBooleanAttr:
  362|  16.4k|{
  363|  16.4k|    const char *str = NULL;
  364|       |
  365|  16.4k|    if (name == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 16.4k]
  ------------------
  366|      0|        return(0);
  367|       |
  368|       |    /*
  369|       |     * These are the HTML attributes which will be output
  370|       |     * in minimized form, i.e. `<option selected="selected">` will be
  371|       |     * output as `<option selected>`, as per XSLT 1.0 16.2 "HTML Output
  372|       |     * Method":
  373|       |     *
  374|       |     * "checked", "compact", "declare", "defer", "disabled", "ismap",
  375|       |     * "multiple", "nohref", "noresize", "noshade", "nowrap", "readonly",
  376|       |     * "selected"
  377|       |     *
  378|       |     * Additional attributes from HTML5 (not implemented yet):
  379|       |     *
  380|       |     * "allowfullscreen", "alpha", "async", "autofocus", "autoplay",
  381|       |     * "controls", "default", "formnovalidate", "inert", "itemscope",
  382|       |     * "loop", "muted", "nomodule", "novalidate", "open", "playsinline",
  383|       |     * "required", "reversed", "shadowrootdelegatesfocus",
  384|       |     * "shadowrootclonable", "shadowrootserializable",
  385|       |     * "shadowrootcustomelementregistry", "truespeed"
  386|       |     */
  387|       |
  388|  16.4k|    switch (name[0] | 0x20) {
  ------------------
  |  Branch (388:13): [True: 9.59k, False: 6.81k]
  ------------------
  389|  2.41k|        case 'c':
  ------------------
  |  Branch (389:9): [True: 2.41k, False: 13.9k]
  ------------------
  390|  2.41k|            name += 1;
  391|  2.41k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (391:21): [True: 279, False: 2.13k]
  ------------------
  392|     78|                case 'h': str = "ecked"; break;
  ------------------
  |  Branch (392:17): [True: 78, False: 2.33k]
  ------------------
  393|    201|                case 'o': str = "mpact"; break;
  ------------------
  |  Branch (393:17): [True: 201, False: 2.21k]
  ------------------
  394|  2.41k|            }
  395|  2.41k|            break;
  396|  3.09k|        case 'd':
  ------------------
  |  Branch (396:9): [True: 3.09k, False: 13.3k]
  ------------------
  397|  3.09k|            name += 1;
  398|  3.09k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (398:21): [True: 753, False: 2.34k]
  ------------------
  399|    539|                case 'e':
  ------------------
  |  Branch (399:17): [True: 539, False: 2.55k]
  ------------------
  400|    539|                    name += 1;
  401|    539|                    switch (name[0] | 0x20) {
  ------------------
  |  Branch (401:29): [True: 148, False: 391]
  ------------------
  402|    109|                        case 'c': str = "lare"; break;
  ------------------
  |  Branch (402:25): [True: 109, False: 430]
  ------------------
  403|     39|                        case 'f': str = "er"; break;
  ------------------
  |  Branch (403:25): [True: 39, False: 500]
  ------------------
  404|    539|                    }
  405|    539|                    break;
  406|    539|                case 'i': str = "sabled"; break;
  ------------------
  |  Branch (406:17): [True: 214, False: 2.87k]
  ------------------
  407|  3.09k|            }
  408|  3.09k|            break;
  409|  3.09k|        case 'i':
  ------------------
  |  Branch (409:9): [True: 474, False: 15.9k]
  ------------------
  410|    474|            str = "smap";
  411|    474|            break;
  412|    216|        case 'm':
  ------------------
  |  Branch (412:9): [True: 216, False: 16.1k]
  ------------------
  413|    216|            str = "ultiple";
  414|    216|            break;
  415|  2.85k|        case 'n':
  ------------------
  |  Branch (415:9): [True: 2.85k, False: 13.5k]
  ------------------
  416|  2.85k|            name += 1;
  417|  2.85k|            if ((name[0] | 0x20) != 'o')
  ------------------
  |  Branch (417:17): [True: 1.33k, False: 1.51k]
  ------------------
  418|  1.33k|                break;
  419|  1.51k|            name += 1;
  420|  1.51k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (420:21): [True: 1.25k, False: 257]
  ------------------
  421|    324|                case 'h': str = "ref"; break;
  ------------------
  |  Branch (421:17): [True: 324, False: 1.18k]
  ------------------
  422|    689|                case 'r': str = "esize"; break;
  ------------------
  |  Branch (422:17): [True: 689, False: 823]
  ------------------
  423|     37|                case 's': str = "hade"; break;
  ------------------
  |  Branch (423:17): [True: 37, False: 1.47k]
  ------------------
  424|    205|                case 'w': str = "rap"; break;
  ------------------
  |  Branch (424:17): [True: 205, False: 1.30k]
  ------------------
  425|  1.51k|            }
  426|  1.51k|            break;
  427|  1.51k|        case 'r':
  ------------------
  |  Branch (427:9): [True: 207, False: 16.1k]
  ------------------
  428|    207|            str = "eadonly";
  429|    207|            break;
  430|    336|        case 's':
  ------------------
  |  Branch (430:9): [True: 336, False: 16.0k]
  ------------------
  431|    336|            str = "elected";
  432|    336|            break;
  433|  16.4k|    }
  434|       |
  435|  16.4k|    if (str == NULL)
  ------------------
  |  Branch (435:9): [True: 13.2k, False: 3.12k]
  ------------------
  436|  13.2k|        return(0);
  437|       |
  438|  3.12k|    return(xmlStrcasecmp(name + 1, BAD_CAST str) == 0);
  ------------------
  |  |   34|  3.12k|#define BAD_CAST (xmlChar *)
  ------------------
  439|  16.4k|}

xmlSAX2InternalSubset:
  242|  17.9k|{
  243|  17.9k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  244|  17.9k|    xmlDtdPtr dtd;
  245|  17.9k|    if (ctx == NULL) return;
  ------------------
  |  Branch (245:9): [True: 0, False: 17.9k]
  ------------------
  246|       |
  247|  17.9k|    if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 17.9k]
  ------------------
  248|      0|	return;
  249|  17.9k|    if ((ctxt->html) && (ctxt->instate != XML_PARSER_MISC))
  ------------------
  |  Branch (249:9): [True: 0, False: 17.9k]
  |  Branch (249:25): [True: 0, False: 0]
  ------------------
  250|      0|        return;
  251|  17.9k|    dtd = xmlGetIntSubset(ctxt->myDoc);
  252|  17.9k|    if (dtd != NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 17.9k]
  ------------------
  253|      0|	xmlUnlinkNode((xmlNodePtr) dtd);
  254|      0|	xmlFreeDtd(dtd);
  255|      0|	ctxt->myDoc->intSubset = NULL;
  256|      0|    }
  257|  17.9k|    ctxt->myDoc->intSubset =
  258|  17.9k|	xmlCreateIntSubset(ctxt->myDoc, name, publicId, systemId);
  259|  17.9k|    if (ctxt->myDoc->intSubset == NULL)
  ------------------
  |  Branch (259:9): [True: 9, False: 17.9k]
  ------------------
  260|      9|        xmlSAX2ErrMemory(ctxt);
  261|  17.9k|}
xmlSAX2ExternalSubset:
  274|  15.7k|{
  275|  15.7k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  276|  15.7k|    if (ctx == NULL) return;
  ------------------
  |  Branch (276:9): [True: 0, False: 15.7k]
  ------------------
  277|  15.7k|    if ((systemId != NULL) &&
  ------------------
  |  Branch (277:9): [True: 2.61k, False: 13.0k]
  ------------------
  278|  2.61k|        ((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (278:9): [True: 2.35k, False: 261]
  ------------------
  279|  2.35k|        (((ctxt->validate) || (ctxt->loadsubset & ~XML_SKIP_IDS)) &&
  ------------------
  |  |  210|    935|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (279:11): [True: 1.41k, False: 935]
  |  Branch (279:31): [True: 750, False: 185]
  ------------------
  280|  2.16k|	 (ctxt->wellFormed && ctxt->myDoc))) {
  ------------------
  |  Branch (280:4): [True: 2.10k, False: 61]
  |  Branch (280:24): [True: 2.10k, False: 0]
  ------------------
  281|       |	/*
  282|       |	 * Try to fetch and parse the external subset.
  283|       |	 */
  284|  2.10k|	xmlParserInputPtr oldinput;
  285|  2.10k|	int oldinputNr;
  286|  2.10k|	int oldinputMax;
  287|  2.10k|	xmlParserInputPtr *oldinputTab;
  288|  2.10k|	xmlParserInputPtr input = NULL;
  289|  2.10k|	xmlChar *oldencoding;
  290|  2.10k|        unsigned long consumed;
  291|  2.10k|        size_t buffered;
  292|  2.10k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  293|  2.10k|        int inputMax = 1;
  294|       |#else
  295|       |        int inputMax = 5;
  296|       |#endif
  297|       |
  298|       |	/*
  299|       |	 * Ask the Entity resolver to load the damn thing
  300|       |	 */
  301|  2.10k|	if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
  ------------------
  |  Branch (301:6): [True: 2.10k, False: 0]
  |  Branch (301:29): [True: 2.10k, False: 0]
  ------------------
  302|  2.10k|	    input = ctxt->sax->resolveEntity(ctxt->userData, publicId,
  303|  2.10k|	                                     systemId);
  304|  2.10k|	if (input == NULL) {
  ------------------
  |  Branch (304:6): [True: 730, False: 1.37k]
  ------------------
  305|    730|	    return;
  306|    730|	}
  307|       |
  308|  1.37k|	if (xmlNewDtd(ctxt->myDoc, name, publicId, systemId) == NULL) {
  ------------------
  |  Branch (308:6): [True: 3, False: 1.37k]
  ------------------
  309|      3|            xmlSAX2ErrMemory(ctxt);
  310|      3|            xmlFreeInputStream(input);
  311|      3|            return;
  312|      3|        }
  313|       |
  314|       |	/*
  315|       |	 * make sure we won't destroy the main document context
  316|       |	 */
  317|  1.37k|	oldinput = ctxt->input;
  318|  1.37k|	oldinputNr = ctxt->inputNr;
  319|  1.37k|	oldinputMax = ctxt->inputMax;
  320|  1.37k|	oldinputTab = ctxt->inputTab;
  321|  1.37k|	oldencoding = ctxt->encoding;
  322|  1.37k|	ctxt->encoding = NULL;
  323|       |
  324|  1.37k|	ctxt->inputTab = xmlMalloc(inputMax * sizeof(xmlParserInputPtr));
  325|  1.37k|	if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (325:6): [True: 1, False: 1.37k]
  ------------------
  326|      1|	    xmlSAX2ErrMemory(ctxt);
  327|      1|            goto error;
  328|      1|	}
  329|  1.37k|	ctxt->inputNr = 0;
  330|  1.37k|	ctxt->inputMax = inputMax;
  331|  1.37k|	ctxt->input = NULL;
  332|  1.37k|	if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (332:6): [True: 1, False: 1.37k]
  ------------------
  333|      1|            goto error;
  334|       |
  335|  1.37k|	if (input->filename == NULL)
  ------------------
  |  Branch (335:6): [True: 0, False: 1.37k]
  ------------------
  336|      0|	    input->filename = (char *) xmlCanonicPath(systemId);
  337|  1.37k|	input->line = 1;
  338|  1.37k|	input->col = 1;
  339|  1.37k|	input->base = ctxt->input->cur;
  340|  1.37k|	input->cur = ctxt->input->cur;
  341|  1.37k|	input->free = NULL;
  342|       |
  343|       |	/*
  344|       |	 * let's parse that entity knowing it's an external subset.
  345|       |	 */
  346|  1.37k|	xmlParseExternalSubset(ctxt, publicId, systemId);
  347|       |
  348|       |        /*
  349|       |	 * Free up the external entities
  350|       |	 */
  351|       |
  352|  1.44k|	while (ctxt->inputNr > 1)
  ------------------
  |  Branch (352:9): [True: 69, False: 1.37k]
  ------------------
  353|     69|	    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
  354|       |
  355|  1.37k|        consumed = ctxt->input->consumed;
  356|  1.37k|        buffered = ctxt->input->cur - ctxt->input->base;
  357|  1.37k|        if (buffered > ULONG_MAX - consumed)
  ------------------
  |  Branch (357:13): [True: 0, False: 1.37k]
  ------------------
  358|      0|            consumed = ULONG_MAX;
  359|  1.37k|        else
  360|  1.37k|            consumed += buffered;
  361|  1.37k|        if (consumed > ULONG_MAX - ctxt->sizeentities)
  ------------------
  |  Branch (361:13): [True: 0, False: 1.37k]
  ------------------
  362|      0|            ctxt->sizeentities = ULONG_MAX;
  363|  1.37k|        else
  364|  1.37k|            ctxt->sizeentities += consumed;
  365|       |
  366|  1.37k|error:
  367|  1.37k|	xmlFreeInputStream(input);
  368|  1.37k|        xmlFree(ctxt->inputTab);
  369|       |
  370|       |	/*
  371|       |	 * Restore the parsing context of the main entity
  372|       |	 */
  373|  1.37k|	ctxt->input = oldinput;
  374|  1.37k|	ctxt->inputNr = oldinputNr;
  375|  1.37k|	ctxt->inputMax = oldinputMax;
  376|  1.37k|	ctxt->inputTab = oldinputTab;
  377|  1.37k|	if (ctxt->encoding != NULL)
  ------------------
  |  Branch (377:6): [True: 52, False: 1.32k]
  ------------------
  378|     52|	    xmlFree(ctxt->encoding);
  379|  1.37k|	ctxt->encoding = oldencoding;
  380|       |	/* ctxt->wellFormed = oldwellFormed; */
  381|  1.37k|    }
  382|  15.7k|}
xmlSAX2ResolveEntity:
  396|  2.10k|{
  397|  2.10k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  398|  2.10k|    xmlParserInputPtr ret = NULL;
  399|  2.10k|    xmlChar *URI = NULL;
  400|       |
  401|  2.10k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (401:9): [True: 0, False: 2.10k]
  ------------------
  402|       |
  403|  2.10k|    if (systemId != NULL) {
  ------------------
  |  Branch (403:9): [True: 2.10k, False: 0]
  ------------------
  404|  2.10k|        const xmlChar *base = NULL;
  405|  2.10k|        int res;
  406|       |
  407|  2.10k|        if (ctxt->input != NULL)
  ------------------
  |  Branch (407:13): [True: 2.10k, False: 0]
  ------------------
  408|  2.10k|            base = BAD_CAST ctxt->input->filename;
  ------------------
  |  |   34|  2.10k|#define BAD_CAST (xmlChar *)
  ------------------
  409|       |
  410|       |        /*
  411|       |         * We don't really need the 'directory' struct member, but some
  412|       |         * users set it manually to a base URI for memory streams.
  413|       |         */
  414|  2.10k|        if (base == NULL)
  ------------------
  |  Branch (414:13): [True: 1.86k, False: 241]
  ------------------
  415|  1.86k|            base = BAD_CAST ctxt->directory;
  ------------------
  |  |   34|  1.86k|#define BAD_CAST (xmlChar *)
  ------------------
  416|       |
  417|  2.10k|        if ((xmlStrlen(systemId) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  2.10k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (417:13): [True: 1, False: 2.10k]
  ------------------
  418|  2.10k|            (xmlStrlen(base) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  2.10k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (418:13): [True: 0, False: 2.10k]
  ------------------
  419|      1|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  420|      1|            return(NULL);
  421|      1|        }
  422|  2.10k|        res = xmlBuildURISafe(systemId, base, &URI);
  423|  2.10k|        if (URI == NULL) {
  ------------------
  |  Branch (423:13): [True: 8, False: 2.09k]
  ------------------
  424|      8|            if (res < 0)
  ------------------
  |  Branch (424:17): [True: 2, False: 6]
  ------------------
  425|      2|                xmlSAX2ErrMemory(ctxt);
  426|      6|            else
  427|      6|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  428|      6|                           "Can't resolve URI: %s\n", systemId);
  429|      8|            return(NULL);
  430|      8|        }
  431|  2.09k|        if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  2.09k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (431:13): [True: 0, False: 2.09k]
  ------------------
  432|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  433|      0|            xmlFree(URI);
  434|      0|            return(NULL);
  435|      0|        }
  436|  2.09k|    }
  437|       |
  438|  2.09k|    ret = xmlLoadResource(ctxt, (const char *) URI,
  439|  2.09k|                          (const char *) publicId, XML_RESOURCE_DTD);
  440|       |
  441|  2.09k|    xmlFree(URI);
  442|  2.09k|    return(ret);
  443|  2.10k|}
xmlSAX2GetEntity:
  454|  2.90M|{
  455|  2.90M|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  456|  2.90M|    xmlEntityPtr ret = NULL;
  457|       |
  458|  2.90M|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (458:9): [True: 0, False: 2.90M]
  ------------------
  459|       |
  460|  2.90M|    if (ctxt->inSubset == 0) {
  ------------------
  |  Branch (460:9): [True: 2.50M, False: 404k]
  ------------------
  461|  2.50M|	ret = xmlGetPredefinedEntity(name);
  462|  2.50M|	if (ret != NULL)
  ------------------
  |  Branch (462:6): [True: 627k, False: 1.87M]
  ------------------
  463|   627k|	    return(ret);
  464|  2.50M|    }
  465|  2.28M|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
  ------------------
  |  Branch (465:9): [True: 2.28M, False: 285]
  |  Branch (465:34): [True: 1.50k, False: 2.28M]
  ------------------
  466|  1.50k|	if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (466:6): [True: 230, False: 1.27k]
  ------------------
  467|    230|	    ctxt->myDoc->standalone = 0;
  468|    230|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  469|    230|	    ctxt->myDoc->standalone = 1;
  470|  1.27k|	} else {
  471|  1.27k|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  472|  1.27k|	    if (ret == NULL) {
  ------------------
  |  Branch (472:10): [True: 948, False: 325]
  ------------------
  473|    948|		ctxt->myDoc->standalone = 0;
  474|    948|		ret = xmlGetDocEntity(ctxt->myDoc, name);
  475|    948|		if (ret != NULL) {
  ------------------
  |  Branch (475:7): [True: 419, False: 529]
  ------------------
  476|    419|		    xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
  477|    419|	 "Entity(%s) document marked standalone but requires external subset\n",
  478|    419|				   name, NULL);
  479|    419|		}
  480|    948|		ctxt->myDoc->standalone = 1;
  481|    948|	    }
  482|  1.27k|	}
  483|  2.28M|    } else {
  484|  2.28M|	ret = xmlGetDocEntity(ctxt->myDoc, name);
  485|  2.28M|    }
  486|  2.28M|    return(ret);
  487|  2.90M|}
xmlSAX2GetParameterEntity:
  498|   406k|{
  499|   406k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  500|   406k|    xmlEntityPtr ret;
  501|       |
  502|   406k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (502:9): [True: 0, False: 406k]
  ------------------
  503|       |
  504|   406k|    ret = xmlGetParameterEntity(ctxt->myDoc, name);
  505|   406k|    return(ret);
  506|   406k|}
xmlSAX2EntityDecl:
  522|   120k|{
  523|   120k|    xmlEntityPtr ent;
  524|   120k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  525|   120k|    int extSubset;
  526|   120k|    int res;
  527|       |
  528|   120k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (528:9): [True: 0, False: 120k]
  |  Branch (528:27): [True: 0, False: 120k]
  ------------------
  529|      0|        return;
  530|       |
  531|   120k|    extSubset = ctxt->inSubset == 2;
  532|   120k|    res = xmlAddEntity(ctxt->myDoc, extSubset, name, type, publicId, systemId,
  533|   120k|                       content, &ent);
  534|   120k|    switch (res) {
  535|  19.3k|        case XML_ERR_OK:
  ------------------
  |  Branch (535:9): [True: 19.3k, False: 101k]
  ------------------
  536|  19.3k|            break;
  537|     25|        case XML_ERR_NO_MEMORY:
  ------------------
  |  Branch (537:9): [True: 25, False: 120k]
  ------------------
  538|     25|            xmlSAX2ErrMemory(ctxt);
  539|     25|            return;
  540|  97.6k|        case XML_WAR_ENTITY_REDEFINED:
  ------------------
  |  Branch (540:9): [True: 97.6k, False: 22.7k]
  ------------------
  541|  97.6k|            if (ctxt->pedantic) {
  ------------------
  |  Branch (541:17): [True: 4.82k, False: 92.7k]
  ------------------
  542|  4.82k|                if (extSubset)
  ------------------
  |  Branch (542:21): [True: 612, False: 4.21k]
  ------------------
  543|    612|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  544|    612|                               " external subset\n", name);
  545|  4.21k|                else
  546|  4.21k|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  547|  4.21k|                               " internal subset\n", name);
  548|  4.82k|            }
  549|  97.6k|            return;
  550|  3.35k|        case XML_ERR_REDECL_PREDEF_ENTITY:
  ------------------
  |  Branch (550:9): [True: 3.35k, False: 117k]
  ------------------
  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.35k|            xmlWarnMsg(ctxt, res, "Invalid redeclaration of predefined"
  556|  3.35k|                       " entity '%s'", name);
  557|  3.35k|            return;
  558|      0|        default:
  ------------------
  |  Branch (558:9): [True: 0, False: 120k]
  ------------------
  559|      0|            xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  560|      0|                           "Unexpected error code from xmlAddEntity\n",
  561|      0|                           NULL, NULL);
  562|      0|            return;
  563|   120k|    }
  564|       |
  565|  19.3k|    if ((ent->URI == NULL) && (systemId != NULL)) {
  ------------------
  |  Branch (565:9): [True: 19.3k, False: 0]
  |  Branch (565:31): [True: 7.15k, False: 12.2k]
  ------------------
  566|  7.15k|        xmlChar *URI;
  567|  7.15k|        const char *base = NULL;
  568|  7.15k|        int i;
  569|       |
  570|  13.7k|        for (i = ctxt->inputNr - 1; i >= 0; i--) {
  ------------------
  |  Branch (570:37): [True: 7.22k, False: 6.53k]
  ------------------
  571|  7.22k|            if (ctxt->inputTab[i]->filename != NULL) {
  ------------------
  |  Branch (571:17): [True: 623, False: 6.60k]
  ------------------
  572|    623|                base = ctxt->inputTab[i]->filename;
  573|    623|                break;
  574|    623|            }
  575|  7.22k|        }
  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.15k|        if (base == NULL)
  ------------------
  |  Branch (581:13): [True: 6.53k, False: 623]
  ------------------
  582|  6.53k|            base = ctxt->directory;
  583|       |
  584|  7.15k|        res = xmlBuildURISafe(systemId, (const xmlChar *) base, &URI);
  585|       |
  586|  7.15k|        if (URI == NULL) {
  ------------------
  |  Branch (586:13): [True: 96, False: 7.05k]
  ------------------
  587|     96|            if (res < 0) {
  ------------------
  |  Branch (587:17): [True: 2, False: 94]
  ------------------
  588|      2|                xmlSAX2ErrMemory(ctxt);
  589|     94|            } else {
  590|     94|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  591|     94|                           "Can't resolve URI: %s\n", systemId);
  592|     94|            }
  593|  7.05k|        } else if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  7.05k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (593:20): [True: 2, False: 7.05k]
  ------------------
  594|      2|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  595|      2|            xmlFree(URI);
  596|  7.05k|        } else {
  597|  7.05k|            ent->URI = URI;
  598|  7.05k|        }
  599|  7.15k|    }
  600|  19.3k|}
xmlSAX2AttributeDecl:
  617|  48.3k|{
  618|  48.3k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  619|  48.3k|    xmlAttributePtr attr;
  620|  48.3k|    const xmlChar *name = NULL;
  621|  48.3k|    xmlChar *prefix = NULL;
  622|       |
  623|       |    /* Avoid unused variable warning if features are disabled. */
  624|  48.3k|    (void) attr;
  625|       |
  626|  48.3k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (626:9): [True: 0, False: 48.3k]
  |  Branch (626:27): [True: 0, False: 48.3k]
  ------------------
  627|      0|        return;
  628|       |
  629|  48.3k|    if ((xmlStrEqual(fullname, BAD_CAST "xml:id")) &&
  ------------------
  |  |   34|  48.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (629:9): [True: 630, False: 47.7k]
  ------------------
  630|    630|        (type != XML_ATTRIBUTE_ID)) {
  ------------------
  |  Branch (630:9): [True: 342, False: 288]
  ------------------
  631|    342|	xmlErrId(ctxt, XML_DTD_XMLID_TYPE,
  632|    342|	      "xml:id : attribute type should be ID\n", NULL);
  633|    342|    }
  634|  48.3k|    name = xmlSplitQName4(fullname, &prefix);
  635|  48.3k|    if (name == NULL)
  ------------------
  |  Branch (635:9): [True: 8, False: 48.3k]
  ------------------
  636|      8|        xmlSAX2ErrMemory(ctxt);
  637|  48.3k|    ctxt->vctxt.valid = 1;
  638|  48.3k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (638:9): [True: 34.1k, False: 14.2k]
  ------------------
  639|  34.1k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem,
  640|  34.1k|	       name, prefix, (xmlAttributeType) type,
  641|  34.1k|	       (xmlAttributeDefault) def, defaultValue, tree);
  642|  14.2k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (642:14): [True: 14.2k, False: 0]
  ------------------
  643|  14.2k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, elem,
  644|  14.2k|	   name, prefix, (xmlAttributeType) type,
  645|  14.2k|	   (xmlAttributeDefault) def, defaultValue, tree);
  646|      0|    else {
  647|      0|        xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  648|      0|	     "SAX.xmlSAX2AttributeDecl(%s) called while not in subset\n",
  649|      0|	               name, NULL);
  650|      0|	xmlFree(prefix);
  651|      0|	xmlFreeEnumeration(tree);
  652|      0|	return;
  653|      0|    }
  654|  48.3k|#ifdef LIBXML_VALID_ENABLED
  655|  48.3k|    if (ctxt->vctxt.valid == 0)
  ------------------
  |  Branch (655:9): [True: 8.64k, False: 39.7k]
  ------------------
  656|  8.64k|	ctxt->valid = 0;
  657|  48.3k|    if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (657:9): [True: 23.2k, False: 25.1k]
  |  Branch (657:27): [True: 16.7k, False: 6.42k]
  |  Branch (657:47): [True: 13.1k, False: 3.65k]
  ------------------
  658|  13.1k|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (658:9): [True: 13.1k, False: 0]
  ------------------
  659|  13.1k|	ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
  660|  13.1k|	                                        attr);
  661|  48.3k|#endif /* LIBXML_VALID_ENABLED */
  662|  48.3k|    if (prefix != NULL)
  ------------------
  |  Branch (662:9): [True: 5.25k, False: 43.1k]
  ------------------
  663|  5.25k|	xmlFree(prefix);
  664|  48.3k|}
xmlSAX2ElementDecl:
  677|  14.5k|{
  678|  14.5k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  679|  14.5k|    xmlElementPtr elem = NULL;
  680|       |
  681|       |    /* Avoid unused variable warning if features are disabled. */
  682|  14.5k|    (void) elem;
  683|       |
  684|  14.5k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (684:9): [True: 0, False: 14.5k]
  |  Branch (684:27): [True: 0, False: 14.5k]
  ------------------
  685|      0|        return;
  686|       |
  687|  14.5k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (687:9): [True: 10.7k, False: 3.77k]
  ------------------
  688|  10.7k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
  689|  10.7k|                                 name, (xmlElementTypeVal) type, content);
  690|  3.77k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (690:14): [True: 3.77k, False: 0]
  ------------------
  691|  3.77k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
  692|  3.77k|                                 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|  14.5k|#ifdef LIBXML_VALID_ENABLED
  700|  14.5k|    if (elem == NULL)
  ------------------
  |  Branch (700:9): [True: 5.26k, False: 9.29k]
  ------------------
  701|  5.26k|        ctxt->valid = 0;
  702|  14.5k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (702:9): [True: 10.7k, False: 3.77k]
  |  Branch (702:27): [True: 6.84k, False: 3.93k]
  ------------------
  703|  6.84k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (703:9): [True: 6.84k, False: 0]
  |  Branch (703:24): [True: 6.84k, False: 0]
  ------------------
  704|  6.84k|        ctxt->valid &=
  705|  6.84k|            xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
  706|  14.5k|#endif /* LIBXML_VALID_ENABLED */
  707|  14.5k|}
xmlSAX2NotationDecl:
  720|  1.99k|{
  721|  1.99k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  722|  1.99k|    xmlNotationPtr nota = NULL;
  723|       |
  724|       |    /* Avoid unused variable warning if features are disabled. */
  725|  1.99k|    (void) nota;
  726|       |
  727|  1.99k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (727:9): [True: 0, False: 1.99k]
  |  Branch (727:27): [True: 0, False: 1.99k]
  ------------------
  728|      0|        return;
  729|       |
  730|  1.99k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (730:9): [True: 985, False: 1.01k]
  |  Branch (730:31): [True: 239, False: 746]
  ------------------
  731|    239|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  732|    239|	     "SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n",
  733|    239|	               name, NULL);
  734|    239|	return;
  735|  1.75k|    } else if (ctxt->inSubset == 1)
  ------------------
  |  Branch (735:16): [True: 1.20k, False: 549]
  ------------------
  736|  1.20k|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
  737|  1.20k|                              publicId, systemId);
  738|    549|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (738:14): [True: 549, False: 0]
  ------------------
  739|    549|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
  740|    549|                              publicId, systemId);
  741|      0|    else {
  742|      0|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  743|      0|	     "SAX.xmlSAX2NotationDecl(%s) called while not in subset\n",
  744|      0|	               name, NULL);
  745|      0|	return;
  746|      0|    }
  747|  1.75k|#ifdef LIBXML_VALID_ENABLED
  748|  1.75k|    if (nota == NULL) ctxt->valid = 0;
  ------------------
  |  Branch (748:9): [True: 1.49k, False: 258]
  ------------------
  749|  1.75k|    if ((ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (749:9): [True: 1.22k, False: 537]
  |  Branch (749:29): [True: 503, False: 717]
  ------------------
  750|    503|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (750:9): [True: 503, False: 0]
  ------------------
  751|    503|	ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
  752|    503|	                                       nota);
  753|  1.75k|#endif /* LIBXML_VALID_ENABLED */
  754|  1.75k|}
xmlSAX2UnparsedEntityDecl:
  769|    711|{
  770|    711|    xmlSAX2EntityDecl(ctx, name, XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,
  771|    711|                      publicId, systemId, (xmlChar *) notationName);
  772|    711|}
xmlSAX2SetDocumentLocator:
  783|  42.6k|{
  784|  42.6k|}
xmlSAX2StartDocument:
  793|  42.2k|{
  794|  42.2k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  795|  42.2k|    xmlDocPtr doc;
  796|       |
  797|  42.2k|    if (ctx == NULL) return;
  ------------------
  |  Branch (797:9): [True: 0, False: 42.2k]
  ------------------
  798|       |
  799|  42.2k|#ifdef LIBXML_HTML_ENABLED
  800|  42.2k|    if (ctxt->html) {
  ------------------
  |  Branch (800:9): [True: 0, False: 42.2k]
  ------------------
  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|  42.2k|#endif
  811|  42.2k|    {
  812|  42.2k|	doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
  813|  42.2k|	if (doc != NULL) {
  ------------------
  |  Branch (813:6): [True: 42.2k, False: 19]
  ------------------
  814|  42.2k|	    doc->properties = 0;
  815|  42.2k|	    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (815:10): [True: 16.1k, False: 26.1k]
  ------------------
  816|  16.1k|	        doc->properties |= XML_DOC_OLD10;
  817|  42.2k|	    doc->parseFlags = ctxt->options;
  818|  42.2k|	    doc->standalone = ctxt->standalone;
  819|  42.2k|	} else {
  820|     19|	    xmlSAX2ErrMemory(ctxt);
  821|     19|	    return;
  822|     19|	}
  823|  42.2k|	if ((ctxt->dictNames) && (doc != NULL)) {
  ------------------
  |  Branch (823:6): [True: 24.1k, False: 18.1k]
  |  Branch (823:27): [True: 24.1k, False: 0]
  ------------------
  824|  24.1k|	    doc->dict = ctxt->dict;
  825|  24.1k|	    xmlDictReference(doc->dict);
  826|  24.1k|	}
  827|  42.2k|    }
  828|  42.2k|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
  ------------------
  |  Branch (828:9): [True: 42.2k, False: 0]
  |  Branch (828:34): [True: 42.2k, False: 0]
  ------------------
  829|  42.2k|	(ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
  ------------------
  |  Branch (829:2): [True: 42.2k, False: 0]
  |  Branch (829:27): [True: 7.56k, False: 34.6k]
  ------------------
  830|  7.56k|	ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
  831|  7.56k|	if (ctxt->myDoc->URL == NULL)
  ------------------
  |  Branch (831:6): [True: 8, False: 7.55k]
  ------------------
  832|      8|	    xmlSAX2ErrMemory(ctxt);
  833|  7.56k|    }
  834|  42.2k|}
xmlSAX2EndDocument:
  843|  23.1k|{
  844|  23.1k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  845|  23.1k|    xmlDocPtr doc;
  846|       |
  847|  23.1k|    if (ctx == NULL) return;
  ------------------
  |  Branch (847:9): [True: 0, False: 23.1k]
  ------------------
  848|  23.1k|#ifdef LIBXML_VALID_ENABLED
  849|  23.1k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (849:9): [True: 3.80k, False: 19.3k]
  |  Branch (849:27): [True: 521, False: 3.28k]
  ------------------
  850|    521|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (850:9): [True: 521, False: 0]
  |  Branch (850:24): [True: 521, False: 0]
  ------------------
  851|    521|	ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
  852|  23.1k|#endif /* LIBXML_VALID_ENABLED */
  853|       |
  854|  23.1k|    doc = ctxt->myDoc;
  855|  23.1k|    if (doc == NULL)
  ------------------
  |  Branch (855:9): [True: 59, False: 23.0k]
  ------------------
  856|     59|        return;
  857|       |
  858|  23.0k|    if (doc->encoding == NULL) {
  ------------------
  |  Branch (858:9): [True: 23.0k, False: 0]
  ------------------
  859|  23.0k|        const xmlChar *encoding = xmlGetActualEncoding(ctxt);
  860|       |
  861|  23.0k|        if (encoding != NULL) {
  ------------------
  |  Branch (861:13): [True: 288, False: 22.7k]
  ------------------
  862|    288|            doc->encoding = xmlStrdup(encoding);
  863|    288|            if (doc->encoding == NULL)
  ------------------
  |  Branch (863:17): [True: 1, False: 287]
  ------------------
  864|      1|                xmlSAX2ErrMemory(ctxt);
  865|    288|        }
  866|  23.0k|    }
  867|       |
  868|  23.0k|#ifdef LIBXML_HTML_ENABLED
  869|  23.0k|    if (ctxt->html) {
  ------------------
  |  Branch (869:9): [True: 0, False: 23.0k]
  ------------------
  870|      0|        if (((ctxt->options & HTML_PARSE_NODEFDTD) == 0) &&
  ------------------
  |  Branch (870:13): [True: 0, False: 0]
  ------------------
  871|      0|            (doc->intSubset == NULL)) {
  ------------------
  |  Branch (871:13): [True: 0, False: 0]
  ------------------
  872|      0|            doc->intSubset = xmlCreateIntSubset(doc, BAD_CAST "html",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  873|      0|                    BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  874|      0|                    BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  875|      0|            if (doc->intSubset == NULL)
  ------------------
  |  Branch (875:17): [True: 0, False: 0]
  ------------------
  876|      0|                xmlSAX2ErrMemory(ctxt);
  877|      0|        }
  878|      0|    } else
  879|  23.0k|#endif /* LIBXML_HTML_ENABLED */
  880|  23.0k|    {
  881|  23.0k|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (881:13): [True: 11.0k, False: 11.9k]
  ------------------
  882|  11.0k|            doc->properties |= XML_DOC_WELLFORMED;
  883|  11.0k|            if (ctxt->valid)
  ------------------
  |  Branch (883:17): [True: 6.30k, False: 4.77k]
  ------------------
  884|  6.30k|                doc->properties |= XML_DOC_DTDVALID;
  885|  11.0k|            if (ctxt->nsWellFormed)
  ------------------
  |  Branch (885:17): [True: 8.89k, False: 2.18k]
  ------------------
  886|  8.89k|                doc->properties |= XML_DOC_NSVALID;
  887|  11.0k|        }
  888|       |
  889|  23.0k|        if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (889:13): [True: 9.22k, False: 13.8k]
  ------------------
  890|  9.22k|            doc->properties |= XML_DOC_OLD10;
  891|  23.0k|    }
  892|  23.0k|}
xmlSAX2StartElement:
 1713|   219k|xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) {
 1714|   219k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1715|       |
 1716|   219k|    (void) atts;
 1717|       |
 1718|   219k|    if ((ctxt == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (1718:9): [True: 0, False: 219k]
  |  Branch (1718:27): [True: 0, False: 219k]
  |  Branch (1718:49): [True: 0, False: 219k]
  ------------------
 1719|      0|        return;
 1720|       |
 1721|   219k|#ifdef LIBXML_SAX1_ENABLED
 1722|   219k|    if (!ctxt->html) {
  ------------------
  |  Branch (1722:9): [True: 219k, False: 0]
  ------------------
 1723|   219k|        xmlSAX1StartElement(ctxt, fullname, atts);
 1724|   219k|        return;
 1725|   219k|    }
 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|   117k|{
 1749|   117k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1750|       |
 1751|   117k|    if (ctxt == NULL)
  ------------------
  |  Branch (1751:9): [True: 0, False: 117k]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|   117k|#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_VALID_ENABLED)
 1755|   117k|    if (!ctxt->html && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1755:9): [True: 117k, False: 0]
  |  Branch (1755:24): [True: 22.5k, False: 94.7k]
  |  Branch (1755:42): [True: 16.1k, False: 6.42k]
  ------------------
 1756|  16.1k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (1756:9): [True: 16.1k, False: 0]
  |  Branch (1756:24): [True: 16.1k, False: 0]
  ------------------
 1757|  16.1k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 1758|  16.1k|					     ctxt->node);
 1759|   117k|#endif /* LIBXML_VALID_ENABLED */
 1760|       |
 1761|   117k|#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
 1762|   117k|    ctxt->nodemem = -1;
 1763|       |
 1764|       |    /*
 1765|       |     * end of parsing of this node.
 1766|       |     */
 1767|   117k|    nodePop(ctxt);
 1768|   117k|#endif
 1769|   117k|}
xmlSAX2StartElementNs:
 2155|   459k|{
 2156|   459k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2157|   459k|    xmlNodePtr ret;
 2158|   459k|    xmlNsPtr last = NULL, ns;
 2159|   459k|    const xmlChar *uri, *pref;
 2160|   459k|    xmlChar *lname = NULL;
 2161|   459k|    int i, j;
 2162|       |
 2163|   459k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2163:9): [True: 0, False: 459k]
  ------------------
 2164|       |
 2165|   459k|#ifdef LIBXML_VALID_ENABLED
 2166|       |    /*
 2167|       |     * First check on validity:
 2168|       |     */
 2169|   459k|    if (ctxt->validate &&
  ------------------
  |  Branch (2169:9): [True: 147k, False: 311k]
  ------------------
 2170|   147k|        ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (2170:10): [True: 0, False: 147k]
  ------------------
 2171|   147k|         ((ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (2171:11): [True: 143k, False: 4.69k]
  ------------------
 2172|   143k|          ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (2172:12): [True: 4.36k, False: 138k]
  ------------------
 2173|   138k|	   ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (2173:6): [True: 138k, False: 646]
  ------------------
 2174|   138k|	    (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (2174:6): [True: 13.3k, False: 124k]
  ------------------
 2175|  13.3k|	    (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (2175:6): [True: 13.3k, False: 0]
  ------------------
 2176|  13.3k|	    (ctxt->myDoc->intSubset->entities == NULL)))))) {
  ------------------
  |  Branch (2176:6): [True: 661, False: 12.6k]
  ------------------
 2177|  5.02k|	xmlErrValid(ctxt, XML_DTD_NO_DTD,
 2178|  5.02k|	  "Validation failed: no DTD found !", NULL, NULL);
 2179|  5.02k|	ctxt->validate = 0;
 2180|  5.02k|    }
 2181|   459k|#endif /* LIBXML_VALID_ENABLED */
 2182|       |
 2183|       |    /*
 2184|       |     * Take care of the rare case of an undefined namespace prefix
 2185|       |     */
 2186|   459k|    if ((prefix != NULL) && (URI == NULL)) {
  ------------------
  |  Branch (2186:9): [True: 56.1k, False: 403k]
  |  Branch (2186:29): [True: 29.4k, False: 26.6k]
  ------------------
 2187|  29.4k|        if (ctxt->dictNames) {
  ------------------
  |  Branch (2187:13): [True: 12.8k, False: 16.5k]
  ------------------
 2188|  12.8k|	    const xmlChar *fullname;
 2189|       |
 2190|  12.8k|	    fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
 2191|  12.8k|	    if (fullname == NULL) {
  ------------------
  |  Branch (2191:10): [True: 1, False: 12.8k]
  ------------------
 2192|      1|                xmlSAX2ErrMemory(ctxt);
 2193|      1|                return;
 2194|      1|            }
 2195|  12.8k|	    localname = fullname;
 2196|  16.5k|	} else {
 2197|  16.5k|	    lname = xmlBuildQName(localname, prefix, NULL, 0);
 2198|  16.5k|            if (lname == NULL) {
  ------------------
  |  Branch (2198:17): [True: 1, False: 16.5k]
  ------------------
 2199|      1|                xmlSAX2ErrMemory(ctxt);
 2200|      1|                return;
 2201|      1|            }
 2202|  16.5k|	}
 2203|  29.4k|    }
 2204|       |    /*
 2205|       |     * allocate the node
 2206|       |     */
 2207|   459k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2207:9): [True: 2.64k, False: 456k]
  ------------------
 2208|  2.64k|        ret = ctxt->freeElems;
 2209|  2.64k|	ctxt->freeElems = ret->next;
 2210|  2.64k|	ctxt->freeElemsNr--;
 2211|  2.64k|	memset(ret, 0, sizeof(xmlNode));
 2212|  2.64k|        ret->doc = ctxt->myDoc;
 2213|  2.64k|	ret->type = XML_ELEMENT_NODE;
 2214|       |
 2215|  2.64k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2215:6): [True: 1.21k, False: 1.42k]
  ------------------
 2216|  1.21k|	    ret->name = localname;
 2217|  1.42k|	else {
 2218|  1.42k|	    if (lname == NULL)
  ------------------
  |  Branch (2218:10): [True: 1.18k, False: 248]
  ------------------
 2219|  1.18k|		ret->name = xmlStrdup(localname);
 2220|    248|	    else
 2221|    248|	        ret->name = lname;
 2222|  1.42k|	    if (ret->name == NULL) {
  ------------------
  |  Branch (2222:10): [True: 4, False: 1.42k]
  ------------------
 2223|      4|	        xmlSAX2ErrMemory(ctxt);
 2224|      4|                xmlFree(ret);
 2225|      4|		return;
 2226|      4|	    }
 2227|  1.42k|	}
 2228|  2.63k|	if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2228:6): [True: 0, False: 2.63k]
  |  Branch (2228:32): [True: 0, False: 0]
  ------------------
 2229|      0|	    xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2230|   456k|    } else {
 2231|   456k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2231:6): [True: 254k, False: 202k]
  ------------------
 2232|   254k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
 2233|   254k|	                               (xmlChar *) localname, NULL);
 2234|   202k|	else if (lname == NULL)
  ------------------
  |  Branch (2234:11): [True: 186k, False: 16.2k]
  ------------------
 2235|   186k|	    ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
 2236|  16.2k|	else
 2237|  16.2k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, lname, NULL);
 2238|   456k|	if (ret == NULL) {
  ------------------
  |  Branch (2238:6): [True: 64, False: 456k]
  ------------------
 2239|     64|	    xmlSAX2ErrMemory(ctxt);
 2240|     64|	    return;
 2241|     64|	}
 2242|   456k|    }
 2243|       |
 2244|       |    /*
 2245|       |     * Build the namespace list
 2246|       |     */
 2247|   636k|    for (i = 0,j = 0;j < nb_namespaces;j++) {
  ------------------
  |  Branch (2247:22): [True: 177k, False: 459k]
  ------------------
 2248|   177k|        pref = namespaces[i++];
 2249|   177k|	uri = namespaces[i++];
 2250|   177k|	ns = xmlNewNs(NULL, uri, pref);
 2251|   177k|	if (ns != NULL) {
  ------------------
  |  Branch (2251:6): [True: 177k, False: 56]
  ------------------
 2252|   177k|	    if (last == NULL) {
  ------------------
  |  Branch (2252:10): [True: 62.3k, False: 114k]
  ------------------
 2253|  62.3k|	        ret->nsDef = last = ns;
 2254|   114k|	    } else {
 2255|   114k|	        last->next = ns;
 2256|   114k|		last = ns;
 2257|   114k|	    }
 2258|   177k|	    if ((URI != NULL) && (prefix == pref))
  ------------------
  |  Branch (2258:10): [True: 133k, False: 44.1k]
  |  Branch (2258:27): [True: 33.1k, False: 99.9k]
  ------------------
 2259|  33.1k|		ret->ns = ns;
 2260|   177k|	} else {
 2261|     56|            xmlSAX2ErrMemory(ctxt);
 2262|     56|	    continue;
 2263|     56|	}
 2264|       |
 2265|   177k|        xmlParserNsUpdateSax(ctxt, pref, ns);
 2266|       |
 2267|   177k|#ifdef LIBXML_VALID_ENABLED
 2268|   177k|	if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2268:6): [True: 177k, False: 0]
  |  Branch (2268:23): [True: 44.8k, False: 132k]
  |  Branch (2268:41): [True: 5.62k, False: 39.2k]
  ------------------
 2269|  5.62k|	    ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2269:6): [True: 5.62k, False: 0]
  |  Branch (2269:21): [True: 5.62k, False: 0]
  ------------------
 2270|  5.62k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 2271|  5.62k|	                                           ret, prefix, ns, uri);
 2272|  5.62k|	}
 2273|   177k|#endif /* LIBXML_VALID_ENABLED */
 2274|   177k|    }
 2275|   459k|    ctxt->nodemem = -1;
 2276|       |
 2277|       |    /*
 2278|       |     * Link the child element
 2279|       |     */
 2280|   459k|    xmlSAX2AppendChild(ctxt, ret);
 2281|       |
 2282|       |    /*
 2283|       |     * We are parsing a new node.
 2284|       |     */
 2285|   459k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (2285:9): [True: 37, False: 459k]
  ------------------
 2286|     37|        xmlUnlinkNode(ret);
 2287|     37|        xmlFreeNode(ret);
 2288|     37|        return;
 2289|     37|    }
 2290|       |
 2291|       |    /*
 2292|       |     * Insert the defaulted attributes from the DTD only if requested:
 2293|       |     */
 2294|   459k|    if ((nb_defaulted != 0) &&
  ------------------
  |  Branch (2294:9): [True: 54.7k, False: 404k]
  ------------------
 2295|  54.7k|        ((ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0))
  ------------------
  |  |  209|  54.7k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (2295:9): [True: 11.4k, False: 43.2k]
  ------------------
 2296|  11.4k|	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|   459k|    if ((URI != NULL) && (ret->ns == NULL)) {
  ------------------
  |  Branch (2302:9): [True: 61.4k, False: 397k]
  |  Branch (2302:26): [True: 28.3k, False: 33.1k]
  ------------------
 2303|  28.3k|        ret->ns = xmlParserNsLookupSax(ctxt, prefix);
 2304|  28.3k|	if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|    409|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2304:6): [True: 409, False: 27.9k]
  |  Branch (2304:27): [True: 386, False: 23]
  ------------------
 2305|    386|            int res;
 2306|       |
 2307|    386|	    res = xmlSearchNsSafe(ret, prefix, &ret->ns);
 2308|    386|            if (res < 0)
  ------------------
  |  Branch (2308:17): [True: 4, False: 382]
  ------------------
 2309|      4|                xmlSAX2ErrMemory(ctxt);
 2310|    386|	}
 2311|  28.3k|	if (ret->ns == NULL) {
  ------------------
  |  Branch (2311:6): [True: 27, False: 28.3k]
  ------------------
 2312|     27|	    ns = xmlNewNs(ret, NULL, prefix);
 2313|     27|	    if (ns == NULL) {
  ------------------
  |  Branch (2313:10): [True: 0, False: 27]
  ------------------
 2314|       |
 2315|      0|	        xmlSAX2ErrMemory(ctxt);
 2316|      0|		return;
 2317|      0|	    }
 2318|     27|            if (prefix != NULL)
  ------------------
  |  Branch (2318:17): [True: 8, False: 19]
  ------------------
 2319|      8|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2320|      8|                             "Namespace prefix %s was not found\n",
 2321|      8|                             prefix, NULL);
 2322|     19|            else
 2323|     19|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2324|     19|                             "Namespace default prefix was not found\n",
 2325|     19|                             NULL, NULL);
 2326|     27|	}
 2327|  28.3k|    }
 2328|       |
 2329|       |    /*
 2330|       |     * process all the other attributes
 2331|       |     */
 2332|   459k|    if (nb_attributes > 0) {
  ------------------
  |  Branch (2332:9): [True: 81.9k, False: 377k]
  ------------------
 2333|  81.9k|        xmlAttrPtr prev = NULL;
 2334|       |
 2335|   328k|        for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
  ------------------
  |  Branch (2335:26): [True: 246k, False: 81.9k]
  ------------------
 2336|   246k|            xmlAttrPtr attr = NULL;
 2337|       |
 2338|       |	    /*
 2339|       |	     * Handle the rare case of an undefined attribute prefix
 2340|       |	     */
 2341|   246k|	    if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
  ------------------
  |  Branch (2341:10): [True: 127k, False: 119k]
  |  Branch (2341:39): [True: 49.9k, False: 77.5k]
  ------------------
 2342|  49.9k|		if (ctxt->dictNames) {
  ------------------
  |  Branch (2342:7): [True: 28.2k, False: 21.7k]
  ------------------
 2343|  28.2k|		    const xmlChar *fullname;
 2344|       |
 2345|  28.2k|		    fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
 2346|  28.2k|		                              attributes[j]);
 2347|  28.2k|		    if (fullname == NULL) {
  ------------------
  |  Branch (2347:11): [True: 1, False: 28.2k]
  ------------------
 2348|      1|                        xmlSAX2ErrMemory(ctxt);
 2349|      1|                        return;
 2350|      1|                    }
 2351|  28.2k|                    attr = xmlSAX2AttributeNs(ctxt, fullname, NULL,
 2352|  28.2k|                                              attributes[j+3],
 2353|  28.2k|                                              attributes[j+4]);
 2354|  28.2k|                    goto have_attr;
 2355|  28.2k|		} else {
 2356|  21.7k|		    lname = xmlBuildQName(attributes[j], attributes[j+1],
 2357|  21.7k|		                          NULL, 0);
 2358|  21.7k|		    if (lname == NULL) {
  ------------------
  |  Branch (2358:11): [True: 2, False: 21.7k]
  ------------------
 2359|      2|                        xmlSAX2ErrMemory(ctxt);
 2360|      2|                        return;
 2361|      2|                    }
 2362|  21.7k|                    attr = xmlSAX2AttributeNs(ctxt, lname, NULL,
 2363|  21.7k|                                              attributes[j+3],
 2364|  21.7k|                                              attributes[j+4]);
 2365|  21.7k|                    xmlFree(lname);
 2366|  21.7k|                    goto have_attr;
 2367|  21.7k|		}
 2368|  49.9k|	    }
 2369|   196k|            attr = xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
 2370|   196k|                                      attributes[j+3], attributes[j+4]);
 2371|   246k|have_attr:
 2372|   246k|            if (attr == NULL)
  ------------------
  |  Branch (2372:17): [True: 15, False: 246k]
  ------------------
 2373|     15|                continue;
 2374|       |
 2375|       |            /* link at the end to preserve order */
 2376|   246k|            if (prev == NULL) {
  ------------------
  |  Branch (2376:17): [True: 81.9k, False: 164k]
  ------------------
 2377|  81.9k|                ctxt->node->properties = attr;
 2378|   164k|            } else {
 2379|   164k|                prev->next = attr;
 2380|   164k|                attr->prev = prev;
 2381|   164k|            }
 2382|       |
 2383|   246k|            prev = attr;
 2384|   246k|	}
 2385|  81.9k|    }
 2386|       |
 2387|   459k|#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|   459k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (2392:9): [True: 142k, False: 316k]
  ------------------
 2393|   142k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|   142k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (2393:9): [True: 3.36k, False: 139k]
  ------------------
 2394|  3.36k|	int chk;
 2395|       |
 2396|  3.36k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 2397|  3.36k|	if (chk <= 0)
  ------------------
  |  Branch (2397:6): [True: 63, False: 3.30k]
  ------------------
 2398|     63|	    ctxt->valid = 0;
 2399|  3.36k|	if (chk < 0)
  ------------------
  |  Branch (2399:6): [True: 0, False: 3.36k]
  ------------------
 2400|      0|	    ctxt->wellFormed = 0;
 2401|  3.36k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 2402|  3.36k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  3.36k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 2403|  3.36k|    }
 2404|   459k|#endif /* LIBXML_VALID_ENABLED */
 2405|   459k|}
xmlSAX2EndElementNs:
 2421|   291k|{
 2422|   291k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2423|       |
 2424|   291k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2424:9): [True: 0, False: 291k]
  ------------------
 2425|   291k|    ctxt->nodemem = -1;
 2426|       |
 2427|   291k|#ifdef LIBXML_VALID_ENABLED
 2428|   291k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2428:9): [True: 87.6k, False: 204k]
  |  Branch (2428:27): [True: 71.6k, False: 16.0k]
  ------------------
 2429|  71.6k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (2429:9): [True: 71.6k, False: 0]
  |  Branch (2429:24): [True: 71.6k, False: 0]
  ------------------
 2430|  71.6k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 2431|  71.6k|                                             ctxt->node);
 2432|   291k|#endif /* LIBXML_VALID_ENABLED */
 2433|       |
 2434|       |    /*
 2435|       |     * end of parsing of this node.
 2436|       |     */
 2437|   291k|    nodePop(ctxt);
 2438|   291k|}
xmlSAX2Reference:
 2448|  28.9k|{
 2449|  28.9k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2450|  28.9k|    xmlNodePtr ret;
 2451|       |
 2452|  28.9k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2452:9): [True: 0, False: 28.9k]
  ------------------
 2453|  28.9k|    ret = xmlNewReference(ctxt->myDoc, name);
 2454|  28.9k|    if (ret == NULL) {
  ------------------
  |  Branch (2454:9): [True: 7, False: 28.9k]
  ------------------
 2455|      7|        xmlSAX2ErrMemory(ctxt);
 2456|      7|        return;
 2457|      7|    }
 2458|       |
 2459|  28.9k|    xmlSAX2AppendChild(ctxt, ret);
 2460|  28.9k|}
xmlSAX2Characters:
 2606|   639k|{
 2607|   639k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
 2608|   639k|}
xmlSAX2ProcessingInstruction:
 2633|  76.3k|{
 2634|  76.3k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2635|  76.3k|    xmlNodePtr ret;
 2636|       |
 2637|  76.3k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2637:9): [True: 0, False: 76.3k]
  ------------------
 2638|       |
 2639|  76.3k|    ret = xmlNewDocPI(ctxt->myDoc, target, data);
 2640|  76.3k|    if (ret == NULL) {
  ------------------
  |  Branch (2640:9): [True: 9, False: 76.3k]
  ------------------
 2641|      9|        xmlSAX2ErrMemory(ctxt);
 2642|      9|        return;
 2643|      9|    }
 2644|       |
 2645|  76.3k|    xmlSAX2AppendChild(ctxt, ret);
 2646|  76.3k|}
xmlSAX2Comment:
 2656|   457k|{
 2657|   457k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2658|   457k|    xmlNodePtr ret;
 2659|       |
 2660|   457k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2660:9): [True: 0, False: 457k]
  ------------------
 2661|       |
 2662|   457k|    ret = xmlNewDocComment(ctxt->myDoc, value);
 2663|   457k|    if (ret == NULL) {
  ------------------
  |  Branch (2663:9): [True: 9, False: 457k]
  ------------------
 2664|      9|        xmlSAX2ErrMemory(ctxt);
 2665|      9|        return;
 2666|      9|    }
 2667|       |
 2668|   457k|    xmlSAX2AppendChild(ctxt, ret);
 2669|   457k|}
xmlSAX2CDataBlock:
 2680|  19.8k|{
 2681|  19.8k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
 2682|  19.8k|}
xmlSAXVersion:
 2711|  79.6k|{
 2712|  79.6k|    if (hdlr == NULL) return(-1);
  ------------------
  |  Branch (2712:9): [True: 0, False: 79.6k]
  ------------------
 2713|  79.6k|    if (version == 2) {
  ------------------
  |  Branch (2713:9): [True: 79.6k, False: 0]
  ------------------
 2714|  79.6k|	hdlr->startElementNs = xmlSAX2StartElementNs;
 2715|  79.6k|	hdlr->endElementNs = xmlSAX2EndElementNs;
 2716|  79.6k|	hdlr->serror = NULL;
 2717|  79.6k|	hdlr->initialized = XML_SAX2_MAGIC;
  ------------------
  |  |  953|  79.6k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
 2718|  79.6k|#ifdef LIBXML_SAX1_ENABLED
 2719|  79.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|  79.6k|#ifdef LIBXML_SAX1_ENABLED
 2725|  79.6k|    hdlr->startElement = xmlSAX2StartElement;
 2726|  79.6k|    hdlr->endElement = xmlSAX2EndElement;
 2727|       |#else
 2728|       |    hdlr->startElement = NULL;
 2729|       |    hdlr->endElement = NULL;
 2730|       |#endif /* LIBXML_SAX1_ENABLED */
 2731|  79.6k|    hdlr->internalSubset = xmlSAX2InternalSubset;
 2732|  79.6k|    hdlr->externalSubset = xmlSAX2ExternalSubset;
 2733|  79.6k|    hdlr->isStandalone = xmlSAX2IsStandalone;
 2734|  79.6k|    hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
 2735|  79.6k|    hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
 2736|  79.6k|    hdlr->resolveEntity = xmlSAX2ResolveEntity;
 2737|  79.6k|    hdlr->getEntity = xmlSAX2GetEntity;
 2738|  79.6k|    hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
 2739|  79.6k|    hdlr->entityDecl = xmlSAX2EntityDecl;
 2740|  79.6k|    hdlr->attributeDecl = xmlSAX2AttributeDecl;
 2741|  79.6k|    hdlr->elementDecl = xmlSAX2ElementDecl;
 2742|  79.6k|    hdlr->notationDecl = xmlSAX2NotationDecl;
 2743|  79.6k|    hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
 2744|  79.6k|    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
 2745|  79.6k|    hdlr->startDocument = xmlSAX2StartDocument;
 2746|  79.6k|    hdlr->endDocument = xmlSAX2EndDocument;
 2747|  79.6k|    hdlr->reference = xmlSAX2Reference;
 2748|  79.6k|    hdlr->characters = xmlSAX2Characters;
 2749|  79.6k|    hdlr->cdataBlock = xmlSAX2CDataBlock;
 2750|  79.6k|    hdlr->ignorableWhitespace = xmlSAX2Characters;
 2751|  79.6k|    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
 2752|  79.6k|    hdlr->comment = xmlSAX2Comment;
 2753|  79.6k|    hdlr->warning = xmlParserWarning;
 2754|  79.6k|    hdlr->error = xmlParserError;
 2755|  79.6k|    hdlr->fatalError = xmlParserError;
 2756|       |
 2757|  79.6k|    return(0);
 2758|  79.6k|}
SAX2.c:xmlSAX2ErrMemory:
   42|    730|xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt) {
   43|    730|    xmlCtxtErrMemory(ctxt);
   44|    730|}
SAX2.c:xmlWarnMsg:
  111|  8.28k|{
  112|  8.28k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  113|  8.28k|               str1, NULL, NULL, 0, msg, str1);
  114|  8.28k|}
SAX2.c:xmlFatalErrMsg:
   79|    658|{
   80|    658|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
   81|       |               str1, str2, NULL, 0, msg, str1, str2);
   82|    658|}
SAX2.c:xmlErrId:
   95|  2.92k|{
   96|  2.92k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
   97|  2.92k|               str1, NULL, NULL, 0, msg, str1);
   98|  2.92k|}
SAX2.c:xmlSAX1StartElement:
 1422|   219k|{
 1423|   219k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1424|   219k|    xmlNodePtr ret;
 1425|   219k|    xmlNodePtr parent;
 1426|   219k|    xmlNsPtr ns;
 1427|   219k|    const xmlChar *name;
 1428|   219k|    xmlChar *prefix;
 1429|   219k|    const xmlChar *att;
 1430|   219k|    const xmlChar *value;
 1431|   219k|    int i, res;
 1432|       |
 1433|   219k|    if ((ctx == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL)) return;
  ------------------
  |  Branch (1433:9): [True: 0, False: 219k]
  |  Branch (1433:26): [True: 0, False: 219k]
  |  Branch (1433:48): [True: 0, False: 219k]
  ------------------
 1434|       |
 1435|   219k|#ifdef LIBXML_VALID_ENABLED
 1436|       |    /*
 1437|       |     * First check on validity:
 1438|       |     */
 1439|   219k|    if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (1439:9): [True: 68.1k, False: 151k]
  |  Branch (1439:27): [True: 58.4k, False: 9.60k]
  ------------------
 1440|  58.4k|        ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (1440:10): [True: 4.21k, False: 54.2k]
  ------------------
 1441|  54.2k|	 ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (1441:4): [True: 53.4k, False: 852]
  ------------------
 1442|  53.4k|	  (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (1442:4): [True: 7.64k, False: 45.7k]
  ------------------
 1443|  7.64k|	  (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (1443:4): [True: 7.64k, False: 0]
  ------------------
 1444|  7.64k|	  (ctxt->myDoc->intSubset->entities == NULL)))) {
  ------------------
  |  Branch (1444:4): [True: 879, False: 6.76k]
  ------------------
 1445|  5.09k|	xmlErrValid(ctxt, XML_ERR_NO_DTD,
 1446|  5.09k|	  "Validation failed: no DTD found !", NULL, NULL);
 1447|  5.09k|	ctxt->validate = 0;
 1448|  5.09k|    }
 1449|   219k|#endif
 1450|       |
 1451|       |    /*
 1452|       |     * Split the full name into a namespace prefix and the tag name
 1453|       |     */
 1454|   219k|    name = xmlSplitQName4(fullname, &prefix);
 1455|   219k|    if (name == NULL) {
  ------------------
  |  Branch (1455:9): [True: 4, False: 219k]
  ------------------
 1456|      4|        xmlSAX2ErrMemory(ctxt);
 1457|      4|        return;
 1458|      4|    }
 1459|       |
 1460|       |    /*
 1461|       |     * Note : the namespace resolution is deferred until the end of the
 1462|       |     *        attributes parsing, since local namespace can be defined as
 1463|       |     *        an attribute at this level.
 1464|       |     */
 1465|   219k|    ret = xmlNewDocNode(ctxt->myDoc, NULL, name, NULL);
 1466|   219k|    if (ret == NULL) {
  ------------------
  |  Branch (1466:9): [True: 42, False: 219k]
  ------------------
 1467|     42|	xmlFree(prefix);
 1468|     42|	xmlSAX2ErrMemory(ctxt);
 1469|     42|        return;
 1470|     42|    }
 1471|   219k|    ctxt->nodemem = -1;
 1472|       |
 1473|       |    /* Initialize parent before pushing node */
 1474|   219k|    parent = ctxt->node;
 1475|   219k|    if (parent == NULL)
  ------------------
  |  Branch (1475:9): [True: 15.6k, False: 204k]
  ------------------
 1476|  15.6k|        parent = (xmlNodePtr) ctxt->myDoc;
 1477|       |
 1478|       |    /*
 1479|       |     * Link the child element
 1480|       |     */
 1481|   219k|    xmlSAX2AppendChild(ctxt, ret);
 1482|       |
 1483|       |    /*
 1484|       |     * We are parsing a new node.
 1485|       |     */
 1486|   219k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (1486:9): [True: 28, False: 219k]
  ------------------
 1487|     28|        xmlUnlinkNode(ret);
 1488|     28|        xmlFreeNode(ret);
 1489|     28|        if (prefix != NULL)
  ------------------
  |  Branch (1489:13): [True: 3, False: 25]
  ------------------
 1490|      3|            xmlFree(prefix);
 1491|     28|        return;
 1492|     28|    }
 1493|       |
 1494|       |    /*
 1495|       |     * Insert all the defaulted attributes from the DTD especially
 1496|       |     * namespaces
 1497|       |     */
 1498|   219k|    if ((ctxt->myDoc->intSubset != NULL) ||
  ------------------
  |  Branch (1498:9): [True: 108k, False: 111k]
  ------------------
 1499|   111k|        (ctxt->myDoc->extSubset != NULL)) {
  ------------------
  |  Branch (1499:9): [True: 0, False: 111k]
  ------------------
 1500|   108k|        xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
 1501|   108k|    }
 1502|       |
 1503|       |    /*
 1504|       |     * process all the attributes whose name start with "xmlns"
 1505|       |     */
 1506|   219k|    if (atts != NULL) {
  ------------------
  |  Branch (1506:9): [True: 52.5k, False: 167k]
  ------------------
 1507|  52.5k|        i = 0;
 1508|  52.5k|        att = atts[i++];
 1509|  52.5k|        value = atts[i++];
 1510|   122k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1510:16): [True: 70.0k, False: 52.5k]
  |  Branch (1510:33): [True: 70.0k, False: 0]
  ------------------
 1511|  70.0k|            if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
  ------------------
  |  Branch (1511:17): [True: 49.5k, False: 20.5k]
  |  Branch (1511:36): [True: 42.1k, False: 7.34k]
  |  Branch (1511:55): [True: 40.9k, False: 1.26k]
  ------------------
 1512|  40.9k|                (att[3] == 'n') && (att[4] == 's'))
  ------------------
  |  Branch (1512:17): [True: 31.7k, False: 9.17k]
  |  Branch (1512:36): [True: 31.4k, False: 322]
  ------------------
 1513|  31.4k|                xmlSAX1Attribute(ctxt, att, value, prefix);
 1514|       |
 1515|  70.0k|            att = atts[i++];
 1516|  70.0k|            value = atts[i++];
 1517|  70.0k|        }
 1518|  52.5k|    }
 1519|       |
 1520|       |    /*
 1521|       |     * Search the namespace, note that since the attributes have been
 1522|       |     * processed, the local namespaces are available.
 1523|       |     */
 1524|   219k|    res = xmlSearchNsSafe(ret, prefix, &ns);
 1525|   219k|    if (res < 0)
  ------------------
  |  Branch (1525:9): [True: 4, False: 219k]
  ------------------
 1526|      4|        xmlSAX2ErrMemory(ctxt);
 1527|   219k|    if ((ns == NULL) && (parent != NULL)) {
  ------------------
  |  Branch (1527:9): [True: 162k, False: 57.6k]
  |  Branch (1527:25): [True: 162k, False: 0]
  ------------------
 1528|   162k|        res = xmlSearchNsSafe(parent, prefix, &ns);
 1529|   162k|        if (res < 0)
  ------------------
  |  Branch (1529:13): [True: 0, False: 162k]
  ------------------
 1530|      0|            xmlSAX2ErrMemory(ctxt);
 1531|   162k|    }
 1532|   219k|    if ((prefix != NULL) && (ns == NULL)) {
  ------------------
  |  Branch (1532:9): [True: 41.4k, False: 178k]
  |  Branch (1532:29): [True: 14.0k, False: 27.4k]
  ------------------
 1533|  14.0k|        xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1534|  14.0k|                     "Namespace prefix %s is not defined\n",
 1535|  14.0k|                     prefix, NULL);
 1536|  14.0k|        ns = xmlNewNs(ret, NULL, prefix);
 1537|  14.0k|        if (ns == NULL)
  ------------------
  |  Branch (1537:13): [True: 8, False: 13.9k]
  ------------------
 1538|      8|            xmlSAX2ErrMemory(ctxt);
 1539|  14.0k|    }
 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|   219k|    if ((ns != NULL) && (ns->href != NULL) &&
  ------------------
  |  Branch (1545:9): [True: 71.6k, False: 148k]
  |  Branch (1545:25): [True: 57.6k, False: 13.9k]
  ------------------
 1546|  57.6k|        ((ns->href[0] != 0) || (ns->prefix != NULL)))
  ------------------
  |  Branch (1546:10): [True: 51.6k, False: 6.01k]
  |  Branch (1546:32): [True: 256, False: 5.75k]
  ------------------
 1547|  51.8k|        xmlSetNs(ret, ns);
 1548|       |
 1549|       |    /*
 1550|       |     * process all the other attributes
 1551|       |     */
 1552|   219k|    if (atts != NULL) {
  ------------------
  |  Branch (1552:9): [True: 52.5k, False: 167k]
  ------------------
 1553|  52.5k|        i = 0;
 1554|  52.5k|	att = atts[i++];
 1555|  52.5k|	value = atts[i++];
 1556|   122k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1556:16): [True: 70.0k, False: 52.5k]
  |  Branch (1556:33): [True: 70.0k, False: 0]
  ------------------
 1557|  70.0k|            if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l') ||
  ------------------
  |  Branch (1557:17): [True: 20.5k, False: 49.5k]
  |  Branch (1557:36): [True: 7.34k, False: 42.1k]
  |  Branch (1557:55): [True: 1.26k, False: 40.9k]
  ------------------
 1558|  40.9k|                (att[3] != 'n') || (att[4] != 's'))
  ------------------
  |  Branch (1558:17): [True: 9.17k, False: 31.7k]
  |  Branch (1558:36): [True: 322, False: 31.4k]
  ------------------
 1559|  38.6k|                xmlSAX1Attribute(ctxt, att, value, NULL);
 1560|       |
 1561|       |            /*
 1562|       |             * Next ones
 1563|       |             */
 1564|  70.0k|            att = atts[i++];
 1565|  70.0k|            value = atts[i++];
 1566|  70.0k|        }
 1567|  52.5k|    }
 1568|       |
 1569|   219k|#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|   219k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (1574:9): [True: 62.9k, False: 156k]
  ------------------
 1575|  62.9k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|  62.9k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (1575:9): [True: 2.36k, False: 60.6k]
  ------------------
 1576|  2.36k|	int chk;
 1577|       |
 1578|  2.36k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 1579|  2.36k|	if (chk <= 0)
  ------------------
  |  Branch (1579:6): [True: 35, False: 2.33k]
  ------------------
 1580|     35|	    ctxt->valid = 0;
 1581|  2.36k|	if (chk < 0)
  ------------------
  |  Branch (1581:6): [True: 0, False: 2.36k]
  ------------------
 1582|      0|	    ctxt->wellFormed = 0;
 1583|  2.36k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 1584|  2.36k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  2.36k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 1585|  2.36k|    }
 1586|   219k|#endif /* LIBXML_VALID_ENABLED */
 1587|       |
 1588|   219k|    if (prefix != NULL)
  ------------------
  |  Branch (1588:9): [True: 41.4k, False: 178k]
  ------------------
 1589|  41.4k|	xmlFree(prefix);
 1590|       |
 1591|   219k|}
SAX2.c:xmlCheckDefaultedAttributes:
 1257|   108k|	const xmlChar *prefix, const xmlChar **atts) {
 1258|   108k|    xmlElementPtr elemDecl;
 1259|   108k|    const xmlChar *att;
 1260|   108k|    int internal = 1;
 1261|   108k|    int i;
 1262|       |
 1263|   108k|    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->intSubset, name, prefix);
 1264|   108k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (1264:9): [True: 64.4k, False: 43.6k]
  ------------------
 1265|  64.4k|	elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset, name, prefix);
 1266|  64.4k|	internal = 0;
 1267|  64.4k|    }
 1268|       |
 1269|   151k|process_external_subset:
 1270|       |
 1271|   151k|    if (elemDecl != NULL) {
  ------------------
  |  Branch (1271:9): [True: 46.7k, False: 104k]
  ------------------
 1272|  46.7k|	xmlAttributePtr attr = elemDecl->attributes;
 1273|       |
 1274|  46.7k|#ifdef LIBXML_VALID_ENABLED
 1275|       |        /*
 1276|       |         * Check against defaulted attributes from the external subset
 1277|       |         * if the document is stamped as standalone.
 1278|       |         *
 1279|       |         * This should be moved to valid.c, but we don't keep track
 1280|       |         * whether an attribute was defaulted.
 1281|       |         */
 1282|  46.7k|	if ((ctxt->myDoc->standalone == 1) &&
  ------------------
  |  Branch (1282:6): [True: 1.48k, False: 45.3k]
  ------------------
 1283|  1.48k|	    (ctxt->myDoc->extSubset != NULL) &&
  ------------------
  |  Branch (1283:6): [True: 1.35k, False: 135]
  ------------------
 1284|  1.35k|	    (ctxt->validate)) {
  ------------------
  |  Branch (1284:6): [True: 1.15k, False: 196]
  ------------------
 1285|  2.08k|	    while (attr != NULL) {
  ------------------
  |  Branch (1285:13): [True: 934, False: 1.15k]
  ------------------
 1286|    934|		if ((attr->defaultValue != NULL) &&
  ------------------
  |  Branch (1286:7): [True: 636, False: 298]
  ------------------
 1287|    636|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->extSubset,
  ------------------
  |  Branch (1287:7): [True: 558, False: 78]
  ------------------
 1288|    636|					attr->elem, attr->name,
 1289|    636|					attr->prefix) == attr) &&
 1290|    558|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
  ------------------
  |  Branch (1290:7): [True: 558, False: 0]
  ------------------
 1291|    558|					attr->elem, attr->name,
 1292|    558|					attr->prefix) == NULL)) {
 1293|    558|		    xmlChar *fulln;
 1294|       |
 1295|    558|		    if (attr->prefix != NULL) {
  ------------------
  |  Branch (1295:11): [True: 72, False: 486]
  ------------------
 1296|     72|			fulln = xmlStrdup(attr->prefix);
 1297|     72|                        if (fulln != NULL)
  ------------------
  |  Branch (1297:29): [True: 71, False: 1]
  ------------------
 1298|     71|			    fulln = xmlStrcat(fulln, BAD_CAST ":");
  ------------------
  |  |   34|     71|#define BAD_CAST (xmlChar *)
  ------------------
 1299|     72|                        if (fulln != NULL)
  ------------------
  |  Branch (1299:29): [True: 71, False: 1]
  ------------------
 1300|     71|			    fulln = xmlStrcat(fulln, attr->name);
 1301|    486|		    } else {
 1302|    486|			fulln = xmlStrdup(attr->name);
 1303|    486|		    }
 1304|    558|                    if (fulln == NULL) {
  ------------------
  |  Branch (1304:25): [True: 4, False: 554]
  ------------------
 1305|      4|                        xmlSAX2ErrMemory(ctxt);
 1306|      4|                        break;
 1307|      4|                    }
 1308|       |
 1309|       |		    /*
 1310|       |		     * Check that the attribute is not declared in the
 1311|       |		     * serialization
 1312|       |		     */
 1313|    554|		    att = NULL;
 1314|    554|		    if (atts != NULL) {
  ------------------
  |  Branch (1314:11): [True: 289, False: 265]
  ------------------
 1315|    289|			i = 0;
 1316|    289|			att = atts[i];
 1317|    545|			while (att != NULL) {
  ------------------
  |  Branch (1317:11): [True: 323, False: 222]
  ------------------
 1318|    323|			    if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1318:12): [True: 67, False: 256]
  ------------------
 1319|     67|				break;
 1320|    256|			    i += 2;
 1321|    256|			    att = atts[i];
 1322|    256|			}
 1323|    289|		    }
 1324|    554|		    if (att == NULL) {
  ------------------
  |  Branch (1324:11): [True: 487, False: 67]
  ------------------
 1325|    487|		        xmlErrValid(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 1326|    487|      "standalone: attribute %s on %s defaulted from external subset\n",
 1327|    487|				    fulln,
 1328|    487|				    attr->elem);
 1329|    487|		    }
 1330|    554|                    xmlFree(fulln);
 1331|    554|		}
 1332|    930|		attr = attr->nexth;
 1333|    930|	    }
 1334|  1.15k|	}
 1335|  46.7k|#endif
 1336|       |
 1337|       |	/*
 1338|       |	 * Actually insert defaulted values when needed
 1339|       |	 */
 1340|  46.7k|	attr = elemDecl->attributes;
 1341|   119k|	while (attr != NULL) {
  ------------------
  |  Branch (1341:9): [True: 72.2k, False: 46.7k]
  ------------------
 1342|       |	    /*
 1343|       |	     * Make sure that attributes redefinition occurring in the
 1344|       |	     * internal subset are not overridden by definitions in the
 1345|       |	     * external subset.
 1346|       |	     */
 1347|  72.2k|	    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (1347:10): [True: 67.6k, False: 4.62k]
  ------------------
 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|  67.6k|		if (((attr->prefix != NULL) &&
  ------------------
  |  Branch (1356:8): [True: 21.8k, False: 45.7k]
  ------------------
 1357|  21.8k|		     (xmlStrEqual(attr->prefix, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  21.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1357:8): [True: 7.75k, False: 14.1k]
  ------------------
 1358|  59.8k|		    ((attr->prefix == NULL) &&
  ------------------
  |  Branch (1358:8): [True: 45.7k, False: 14.1k]
  ------------------
 1359|  45.7k|		     (xmlStrEqual(attr->name, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  45.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1359:8): [True: 3.39k, False: 42.3k]
  ------------------
 1360|  56.4k|		    (ctxt->loadsubset & XML_COMPLETE_ATTRS)) {
  ------------------
  |  |  209|  56.4k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (1360:7): [True: 25.8k, False: 30.6k]
  ------------------
 1361|  36.9k|		    xmlAttributePtr tst;
 1362|       |
 1363|  36.9k|		    tst = xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
 1364|  36.9k|					     attr->elem, attr->name,
 1365|  36.9k|					     attr->prefix);
 1366|  36.9k|		    if ((tst == attr) || (tst == NULL)) {
  ------------------
  |  Branch (1366:11): [True: 34.8k, False: 2.10k]
  |  Branch (1366:28): [True: 2.10k, False: 0]
  ------------------
 1367|  36.9k|		        xmlChar fn[50];
 1368|  36.9k|			xmlChar *fulln;
 1369|       |
 1370|  36.9k|                        fulln = xmlBuildQName(attr->name, attr->prefix, fn, 50);
 1371|  36.9k|			if (fulln == NULL) {
  ------------------
  |  Branch (1371:8): [True: 5, False: 36.9k]
  ------------------
 1372|      5|			    xmlSAX2ErrMemory(ctxt);
 1373|      5|			    return;
 1374|      5|			}
 1375|       |
 1376|       |			/*
 1377|       |			 * Check that the attribute is not declared in the
 1378|       |			 * serialization
 1379|       |			 */
 1380|  36.9k|			att = NULL;
 1381|  36.9k|			if (atts != NULL) {
  ------------------
  |  Branch (1381:8): [True: 2.46k, False: 34.4k]
  ------------------
 1382|  2.46k|			    i = 0;
 1383|  2.46k|			    att = atts[i];
 1384|  4.44k|			    while (att != NULL) {
  ------------------
  |  Branch (1384:15): [True: 2.99k, False: 1.45k]
  ------------------
 1385|  2.99k|				if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1385:9): [True: 1.01k, False: 1.97k]
  ------------------
 1386|  1.01k|				    break;
 1387|  1.97k|				i += 2;
 1388|  1.97k|				att = atts[i];
 1389|  1.97k|			    }
 1390|  2.46k|			}
 1391|  36.9k|			if (att == NULL) {
  ------------------
  |  Branch (1391:8): [True: 35.9k, False: 1.01k]
  ------------------
 1392|  35.9k|			    xmlSAX1Attribute(ctxt, fulln,
 1393|  35.9k|					     attr->defaultValue, prefix);
 1394|  35.9k|			}
 1395|  36.9k|			if ((fulln != fn) && (fulln != attr->name))
  ------------------
  |  Branch (1395:8): [True: 34.8k, False: 2.13k]
  |  Branch (1395:25): [True: 12.5k, False: 22.2k]
  ------------------
 1396|  12.5k|			    xmlFree(fulln);
 1397|  36.9k|		    }
 1398|  36.9k|		}
 1399|  67.6k|	    }
 1400|  72.2k|	    attr = attr->nexth;
 1401|  72.2k|	}
 1402|  46.7k|	if (internal == 1) {
  ------------------
  |  Branch (1402:6): [True: 43.6k, False: 3.16k]
  ------------------
 1403|  43.6k|	    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset,
 1404|  43.6k|		                             name, prefix);
 1405|  43.6k|	    internal = 0;
 1406|  43.6k|	    goto process_external_subset;
 1407|  43.6k|	}
 1408|  46.7k|    }
 1409|   151k|}
SAX2.c:xmlSAX1Attribute:
  960|   105k|{
  961|   105k|    xmlAttrPtr ret;
  962|   105k|    const xmlChar *name;
  963|   105k|    xmlChar *ns;
  964|   105k|    xmlNsPtr namespace;
  965|       |
  966|       |    /*
  967|       |     * Split the full name into a namespace prefix and the tag name
  968|       |     */
  969|   105k|    name = xmlSplitQName4(fullname, &ns);
  970|   105k|    if (name == NULL) {
  ------------------
  |  Branch (970:9): [True: 5, False: 105k]
  ------------------
  971|      5|        xmlSAX2ErrMemory(ctxt);
  972|      5|        return;
  973|      5|    }
  974|       |
  975|       |    /*
  976|       |     * Check whether it's a namespace definition
  977|       |     */
  978|   105k|    if ((ns == NULL) &&
  ------------------
  |  Branch (978:9): [True: 55.0k, False: 50.9k]
  ------------------
  979|  55.0k|        (name[0] == 'x') && (name[1] == 'm') && (name[2] == 'l') &&
  ------------------
  |  Branch (979:9): [True: 22.7k, False: 32.2k]
  |  Branch (979:29): [True: 14.9k, False: 7.76k]
  |  Branch (979:49): [True: 14.4k, False: 575]
  ------------------
  980|  14.4k|        (name[3] == 'n') && (name[4] == 's') && (name[5] == 0)) {
  ------------------
  |  Branch (980:9): [True: 13.1k, False: 1.27k]
  |  Branch (980:29): [True: 12.6k, False: 515]
  |  Branch (980:49): [True: 12.3k, False: 317]
  ------------------
  981|  12.3k|	xmlNsPtr nsret;
  982|  12.3k|	xmlChar *val;
  983|       |
  984|       |        /* Avoid unused variable warning if features are disabled. */
  985|  12.3k|        (void) nsret;
  986|       |
  987|  12.3k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (987:13): [True: 8.29k, False: 4.02k]
  ------------------
  988|       |            /* TODO: normalize if needed */
  989|  8.29k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
  990|  8.29k|	    if (val == NULL) {
  ------------------
  |  Branch (990:10): [True: 8, False: 8.28k]
  ------------------
  991|      8|	        xmlSAX2ErrMemory(ctxt);
  992|      8|		return;
  993|      8|	    }
  994|  8.29k|	} else {
  995|  4.02k|	    val = (xmlChar *) value;
  996|  4.02k|	}
  997|       |
  998|  12.3k|	if (val[0] != 0) {
  ------------------
  |  Branch (998:6): [True: 8.14k, False: 4.16k]
  ------------------
  999|  8.14k|	    xmlURIPtr uri;
 1000|       |
 1001|  8.14k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1001:10): [True: 22, False: 8.12k]
  ------------------
 1002|     22|                xmlSAX2ErrMemory(ctxt);
 1003|  8.14k|	    if (uri == NULL) {
  ------------------
  |  Branch (1003:10): [True: 1.83k, False: 6.31k]
  ------------------
 1004|  1.83k|                xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1005|  1.83k|                             "xmlns:%s: %s not a valid URI\n", name, value);
 1006|  6.31k|	    } else {
 1007|  6.31k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1007:7): [True: 5.77k, False: 531]
  ------------------
 1008|  5.77k|                    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1009|  5.77k|                                 "xmlns:%s: URI %s is not absolute\n",
 1010|  5.77k|                                 name, value);
 1011|  5.77k|		}
 1012|  6.31k|		xmlFreeURI(uri);
 1013|  6.31k|	    }
 1014|  8.14k|	}
 1015|       |
 1016|       |	/* a default namespace definition */
 1017|  12.3k|	nsret = xmlNewNs(ctxt->node, val, NULL);
 1018|  12.3k|        if (nsret == NULL) {
  ------------------
  |  Branch (1018:13): [True: 9, False: 12.2k]
  ------------------
 1019|      9|            xmlSAX2ErrMemory(ctxt);
 1020|      9|        }
 1021|  12.2k|#ifdef LIBXML_VALID_ENABLED
 1022|       |	/*
 1023|       |	 * Validate also for namespace decls, they are attributes from
 1024|       |	 * an XML-1.0 perspective
 1025|       |	 */
 1026|  12.2k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1026:18): [True: 2.61k, False: 9.68k]
  |  Branch (1026:36): [True: 1.95k, False: 665]
  ------------------
 1027|  1.95k|                 ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1027:18): [True: 1.95k, False: 0]
  |  Branch (1027:33): [True: 1.95k, False: 0]
  ------------------
 1028|  1.95k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1029|  1.95k|					   ctxt->node, prefix, nsret, val);
 1030|  1.95k|        }
 1031|  12.3k|#endif /* LIBXML_VALID_ENABLED */
 1032|  12.3k|	if (val != value)
  ------------------
  |  Branch (1032:6): [True: 8.28k, False: 4.02k]
  ------------------
 1033|  8.28k|	    xmlFree(val);
 1034|  12.3k|	return;
 1035|  12.3k|    }
 1036|  93.6k|    if ((ns != NULL) && (ns[0] == 'x') && (ns[1] == 'm') && (ns[2] == 'l') &&
  ------------------
  |  Branch (1036:9): [True: 50.9k, False: 42.7k]
  |  Branch (1036:25): [True: 44.3k, False: 6.58k]
  |  Branch (1036:43): [True: 43.0k, False: 1.33k]
  |  Branch (1036:61): [True: 41.6k, False: 1.35k]
  ------------------
 1037|  41.6k|        (ns[3] == 'n') && (ns[4] == 's') && (ns[5] == 0)) {
  ------------------
  |  Branch (1037:9): [True: 31.6k, False: 10.0k]
  |  Branch (1037:27): [True: 31.1k, False: 420]
  |  Branch (1037:45): [True: 30.0k, False: 1.09k]
  ------------------
 1038|  30.0k|	xmlNsPtr nsret;
 1039|  30.0k|	xmlChar *val;
 1040|       |
 1041|       |        /* Avoid unused variable warning if features are disabled. */
 1042|  30.0k|        (void) nsret;
 1043|       |
 1044|  30.0k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1044:13): [True: 9.68k, False: 20.4k]
  ------------------
 1045|       |            /* TODO: normalize if needed */
 1046|  9.68k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1047|  9.68k|	    if (val == NULL) {
  ------------------
  |  Branch (1047:10): [True: 4, False: 9.68k]
  ------------------
 1048|      4|	        xmlSAX2ErrMemory(ctxt);
 1049|      4|	        xmlFree(ns);
 1050|      4|		return;
 1051|      4|	    }
 1052|  20.4k|	} else {
 1053|  20.4k|	    val = (xmlChar *) value;
 1054|  20.4k|	}
 1055|       |
 1056|  30.0k|	if (val[0] == 0) {
  ------------------
  |  Branch (1056:6): [True: 430, False: 29.6k]
  ------------------
 1057|    430|	    xmlNsErrMsg(ctxt, XML_NS_ERR_EMPTY,
 1058|    430|		        "Empty namespace name for prefix %s\n", name, NULL);
 1059|    430|	}
 1060|  30.0k|	if ((ctxt->pedantic != 0) && (val[0] != 0)) {
  ------------------
  |  Branch (1060:6): [True: 16.6k, False: 13.4k]
  |  Branch (1060:31): [True: 16.3k, False: 275]
  ------------------
 1061|  16.3k|	    xmlURIPtr uri;
 1062|       |
 1063|  16.3k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1063:10): [True: 7, False: 16.3k]
  ------------------
 1064|      7|                xmlSAX2ErrMemory(ctxt);
 1065|  16.3k|	    if (uri == NULL) {
  ------------------
  |  Branch (1065:10): [True: 1.94k, False: 14.4k]
  ------------------
 1066|  1.94k|	        xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1067|  1.94k|			 "xmlns:%s: %s not a valid URI\n", name, value);
 1068|  14.4k|	    } else {
 1069|  14.4k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1069:7): [True: 12.5k, False: 1.83k]
  ------------------
 1070|  12.5k|		    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1071|  12.5k|			   "xmlns:%s: URI %s is not absolute\n", name, value);
 1072|  12.5k|		}
 1073|  14.4k|		xmlFreeURI(uri);
 1074|  14.4k|	    }
 1075|  16.3k|	}
 1076|       |
 1077|       |	/* a standard namespace definition */
 1078|  30.0k|	nsret = xmlNewNs(ctxt->node, val, name);
 1079|  30.0k|	xmlFree(ns);
 1080|       |
 1081|  30.0k|        if (nsret == NULL) {
  ------------------
  |  Branch (1081:13): [True: 6, False: 30.0k]
  ------------------
 1082|      6|            xmlSAX2ErrMemory(ctxt);
 1083|      6|        }
 1084|  30.0k|#ifdef LIBXML_VALID_ENABLED
 1085|       |	/*
 1086|       |	 * Validate also for namespace decls, they are attributes from
 1087|       |	 * an XML-1.0 perspective
 1088|       |	 */
 1089|  30.0k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1089:18): [True: 5.31k, False: 24.7k]
  |  Branch (1089:36): [True: 3.22k, False: 2.09k]
  ------------------
 1090|  3.22k|	         ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1090:11): [True: 3.22k, False: 0]
  |  Branch (1090:26): [True: 3.22k, False: 0]
  ------------------
 1091|  3.22k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1092|  3.22k|					   ctxt->node, prefix, nsret, value);
 1093|  3.22k|        }
 1094|  30.0k|#endif /* LIBXML_VALID_ENABLED */
 1095|  30.0k|	if (val != value)
  ------------------
  |  Branch (1095:6): [True: 9.68k, False: 20.4k]
  ------------------
 1096|  9.68k|	    xmlFree(val);
 1097|  30.0k|	return;
 1098|  30.0k|    }
 1099|       |
 1100|  63.5k|    if (ns != NULL) {
  ------------------
  |  Branch (1100:9): [True: 20.8k, False: 42.7k]
  ------------------
 1101|  20.8k|        int res;
 1102|       |
 1103|  20.8k|	res = xmlSearchNsSafe(ctxt->node, ns, &namespace);
 1104|  20.8k|        if (res < 0)
  ------------------
  |  Branch (1104:13): [True: 5, False: 20.8k]
  ------------------
 1105|      5|            xmlSAX2ErrMemory(ctxt);
 1106|       |
 1107|  20.8k|	if (namespace == NULL) {
  ------------------
  |  Branch (1107:6): [True: 8.73k, False: 12.1k]
  ------------------
 1108|  8.73k|	    xmlNsErrMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1109|  8.73k|		    "Namespace prefix %s of attribute %s is not defined\n",
 1110|  8.73k|		             ns, name);
 1111|  12.1k|	} else {
 1112|  12.1k|            xmlAttrPtr prop;
 1113|       |
 1114|  12.1k|            prop = ctxt->node->properties;
 1115|  35.0k|            while (prop != NULL) {
  ------------------
  |  Branch (1115:20): [True: 23.1k, False: 11.9k]
  ------------------
 1116|  23.1k|                if (prop->ns != NULL) {
  ------------------
  |  Branch (1116:21): [True: 11.0k, False: 12.0k]
  ------------------
 1117|  11.0k|                    if ((xmlStrEqual(name, prop->name)) &&
  ------------------
  |  Branch (1117:25): [True: 423, False: 10.6k]
  ------------------
 1118|    423|                        ((namespace == prop->ns) ||
  ------------------
  |  Branch (1118:26): [True: 0, False: 423]
  ------------------
 1119|    423|                         (xmlStrEqual(namespace->href, prop->ns->href)))) {
  ------------------
  |  Branch (1119:26): [True: 205, False: 218]
  ------------------
 1120|    205|                        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER,
 1121|    205|                                   XML_ERR_ATTRIBUTE_REDEFINED, XML_ERR_FATAL,
 1122|    205|                                   name, NULL, NULL, 0,
 1123|    205|                                   "Attribute %s in %s redefined\n",
 1124|    205|                                   name, namespace->href);
 1125|    205|                        goto error;
 1126|    205|                    }
 1127|  11.0k|                }
 1128|  22.9k|                prop = prop->next;
 1129|  22.9k|            }
 1130|  12.1k|        }
 1131|  42.7k|    } else {
 1132|  42.7k|	namespace = NULL;
 1133|  42.7k|    }
 1134|       |
 1135|       |    /* !!!!!! <a toto:arg="" xmlns:toto="http://toto.com"> */
 1136|  63.3k|    ret = xmlNewNsProp(ctxt->node, namespace, name, NULL);
 1137|  63.3k|    if (ret == NULL) {
  ------------------
  |  Branch (1137:9): [True: 33, False: 63.3k]
  ------------------
 1138|     33|        xmlSAX2ErrMemory(ctxt);
 1139|     33|        goto error;
 1140|     33|    }
 1141|       |
 1142|  63.3k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (1142:9): [True: 29.3k, False: 34.0k]
  ------------------
 1143|  29.3k|        if (xmlNodeParseAttValue(ret->doc, ret, value, SIZE_MAX, NULL) < 0)
  ------------------
  |  Branch (1143:13): [True: 47, False: 29.2k]
  ------------------
 1144|     47|            xmlSAX2ErrMemory(ctxt);
 1145|  34.0k|    } else if (value != NULL) {
  ------------------
  |  Branch (1145:16): [True: 34.0k, False: 0]
  ------------------
 1146|  34.0k|        ret->children = xmlNewDocText(ctxt->myDoc, value);
 1147|  34.0k|        if (ret->children == NULL) {
  ------------------
  |  Branch (1147:13): [True: 22, False: 34.0k]
  ------------------
 1148|     22|            xmlSAX2ErrMemory(ctxt);
 1149|  34.0k|        } else {
 1150|  34.0k|            ret->last = ret->children;
 1151|  34.0k|            ret->children->parent = (xmlNodePtr) ret;
 1152|  34.0k|        }
 1153|  34.0k|    }
 1154|       |
 1155|  63.3k|#ifdef LIBXML_VALID_ENABLED
 1156|  63.3k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1156:9): [True: 20.0k, False: 43.2k]
  |  Branch (1156:27): [True: 10.6k, False: 9.40k]
  ------------------
 1157|  10.6k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1157:9): [True: 10.6k, False: 0]
  |  Branch (1157:24): [True: 10.6k, 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|  10.6k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1163:13): [True: 4.39k, False: 6.28k]
  ------------------
 1164|  4.39k|	    xmlChar *val;
 1165|       |
 1166|       |            /* TODO: normalize if needed */
 1167|  4.39k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1168|       |
 1169|  4.39k|	    if (val == NULL)
  ------------------
  |  Branch (1169:10): [True: 2, False: 4.39k]
  ------------------
 1170|      2|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1171|      2|				ctxt->myDoc, ctxt->node, ret, value);
 1172|  4.39k|	    else {
 1173|  4.39k|		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.39k|                nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 1181|  4.39k|                                 &ctxt->vctxt, ctxt->myDoc,
 1182|  4.39k|                                 ctxt->node, fullname, val);
 1183|  4.39k|		if (nvalnorm != NULL) {
  ------------------
  |  Branch (1183:7): [True: 2.53k, False: 1.85k]
  ------------------
 1184|  2.53k|		    xmlFree(val);
 1185|  2.53k|		    val = nvalnorm;
 1186|  2.53k|		}
 1187|       |
 1188|  4.39k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1189|  4.39k|			        ctxt->myDoc, ctxt->node, ret, val);
 1190|  4.39k|                xmlFree(val);
 1191|  4.39k|	    }
 1192|  6.28k|	} 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|  6.28k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (1199:17): [True: 428, False: 5.85k]
  ------------------
 1200|    428|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    428|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1201|       |
 1202|  6.28k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
 1203|  6.28k|					       ctxt->node, ret, value);
 1204|       |
 1205|  6.28k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  6.28k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1206|  6.28k|	}
 1207|  10.6k|    } else
 1208|  52.6k|#endif /* LIBXML_VALID_ENABLED */
 1209|  52.6k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|  52.6k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (1209:16): [True: 31.5k, False: 21.0k]
  ------------------
 1210|  31.5k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (1210:16): [True: 30.4k, False: 1.11k]
  ------------------
 1211|       |               /* Don't create IDs containing entity references */
 1212|  30.4k|               (ret->children != NULL) &&
  ------------------
  |  Branch (1212:16): [True: 28.1k, False: 2.29k]
  ------------------
 1213|  28.1k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1213:16): [True: 27.8k, False: 303]
  ------------------
 1214|  27.8k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (1214:16): [True: 27.7k, False: 121]
  ------------------
 1215|  27.7k|        xmlChar *content = ret->children->content;
 1216|       |        /*
 1217|       |	 * when validating, the ID registration is done at the attribute
 1218|       |	 * validation level. Otherwise we have to do specific handling here.
 1219|       |	 */
 1220|  27.7k|	if (xmlStrEqual(fullname, BAD_CAST "xml:id")) {
  ------------------
  |  |   34|  27.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1220:6): [True: 1.40k, False: 26.3k]
  ------------------
 1221|       |	    /*
 1222|       |	     * Add the xml:id value
 1223|       |	     *
 1224|       |	     * Open issue: normalization of the value.
 1225|       |	     */
 1226|  1.40k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (1226:10): [True: 1.00k, False: 391]
  ------------------
 1227|  1.00k|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 1228|  1.00k|		         "xml:id : attribute value %s is not an NCName\n",
 1229|  1.00k|		         content);
 1230|  1.00k|	    }
 1231|  1.40k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1232|  26.3k|	} else {
 1233|  26.3k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 1234|       |
 1235|  26.3k|            if (res < 0)
  ------------------
  |  Branch (1235:17): [True: 1, False: 26.3k]
  ------------------
 1236|      1|                xmlCtxtErrMemory(ctxt);
 1237|  26.3k|            else if (res > 0)
  ------------------
  |  Branch (1237:22): [True: 2.26k, False: 24.0k]
  ------------------
 1238|  2.26k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1239|  24.0k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (1239:22): [True: 7.65k, False: 16.4k]
  ------------------
 1240|  7.65k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1241|  26.3k|        }
 1242|  27.7k|    }
 1243|       |
 1244|  63.5k|error:
 1245|  63.5k|    if (ns != NULL)
  ------------------
  |  Branch (1245:9): [True: 20.8k, False: 42.7k]
  ------------------
 1246|  20.8k|	xmlFree(ns);
 1247|  63.5k|}
SAX2.c:xmlNsErrMsg:
  942|  9.16k|{
  943|  9.16k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  944|       |               str1, str2, NULL, 0, msg, str1, str2);
  945|  9.16k|}
SAX2.c:xmlErrValid:
   59|  10.6k|{
   60|  10.6k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
   61|  10.6k|               str1, str2, NULL, 0, msg, str1, str2);
   62|  10.6k|    if (ctxt != NULL)
  ------------------
  |  Branch (62:9): [True: 10.6k, False: 0]
  ------------------
   63|  10.6k|	ctxt->valid = 0;
   64|  10.6k|}
SAX2.c:xmlSAX2AppendChild:
  895|  1.56M|xmlSAX2AppendChild(xmlParserCtxtPtr ctxt, xmlNodePtr node) {
  896|  1.56M|    xmlNodePtr parent;
  897|  1.56M|    xmlNodePtr last;
  898|       |
  899|  1.56M|    if (ctxt->inSubset == 1) {
  ------------------
  |  Branch (899:9): [True: 141k, False: 1.42M]
  ------------------
  900|   141k|	parent = (xmlNodePtr) ctxt->myDoc->intSubset;
  901|  1.42M|    } else if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (901:16): [True: 171k, False: 1.25M]
  ------------------
  902|   171k|	parent = (xmlNodePtr) ctxt->myDoc->extSubset;
  903|  1.25M|    } else {
  904|  1.25M|        parent = ctxt->node;
  905|  1.25M|        if (parent == NULL)
  ------------------
  |  Branch (905:13): [True: 131k, False: 1.12M]
  ------------------
  906|   131k|            parent = (xmlNodePtr) ctxt->myDoc;
  907|  1.25M|    }
  908|       |
  909|  1.56M|    last = parent->last;
  910|  1.56M|    if (last == NULL) {
  ------------------
  |  Branch (910:9): [True: 282k, False: 1.28M]
  ------------------
  911|   282k|        parent->children = node;
  912|  1.28M|    } else {
  913|  1.28M|        last->next = node;
  914|  1.28M|        node->prev = last;
  915|  1.28M|    }
  916|       |
  917|  1.56M|    parent->last = node;
  918|  1.56M|    node->parent = parent;
  919|       |
  920|  1.56M|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (920:9): [True: 1.26M, False: 302k]
  ------------------
  921|  1.26M|	(ctxt->input != NULL)) {
  ------------------
  |  Branch (921:2): [True: 1.26M, False: 0]
  ------------------
  922|  1.26M|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (922:13): [True: 1.20M, False: 53.6k]
  ------------------
  923|  1.20M|            node->line = ctxt->input->line;
  924|  53.6k|        else
  925|  53.6k|            node->line = USHRT_MAX;
  926|  1.26M|    }
  927|  1.56M|}
SAX2.c:xmlNsWarnMsg:
  128|  36.1k|{
  129|  36.1k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  130|       |               str1, str2, NULL, 0, msg, str1, str2);
  131|  36.1k|}
SAX2.c:xmlSAX2AttributeNs:
 1908|   246k|{
 1909|   246k|    xmlAttrPtr ret;
 1910|   246k|    xmlNsPtr namespace = NULL;
 1911|   246k|    xmlChar *dup = NULL;
 1912|       |
 1913|       |    /*
 1914|       |     * Note: if prefix == NULL, the attribute is not in the default namespace
 1915|       |     */
 1916|   246k|    if (prefix != NULL) {
  ------------------
  |  Branch (1916:9): [True: 77.5k, False: 169k]
  ------------------
 1917|  77.5k|	namespace = xmlParserNsLookupSax(ctxt, prefix);
 1918|  77.5k|	if ((namespace == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|  62.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1918:6): [True: 62.9k, False: 14.6k]
  |  Branch (1918:29): [True: 62.8k, False: 60]
  ------------------
 1919|  62.8k|            int res;
 1920|       |
 1921|  62.8k|	    res = xmlSearchNsSafe(ctxt->node, prefix, &namespace);
 1922|  62.8k|            if (res < 0)
  ------------------
  |  Branch (1922:17): [True: 9, False: 62.8k]
  ------------------
 1923|      9|                xmlSAX2ErrMemory(ctxt);
 1924|  62.8k|	}
 1925|  77.5k|    }
 1926|       |
 1927|       |    /*
 1928|       |     * allocate the node
 1929|       |     */
 1930|   246k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (1930:9): [True: 1.67k, False: 244k]
  ------------------
 1931|  1.67k|        ret = ctxt->freeAttrs;
 1932|  1.67k|	ctxt->freeAttrs = ret->next;
 1933|  1.67k|	ctxt->freeAttrsNr--;
 1934|   244k|    } else {
 1935|   244k|        ret = xmlMalloc(sizeof(*ret));
 1936|   244k|        if (ret == NULL) {
  ------------------
  |  Branch (1936:13): [True: 15, False: 244k]
  ------------------
 1937|     15|            xmlSAX2ErrMemory(ctxt);
 1938|     15|            return(NULL);
 1939|     15|        }
 1940|   244k|    }
 1941|       |
 1942|   246k|    memset(ret, 0, sizeof(xmlAttr));
 1943|   246k|    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|   246k|    ret->parent = ctxt->node;
 1955|   246k|    ret->doc = ctxt->node->doc;
 1956|   246k|    ret->ns = namespace;
 1957|       |
 1958|   246k|    if (ctxt->dictNames) {
  ------------------
  |  Branch (1958:9): [True: 171k, False: 74.6k]
  ------------------
 1959|   171k|        ret->name = localname;
 1960|   171k|    } else {
 1961|  74.6k|        ret->name = xmlStrdup(localname);
 1962|  74.6k|        if (ret->name == NULL)
  ------------------
  |  Branch (1962:13): [True: 55, False: 74.5k]
  ------------------
 1963|     55|            xmlSAX2ErrMemory(ctxt);
 1964|  74.6k|    }
 1965|       |
 1966|   246k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1966:9): [True: 0, False: 246k]
  |  Branch (1966:35): [True: 0, False: 0]
  ------------------
 1967|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1968|       |
 1969|   246k|    if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
  ------------------
  |  Branch (1969:9): [True: 68.7k, False: 177k]
  |  Branch (1969:41): [True: 68.7k, False: 0]
  ------------------
 1970|  68.7k|	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|  68.7k|	if (*valueend != 0) {
  ------------------
  |  Branch (1977:6): [True: 27.4k, False: 41.2k]
  ------------------
 1978|  27.4k|	    tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1979|  27.4k|	    ret->children = tmp;
 1980|  27.4k|	    ret->last = tmp;
 1981|  27.4k|	    if (tmp != NULL) {
  ------------------
  |  Branch (1981:10): [True: 27.4k, False: 17]
  ------------------
 1982|  27.4k|		tmp->parent = (xmlNodePtr) ret;
 1983|  27.4k|	    }
 1984|  41.2k|	} else if (valueend > value) {
  ------------------
  |  Branch (1984:13): [True: 40.6k, False: 624]
  ------------------
 1985|  40.6k|            if (xmlNodeParseAttValue(ret->doc, ret, value, valueend - value,
  ------------------
  |  Branch (1985:17): [True: 32, False: 40.5k]
  ------------------
 1986|  40.6k|                                     NULL) < 0)
 1987|     32|                xmlSAX2ErrMemory(ctxt);
 1988|  40.6k|	}
 1989|   177k|    } else if (value != NULL) {
  ------------------
  |  Branch (1989:16): [True: 177k, False: 0]
  ------------------
 1990|   177k|	xmlNodePtr tmp;
 1991|       |
 1992|   177k|	tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1993|   177k|	ret->children = tmp;
 1994|   177k|	ret->last = tmp;
 1995|   177k|	if (tmp != NULL) {
  ------------------
  |  Branch (1995:6): [True: 177k, False: 21]
  ------------------
 1996|   177k|	    tmp->parent = (xmlNodePtr) ret;
 1997|   177k|	}
 1998|   177k|    }
 1999|       |
 2000|   246k|#ifdef LIBXML_VALID_ENABLED
 2001|   246k|    if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2001:9): [True: 246k, False: 0]
  |  Branch (2001:26): [True: 103k, False: 142k]
  |  Branch (2001:44): [True: 54.5k, False: 49.3k]
  ------------------
 2002|  54.5k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2002:9): [True: 54.5k, False: 0]
  |  Branch (2002:24): [True: 54.5k, False: 0]
  ------------------
 2003|       |	/*
 2004|       |	 * If we don't substitute entities, the validation should be
 2005|       |	 * done on a value with replaced entities anyway.
 2006|       |	 */
 2007|  54.5k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (2007:13): [True: 6.36k, False: 48.1k]
  ------------------
 2008|  6.36k|	    dup = xmlSAX2DecodeAttrEntities(ctxt, value, valueend);
 2009|  6.36k|	    if (dup == NULL) {
  ------------------
  |  Branch (2009:10): [True: 4.14k, False: 2.22k]
  ------------------
 2010|  4.14k|	        if (*valueend == 0) {
  ------------------
  |  Branch (2010:14): [True: 3.06k, False: 1.08k]
  ------------------
 2011|  3.06k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2012|  3.06k|				    ctxt->myDoc, ctxt->node, ret, value);
 2013|  3.06k|		} else {
 2014|       |		    /*
 2015|       |		     * That should already be normalized.
 2016|       |		     * cheaper to finally allocate here than duplicate
 2017|       |		     * entry points in the full validation code
 2018|       |		     */
 2019|  1.08k|		    dup = xmlStrndup(value, valueend - value);
 2020|  1.08k|                    if (dup == NULL)
  ------------------
  |  Branch (2020:25): [True: 2, False: 1.08k]
  ------------------
 2021|      2|                        xmlSAX2ErrMemory(ctxt);
 2022|       |
 2023|  1.08k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2024|  1.08k|				    ctxt->myDoc, ctxt->node, ret, dup);
 2025|  1.08k|		}
 2026|  4.14k|	    } 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.22k|		if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (2034:7): [True: 1.92k, False: 297]
  ------------------
 2035|  1.92k|		    xmlChar *nvalnorm;
 2036|  1.92k|		    xmlChar fn[50];
 2037|  1.92k|		    xmlChar *fullname;
 2038|       |
 2039|  1.92k|		    fullname = xmlBuildQName(localname, prefix, fn, 50);
 2040|  1.92k|                    if (fullname == NULL) {
  ------------------
  |  Branch (2040:25): [True: 1, False: 1.92k]
  ------------------
 2041|      1|                        xmlSAX2ErrMemory(ctxt);
 2042|  1.92k|                    } else {
 2043|  1.92k|			ctxt->vctxt.valid = 1;
 2044|  1.92k|		        nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 2045|  1.92k|			                 &ctxt->vctxt, ctxt->myDoc,
 2046|  1.92k|					 ctxt->node, fullname, dup);
 2047|  1.92k|			if (ctxt->vctxt.valid != 1)
  ------------------
  |  Branch (2047:8): [True: 18, False: 1.90k]
  ------------------
 2048|     18|			    ctxt->valid = 0;
 2049|       |
 2050|  1.92k|			if ((fullname != fn) && (fullname != localname))
  ------------------
  |  Branch (2050:8): [True: 1.85k, False: 72]
  |  Branch (2050:28): [True: 753, False: 1.09k]
  ------------------
 2051|    753|			    xmlFree(fullname);
 2052|  1.92k|			if (nvalnorm != NULL) {
  ------------------
  |  Branch (2052:8): [True: 1.84k, False: 74]
  ------------------
 2053|  1.84k|			    xmlFree(dup);
 2054|  1.84k|			    dup = nvalnorm;
 2055|  1.84k|			}
 2056|  1.92k|		    }
 2057|  1.92k|		}
 2058|       |
 2059|  2.22k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2060|  2.22k|			        ctxt->myDoc, ctxt->node, ret, dup);
 2061|  2.22k|	    }
 2062|  48.1k|	} else {
 2063|       |	    /*
 2064|       |	     * if entities already have been substituted, then
 2065|       |	     * the attribute as passed is already normalized
 2066|       |	     */
 2067|  48.1k|	    dup = xmlStrndup(value, valueend - value);
 2068|  48.1k|            if (dup == NULL)
  ------------------
  |  Branch (2068:17): [True: 11, False: 48.1k]
  ------------------
 2069|     11|                xmlSAX2ErrMemory(ctxt);
 2070|       |
 2071|       |            /*
 2072|       |             * When replacing entities, make sure that IDs in
 2073|       |             * entities aren't registered. This also shouldn't be
 2074|       |             * done when entities aren't replaced, but this would
 2075|       |             * require to rework IDREF checks.
 2076|       |             */
 2077|  48.1k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (2077:17): [True: 548, False: 47.5k]
  ------------------
 2078|    548|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    548|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2079|       |
 2080|  48.1k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2081|  48.1k|	                             ctxt->myDoc, ctxt->node, ret, dup);
 2082|       |
 2083|  48.1k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  48.1k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2084|  48.1k|	}
 2085|  54.5k|    } else
 2086|   192k|#endif /* LIBXML_VALID_ENABLED */
 2087|   192k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   192k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (2087:16): [True: 105k, False: 86.3k]
  ------------------
 2088|   105k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (2088:16): [True: 102k, False: 3.65k]
  ------------------
 2089|       |               /* Don't create IDs containing entity references */
 2090|   102k|               (ret->children != NULL) &&
  ------------------
  |  Branch (2090:16): [True: 101k, False: 327]
  ------------------
 2091|   101k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2091:16): [True: 101k, False: 744]
  ------------------
 2092|   101k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (2092:16): [True: 100k, False: 287]
  ------------------
 2093|   100k|        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|   100k|        if ((prefix == ctxt->str_xml) &&
  ------------------
  |  Branch (2098:13): [True: 21.5k, False: 79.2k]
  ------------------
 2099|  21.5k|	           (localname[0] == 'i') && (localname[1] == 'd') &&
  ------------------
  |  Branch (2099:13): [True: 2.76k, False: 18.7k]
  |  Branch (2099:38): [True: 2.39k, False: 365]
  ------------------
 2100|  2.39k|		   (localname[2] == 0)) {
  ------------------
  |  Branch (2100:6): [True: 2.03k, False: 361]
  ------------------
 2101|       |	    /*
 2102|       |	     * Add the xml:id value
 2103|       |	     *
 2104|       |	     * Open issue: normalization of the value.
 2105|       |	     */
 2106|  2.03k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (2106:10): [True: 1.56k, False: 469]
  ------------------
 2107|  1.56k|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 2108|  1.56k|                         "xml:id : attribute value %s is not an NCName\n",
 2109|  1.56k|                         content);
 2110|  1.56k|	    }
 2111|  2.03k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2112|  98.6k|	} else {
 2113|  98.6k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 2114|       |
 2115|  98.6k|            if (res < 0)
  ------------------
  |  Branch (2115:17): [True: 2, False: 98.6k]
  ------------------
 2116|      2|                xmlCtxtErrMemory(ctxt);
 2117|  98.6k|            else if (res > 0)
  ------------------
  |  Branch (2117:22): [True: 3.32k, False: 95.3k]
  ------------------
 2118|  3.32k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2119|  95.3k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (2119:22): [True: 13.5k, False: 81.8k]
  ------------------
 2120|  13.5k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2121|  98.6k|	}
 2122|   100k|    }
 2123|   246k|    if (dup != NULL)
  ------------------
  |  Branch (2123:9): [True: 51.4k, False: 195k]
  ------------------
 2124|  51.4k|	xmlFree(dup);
 2125|       |
 2126|   246k|    return(ret);
 2127|   246k|}
SAX2.c:xmlSAX2TextNode:
 1783|   635k|                int len) {
 1784|   635k|    xmlNodePtr ret;
 1785|   635k|    const xmlChar *intern = NULL;
 1786|       |
 1787|       |    /*
 1788|       |     * Allocate
 1789|       |     */
 1790|   635k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (1790:9): [True: 1.77k, False: 633k]
  ------------------
 1791|  1.77k|	ret = ctxt->freeElems;
 1792|  1.77k|	ctxt->freeElems = ret->next;
 1793|  1.77k|	ctxt->freeElemsNr--;
 1794|   633k|    } else {
 1795|   633k|	ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1796|   633k|    }
 1797|   635k|    if (ret == NULL) {
  ------------------
  |  Branch (1797:9): [True: 76, False: 635k]
  ------------------
 1798|     76|        xmlCtxtErrMemory(ctxt);
 1799|     76|	return(NULL);
 1800|     76|    }
 1801|   635k|    memset(ret, 0, sizeof(xmlNode));
 1802|       |    /*
 1803|       |     * intern the formatting blanks found between tags, or the
 1804|       |     * very short strings
 1805|       |     */
 1806|   635k|    if ((!ctxt->html) && (ctxt->dictNames)) {
  ------------------
  |  Branch (1806:9): [True: 635k, False: 0]
  |  Branch (1806:26): [True: 368k, False: 266k]
  ------------------
 1807|   368k|        xmlChar cur = str[len];
 1808|       |
 1809|   368k|	if ((len < (int) (2 * sizeof(void *))) &&
  ------------------
  |  Branch (1809:6): [True: 309k, False: 59.2k]
  ------------------
 1810|   309k|	    (ctxt->options & XML_PARSE_COMPACT)) {
  ------------------
  |  Branch (1810:6): [True: 309k, False: 0]
  ------------------
 1811|       |	    /* store the string in the node overriding properties and nsDef */
 1812|   309k|	    xmlChar *tmp = (xmlChar *) &(ret->properties);
 1813|   309k|	    memcpy(tmp, str, len);
 1814|   309k|	    tmp[len] = 0;
 1815|   309k|	    intern = tmp;
 1816|   309k|	} else if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
  ------------------
  |  Branch (1816:13): [True: 0, False: 59.2k]
  |  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|  59.2k|	} else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
  ------------------
  |  |  137|  59.2k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   118k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.53k, False: 55.7k]
  |  |  |  |  ------------------
  |  |  |  |   91|  59.2k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 55.5k, False: 203]
  |  |  |  |  |  Branch (91:23): [True: 3.39k, False: 52.1k]
  |  |  |  |  ------------------
  |  |  |  |   92|   118k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 239, False: 52.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1824:34): [True: 6.03k, False: 1.12k]
  |  Branch (1824:48): [True: 4.91k, False: 1.12k]
  ------------------
 1825|  4.91k|	           (str[len + 1] != '!')) {
  ------------------
  |  Branch (1825:13): [True: 3.78k, False: 1.12k]
  ------------------
 1826|  3.78k|	    int i;
 1827|       |
 1828|  42.6k|	    for (i = 1;i < len;i++) {
  ------------------
  |  Branch (1828:17): [True: 41.1k, False: 1.49k]
  ------------------
 1829|  41.1k|		if (!IS_BLANK_CH(str[i])) goto skip;
  ------------------
  |  |  137|  41.1k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  41.1k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 28.0k, False: 13.1k]
  |  |  |  |  ------------------
  |  |  |  |   91|  41.1k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 13.1k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 10.8k, False: 2.29k]
  |  |  |  |  ------------------
  |  |  |  |   92|  41.1k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 2.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1830|  41.1k|	    }
 1831|  1.49k|	    intern = xmlDictLookup(ctxt->dict, str, len);
 1832|  1.49k|            if (intern == NULL) {
  ------------------
  |  Branch (1832:17): [True: 1, False: 1.49k]
  ------------------
 1833|      1|                xmlSAX2ErrMemory(ctxt);
 1834|      1|                xmlFree(ret);
 1835|      1|                return(NULL);
 1836|      1|            }
 1837|  1.49k|	}
 1838|   368k|    }
 1839|   635k|skip:
 1840|   635k|    ret->type = XML_TEXT_NODE;
 1841|   635k|    ret->doc = doc;
 1842|       |
 1843|   635k|    ret->name = xmlStringText;
 1844|   635k|    if (intern == NULL) {
  ------------------
  |  Branch (1844:9): [True: 324k, False: 310k]
  ------------------
 1845|   324k|	ret->content = xmlStrndup(str, len);
 1846|   324k|	if (ret->content == NULL) {
  ------------------
  |  Branch (1846:6): [True: 35, False: 324k]
  ------------------
 1847|     35|	    xmlSAX2ErrMemory(ctxt);
 1848|     35|	    xmlFree(ret);
 1849|     35|	    return(NULL);
 1850|     35|	}
 1851|   324k|    } else
 1852|   310k|	ret->content = (xmlChar *) intern;
 1853|       |
 1854|   635k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1854:9): [True: 0, False: 635k]
  |  Branch (1854:35): [True: 0, False: 0]
  ------------------
 1855|      0|	xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1856|   635k|    return(ret);
 1857|   635k|}
SAX2.c:xmlSAX2DecodeAttrEntities:
 1871|  6.36k|                          const xmlChar *end) {
 1872|  6.36k|    const xmlChar *in;
 1873|       |
 1874|  6.36k|    in = str;
 1875|  54.6k|    while (in < end)
  ------------------
  |  Branch (1875:12): [True: 50.5k, False: 4.14k]
  ------------------
 1876|  50.5k|        if (*in++ == '&')
  ------------------
  |  Branch (1876:13): [True: 2.22k, False: 48.3k]
  ------------------
 1877|  2.22k|	    goto decode;
 1878|  4.14k|    return(NULL);
 1879|  2.22k|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.22k|    return(xmlExpandEntitiesInAttValue(ctxt, str, /* normalize */ 0));
 1886|  6.36k|}
SAX2.c:xmlSAX2Text:
 2473|   659k|{
 2474|   659k|    xmlNodePtr lastChild;
 2475|   659k|    xmlNodePtr parent;
 2476|       |
 2477|   659k|    if (ctxt == NULL)
  ------------------
  |  Branch (2477:9): [True: 0, False: 659k]
  ------------------
 2478|      0|        return;
 2479|       |
 2480|   659k|    parent = ctxt->node;
 2481|   659k|    if (parent == NULL)
  ------------------
  |  Branch (2481:9): [True: 0, False: 659k]
  ------------------
 2482|      0|        return;
 2483|   659k|    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|   659k|    if ((lastChild == NULL) ||
  ------------------
  |  Branch (2492:9): [True: 128k, False: 530k]
  ------------------
 2493|   530k|        (lastChild->type != type) ||
  ------------------
  |  Branch (2493:9): [True: 321k, False: 209k]
  ------------------
 2494|   449k|        ((!ctxt->html) && (type != XML_TEXT_NODE))) {
  ------------------
  |  Branch (2494:10): [True: 209k, False: 0]
  |  Branch (2494:27): [True: 600, False: 209k]
  ------------------
 2495|   449k|        xmlNode *node;
 2496|       |
 2497|   449k|        if (type == XML_TEXT_NODE)
  ------------------
  |  Branch (2497:13): [True: 430k, False: 19.8k]
  ------------------
 2498|   430k|            node = xmlSAX2TextNode(ctxt, parent->doc, ch, len);
 2499|  19.8k|        else
 2500|  19.8k|            node = xmlNewCDataBlock(parent->doc, ch, len);
 2501|   449k|	if (node == NULL) {
  ------------------
  |  Branch (2501:6): [True: 79, False: 449k]
  ------------------
 2502|     79|	    xmlSAX2ErrMemory(ctxt);
 2503|     79|	    return;
 2504|     79|	}
 2505|       |
 2506|   449k|        if (lastChild == NULL) {
  ------------------
  |  Branch (2506:13): [True: 128k, False: 321k]
  ------------------
 2507|   128k|            parent->children = node;
 2508|   128k|            parent->last = node;
 2509|   128k|            node->parent = parent;
 2510|   321k|        } else {
 2511|   321k|            xmlSAX2AppendChild(ctxt, node);
 2512|   321k|        }
 2513|       |
 2514|   449k|        ctxt->nodelen = len;
 2515|   449k|        ctxt->nodemem = len + 1;
 2516|   449k|        lastChild = node;
 2517|   449k|    } else {
 2518|   209k|        xmlChar *content;
 2519|   209k|        int oldSize, newSize, capacity;
 2520|   209k|        int maxSize = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (2520:23): [True: 103k, False: 106k]
  ------------------
 2521|   103k|                      XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   103k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 2522|   209k|                      XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   106k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 2523|       |
 2524|   209k|        content = lastChild->content;
 2525|   209k|        oldSize = ctxt->nodelen;
 2526|   209k|        capacity = ctxt->nodemem;
 2527|       |
 2528|       |        /* Shouldn't happen */
 2529|   209k|        if ((content == NULL) || (capacity <= 0)) {
  ------------------
  |  Branch (2529:13): [True: 0, False: 209k]
  |  Branch (2529:34): [True: 0, False: 209k]
  ------------------
 2530|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 2531|      0|                        "xmlSAX2Text: no content");
 2532|      0|            return;
 2533|      0|        }
 2534|       |
 2535|   209k|        if ((len > maxSize) || (oldSize > maxSize - len)) {
  ------------------
  |  Branch (2535:13): [True: 0, False: 209k]
  |  Branch (2535:32): [True: 0, False: 209k]
  ------------------
 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|   209k|        newSize = oldSize + len;
 2542|       |
 2543|   209k|        if (newSize >= capacity) {
  ------------------
  |  Branch (2543:13): [True: 76.7k, False: 132k]
  ------------------
 2544|  76.7k|            if (newSize <= 20)
  ------------------
  |  Branch (2544:17): [True: 44.0k, False: 32.6k]
  ------------------
 2545|  44.0k|                capacity = 40;
 2546|  32.6k|            else
 2547|  32.6k|                capacity = newSize > INT_MAX / 2 ? INT_MAX : newSize * 2;
  ------------------
  |  Branch (2547:28): [True: 0, False: 32.6k]
  ------------------
 2548|       |
 2549|       |            /*
 2550|       |             * If the content was stored in properties or in
 2551|       |             * the dictionary, don't realloc.
 2552|       |             */
 2553|  76.7k|            if ((content == (xmlChar *) &lastChild->properties) ||
  ------------------
  |  Branch (2553:17): [True: 21.8k, False: 54.9k]
  ------------------
 2554|  54.9k|                ((ctxt->nodemem == oldSize + 1) &&
  ------------------
  |  Branch (2554:18): [True: 40.8k, False: 14.1k]
  ------------------
 2555|  40.8k|                 (xmlDictOwns(ctxt->dict, content)))) {
  ------------------
  |  Branch (2555:18): [True: 343, False: 40.4k]
  ------------------
 2556|  22.1k|                xmlChar *newContent;
 2557|       |
 2558|  22.1k|                newContent = xmlMalloc(capacity);
 2559|  22.1k|                if (newContent == NULL) {
  ------------------
  |  Branch (2559:21): [True: 11, False: 22.1k]
  ------------------
 2560|     11|                    xmlSAX2ErrMemory(ctxt);
 2561|     11|                    return;
 2562|     11|                }
 2563|       |
 2564|  22.1k|                memcpy(newContent, content, oldSize);
 2565|  22.1k|                lastChild->properties = NULL;
 2566|  22.1k|                content = newContent;
 2567|  54.5k|            } else {
 2568|  54.5k|                content = xmlRealloc(content, capacity);
 2569|  54.5k|                if (content == NULL) {
  ------------------
  |  Branch (2569:21): [True: 8, False: 54.5k]
  ------------------
 2570|      8|                    xmlSAX2ErrMemory(ctxt);
 2571|      8|                    return;
 2572|      8|                }
 2573|  54.5k|            }
 2574|       |
 2575|  76.7k|            ctxt->nodemem = capacity;
 2576|  76.7k|            lastChild->content = content;
 2577|  76.7k|        }
 2578|       |
 2579|   209k|        memcpy(&content[oldSize], ch, len);
 2580|   209k|        content[newSize] = 0;
 2581|   209k|        ctxt->nodelen = newSize;
 2582|   209k|    }
 2583|       |
 2584|   659k|    if ((lastChild != NULL) &&
  ------------------
  |  Branch (2584:9): [True: 659k, False: 0]
  ------------------
 2585|   659k|        (type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2585:9): [True: 639k, False: 19.8k]
  ------------------
 2586|   639k|        (ctxt->input != NULL)) {
  ------------------
  |  Branch (2586:9): [True: 639k, False: 0]
  ------------------
 2587|   639k|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (2587:13): [True: 604k, False: 34.8k]
  ------------------
 2588|   604k|            lastChild->line = ctxt->input->line;
 2589|  34.8k|        else {
 2590|  34.8k|            lastChild->line = USHRT_MAX;
 2591|  34.8k|            if (ctxt->options & XML_PARSE_BIG_LINES)
  ------------------
  |  Branch (2591:17): [True: 8.27k, False: 26.6k]
  ------------------
 2592|  8.27k|                lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
  ------------------
  |  |   59|  8.27k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 2593|  34.8k|        }
 2594|   639k|    }
 2595|   659k|}

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

xmlInitCatalogInternal:
 3211|      2|xmlInitCatalogInternal(void) {
 3212|      2|    if (getenv("XML_DEBUG_CATALOG"))
  ------------------
  |  Branch (3212:9): [True: 0, False: 2]
  ------------------
 3213|      0|	xmlDebugCatalogs = 1;
 3214|      2|    xmlInitRMutex(&xmlCatalogMutex);
 3215|      2|}
xmlInitializeCatalog:
 3221|      2|xmlInitializeCatalog(void) {
 3222|      2|    if (xmlCatalogInitialized != 0)
  ------------------
  |  Branch (3222:9): [True: 0, False: 2]
  ------------------
 3223|      0|	return;
 3224|       |
 3225|      2|    xmlInitParser();
 3226|       |
 3227|      2|    xmlRMutexLock(&xmlCatalogMutex);
 3228|       |
 3229|      2|    if (xmlDefaultCatalog == NULL) {
  ------------------
  |  Branch (3229:9): [True: 2, False: 0]
  ------------------
 3230|      2|	const char *catalogs;
 3231|      2|	char *path;
 3232|      2|	const char *cur, *paths;
 3233|      2|	xmlCatalogPtr catal;
 3234|      2|	xmlCatalogEntryPtr *nextent;
 3235|       |
 3236|      2|	catalogs = (const char *) getenv("XML_CATALOG_FILES");
 3237|      2|	if (catalogs == NULL)
  ------------------
  |  Branch (3237:6): [True: 2, False: 0]
  ------------------
 3238|      2|	    catalogs = XML_XML_DEFAULT_CATALOG;
  ------------------
  |  |   58|      2|#define XML_XML_DEFAULT_CATALOG "file://" XML_SYSCONFDIR "/xml/catalog"
  ------------------
 3239|       |
 3240|      2|	catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
 3241|      2|		xmlCatalogDefaultPrefer);
 3242|      2|	if (catal != NULL) {
  ------------------
  |  Branch (3242:6): [True: 2, False: 0]
  ------------------
 3243|       |	    /* the XML_CATALOG_FILES envvar is allowed to contain a
 3244|       |	       space-separated list of entries. */
 3245|      2|	    cur = catalogs;
 3246|      2|	    nextent = &catal->xml;
 3247|      4|	    while (*cur != '\0') {
  ------------------
  |  Branch (3247:13): [True: 2, False: 2]
  ------------------
 3248|      2|		while (xmlIsBlank_ch(*cur))
  ------------------
  |  |   90|      2|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  ------------------
  |  |  |  Branch (90:27): [True: 0, False: 2]
  |  |  ------------------
  |  |   91|      2|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  ------------------
  |  |  |  Branch (91:7): [True: 2, False: 0]
  |  |  |  Branch (91:23): [True: 0, False: 2]
  |  |  ------------------
  |  |   92|      2|				 ((c) == 0xd))
  |  |  ------------------
  |  |  |  Branch (92:6): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 3249|      0|		    cur++;
 3250|      2|		if (*cur != 0) {
  ------------------
  |  Branch (3250:7): [True: 2, False: 0]
  ------------------
 3251|      2|		    paths = cur;
 3252|     68|		    while ((*cur != 0) && (!xmlIsBlank_ch(*cur)))
  ------------------
  |  |   90|     66|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  ------------------
  |  |  |  Branch (90:27): [True: 0, False: 66]
  |  |  ------------------
  |  |   91|     66|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  ------------------
  |  |  |  Branch (91:7): [True: 66, False: 0]
  |  |  |  Branch (91:23): [True: 0, False: 66]
  |  |  ------------------
  |  |   92|     66|				 ((c) == 0xd))
  |  |  ------------------
  |  |  |  Branch (92:6): [True: 0, False: 66]
  |  |  ------------------
  ------------------
  |  Branch (3252:14): [True: 66, False: 2]
  ------------------
 3253|     66|			cur++;
 3254|      2|		    path = (char *) xmlStrndup((const xmlChar *)paths, cur - paths);
 3255|      2|		    if (path != NULL) {
  ------------------
  |  Branch (3255:11): [True: 2, False: 0]
  ------------------
 3256|      2|			*nextent = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
 3257|      2|				NULL, BAD_CAST path, xmlCatalogDefaultPrefer, NULL);
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 3258|      2|			if (*nextent != NULL)
  ------------------
  |  Branch (3258:8): [True: 2, False: 0]
  ------------------
 3259|      2|			    nextent = &((*nextent)->next);
 3260|      2|			xmlFree(path);
 3261|      2|		    }
 3262|      2|		}
 3263|      2|	    }
 3264|      2|	    xmlDefaultCatalog = catal;
 3265|      2|	}
 3266|      2|    }
 3267|       |
 3268|      2|    xmlRMutexUnlock(&xmlCatalogMutex);
 3269|       |
 3270|      2|    xmlCatalogInitialized = 1;
 3271|      2|}
xmlCatalogGetDefaults:
 3586|   259k|xmlCatalogGetDefaults(void) {
 3587|   259k|    return(xmlCatalogDefaultAllow);
 3588|   259k|}
xmlCatalogSetDefaults:
 3600|      2|xmlCatalogSetDefaults(xmlCatalogAllow allow) {
 3601|      2|    if (xmlDebugCatalogs) {
  ------------------
  |  Branch (3601:9): [True: 0, False: 2]
  ------------------
 3602|      0|	switch (allow) {
  ------------------
  |  Branch (3602:10): [True: 0, False: 0]
  ------------------
 3603|      0|	    case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (3603:6): [True: 0, False: 0]
  ------------------
 3604|      0|		xmlCatalogPrintDebug(
 3605|      0|			"Disabling catalog usage\n");
 3606|      0|		break;
 3607|      0|	    case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (3607:6): [True: 0, False: 0]
  ------------------
 3608|      0|		xmlCatalogPrintDebug(
 3609|      0|			"Allowing only global catalogs\n");
 3610|      0|		break;
 3611|      0|	    case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (3611:6): [True: 0, False: 0]
  ------------------
 3612|      0|		xmlCatalogPrintDebug(
 3613|      0|			"Allowing only catalogs from the document\n");
 3614|      0|		break;
 3615|      0|	    case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (3615:6): [True: 0, False: 0]
  ------------------
 3616|      0|		xmlCatalogPrintDebug(
 3617|      0|			"Allowing all catalogs\n");
 3618|      0|		break;
 3619|      0|	}
 3620|      0|    }
 3621|      2|    xmlCatalogDefaultAllow = allow;
 3622|      2|}
catalog.c:xmlCreateNewCatalog:
  458|      2|xmlCreateNewCatalog(xmlCatalogType type, xmlCatalogPrefer prefer) {
  459|      2|    xmlCatalogPtr ret;
  460|       |
  461|      2|    ret = (xmlCatalogPtr) xmlMalloc(sizeof(xmlCatalog));
  462|      2|    if (ret == NULL) {
  ------------------
  |  Branch (462:9): [True: 0, False: 2]
  ------------------
  463|      0|        xmlCatalogErrMemory();
  464|      0|	return(NULL);
  465|      0|    }
  466|      2|    memset(ret, 0, sizeof(xmlCatalog));
  467|      2|    ret->type = type;
  468|      2|    ret->prefer = prefer;
  469|      2|#ifdef LIBXML_SGML_CATALOG_ENABLED
  470|      2|    ret->catalNr = 0;
  471|      2|    ret->catalMax = XML_MAX_SGML_CATA_DEPTH;
  ------------------
  |  |  133|      2|#define XML_MAX_SGML_CATA_DEPTH 10
  ------------------
  472|      2|    if (ret->type == XML_SGML_CATALOG_TYPE)
  ------------------
  |  Branch (472:9): [True: 0, False: 2]
  ------------------
  473|      0|	ret->sgml = xmlHashCreate(10);
  474|      2|#endif
  475|      2|    return(ret);
  476|      2|}
catalog.c:xmlNewCatalogEntry:
  322|      2|	   xmlCatalogEntryPtr group) {
  323|      2|    xmlCatalogEntryPtr ret;
  324|      2|    xmlChar *normid = NULL;
  325|       |
  326|      2|    ret = (xmlCatalogEntryPtr) xmlMalloc(sizeof(xmlCatalogEntry));
  327|      2|    if (ret == NULL) {
  ------------------
  |  Branch (327:9): [True: 0, False: 2]
  ------------------
  328|      0|        xmlCatalogErrMemory();
  329|      0|	return(NULL);
  330|      0|    }
  331|      2|    ret->next = NULL;
  332|      2|    ret->parent = NULL;
  333|      2|    ret->children = NULL;
  334|      2|    ret->type = type;
  335|      2|    if (type == XML_CATA_PUBLIC || type == XML_CATA_DELEGATE_PUBLIC) {
  ------------------
  |  Branch (335:9): [True: 0, False: 2]
  |  Branch (335:36): [True: 0, False: 2]
  ------------------
  336|      0|        normid = xmlCatalogNormalizePublic(name);
  337|      0|        if (normid != NULL)
  ------------------
  |  Branch (337:13): [True: 0, False: 0]
  ------------------
  338|      0|            name = (*normid != 0 ? normid : NULL);
  ------------------
  |  Branch (338:21): [True: 0, False: 0]
  ------------------
  339|      0|    }
  340|      2|    if (name != NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 2]
  ------------------
  341|      0|	ret->name = xmlStrdup(name);
  342|      2|    else
  343|      2|	ret->name = NULL;
  344|      2|    if (normid != NULL)
  ------------------
  |  Branch (344:9): [True: 0, False: 2]
  ------------------
  345|      0|        xmlFree(normid);
  346|      2|    if (value != NULL)
  ------------------
  |  Branch (346:9): [True: 0, False: 2]
  ------------------
  347|      0|	ret->value = xmlStrdup(value);
  348|      2|    else
  349|      2|	ret->value = NULL;
  350|      2|    if (URL == NULL)
  ------------------
  |  Branch (350:9): [True: 0, False: 2]
  ------------------
  351|      0|	URL = value;
  352|      2|    if (URL != NULL)
  ------------------
  |  Branch (352:9): [True: 2, False: 0]
  ------------------
  353|      2|	ret->URL = xmlStrdup(URL);
  354|      0|    else
  355|      0|	ret->URL = NULL;
  356|      2|    ret->prefer = prefer;
  357|      2|    ret->dealloc = 0;
  358|      2|    ret->depth = 0;
  359|      2|    ret->group = group;
  360|      2|    return(ret);
  361|      2|}

xmlCharInRange:
   32|   445k|xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
   33|   445k|    int low, high, mid;
   34|   445k|    const xmlChSRange *sptr;
   35|   445k|    const xmlChLRange *lptr;
   36|       |
   37|   445k|    if (rptr == NULL) return(0);
  ------------------
  |  Branch (37:9): [True: 0, False: 445k]
  ------------------
   38|   445k|    if (val < 0x10000) {	/* is val in 'short' or 'long'  array? */
  ------------------
  |  Branch (38:9): [True: 404k, False: 41.2k]
  ------------------
   39|   404k|	if (rptr->nbShortRange == 0)
  ------------------
  |  Branch (39:6): [True: 0, False: 404k]
  ------------------
   40|      0|	    return 0;
   41|   404k|	low = 0;
   42|   404k|	high = rptr->nbShortRange - 1;
   43|   404k|	sptr = rptr->shortRange;
   44|  3.00M|	while (low <= high) {
  ------------------
  |  Branch (44:9): [True: 2.99M, False: 13.1k]
  ------------------
   45|  2.99M|	    mid = (low + high) / 2;
   46|  2.99M|	    if ((unsigned short) val < sptr[mid].low) {
  ------------------
  |  Branch (46:10): [True: 2.02M, False: 972k]
  ------------------
   47|  2.02M|		high = mid - 1;
   48|  2.02M|	    } else {
   49|   972k|		if ((unsigned short) val > sptr[mid].high) {
  ------------------
  |  Branch (49:7): [True: 580k, False: 391k]
  ------------------
   50|   580k|		    low = mid + 1;
   51|   580k|		} else {
   52|   391k|		    return 1;
   53|   391k|		}
   54|   972k|	    }
   55|  2.99M|	}
   56|   404k|    } else {
   57|  41.2k|	if (rptr->nbLongRange == 0) {
  ------------------
  |  Branch (57:6): [True: 41.2k, False: 0]
  ------------------
   58|  41.2k|	    return 0;
   59|  41.2k|	}
   60|      0|	low = 0;
   61|      0|	high = rptr->nbLongRange - 1;
   62|      0|	lptr = rptr->longRange;
   63|      0|	while (low <= high) {
  ------------------
  |  Branch (63:9): [True: 0, False: 0]
  ------------------
   64|      0|	    mid = (low + high) / 2;
   65|      0|	    if (val < lptr[mid].low) {
  ------------------
  |  Branch (65:10): [True: 0, False: 0]
  ------------------
   66|      0|		high = mid - 1;
   67|      0|	    } else {
   68|      0|		if (val > lptr[mid].high) {
  ------------------
  |  Branch (68:7): [True: 0, False: 0]
  ------------------
   69|      0|		    low = mid + 1;
   70|      0|		} else {
   71|      0|		    return 1;
   72|      0|		}
   73|      0|	    }
   74|      0|	}
   75|      0|    }
   76|  13.1k|    return 0;
   77|   445k|}

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

xmlGetEncodingAlias:
  473|  10.8k|xmlGetEncodingAlias(const char *alias) {
  474|  10.8k|    int i;
  475|  10.8k|    char upper[100];
  476|       |
  477|  10.8k|    if (alias == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 10.8k]
  ------------------
  478|      0|	return(NULL);
  479|       |
  480|  10.8k|    if (xmlCharEncodingAliases == NULL)
  ------------------
  |  Branch (480:9): [True: 10.8k, False: 0]
  ------------------
  481|  10.8k|	return(NULL);
  482|       |
  483|      0|    for (i = 0;i < 99;i++) {
  ------------------
  |  Branch (483:16): [True: 0, False: 0]
  ------------------
  484|      0|        upper[i] = (char) toupper((unsigned char) alias[i]);
  ------------------
  |  Branch (484:27): [True: 0, False: 0]
  |  Branch (484:27): [True: 0, False: 0]
  |  Branch (484:27): [Folded, False: 0]
  ------------------
  485|      0|	if (upper[i] == 0) break;
  ------------------
  |  Branch (485:6): [True: 0, False: 0]
  ------------------
  486|      0|    }
  487|      0|    upper[i] = 0;
  488|       |
  489|       |    /*
  490|       |     * Walk down the list looking for a definition of the alias
  491|       |     */
  492|      0|    for (i = 0;i < xmlCharEncodingAliasesNb;i++) {
  ------------------
  |  Branch (492:16): [True: 0, False: 0]
  ------------------
  493|      0|	if (!strcmp(xmlCharEncodingAliases[i].alias, upper)) {
  ------------------
  |  Branch (493:6): [True: 0, False: 0]
  ------------------
  494|      0|	    return(xmlCharEncodingAliases[i].name);
  495|      0|	}
  496|      0|    }
  497|      0|    return(NULL);
  498|      0|}
xmlCharEncNewCustomHandler:
  770|  7.42k|                           xmlCharEncodingHandler **out) {
  771|  7.42k|    xmlCharEncodingHandler *handler;
  772|       |
  773|  7.42k|    if (out == NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 7.42k]
  ------------------
  774|      0|        return(XML_ERR_ARGUMENT);
  775|       |
  776|  7.42k|    handler = xmlMalloc(sizeof(*handler));
  777|  7.42k|    if (handler == NULL)
  ------------------
  |  Branch (777:9): [True: 8, False: 7.42k]
  ------------------
  778|      8|        goto error;
  779|  7.42k|    memset(handler, 0, sizeof(*handler));
  780|       |
  781|  7.42k|    if (name != NULL) {
  ------------------
  |  Branch (781:9): [True: 7.42k, False: 0]
  ------------------
  782|  7.42k|        handler->name = xmlMemStrdup(name);
  783|  7.42k|        if (handler->name == NULL)
  ------------------
  |  Branch (783:13): [True: 5, False: 7.41k]
  ------------------
  784|      5|            goto error;
  785|  7.42k|    }
  786|       |
  787|  7.41k|    handler->input.func = input;
  788|  7.41k|    handler->output.func = output;
  789|  7.41k|    handler->ctxtDtor = ctxtDtor;
  790|  7.41k|    handler->inputCtxt = inputCtxt;
  791|  7.41k|    handler->outputCtxt = outputCtxt;
  792|       |
  793|  7.41k|    *out = handler;
  794|  7.41k|    return(XML_ERR_OK);
  795|       |
  796|     13|error:
  797|     13|    xmlFree(handler);
  798|       |
  799|     13|    if (ctxtDtor != NULL) {
  ------------------
  |  Branch (799:9): [True: 13, False: 0]
  ------------------
  800|     13|        if (inputCtxt != NULL)
  ------------------
  |  Branch (800:13): [True: 13, False: 0]
  ------------------
  801|     13|            ctxtDtor(inputCtxt);
  802|     13|        if (outputCtxt != NULL)
  ------------------
  |  Branch (802:13): [True: 3, False: 10]
  ------------------
  803|      3|            ctxtDtor(outputCtxt);
  804|     13|    }
  805|       |
  806|     13|    return(XML_ERR_NO_MEMORY);
  807|  7.42k|}
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.95k|                             xmlCharEncodingHandler **out) {
  987|  6.95k|    const xmlCharEncodingHandler *handler;
  988|       |
  989|  6.95k|    if (out == NULL)
  ------------------
  |  Branch (989:9): [True: 0, False: 6.95k]
  ------------------
  990|      0|        return(XML_ERR_ARGUMENT);
  991|  6.95k|    *out = NULL;
  992|       |
  993|  6.95k|    if ((enc <= 0) || ((size_t) enc >= NUM_DEFAULT_HANDLERS))
  ------------------
  |  |  355|  6.95k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (993:9): [True: 0, False: 6.95k]
  |  Branch (993:23): [True: 0, False: 6.95k]
  ------------------
  994|      0|        return(XML_ERR_UNSUPPORTED_ENCODING);
  995|       |
  996|       |    /* Return NULL handler for UTF-8 */
  997|  6.95k|    if ((enc == XML_CHAR_ENCODING_UTF8) ||
  ------------------
  |  Branch (997:9): [True: 46, False: 6.90k]
  ------------------
  998|  6.90k|        (enc == XML_CHAR_ENCODING_NONE))
  ------------------
  |  Branch (998:9): [True: 0, False: 6.90k]
  ------------------
  999|     46|        return(XML_ERR_OK);
 1000|       |
 1001|  6.90k|    handler = &defaultHandlers[enc];
 1002|  6.90k|    if ((handler->input.func != NULL) || (handler->output.func != NULL)) {
  ------------------
  |  Branch (1002:9): [True: 6.16k, False: 739]
  |  Branch (1002:42): [True: 0, False: 739]
  ------------------
 1003|  6.16k|        *out = (xmlCharEncodingHandler *) handler;
 1004|  6.16k|        return(XML_ERR_OK);
 1005|  6.16k|    }
 1006|       |
 1007|    739|    if (handler->name != NULL) {
  ------------------
  |  Branch (1007:9): [True: 739, False: 0]
  ------------------
 1008|    739|        xmlCharEncFlags flags = XML_ENC_INPUT;
 1009|       |
 1010|    739|#ifdef LIBXML_OUTPUT_ENABLED
 1011|    739|        flags |= XML_ENC_OUTPUT;
 1012|    739|#endif
 1013|    739|        return(xmlFindExtraHandler(handler->name, handler->name, flags,
 1014|    739|                                   NULL, NULL, out));
 1015|    739|    }
 1016|       |
 1017|      0|    return(XML_ERR_UNSUPPORTED_ENCODING);
 1018|    739|}
xmlCreateCharEncodingHandler:
 1066|  10.8k|                             xmlCharEncodingHandler **out) {
 1067|  10.8k|    const xmlCharEncodingHandler *handler;
 1068|  10.8k|    const char *norig, *nalias;
 1069|  10.8k|    xmlCharEncoding enc;
 1070|       |
 1071|  10.8k|    if (out == NULL)
  ------------------
  |  Branch (1071:9): [True: 0, False: 10.8k]
  ------------------
 1072|      0|        return(XML_ERR_ARGUMENT);
 1073|  10.8k|    *out = NULL;
 1074|       |
 1075|  10.8k|    if ((name == NULL) || (flags == 0))
  ------------------
  |  Branch (1075:9): [True: 0, False: 10.8k]
  |  Branch (1075:27): [True: 0, False: 10.8k]
  ------------------
 1076|      0|        return(XML_ERR_ARGUMENT);
 1077|       |
 1078|  10.8k|    norig = name;
 1079|  10.8k|    nalias = xmlGetEncodingAlias(name);
 1080|  10.8k|    if (nalias != NULL)
  ------------------
  |  Branch (1080:9): [True: 0, False: 10.8k]
  ------------------
 1081|      0|	name = nalias;
 1082|       |
 1083|  10.8k|    enc = xmlParseCharEncodingInternal(name);
 1084|       |
 1085|       |    /* Return NULL handler for UTF-8 */
 1086|  10.8k|    if (enc == XML_CHAR_ENCODING_UTF8)
  ------------------
  |  Branch (1086:9): [True: 195, False: 10.6k]
  ------------------
 1087|    195|        return(XML_ERR_OK);
 1088|       |
 1089|  10.6k|    if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) {
  ------------------
  |  |  355|  3.57k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (1089:9): [True: 3.57k, False: 7.06k]
  |  Branch (1089:22): [True: 3.57k, False: 0]
  ------------------
 1090|  3.57k|        if (flags & XML_ENC_HTML) {
  ------------------
  |  Branch (1090:13): [True: 0, False: 3.57k]
  ------------------
 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.57k|        handler = &defaultHandlers[enc];
 1113|  3.57k|        if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) &&
  ------------------
  |  Branch (1113:14): [True: 0, False: 3.57k]
  |  Branch (1113:48): [True: 3.20k, False: 369]
  ------------------
 1114|  3.20k|            (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) {
  ------------------
  |  Branch (1114:14): [True: 3.20k, False: 0]
  |  Branch (1114:49): [True: 0, False: 0]
  ------------------
 1115|  3.20k|            xmlCharEncodingHandler *ret;
 1116|       |
 1117|       |            /*
 1118|       |             * Return a copy of the handler with the original name.
 1119|       |             */
 1120|       |
 1121|  3.20k|            ret = xmlMalloc(sizeof(*ret));
 1122|  3.20k|            if (ret == NULL)
  ------------------
  |  Branch (1122:17): [True: 3, False: 3.20k]
  ------------------
 1123|      3|                return(XML_ERR_NO_MEMORY);
 1124|  3.20k|            memset(ret, 0, sizeof(*ret));
 1125|       |
 1126|  3.20k|            ret->name = xmlMemStrdup(norig);
 1127|  3.20k|            if (ret->name == NULL) {
  ------------------
  |  Branch (1127:17): [True: 2, False: 3.19k]
  ------------------
 1128|      2|                xmlFree(ret);
 1129|      2|                return(XML_ERR_NO_MEMORY);
 1130|      2|            }
 1131|  3.19k|            ret->input = handler->input;
 1132|  3.19k|            ret->output = handler->output;
 1133|  3.19k|            ret->inputCtxt = handler->inputCtxt;
 1134|  3.19k|            ret->outputCtxt = handler->outputCtxt;
 1135|  3.19k|            ret->ctxtDtor = handler->ctxtDtor;
 1136|       |
 1137|  3.19k|            *out = ret;
 1138|  3.19k|            return(XML_ERR_OK);
 1139|  3.20k|        }
 1140|  3.57k|    }
 1141|       |
 1142|  7.43k|    return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out));
 1143|  10.6k|}
xmlOpenCharEncodingHandler:
 1169|     32|                           xmlCharEncodingHandler **out) {
 1170|     32|    xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT;
  ------------------
  |  Branch (1170:29): [True: 0, False: 32]
  ------------------
 1171|       |
 1172|     32|    return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out));
 1173|     32|}
xmlEncInputChunk:
 1685|   159k|                 int flush) {
 1686|   159k|    xmlCharEncError ret;
 1687|       |
 1688|   159k|    if (handler->flags & XML_HANDLER_LEGACY) {
  ------------------
  |  |   54|   159k|#define XML_HANDLER_LEGACY (1 << 1)
  ------------------
  |  Branch (1688:9): [True: 0, False: 159k]
  ------------------
 1689|      0|        xmlCharEncodingInputFunc func = handler->input.legacyFunc;
 1690|       |
 1691|      0|        if (func == NULL) {
  ------------------
  |  Branch (1691:13): [True: 0, False: 0]
  ------------------
 1692|      0|            *outlen = 0;
 1693|      0|            *inlen = 0;
 1694|      0|            return(XML_ENC_ERR_INTERNAL);
 1695|      0|        }
 1696|       |
 1697|      0|        ret = func(out, outlen, in, inlen);
 1698|   159k|    } else {
 1699|   159k|        xmlCharEncConvFunc func = handler->input.func;
 1700|   159k|        int oldInlen;
 1701|       |
 1702|   159k|        if (func == NULL) {
  ------------------
  |  Branch (1702:13): [True: 0, False: 159k]
  ------------------
 1703|      0|            *outlen = 0;
 1704|      0|            *inlen = 0;
 1705|      0|            return(XML_ENC_ERR_INTERNAL);
 1706|      0|        }
 1707|       |
 1708|   159k|        oldInlen = *inlen;
 1709|   159k|        ret = func(handler->inputCtxt, out, outlen, in, inlen, flush);
 1710|       |
 1711|       |        /*
 1712|       |         * Check for truncated multi-byte sequence.
 1713|       |         */
 1714|   159k|        if ((flush) && (ret == XML_ENC_ERR_SUCCESS) && (*inlen != oldInlen))
  ------------------
  |  Branch (1714:13): [True: 8, False: 159k]
  |  Branch (1714:24): [True: 8, False: 0]
  |  Branch (1714:56): [True: 0, False: 8]
  ------------------
 1715|      0|            ret = XML_ENC_ERR_INPUT;
 1716|   159k|    }
 1717|       |
 1718|   159k|    if (ret > 0)
  ------------------
  |  Branch (1718:9): [True: 25.1k, False: 134k]
  ------------------
 1719|  25.1k|        ret = XML_ENC_ERR_SUCCESS;
 1720|       |
 1721|   159k|    return(ret);
 1722|   159k|}
xmlCharEncInput:
 1795|   324k|{
 1796|   324k|    xmlBufPtr out, in;
 1797|   324k|    const xmlChar *dataIn;
 1798|   324k|    size_t availIn;
 1799|   324k|    size_t maxOut;
 1800|   324k|    size_t totalIn, totalOut;
 1801|   324k|    xmlCharEncError ret;
 1802|       |
 1803|   324k|    out = input->buffer;
 1804|   324k|    in = input->raw;
 1805|       |
 1806|   324k|    maxOut = *sizeOut;
 1807|   324k|    totalOut = 0;
 1808|       |
 1809|   324k|    *sizeOut = 0;
 1810|       |
 1811|   324k|    availIn = xmlBufUse(in);
 1812|   324k|    if ((availIn == 0) && (!flush))
  ------------------
  |  Branch (1812:9): [True: 171k, False: 152k]
  |  Branch (1812:27): [True: 171k, False: 8]
  ------------------
 1813|   171k|        return(0);
 1814|   152k|    dataIn = xmlBufContent(in);
 1815|   152k|    totalIn = 0;
 1816|       |
 1817|   156k|    while (1) {
  ------------------
  |  Branch (1817:12): [True: 156k, Folded]
  ------------------
 1818|   156k|        size_t availOut;
 1819|   156k|        int completeOut, completeIn;
 1820|   156k|        int c_out, c_in;
 1821|       |
 1822|   156k|        availOut = xmlBufAvail(out);
 1823|   156k|        if (availOut > INT_MAX / 2)
  ------------------
  |  Branch (1823:13): [True: 0, False: 156k]
  ------------------
 1824|      0|            availOut = INT_MAX / 2;
 1825|       |
 1826|   156k|        if (availOut < maxOut) {
  ------------------
  |  Branch (1826:13): [True: 109k, False: 46.7k]
  ------------------
 1827|   109k|            c_out = availOut;
 1828|   109k|            completeOut = 0;
 1829|   109k|        } else {
 1830|  46.7k|            c_out = maxOut;
 1831|  46.7k|            completeOut = 1;
 1832|  46.7k|        }
 1833|       |
 1834|   156k|        if (availIn > INT_MAX / 2) {
  ------------------
  |  Branch (1834:13): [True: 0, False: 156k]
  ------------------
 1835|      0|            c_in = INT_MAX / 2;
 1836|      0|            completeIn = 0;
 1837|   156k|        } else {
 1838|   156k|            c_in = availIn;
 1839|   156k|            completeIn = 1;
 1840|   156k|        }
 1841|       |
 1842|   156k|        ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
 1843|   156k|                               dataIn, &c_in, flush && completeIn);
  ------------------
  |  Branch (1843:47): [True: 8, False: 156k]
  |  Branch (1843:56): [True: 8, False: 0]
  ------------------
 1844|       |
 1845|   156k|        totalIn += c_in;
 1846|   156k|        dataIn += c_in;
 1847|   156k|        availIn -= c_in;
 1848|       |
 1849|   156k|        totalOut += c_out;
 1850|   156k|        maxOut -= c_out;
 1851|   156k|        xmlBufAddLen(out, c_out);
 1852|       |
 1853|   156k|        if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE)) {
  ------------------
  |  Branch (1853:13): [True: 32.8k, False: 123k]
  |  Branch (1853:45): [True: 3.42k, False: 29.4k]
  ------------------
 1854|  3.42k|            input->error = xmlEncConvertError(ret);
 1855|  3.42k|            return(ret);
 1856|  3.42k|        }
 1857|       |
 1858|   152k|        if ((completeOut) && (completeIn))
  ------------------
  |  Branch (1858:13): [True: 43.9k, False: 108k]
  |  Branch (1858:30): [True: 43.9k, False: 0]
  ------------------
 1859|  43.9k|            break;
 1860|   108k|        if ((completeOut) && (ret == XML_ENC_ERR_SPACE))
  ------------------
  |  Branch (1860:13): [True: 0, False: 108k]
  |  Branch (1860:30): [True: 0, False: 0]
  ------------------
 1861|      0|            break;
 1862|   108k|        if ((completeIn) && (ret == XML_ENC_ERR_SUCCESS))
  ------------------
  |  Branch (1862:13): [True: 108k, False: 0]
  |  Branch (1862:29): [True: 105k, False: 3.65k]
  ------------------
 1863|   105k|            break;
 1864|       |
 1865|  3.65k|        if (ret == XML_ENC_ERR_SPACE) {
  ------------------
  |  Branch (1865:13): [True: 3.65k, False: 0]
  ------------------
 1866|  3.65k|            if (xmlBufGrow(out, 4096) < 0) {
  ------------------
  |  Branch (1866:17): [True: 10, False: 3.64k]
  ------------------
 1867|     10|                input->error = XML_ERR_NO_MEMORY;
 1868|     10|                return(XML_ENC_ERR_MEMORY);
 1869|     10|            }
 1870|  3.65k|        }
 1871|  3.65k|    }
 1872|       |
 1873|   149k|    xmlBufShrink(in, totalIn);
 1874|       |
 1875|   149k|    if (input->rawconsumed > ULONG_MAX - (unsigned long) totalIn)
  ------------------
  |  Branch (1875:9): [True: 0, False: 149k]
  ------------------
 1876|      0|        input->rawconsumed = ULONG_MAX;
 1877|   149k|    else
 1878|   149k|        input->rawconsumed += totalIn;
 1879|       |
 1880|   149k|    *sizeOut = totalOut;
 1881|   149k|    return(XML_ENC_ERR_SUCCESS);
 1882|   152k|}
xmlCharEncCloseFunc:
 2192|  16.9k|xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
 2193|  16.9k|    if (handler == NULL)
  ------------------
  |  Branch (2193:9): [True: 145, False: 16.7k]
  ------------------
 2194|    145|        return(0);
 2195|       |
 2196|  16.7k|    if (handler->flags & XML_HANDLER_STATIC)
  ------------------
  |  |   53|  16.7k|#define XML_HANDLER_STATIC (1 << 0)
  ------------------
  |  Branch (2196:9): [True: 6.16k, False: 10.6k]
  ------------------
 2197|  6.16k|        return(0);
 2198|       |
 2199|  10.6k|    xmlFree(handler->name);
 2200|  10.6k|    if (handler->ctxtDtor != NULL) {
  ------------------
  |  Branch (2200:9): [True: 7.41k, False: 3.19k]
  ------------------
 2201|  7.41k|        handler->ctxtDtor(handler->inputCtxt);
 2202|  7.41k|        handler->ctxtDtor(handler->outputCtxt);
 2203|  7.41k|    }
 2204|  10.6k|    xmlFree(handler);
 2205|  10.6k|    return(0);
 2206|  16.7k|}
encoding.c:xmlParseCharEncodingInternal:
  618|  10.8k|{
  619|  10.8k|    const xmlEncTableEntry *entry;
  620|       |
  621|  10.8k|    if (name == NULL)
  ------------------
  |  Branch (621:9): [True: 0, False: 10.8k]
  ------------------
  622|      0|       return(XML_CHAR_ENCODING_NONE);
  623|       |
  624|  10.8k|    entry = bsearch(name, xmlEncTable,
  625|  10.8k|                    sizeof(xmlEncTable) / sizeof(xmlEncTable[0]),
  626|  10.8k|                    sizeof(xmlEncTable[0]), xmlCompareEncTableEntries);
  627|  10.8k|    if (entry != NULL)
  ------------------
  |  Branch (627:9): [True: 3.76k, False: 7.06k]
  ------------------
  628|  3.76k|        return(entry->enc);
  629|       |
  630|  7.06k|    return(XML_CHAR_ENCODING_ERROR);
  631|  10.8k|}
encoding.c:xmlCompareEncTableEntries:
  609|  63.5k|xmlCompareEncTableEntries(const void *vkey, const void *ventry) {
  610|  63.5k|    const char *key = vkey;
  611|  63.5k|    const xmlEncTableEntry *entry = ventry;
  612|       |
  613|  63.5k|    return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  63.5k|#define BAD_CAST (xmlChar *)
  ------------------
                  return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  63.5k|#define BAD_CAST (xmlChar *)
  ------------------
  614|  63.5k|}
encoding.c:UTF16LEToUTF8:
 2492|  85.0k|              int flush ATTRIBUTE_UNUSED) {
 2493|  85.0k|    const unsigned char *instart = in;
 2494|  85.0k|    const unsigned char *inend = in + (*inlen & ~1);
 2495|  85.0k|    unsigned char *outstart = out;
 2496|  85.0k|    unsigned char *outend = out + *outlen;
 2497|  85.0k|    unsigned c, d;
 2498|  85.0k|    int ret = XML_ENC_ERR_SPACE;
 2499|       |
 2500|  8.16M|    while (in < inend) {
  ------------------
  |  Branch (2500:12): [True: 8.08M, False: 77.6k]
  ------------------
 2501|  8.08M|        c = in[0] | (in[1] << 8);
 2502|       |
 2503|  8.08M|        if (c < 0x80) {
  ------------------
  |  Branch (2503:13): [True: 12.9k, False: 8.07M]
  ------------------
 2504|  12.9k|            if (out >= outend)
  ------------------
  |  Branch (2504:17): [True: 219, False: 12.7k]
  ------------------
 2505|    219|                goto done;
 2506|  12.7k|            out[0] = c;
 2507|  12.7k|            in += 2;
 2508|  12.7k|            out += 1;
 2509|  8.07M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2509:20): [True: 12.7k, False: 8.05M]
  ------------------
 2510|  12.7k|            if (outend - out < 2)
  ------------------
  |  Branch (2510:17): [True: 292, False: 12.4k]
  ------------------
 2511|    292|                goto done;
 2512|  12.4k|            out[0] = (c >> 6)   | 0xC0;
 2513|  12.4k|            out[1] = (c & 0x3F) | 0x80;
 2514|  12.4k|            in += 2;
 2515|  12.4k|            out += 2;
 2516|  8.05M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2516:20): [True: 8.05M, False: 2.95k]
  ------------------
 2517|  8.05M|            if (outend - out < 3)
  ------------------
  |  Branch (2517:17): [True: 5.05k, False: 8.05M]
  ------------------
 2518|  5.05k|                goto done;
 2519|  8.05M|            out[0] =  (c >> 12)         | 0xE0;
 2520|  8.05M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2521|  8.05M|            out[2] =  (c        & 0x3F) | 0x80;
 2522|  8.05M|            in += 2;
 2523|  8.05M|            out += 3;
 2524|  8.05M|        } else {
 2525|       |            /* Surrogate pair */
 2526|  2.95k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2526:17): [True: 498, False: 2.45k]
  ------------------
 2527|    498|                ret = XML_ENC_ERR_INPUT;
 2528|    498|                goto done;
 2529|    498|            }
 2530|  2.45k|	    if (inend - in < 4)
  ------------------
  |  Branch (2530:10): [True: 385, False: 2.06k]
  ------------------
 2531|    385|		break;
 2532|  2.06k|            d = in[2] | (in[3] << 8);
 2533|  2.06k|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2533:17): [True: 727, False: 1.34k]
  ------------------
 2534|    727|                ret = XML_ENC_ERR_INPUT;
 2535|    727|                goto done;
 2536|    727|            }
 2537|  1.34k|	    if (outend - out < 4)
  ------------------
  |  Branch (2537:10): [True: 238, False: 1.10k]
  ------------------
 2538|    238|		goto done;
 2539|  1.10k|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2540|  1.10k|            out[0] =  (c >> 18)         | 0xF0;
 2541|  1.10k|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2542|  1.10k|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2543|  1.10k|            out[3] =  (c        & 0x3F) | 0x80;
 2544|  1.10k|            in += 4;
 2545|  1.10k|            out += 4;
 2546|  1.10k|        }
 2547|  8.08M|    }
 2548|       |
 2549|  78.0k|    ret = out - outstart;
 2550|       |
 2551|  85.0k|done:
 2552|  85.0k|    *outlen = out - outstart;
 2553|  85.0k|    *inlen = in - instart;
 2554|  85.0k|    return(ret);
 2555|  78.0k|}
encoding.c:UTF16BEToUTF8:
 2689|  24.8k|              int flush ATTRIBUTE_UNUSED) {
 2690|  24.8k|    const unsigned char *instart = in;
 2691|  24.8k|    const unsigned char *inend = in + (*inlen & ~1);
 2692|  24.8k|    unsigned char *outstart = out;
 2693|  24.8k|    unsigned char *outend = out + *outlen;
 2694|  24.8k|    unsigned c, d;
 2695|  24.8k|    int ret = XML_ENC_ERR_SPACE;
 2696|       |
 2697|  16.4M|    while (in < inend) {
  ------------------
  |  Branch (2697:12): [True: 16.4M, False: 12.0k]
  ------------------
 2698|  16.4M|        c = (in[0] << 8) | in[1];
 2699|       |
 2700|  16.4M|        if (c < 0x80) {
  ------------------
  |  Branch (2700:13): [True: 24.3k, False: 16.4M]
  ------------------
 2701|  24.3k|            if (out >= outend)
  ------------------
  |  Branch (2701:17): [True: 268, False: 24.0k]
  ------------------
 2702|    268|                goto done;
 2703|  24.0k|            out[0] = c;
 2704|  24.0k|            in += 2;
 2705|  24.0k|            out += 1;
 2706|  16.4M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2706:20): [True: 20.0k, False: 16.4M]
  ------------------
 2707|  20.0k|            if (outend - out < 2)
  ------------------
  |  Branch (2707:17): [True: 267, False: 19.8k]
  ------------------
 2708|    267|                goto done;
 2709|  19.8k|            out[0] = (c >> 6)   | 0xC0;
 2710|  19.8k|            out[1] = (c & 0x3F) | 0x80;
 2711|  19.8k|            in += 2;
 2712|  19.8k|            out += 2;
 2713|  16.4M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2713:20): [True: 16.4M, False: 2.07k]
  ------------------
 2714|  16.4M|            if (outend - out < 3)
  ------------------
  |  Branch (2714:17): [True: 10.9k, False: 16.4M]
  ------------------
 2715|  10.9k|                goto done;
 2716|  16.4M|            out[0] =  (c >> 12)         | 0xE0;
 2717|  16.4M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2718|  16.4M|            out[2] =  (c        & 0x3F) | 0x80;
 2719|  16.4M|            in += 2;
 2720|  16.4M|            out += 3;
 2721|  16.4M|        } else {
 2722|       |            /* Surrogate pair */
 2723|  2.07k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2723:17): [True: 793, False: 1.28k]
  ------------------
 2724|    793|                ret = XML_ENC_ERR_INPUT;
 2725|    793|                goto done;
 2726|    793|            }
 2727|  1.28k|	    if (inend - in < 4)
  ------------------
  |  Branch (2727:10): [True: 296, False: 987]
  ------------------
 2728|    296|		break;
 2729|    987|            d = (in[2] << 8) | in[3];
 2730|    987|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2730:17): [True: 222, False: 765]
  ------------------
 2731|    222|                ret = XML_ENC_ERR_INPUT;
 2732|    222|                goto done;
 2733|    222|            }
 2734|    765|	    if (outend - out < 4)
  ------------------
  |  Branch (2734:10): [True: 116, False: 649]
  ------------------
 2735|    116|		goto done;
 2736|    649|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2737|    649|            out[0] =  (c >> 18)         | 0xF0;
 2738|    649|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2739|    649|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2740|    649|            out[3] =  (c        & 0x3F) | 0x80;
 2741|    649|            in += 4;
 2742|    649|            out += 4;
 2743|    649|        }
 2744|  16.4M|    }
 2745|       |
 2746|  12.3k|    ret = out - outstart;
 2747|       |
 2748|  24.8k|done:
 2749|  24.8k|    *outlen = out - outstart;
 2750|  24.8k|    *inlen = in - instart;
 2751|  24.8k|    return(ret);
 2752|  12.3k|}
encoding.c:asciiToAscii:
 2278|    959|             int flush ATTRIBUTE_UNUSED) {
 2279|    959|    const unsigned char *inend;
 2280|    959|    const unsigned char *instart = in;
 2281|    959|    int inlen, outlen, ret;
 2282|       |
 2283|    959|    if (in == NULL) {
  ------------------
  |  Branch (2283:9): [True: 0, False: 959]
  ------------------
 2284|      0|        *pinlen = 0;
 2285|      0|        *poutlen = 0;
 2286|      0|        return(XML_ENC_ERR_SUCCESS);
 2287|      0|    }
 2288|       |
 2289|    959|    inlen = *pinlen;
 2290|    959|    outlen = *poutlen;
 2291|       |
 2292|    959|    if (outlen < inlen) {
  ------------------
  |  Branch (2292:9): [True: 103, False: 856]
  ------------------
 2293|    103|        inlen = outlen;
 2294|    103|        ret = XML_ENC_ERR_SPACE;
 2295|    856|    } else {
 2296|    856|        ret = inlen;
 2297|    856|    }
 2298|       |
 2299|    959|    inend = in + inlen;
 2300|    959|    *poutlen = inlen;
 2301|    959|    *pinlen = inlen;
 2302|       |
 2303|  39.8k|    while (in < inend) {
  ------------------
  |  Branch (2303:12): [True: 39.5k, False: 281]
  ------------------
 2304|  39.5k|	unsigned c = *in;
 2305|       |
 2306|  39.5k|        if (c >= 0x80) {
  ------------------
  |  Branch (2306:13): [True: 678, False: 38.9k]
  ------------------
 2307|    678|	    *poutlen = in - instart;
 2308|    678|	    *pinlen = in - instart;
 2309|    678|	    return(XML_ENC_ERR_INPUT);
 2310|    678|	}
 2311|       |
 2312|  38.9k|        in++;
 2313|  38.9k|	*out++ = c;
 2314|  38.9k|    }
 2315|       |
 2316|    281|    return(ret);
 2317|    959|}
encoding.c:xmlFindExtraHandler:
  908|  8.16k|                    xmlCharEncodingHandler **out) {
  909|       |    /*
  910|       |     * Try custom implementation before deprecated global handlers.
  911|       |     *
  912|       |     * Note that we pass the original name without deprecated
  913|       |     * alias resolution.
  914|       |     */
  915|  8.16k|    if (impl != NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 8.16k]
  ------------------
  916|      0|        return(impl(implCtxt, norig, flags, out));
  917|       |
  918|       |    /*
  919|       |     * Deprecated
  920|       |     */
  921|  8.16k|    if (globalHandlers != NULL) {
  ------------------
  |  Branch (921:9): [True: 0, False: 8.16k]
  ------------------
  922|      0|        int i;
  923|       |
  924|      0|        for (i = 0; i < nbCharEncodingHandler; i++) {
  ------------------
  |  Branch (924:21): [True: 0, False: 0]
  ------------------
  925|      0|            xmlCharEncodingHandler *h = globalHandlers[i];
  926|       |
  927|      0|            if (!xmlStrcasecmp((const xmlChar *) name,
  ------------------
  |  Branch (927:17): [True: 0, False: 0]
  ------------------
  928|      0|                               (const xmlChar *) h->name)) {
  929|      0|                if ((((flags & XML_ENC_INPUT) == 0) || (h->input.func)) &&
  ------------------
  |  Branch (929:22): [True: 0, False: 0]
  |  Branch (929:56): [True: 0, False: 0]
  ------------------
  930|      0|                    (((flags & XML_ENC_OUTPUT) == 0) || (h->output.func))) {
  ------------------
  |  Branch (930:22): [True: 0, False: 0]
  |  Branch (930:57): [True: 0, False: 0]
  ------------------
  931|      0|                    *out = h;
  932|      0|                    return(XML_ERR_OK);
  933|      0|                }
  934|      0|            }
  935|      0|        }
  936|      0|    }
  937|       |
  938|  8.16k|#ifdef LIBXML_ICONV_ENABLED
  939|  8.16k|    {
  940|  8.16k|        int ret = xmlCharEncIconv(name, flags, out);
  941|       |
  942|  8.16k|        if (ret == XML_ERR_OK)
  ------------------
  |  Branch (942:13): [True: 7.41k, False: 753]
  ------------------
  943|  7.41k|            return(XML_ERR_OK);
  944|    753|        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (944:13): [True: 18, False: 735]
  ------------------
  945|     18|            return(ret);
  946|    753|    }
  947|    735|#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|    735|    return(XML_ERR_UNSUPPORTED_ENCODING);
  961|    753|}
encoding.c:xmlCharEncIconv:
 1319|  8.16k|                xmlCharEncodingHandler **out) {
 1320|  8.16k|    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
 1321|  8.16k|    xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
 1322|  8.16k|    iconv_t icv_in;
 1323|  8.16k|    iconv_t icv_out;
 1324|  8.16k|    xmlParserErrors ret;
 1325|       |
 1326|       |    /*
 1327|       |     * POSIX allows "indicator suffixes" like "//IGNORE" to be
 1328|       |     * passed to iconv_open. This can change the behavior in
 1329|       |     * unexpected ways.
 1330|       |     *
 1331|       |     * Many iconv implementations also support non-standard
 1332|       |     * codesets like "wchar_t", "char" or the empty string "".
 1333|       |     * It would make sense to disallow them, but codeset names
 1334|       |     * are matched fuzzily, so a string like "w-C.hA_rt" could
 1335|       |     * be interpreted as "wchar_t".
 1336|       |     *
 1337|       |     * When escaping characters that aren't supported in the
 1338|       |     * target encoding, we also rely on GNU libiconv behavior to
 1339|       |     * stop conversion without trying any kind of fallback.
 1340|       |     * This violates the POSIX spec which says:
 1341|       |     *
 1342|       |     * > If iconv() encounters a character in the input buffer
 1343|       |     * > that is valid, but for which an identical character does
 1344|       |     * > not exist in the output codeset [...] iconv() shall
 1345|       |     * > perform an implementation-defined conversion on the
 1346|       |     * > character.
 1347|       |     *
 1348|       |     * See: https://sourceware.org/bugzilla/show_bug.cgi?id=29913
 1349|       |     *
 1350|       |     * Unfortunately, strict POSIX compliance makes it impossible
 1351|       |     * to detect untranslatable characters.
 1352|       |     */
 1353|  8.16k|    if (strstr(name, "//") != NULL) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 8.16k]
  ------------------
 1354|      6|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1355|      6|        goto error;
 1356|      6|    }
 1357|       |
 1358|  8.16k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
 1359|  8.16k|    defined(__GLIBC__)
 1360|       |    /*
 1361|       |     * This glibc bug can lead to unpredictable results with the
 1362|       |     * push parser.
 1363|       |     *
 1364|       |     * https://sourceware.org/bugzilla/show_bug.cgi?id=32633
 1365|       |     */
 1366|  8.16k|    if ((xmlEncodingMatch(name, "TSCII")) ||
  ------------------
  |  Branch (1366:9): [True: 233, False: 7.93k]
  ------------------
 1367|  7.93k|        (xmlEncodingMatch(name, "BIG5-HKSCS"))) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 7.93k]
  ------------------
 1368|    233|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1369|    233|        goto error;
 1370|    233|    }
 1371|  7.93k|#endif
 1372|       |
 1373|  7.93k|    if (flags & XML_ENC_INPUT) {
  ------------------
  |  Branch (1373:9): [True: 7.93k, False: 0]
  ------------------
 1374|  7.93k|        inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1375|  7.93k|        if (inputCtxt == NULL) {
  ------------------
  |  Branch (1375:13): [True: 4, False: 7.92k]
  ------------------
 1376|      4|            ret = XML_ERR_NO_MEMORY;
 1377|      4|            goto error;
 1378|      4|        }
 1379|  7.92k|        inputCtxt->cd = (iconv_t) -1;
 1380|       |
 1381|  7.92k|        icv_in = iconv_open("UTF-8", name);
 1382|  7.92k|        if (icv_in == (iconv_t) -1) {
  ------------------
  |  Branch (1382:13): [True: 496, False: 7.43k]
  ------------------
 1383|    496|            if (errno == EINVAL)
  ------------------
  |  Branch (1383:17): [True: 496, False: 0]
  ------------------
 1384|    496|                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|    496|            goto error;
 1390|    496|        }
 1391|  7.43k|        inputCtxt->cd = icv_in;
 1392|       |
 1393|  7.43k|        inFunc = xmlIconvConvert;
 1394|  7.43k|    }
 1395|       |
 1396|  7.43k|    if (flags & XML_ENC_OUTPUT) {
  ------------------
  |  Branch (1396:9): [True: 739, False: 6.69k]
  ------------------
 1397|    739|        outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1398|    739|        if (outputCtxt == NULL) {
  ------------------
  |  Branch (1398:13): [True: 1, False: 738]
  ------------------
 1399|      1|            ret = XML_ERR_NO_MEMORY;
 1400|      1|            goto error;
 1401|      1|        }
 1402|    738|        outputCtxt->cd = (iconv_t) -1;
 1403|       |
 1404|    738|        icv_out = iconv_open(name, "UTF-8");
 1405|    738|        if (icv_out == (iconv_t) -1) {
  ------------------
  |  Branch (1405:13): [True: 0, False: 738]
  ------------------
 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|    738|        outputCtxt->cd = icv_out;
 1415|       |
 1416|    738|        outFunc = xmlIconvConvert;
 1417|    738|    }
 1418|       |
 1419|  7.42k|    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree,
 1420|  7.42k|                                      inputCtxt, outputCtxt, out));
 1421|       |
 1422|    740|error:
 1423|    740|    if (inputCtxt != NULL)
  ------------------
  |  Branch (1423:9): [True: 497, False: 243]
  ------------------
 1424|    497|        xmlIconvFree(inputCtxt);
 1425|    740|    if (outputCtxt != NULL)
  ------------------
  |  Branch (1425:9): [True: 0, False: 740]
  ------------------
 1426|      0|        xmlIconvFree(outputCtxt);
 1427|    740|    return(ret);
 1428|  7.43k|}
encoding.c:xmlEncodingMatch:
 1295|  16.0k|xmlEncodingMatch(const char *name1, const char *name2) {
 1296|       |    /*
 1297|       |     * Fuzzy match for encoding names
 1298|       |     */
 1299|  17.4k|    while (1) {
  ------------------
  |  Branch (1299:12): [True: 17.4k, Folded]
  ------------------
 1300|  18.8k|        while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1)))
  ------------------
  |  |  222|  18.5k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 17.7k, False: 775]
  |  |  ------------------
  |  |  223|  18.5k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 17.0k, False: 670]
  |  |  ------------------
  ------------------
  |  Branch (1300:16): [True: 18.5k, False: 337]
  ------------------
 1301|  1.44k|            name1 += 1;
 1302|  17.4k|        while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2)))
  ------------------
  |  |  222|  17.1k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 17.1k, False: 0]
  |  |  ------------------
  |  |  223|  17.1k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 17.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1302:16): [True: 17.1k, False: 233]
  ------------------
 1303|      0|            name2 += 1;
 1304|  17.4k|        if ((*name1 == 0) || (*name2 == 0))
  ------------------
  |  Branch (1304:13): [True: 337, False: 17.0k]
  |  Branch (1304:30): [True: 219, False: 16.8k]
  ------------------
 1305|    556|            break;
 1306|  16.8k|        if ((*name1 | 0x20) != (*name2 | 0x20))
  ------------------
  |  Branch (1306:13): [True: 15.5k, False: 1.33k]
  ------------------
 1307|  15.5k|            return(0);
 1308|  1.33k|        name1 += 1;
 1309|  1.33k|        name2 += 1;
 1310|  1.33k|    }
 1311|       |
 1312|       |    /* Only check whether name1 starts with name2 */
 1313|    556|    return(*name2 == 0);
 1314|  16.0k|}
encoding.c:xmlIconvConvert:
 1234|  30.2k|                int flush ATTRIBUTE_UNUSED) {
 1235|  30.2k|    xmlIconvCtxt *ctxt = vctxt;
 1236|  30.2k|    size_t icv_inlen, icv_outlen;
 1237|  30.2k|    const char *icv_in = (const char *) in;
 1238|  30.2k|    char *icv_out = (char *) out;
 1239|  30.2k|    size_t ret;
 1240|       |
 1241|  30.2k|    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
  ------------------
  |  Branch (1241:9): [True: 0, False: 30.2k]
  |  Branch (1241:26): [True: 0, False: 30.2k]
  |  Branch (1241:46): [True: 0, False: 30.2k]
  |  Branch (1241:65): [True: 0, False: 30.2k]
  ------------------
 1242|      0|        if (outlen != NULL) *outlen = 0;
  ------------------
  |  Branch (1242:13): [True: 0, False: 0]
  ------------------
 1243|      0|        return(XML_ENC_ERR_INTERNAL);
 1244|      0|    }
 1245|  30.2k|    icv_inlen = *inlen;
 1246|  30.2k|    icv_outlen = *outlen;
 1247|       |    /*
 1248|       |     * Some versions take const, other versions take non-const input.
 1249|       |     */
 1250|  30.2k|    ret = iconv(ctxt->cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
 1251|  30.2k|    *inlen -= icv_inlen;
 1252|  30.2k|    *outlen -= icv_outlen;
 1253|  30.2k|    if (ret == (size_t) -1) {
  ------------------
  |  Branch (1253:9): [True: 9.93k, False: 20.2k]
  ------------------
 1254|  9.93k|        if (errno == EILSEQ)
  ------------------
  |  Branch (1254:13): [True: 503, False: 9.43k]
  ------------------
 1255|    503|            return(XML_ENC_ERR_INPUT);
 1256|  9.43k|        if (errno == E2BIG)
  ------------------
  |  Branch (1256:13): [True: 7.98k, False: 1.44k]
  ------------------
 1257|  7.98k|            return(XML_ENC_ERR_SPACE);
 1258|       |        /*
 1259|       |         * EINVAL means a truncated multi-byte sequence at the end
 1260|       |         * of the input buffer. We treat this as success.
 1261|       |         */
 1262|  1.44k|        if (errno == EINVAL)
  ------------------
  |  Branch (1262:13): [True: 1.44k, False: 0]
  ------------------
 1263|  1.44k|            return(XML_ENC_ERR_SUCCESS);
 1264|       |#ifdef __APPLE__
 1265|       |        /*
 1266|       |         * Apple's new libiconv can return EOPNOTSUPP under
 1267|       |         * unknown circumstances (detected when fuzzing).
 1268|       |         */
 1269|       |        if (errno == EOPNOTSUPP)
 1270|       |            return(XML_ENC_ERR_INPUT);
 1271|       |#endif
 1272|      0|        return(XML_ENC_ERR_INTERNAL);
 1273|  1.44k|    }
 1274|  20.2k|    return(XML_ENC_ERR_SUCCESS);
 1275|  30.2k|}
encoding.c:xmlIconvFree:
 1278|  15.3k|xmlIconvFree(void *vctxt) {
 1279|  15.3k|    xmlIconvCtxt *ctxt = vctxt;
 1280|       |
 1281|  15.3k|    if (ctxt == NULL)
  ------------------
  |  Branch (1281:9): [True: 6.68k, False: 8.66k]
  ------------------
 1282|  6.68k|        return;
 1283|       |
 1284|  8.66k|    if (ctxt->cd != (iconv_t) -1)
  ------------------
  |  Branch (1284:9): [True: 8.16k, False: 496]
  ------------------
 1285|  8.16k|        iconv_close(ctxt->cd);
 1286|       |
 1287|  8.66k|    xmlFree(ctxt);
 1288|  8.66k|}
encoding.c:xmlEncConvertError:
 1649|  3.42k|xmlEncConvertError(xmlCharEncError code) {
 1650|  3.42k|    xmlParserErrors ret;
 1651|       |
 1652|  3.42k|    switch (code) {
 1653|      0|        case XML_ENC_ERR_SUCCESS:
  ------------------
  |  Branch (1653:9): [True: 0, False: 3.42k]
  ------------------
 1654|      0|            ret = XML_ERR_OK;
 1655|      0|            break;
 1656|  3.42k|        case XML_ENC_ERR_INPUT:
  ------------------
  |  Branch (1656:9): [True: 3.42k, False: 0]
  ------------------
 1657|  3.42k|            ret = XML_ERR_INVALID_ENCODING;
 1658|  3.42k|            break;
 1659|      0|        case XML_ENC_ERR_MEMORY:
  ------------------
  |  Branch (1659:9): [True: 0, False: 3.42k]
  ------------------
 1660|      0|            ret = XML_ERR_NO_MEMORY;
 1661|      0|            break;
 1662|      0|        default:
  ------------------
  |  Branch (1662:9): [True: 0, False: 3.42k]
  ------------------
 1663|      0|            ret = XML_ERR_INTERNAL_ERROR;
 1664|      0|            break;
 1665|  3.42k|    }
 1666|       |
 1667|  3.42k|    return(ret);
 1668|  3.42k|}
encoding.c:latin1ToUTF8:
 2323|  18.3k|             int flush ATTRIBUTE_UNUSED) {
 2324|  18.3k|    unsigned char* outstart = out;
 2325|  18.3k|    const unsigned char* instart = in;
 2326|  18.3k|    unsigned char* outend;
 2327|  18.3k|    const unsigned char* inend;
 2328|  18.3k|    int ret = XML_ENC_ERR_SPACE;
 2329|       |
 2330|  18.3k|    if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
  ------------------
  |  Branch (2330:9): [True: 0, False: 18.3k]
  |  Branch (2330:26): [True: 0, False: 18.3k]
  |  Branch (2330:42): [True: 0, False: 18.3k]
  |  Branch (2330:62): [True: 0, False: 18.3k]
  ------------------
 2331|      0|	return(XML_ENC_ERR_INTERNAL);
 2332|       |
 2333|  18.3k|    outend = out + *outlen;
 2334|  18.3k|    inend = in + *inlen;
 2335|       |
 2336|  15.8M|    while (in < inend) {
  ------------------
  |  Branch (2336:12): [True: 15.8M, False: 13.6k]
  ------------------
 2337|  15.8M|        unsigned c = *in;
 2338|       |
 2339|  15.8M|	if (c < 0x80) {
  ------------------
  |  Branch (2339:6): [True: 4.76M, False: 11.0M]
  ------------------
 2340|  4.76M|            if (out >= outend)
  ------------------
  |  Branch (2340:17): [True: 1.98k, False: 4.75M]
  ------------------
 2341|  1.98k|                goto done;
 2342|  4.75M|            *out++ = c;
 2343|  11.0M|	} else {
 2344|  11.0M|            if (outend - out < 2)
  ------------------
  |  Branch (2344:17): [True: 2.73k, False: 11.0M]
  ------------------
 2345|  2.73k|                goto done;
 2346|  11.0M|	    *out++ = (c >> 6) | 0xC0;
 2347|  11.0M|            *out++ = (c & 0x3F) | 0x80;
 2348|  11.0M|        }
 2349|       |
 2350|  15.8M|        in++;
 2351|  15.8M|    }
 2352|       |
 2353|  13.6k|    ret = out - outstart;
 2354|       |
 2355|  18.3k|done:
 2356|  18.3k|    *outlen = out - outstart;
 2357|  18.3k|    *inlen = in - instart;
 2358|  18.3k|    return(ret);
 2359|  13.6k|}

xmlFreeEntity:
   85|   119k|{
   86|   119k|    xmlDictPtr dict = NULL;
   87|       |
   88|   119k|    if (entity == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 119k]
  ------------------
   89|      0|        return;
   90|       |
   91|   119k|    if (entity->doc != NULL)
  ------------------
  |  Branch (91:9): [True: 117k, False: 1.92k]
  ------------------
   92|   117k|        dict = entity->doc->dict;
   93|       |
   94|       |
   95|   119k|    if ((entity->children) &&
  ------------------
  |  Branch (95:9): [True: 3.51k, False: 115k]
  ------------------
   96|  3.51k|        (entity == (xmlEntityPtr) entity->children->parent))
  ------------------
  |  Branch (96:9): [True: 3.51k, False: 0]
  ------------------
   97|  3.51k|        xmlFreeNodeList(entity->children);
   98|   119k|    if ((entity->name != NULL) &&
  ------------------
  |  Branch (98:9): [True: 119k, False: 6]
  ------------------
   99|   119k|        ((dict == NULL) || (!xmlDictOwns(dict, entity->name))))
  ------------------
  |  Branch (99:10): [True: 88.4k, False: 30.6k]
  |  Branch (99:28): [True: 0, False: 30.6k]
  ------------------
  100|  88.4k|        xmlFree((char *) entity->name);
  101|   119k|    if (entity->ExternalID != NULL)
  ------------------
  |  Branch (101:9): [True: 3.89k, False: 115k]
  ------------------
  102|  3.89k|        xmlFree((char *) entity->ExternalID);
  103|   119k|    if (entity->SystemID != NULL)
  ------------------
  |  Branch (103:9): [True: 13.6k, False: 105k]
  ------------------
  104|  13.6k|        xmlFree((char *) entity->SystemID);
  105|   119k|    if (entity->URI != NULL)
  ------------------
  |  Branch (105:9): [True: 7.94k, False: 111k]
  ------------------
  106|  7.94k|        xmlFree((char *) entity->URI);
  107|   119k|    if (entity->content != NULL)
  ------------------
  |  Branch (107:9): [True: 102k, False: 16.4k]
  ------------------
  108|   102k|        xmlFree((char *) entity->content);
  109|   119k|    if (entity->orig != NULL)
  ------------------
  |  Branch (109:9): [True: 13.2k, False: 105k]
  ------------------
  110|  13.2k|        xmlFree((char *) entity->orig);
  111|   119k|    xmlFree(entity);
  112|   119k|}
xmlAddEntity:
  188|   120k|	  const xmlChar *content, xmlEntity **out) {
  189|   120k|    xmlDtdPtr dtd;
  190|   120k|    xmlDictPtr dict = NULL;
  191|   120k|    xmlEntitiesTablePtr table = NULL;
  192|   120k|    xmlEntityPtr ret, predef;
  193|   120k|    int res;
  194|       |
  195|   120k|    if (out != NULL)
  ------------------
  |  Branch (195:9): [True: 120k, False: 0]
  ------------------
  196|   120k|        *out = NULL;
  197|   120k|    if ((doc == NULL) || (name == NULL))
  ------------------
  |  Branch (197:9): [True: 0, False: 120k]
  |  Branch (197:26): [True: 0, False: 120k]
  ------------------
  198|      0|	return(XML_ERR_ARGUMENT);
  199|   120k|    dict = doc->dict;
  200|       |
  201|   120k|    if (extSubset)
  ------------------
  |  Branch (201:9): [True: 9.57k, False: 110k]
  ------------------
  202|  9.57k|        dtd = doc->extSubset;
  203|   110k|    else
  204|   110k|        dtd = doc->intSubset;
  205|   120k|    if (dtd == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 120k]
  ------------------
  206|      0|        return(XML_DTD_NO_DTD);
  207|       |
  208|   120k|    switch (type) {
  209|  50.9k|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (209:9): [True: 50.9k, False: 69.5k]
  ------------------
  210|  60.7k|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (210:9): [True: 9.81k, False: 110k]
  ------------------
  211|  61.4k|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (211:9): [True: 711, False: 119k]
  ------------------
  212|  61.4k|            predef = xmlGetPredefinedEntity(name);
  213|  61.4k|            if (predef != NULL) {
  ------------------
  |  Branch (213:17): [True: 4.47k, False: 57.0k]
  ------------------
  214|  4.47k|                int valid = 0;
  215|       |
  216|       |                /* 4.6 Predefined Entities */
  217|  4.47k|                if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
  ------------------
  |  Branch (217:21): [True: 3.95k, False: 516]
  ------------------
  218|  3.95k|                    (content != NULL)) {
  ------------------
  |  Branch (218:21): [True: 2.97k, False: 981]
  ------------------
  219|  2.97k|                    int c = predef->content[0];
  220|       |
  221|  2.97k|                    if (((content[0] == c) && (content[1] == 0)) &&
  ------------------
  |  Branch (221:26): [True: 1.92k, False: 1.04k]
  |  Branch (221:47): [True: 1.26k, False: 669]
  ------------------
  222|  1.26k|                        ((c == '>') || (c == '\'') || (c == '"'))) {
  ------------------
  |  Branch (222:26): [True: 350, False: 910]
  |  Branch (222:40): [True: 239, False: 671]
  |  Branch (222:55): [True: 271, False: 400]
  ------------------
  223|    860|                        valid = 1;
  224|  2.11k|                    } else if ((content[0] == '&') && (content[1] == '#')) {
  ------------------
  |  Branch (224:32): [True: 1.29k, False: 822]
  |  Branch (224:55): [True: 869, False: 425]
  ------------------
  225|    869|                        if (content[2] == 'x') {
  ------------------
  |  Branch (225:29): [True: 92, False: 777]
  ------------------
  226|     92|                            xmlChar *hex = BAD_CAST "0123456789ABCDEF";
  ------------------
  |  |   34|     92|#define BAD_CAST (xmlChar *)
  ------------------
  227|     92|                            xmlChar ref[] = "00;";
  228|       |
  229|     92|                            ref[0] = hex[c / 16 % 16];
  230|     92|                            ref[1] = hex[c % 16];
  231|     92|                            if (xmlStrcasecmp(&content[3], ref) == 0)
  ------------------
  |  Branch (231:33): [True: 19, False: 73]
  ------------------
  232|     19|                                valid = 1;
  233|    777|                        } else {
  234|    777|                            xmlChar ref[] = "00;";
  235|       |
  236|    777|                            ref[0] = '0' + c / 10 % 10;
  237|    777|                            ref[1] = '0' + c % 10;
  238|    777|                            if (xmlStrEqual(&content[2], ref))
  ------------------
  |  Branch (238:33): [True: 238, False: 539]
  ------------------
  239|    238|                                valid = 1;
  240|    777|                        }
  241|    869|                    }
  242|  2.97k|                }
  243|  4.47k|                if (!valid)
  ------------------
  |  Branch (243:21): [True: 3.35k, False: 1.11k]
  ------------------
  244|  3.35k|                    return(XML_ERR_REDECL_PREDEF_ENTITY);
  245|  4.47k|            }
  246|  58.1k|	    if (dtd->entities == NULL) {
  ------------------
  |  Branch (246:10): [True: 4.54k, False: 53.5k]
  ------------------
  247|  4.54k|		dtd->entities = xmlHashCreateDict(0, dict);
  248|  4.54k|                if (dtd->entities == NULL)
  ------------------
  |  Branch (248:21): [True: 2, False: 4.54k]
  ------------------
  249|      2|                    return(XML_ERR_NO_MEMORY);
  250|  4.54k|            }
  251|  58.1k|	    table = dtd->entities;
  252|  58.1k|	    break;
  253|  53.0k|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (253:9): [True: 53.0k, False: 67.4k]
  ------------------
  254|  59.0k|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (254:9): [True: 5.94k, False: 114k]
  ------------------
  255|  59.0k|	    if (dtd->pentities == NULL) {
  ------------------
  |  Branch (255:10): [True: 3.08k, False: 55.9k]
  ------------------
  256|  3.08k|		dtd->pentities = xmlHashCreateDict(0, dict);
  257|  3.08k|                if (dtd->pentities == NULL)
  ------------------
  |  Branch (257:21): [True: 1, False: 3.08k]
  ------------------
  258|      1|                    return(XML_ERR_NO_MEMORY);
  259|  3.08k|            }
  260|  59.0k|	    table = dtd->pentities;
  261|  59.0k|	    break;
  262|      0|        default:
  ------------------
  |  Branch (262:9): [True: 0, False: 120k]
  ------------------
  263|      0|	    return(XML_ERR_ARGUMENT);
  264|   120k|    }
  265|   117k|    ret = xmlCreateEntity(dtd->doc, name, type, publicId, systemId, content);
  266|   117k|    if (ret == NULL)
  ------------------
  |  Branch (266:9): [True: 19, False: 117k]
  ------------------
  267|     19|        return(XML_ERR_NO_MEMORY);
  268|       |
  269|   117k|    res = xmlHashAdd(table, name, ret);
  270|   117k|    if (res < 0) {
  ------------------
  |  Branch (270:9): [True: 6, False: 117k]
  ------------------
  271|      6|        xmlFreeEntity(ret);
  272|      6|        return(XML_ERR_NO_MEMORY);
  273|   117k|    } else if (res == 0) {
  ------------------
  |  Branch (273:16): [True: 97.6k, False: 19.5k]
  ------------------
  274|       |	/*
  275|       |	 * entity was already defined at another level.
  276|       |	 */
  277|  97.6k|        xmlFreeEntity(ret);
  278|  97.6k|	return(XML_WAR_ENTITY_REDEFINED);
  279|  97.6k|    }
  280|       |
  281|       |    /*
  282|       |     * Link it to the DTD
  283|       |     */
  284|  19.5k|    ret->parent = dtd;
  285|  19.5k|    ret->doc = dtd->doc;
  286|  19.5k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (286:9): [True: 5.23k, False: 14.2k]
  ------------------
  287|  5.23k|	dtd->children = dtd->last = (xmlNodePtr) ret;
  288|  14.2k|    } else {
  289|  14.2k|	dtd->last->next = (xmlNodePtr) ret;
  290|  14.2k|	ret->prev = dtd->last;
  291|  14.2k|	dtd->last = (xmlNodePtr) ret;
  292|  14.2k|    }
  293|       |
  294|  19.5k|    if (out != NULL)
  ------------------
  |  Branch (294:9): [True: 19.5k, False: 0]
  ------------------
  295|  19.5k|        *out = ret;
  296|  19.5k|    return(0);
  297|   117k|}
xmlGetPredefinedEntity:
  306|  4.83M|xmlGetPredefinedEntity(const xmlChar *name) {
  307|  4.83M|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (307:9): [True: 4, False: 4.83M]
  ------------------
  308|  4.83M|    switch (name[0]) {
  309|   202k|        case 'l':
  ------------------
  |  Branch (309:9): [True: 202k, False: 4.63M]
  ------------------
  310|   202k|	    if (xmlStrEqual(name, BAD_CAST "lt"))
  ------------------
  |  |   34|   202k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (310:10): [True: 8.74k, False: 193k]
  ------------------
  311|  8.74k|	        return(&xmlEntityLt);
  312|   193k|	    break;
  313|  1.39M|        case 'g':
  ------------------
  |  Branch (313:9): [True: 1.39M, False: 3.44M]
  ------------------
  314|  1.39M|	    if (xmlStrEqual(name, BAD_CAST "gt"))
  ------------------
  |  |   34|  1.39M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (314:10): [True: 1.37M, False: 18.9k]
  ------------------
  315|  1.37M|	        return(&xmlEntityGt);
  316|  18.9k|	    break;
  317|  83.1k|        case 'a':
  ------------------
  |  Branch (317:9): [True: 83.1k, False: 4.75M]
  ------------------
  318|  83.1k|	    if (xmlStrEqual(name, BAD_CAST "amp"))
  ------------------
  |  |   34|  83.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (318:10): [True: 6.60k, False: 76.5k]
  ------------------
  319|  6.60k|	        return(&xmlEntityAmp);
  320|  76.5k|	    if (xmlStrEqual(name, BAD_CAST "apos"))
  ------------------
  |  |   34|  76.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (320:10): [True: 7.07k, False: 69.4k]
  ------------------
  321|  7.07k|	        return(&xmlEntityApos);
  322|  69.4k|	    break;
  323|  78.5k|        case 'q':
  ------------------
  |  Branch (323:9): [True: 78.5k, False: 4.76M]
  ------------------
  324|  78.5k|	    if (xmlStrEqual(name, BAD_CAST "quot"))
  ------------------
  |  |   34|  78.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (324:10): [True: 77.8k, False: 766]
  ------------------
  325|  77.8k|	        return(&xmlEntityQuot);
  326|    766|	    break;
  327|  3.08M|	default:
  ------------------
  |  Branch (327:2): [True: 3.08M, False: 1.75M]
  ------------------
  328|  3.08M|	    break;
  329|  4.83M|    }
  330|  3.36M|    return(NULL);
  331|  4.83M|}
xmlAddDocEntity:
  372|    163|	        const xmlChar *content) {
  373|    163|    xmlEntityPtr ret;
  374|       |
  375|    163|    xmlAddEntity(doc, 0, name, type, publicId, systemId, content, &ret);
  376|    163|    return(ret);
  377|    163|}
xmlGetParameterEntity:
  428|   406k|xmlGetParameterEntity(xmlDoc *doc, const xmlChar *name) {
  429|   406k|    xmlEntitiesTablePtr table;
  430|   406k|    xmlEntityPtr ret;
  431|       |
  432|   406k|    if (doc == NULL)
  ------------------
  |  Branch (432:9): [True: 44, False: 406k]
  ------------------
  433|     44|	return(NULL);
  434|   406k|    if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
  ------------------
  |  Branch (434:9): [True: 406k, False: 33]
  |  Branch (434:37): [True: 394k, False: 11.6k]
  ------------------
  435|   394k|	table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
  436|   394k|	ret = xmlGetEntityFromTable(table, name);
  437|   394k|	if (ret != NULL)
  ------------------
  |  Branch (437:6): [True: 302k, False: 92.2k]
  ------------------
  438|   302k|	    return(ret);
  439|   394k|    }
  440|   103k|    if ((doc->extSubset != NULL) && (doc->extSubset->pentities != NULL)) {
  ------------------
  |  Branch (440:9): [True: 11.9k, False: 91.9k]
  |  Branch (440:37): [True: 11.6k, False: 259]
  ------------------
  441|  11.6k|	table = (xmlEntitiesTablePtr) doc->extSubset->pentities;
  442|  11.6k|	return(xmlGetEntityFromTable(table, name));
  443|  11.6k|    }
  444|  92.2k|    return(NULL);
  445|   103k|}
xmlGetDocEntity:
  476|  2.34M|xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
  477|  2.34M|    xmlEntityPtr cur;
  478|  2.34M|    xmlEntitiesTablePtr table;
  479|       |
  480|  2.34M|    if (doc != NULL) {
  ------------------
  |  Branch (480:9): [True: 2.34M, False: 655]
  ------------------
  481|  2.34M|	if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
  ------------------
  |  Branch (481:6): [True: 2.32M, False: 15.5k]
  |  Branch (481:34): [True: 2.25M, False: 72.7k]
  ------------------
  482|  2.25M|	    table = (xmlEntitiesTablePtr) doc->intSubset->entities;
  483|  2.25M|	    cur = xmlGetEntityFromTable(table, name);
  484|  2.25M|	    if (cur != NULL)
  ------------------
  |  Branch (484:10): [True: 1.91M, False: 345k]
  ------------------
  485|  1.91M|		return(cur);
  486|  2.25M|	}
  487|   433k|	if (doc->standalone != 1) {
  ------------------
  |  Branch (487:6): [True: 432k, False: 1.04k]
  ------------------
  488|   432k|	    if ((doc->extSubset != NULL) &&
  ------------------
  |  Branch (488:10): [True: 10.5k, False: 421k]
  ------------------
  489|  10.5k|		(doc->extSubset->entities != NULL)) {
  ------------------
  |  Branch (489:3): [True: 9.13k, False: 1.46k]
  ------------------
  490|  9.13k|		table = (xmlEntitiesTablePtr) doc->extSubset->entities;
  491|  9.13k|		cur = xmlGetEntityFromTable(table, name);
  492|  9.13k|		if (cur != NULL)
  ------------------
  |  Branch (492:7): [True: 7.65k, False: 1.48k]
  ------------------
  493|  7.65k|		    return(cur);
  494|  9.13k|	    }
  495|   432k|	}
  496|   433k|    }
  497|   426k|    return(xmlGetPredefinedEntity(name));
  498|  2.34M|}
xmlFreeEntitiesTable:
  588|  8.81k|xmlFreeEntitiesTable(xmlEntitiesTable *table) {
  589|  8.81k|    xmlHashFree(table, xmlFreeEntityWrapper);
  590|  8.81k|}
xmlCopyEntitiesTable:
  665|  1.20k|xmlCopyEntitiesTable(xmlEntitiesTable *table) {
  666|  1.20k|    return(xmlHashCopySafe(table, xmlCopyEntity, xmlFreeEntityWrapper));
  667|  1.20k|}
entities.c:xmlCreateEntity:
  120|   117k|	        const xmlChar *content) {
  121|   117k|    xmlEntityPtr ret;
  122|       |
  123|   117k|    ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  124|   117k|    if (ret == NULL)
  ------------------
  |  Branch (124:9): [True: 9, False: 117k]
  ------------------
  125|      9|	return(NULL);
  126|   117k|    memset(ret, 0, sizeof(xmlEntity));
  127|   117k|    ret->doc = doc;
  128|   117k|    ret->type = XML_ENTITY_DECL;
  129|       |
  130|       |    /*
  131|       |     * fill the structure.
  132|       |     */
  133|   117k|    ret->etype = (xmlEntityType) type;
  134|   117k|    if ((doc == NULL) || (doc->dict == NULL))
  ------------------
  |  Branch (134:9): [True: 0, False: 117k]
  |  Branch (134:26): [True: 86.5k, False: 30.6k]
  ------------------
  135|  86.5k|	ret->name = xmlStrdup(name);
  136|  30.6k|    else
  137|  30.6k|        ret->name = xmlDictLookup(doc->dict, name, -1);
  138|   117k|    if (ret->name == NULL)
  ------------------
  |  Branch (138:9): [True: 2, False: 117k]
  ------------------
  139|      2|        goto error;
  140|   117k|    if (publicId != NULL) {
  ------------------
  |  Branch (140:9): [True: 3.82k, False: 113k]
  ------------------
  141|  3.82k|        ret->ExternalID = xmlStrdup(publicId);
  142|  3.82k|        if (ret->ExternalID == NULL)
  ------------------
  |  Branch (142:13): [True: 2, False: 3.82k]
  ------------------
  143|      2|            goto error;
  144|  3.82k|    }
  145|   117k|    if (systemId != NULL) {
  ------------------
  |  Branch (145:9): [True: 12.8k, False: 104k]
  ------------------
  146|  12.8k|        ret->SystemID = xmlStrdup(systemId);
  147|  12.8k|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (147:13): [True: 2, False: 12.8k]
  ------------------
  148|      2|            goto error;
  149|  12.8k|    }
  150|   117k|    if (content != NULL) {
  ------------------
  |  Branch (150:9): [True: 101k, False: 15.9k]
  ------------------
  151|   101k|        ret->length = xmlStrlen(content);
  152|   101k|	ret->content = xmlStrndup(content, ret->length);
  153|   101k|        if (ret->content == NULL)
  ------------------
  |  Branch (153:13): [True: 4, False: 101k]
  ------------------
  154|      4|            goto error;
  155|   101k|     } else {
  156|  15.9k|        ret->length = 0;
  157|  15.9k|        ret->content = NULL;
  158|  15.9k|    }
  159|   117k|    ret->URI = NULL; /* to be computed by the layer knowing
  160|       |			the defining entity */
  161|   117k|    ret->orig = NULL;
  162|       |
  163|   117k|    return(ret);
  164|       |
  165|     10|error:
  166|     10|    xmlFreeEntity(ret);
  167|       |    return(NULL);
  168|   117k|}
entities.c:xmlGetEntityFromTable:
  415|  2.67M|xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
  416|  2.67M|    return((xmlEntityPtr) xmlHashLookup(table, name));
  417|  2.67M|}
entities.c:xmlFreeEntityWrapper:
  575|  21.4k|xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) {
  576|  21.4k|    if (entity != NULL)
  ------------------
  |  Branch (576:9): [True: 21.4k, False: 0]
  ------------------
  577|  21.4k|	xmlFreeEntity((xmlEntityPtr) entity);
  578|  21.4k|}
entities.c:xmlCopyEntity:
  600|  1.92k|xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
  601|  1.92k|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  602|  1.92k|    xmlEntityPtr cur;
  603|       |
  604|  1.92k|    cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  605|  1.92k|    if (cur == NULL)
  ------------------
  |  Branch (605:9): [True: 1, False: 1.92k]
  ------------------
  606|      1|	return(NULL);
  607|  1.92k|    memset(cur, 0, sizeof(xmlEntity));
  608|  1.92k|    cur->type = XML_ENTITY_DECL;
  609|       |
  610|  1.92k|    cur->etype = ent->etype;
  611|  1.92k|    if (ent->name != NULL) {
  ------------------
  |  Branch (611:9): [True: 1.92k, False: 0]
  ------------------
  612|  1.92k|	cur->name = xmlStrdup(ent->name);
  613|  1.92k|        if (cur->name == NULL)
  ------------------
  |  Branch (613:13): [True: 4, False: 1.91k]
  ------------------
  614|      4|            goto error;
  615|  1.92k|    }
  616|  1.91k|    if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (616:9): [True: 66, False: 1.85k]
  ------------------
  617|     66|	cur->ExternalID = xmlStrdup(ent->ExternalID);
  618|     66|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (618:13): [True: 0, False: 66]
  ------------------
  619|      0|            goto error;
  620|     66|    }
  621|  1.91k|    if (ent->SystemID != NULL) {
  ------------------
  |  Branch (621:9): [True: 792, False: 1.12k]
  ------------------
  622|    792|	cur->SystemID = xmlStrdup(ent->SystemID);
  623|    792|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (623:13): [True: 3, False: 789]
  ------------------
  624|      3|            goto error;
  625|    792|    }
  626|  1.91k|    if (ent->content != NULL) {
  ------------------
  |  Branch (626:9): [True: 1.19k, False: 721]
  ------------------
  627|  1.19k|	cur->content = xmlStrdup(ent->content);
  628|  1.19k|        if (cur->content == NULL)
  ------------------
  |  Branch (628:13): [True: 1, False: 1.19k]
  ------------------
  629|      1|            goto error;
  630|  1.19k|    }
  631|  1.91k|    if (ent->orig != NULL) {
  ------------------
  |  Branch (631:9): [True: 1.24k, False: 669]
  ------------------
  632|  1.24k|	cur->orig = xmlStrdup(ent->orig);
  633|  1.24k|        if (cur->orig == NULL)
  ------------------
  |  Branch (633:13): [True: 3, False: 1.24k]
  ------------------
  634|      3|            goto error;
  635|  1.24k|    }
  636|  1.91k|    if (ent->URI != NULL) {
  ------------------
  |  Branch (636:9): [True: 789, False: 1.12k]
  ------------------
  637|    789|	cur->URI = xmlStrdup(ent->URI);
  638|    789|        if (cur->URI == NULL)
  ------------------
  |  Branch (638:13): [True: 2, False: 787]
  ------------------
  639|      2|            goto error;
  640|    789|    }
  641|       |    /* Handle XML_TEXT_NODE children for XML_ENTITY_DECL */
  642|  1.91k|    if (ent->children != NULL) {
  ------------------
  |  Branch (642:9): [True: 621, False: 1.28k]
  ------------------
  643|    621|        cur->children = xmlStaticCopyNodeList(ent->children, cur->doc, (xmlNodePtr)cur);
  644|       |        /* Update last pointers */
  645|    621|        cur->last = cur->children;
  646|  2.91k|        while (cur->last && cur->last->next) cur->last = cur->last->next;
  ------------------
  |  Branch (646:16): [True: 2.91k, False: 6]
  |  Branch (646:29): [True: 2.29k, False: 615]
  ------------------
  647|    621|    }
  648|       |
  649|  1.91k|    return(cur);
  650|       |
  651|     13|error:
  652|     13|    xmlFreeEntity(cur);
  653|       |    return(NULL);
  654|  1.91k|}

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

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

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|  35.7k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
  105|  35.7k|    xmlTextReaderPtr reader;
  106|  35.7k|    xmlDocPtr doc = NULL;
  107|  35.7k|    const xmlError *error;
  108|  35.7k|    const char *docBuffer;
  109|  35.7k|    const unsigned char *program;
  110|  35.7k|    size_t failurePos, docSize, programSize, i;
  111|  35.7k|    size_t totalStringSize = 0;
  112|  35.7k|    int opts;
  113|  35.7k|    int oomReport = 0;
  114|       |
  115|  35.7k|    xmlFuzzDataInit(data, size);
  116|  35.7k|    opts = (int) xmlFuzzReadInt(4);
  117|  35.7k|    failurePos = xmlFuzzReadInt(4) % (size + 100);
  118|       |
  119|  35.7k|    program = (const unsigned char *) xmlFuzzReadString(&programSize);
  120|  35.7k|    if (programSize > 1000)
  ------------------
  |  Branch (120:9): [True: 37, False: 35.7k]
  ------------------
  121|     37|        programSize = 1000;
  122|       |
  123|  35.7k|    xmlFuzzReadEntities();
  124|  35.7k|    docBuffer = xmlFuzzMainEntity(&docSize);
  125|  35.7k|    if (docBuffer == NULL)
  ------------------
  |  Branch (125:9): [True: 113, False: 35.6k]
  ------------------
  126|    113|        goto exit;
  127|       |
  128|       |#ifdef DEBUG
  129|       |    fprintf(stderr, "Input document (%d bytes):\n", (int) docSize);
  130|       |    for (i = 0; (size_t) i < docSize; i++) {
  131|       |        int c = (unsigned char) docBuffer[i];
  132|       |
  133|       |        if ((c == '\n' || (c >= 0x20 && c <= 0x7E)))
  134|       |            putc(c, stderr);
  135|       |        else
  136|       |            fprintf(stderr, "\\x%02X", c);
  137|       |    }
  138|       |    fprintf(stderr, "\nEOF\n");
  139|       |#endif
  140|       |
  141|  35.6k|    xmlFuzzInjectFailure(failurePos);
  142|  35.6k|    reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
  143|  35.6k|    if (reader == NULL)
  ------------------
  |  Branch (143:9): [True: 60, False: 35.5k]
  ------------------
  144|     60|        goto exit;
  145|       |
  146|  35.5k|    xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
  147|  35.5k|    xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
  148|       |
  149|  35.5k|    i = 0;
  150|   774k|    while (i < programSize) {
  ------------------
  |  Branch (150:12): [True: 740k, False: 34.4k]
  ------------------
  151|   740k|        int op = program[i++];
  152|       |
  153|   740k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  154|   740k|#define FREE_STRING(str) \
  155|   740k|    do { \
  156|   740k|        if (str != NULL) { \
  157|   740k|            totalStringSize += strlen((char *) str); \
  158|   740k|            xmlFree(str); \
  159|   740k|        } \
  160|   740k|    } while (0)
  161|       |
  162|   740k|        switch (op & 0x3F) {
  163|  47.6k|            case OP_READ:
  ------------------
  |  Branch (163:13): [True: 47.6k, False: 692k]
  ------------------
  164|   246k|            default:
  ------------------
  |  Branch (164:13): [True: 198k, False: 541k]
  ------------------
  165|   246k|                startOp("Read");
  166|   246k|                xmlTextReaderRead(reader);
  167|   246k|                break;
  168|       |
  169|  13.2k|            case OP_READ_INNER_XML: {
  ------------------
  |  Branch (169:13): [True: 13.2k, False: 727k]
  ------------------
  170|  13.2k|                xmlChar *result;
  171|       |
  172|  13.2k|                startOp("ReadInnerXml");
  173|  13.2k|                result = xmlTextReaderReadInnerXml(reader);
  174|  13.2k|                FREE_STRING(result);
  ------------------
  |  |  155|  13.2k|    do { \
  |  |  156|  13.2k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 7.56k, False: 5.73k]
  |  |  ------------------
  |  |  157|  7.56k|            totalStringSize += strlen((char *) str); \
  |  |  158|  7.56k|            xmlFree(str); \
  |  |  159|  7.56k|        } \
  |  |  160|  13.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 13.2k]
  |  |  ------------------
  ------------------
  175|  13.2k|                break;
  176|  47.6k|            }
  177|       |
  178|  32.9k|            case OP_READ_OUTER_XML: {
  ------------------
  |  Branch (178:13): [True: 32.9k, False: 707k]
  ------------------
  179|  32.9k|                xmlChar *result;
  180|       |
  181|  32.9k|                startOp("ReadOuterXml");
  182|  32.9k|                result = xmlTextReaderReadOuterXml(reader);
  183|  32.9k|                FREE_STRING(result);
  ------------------
  |  |  155|  32.9k|    do { \
  |  |  156|  32.9k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 22.9k, False: 9.96k]
  |  |  ------------------
  |  |  157|  22.9k|            totalStringSize += strlen((char *) str); \
  |  |  158|  22.9k|            xmlFree(str); \
  |  |  159|  22.9k|        } \
  |  |  160|  32.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 32.9k]
  |  |  ------------------
  ------------------
  184|  32.9k|                break;
  185|  47.6k|            }
  186|       |
  187|  9.30k|            case OP_READ_STRING: {
  ------------------
  |  Branch (187:13): [True: 9.30k, False: 730k]
  ------------------
  188|  9.30k|                xmlChar *result;
  189|       |
  190|  9.30k|                startOp("ReadString");
  191|  9.30k|                result = xmlTextReaderReadString(reader);
  192|  9.30k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.30k|    do { \
  |  |  156|  9.30k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.39k, False: 6.90k]
  |  |  ------------------
  |  |  157|  2.39k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.39k|            xmlFree(str); \
  |  |  159|  2.39k|        } \
  |  |  160|  9.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.30k]
  |  |  ------------------
  ------------------
  193|  9.30k|                break;
  194|  47.6k|            }
  195|       |
  196|  10.1k|            case OP_READ_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (196:13): [True: 10.1k, False: 730k]
  ------------------
  197|  10.1k|                startOp("ReadAttributeValue");
  198|  10.1k|                xmlTextReaderReadAttributeValue(reader);
  199|  10.1k|                break;
  200|       |
  201|  9.17k|            case OP_ATTRIBUTE_COUNT:
  ------------------
  |  Branch (201:13): [True: 9.17k, False: 731k]
  ------------------
  202|  9.17k|                startOp("AttributeCount");
  203|  9.17k|                xmlTextReaderAttributeCount(reader);
  204|  9.17k|                break;
  205|       |
  206|  3.41k|            case OP_DEPTH:
  ------------------
  |  Branch (206:13): [True: 3.41k, False: 736k]
  ------------------
  207|  3.41k|                startOp("Depth");
  208|  3.41k|                xmlTextReaderDepth(reader);
  209|  3.41k|                break;
  210|       |
  211|  3.29k|            case OP_HAS_ATTRIBUTES:
  ------------------
  |  Branch (211:13): [True: 3.29k, False: 737k]
  ------------------
  212|  3.29k|                startOp("HasAttributes");
  213|  3.29k|                xmlTextReaderHasAttributes(reader);
  214|  3.29k|                break;
  215|       |
  216|  11.0k|            case OP_HAS_VALUE:
  ------------------
  |  Branch (216:13): [True: 11.0k, False: 729k]
  ------------------
  217|  11.0k|                startOp("HasValue");
  218|  11.0k|                xmlTextReaderHasValue(reader);
  219|  11.0k|                break;
  220|       |
  221|  6.53k|            case OP_IS_DEFAULT:
  ------------------
  |  Branch (221:13): [True: 6.53k, False: 733k]
  ------------------
  222|  6.53k|                startOp("IsDefault");
  223|  6.53k|                xmlTextReaderIsDefault(reader);
  224|  6.53k|                break;
  225|       |
  226|  10.2k|            case OP_IS_EMPTY_ELEMENT:
  ------------------
  |  Branch (226:13): [True: 10.2k, False: 730k]
  ------------------
  227|  10.2k|                startOp("IsEmptyElement");
  228|  10.2k|                xmlTextReaderIsEmptyElement(reader);
  229|  10.2k|                break;
  230|       |
  231|  10.7k|            case OP_NODE_TYPE:
  ------------------
  |  Branch (231:13): [True: 10.7k, False: 729k]
  ------------------
  232|  10.7k|                startOp("NodeType");
  233|  10.7k|                xmlTextReaderNodeType(reader);
  234|  10.7k|                break;
  235|       |
  236|  3.13k|            case OP_QUOTE_CHAR:
  ------------------
  |  Branch (236:13): [True: 3.13k, False: 737k]
  ------------------
  237|  3.13k|                startOp("QuoteChar");
  238|  3.13k|                xmlTextReaderQuoteChar(reader);
  239|  3.13k|                break;
  240|       |
  241|  5.83k|            case OP_READ_STATE:
  ------------------
  |  Branch (241:13): [True: 5.83k, False: 734k]
  ------------------
  242|  5.83k|                startOp("ReadState");
  243|  5.83k|                xmlTextReaderReadState(reader);
  244|  5.83k|                break;
  245|       |
  246|  3.66k|            case OP_IS_NAMESPACE_DECL:
  ------------------
  |  Branch (246:13): [True: 3.66k, False: 736k]
  ------------------
  247|  3.66k|                startOp("IsNamespaceDecl");
  248|  3.66k|                xmlTextReaderIsNamespaceDecl(reader);
  249|  3.66k|                break;
  250|       |
  251|  44.4k|            case OP_CONST_BASE_URI:
  ------------------
  |  Branch (251:13): [True: 44.4k, False: 695k]
  ------------------
  252|  44.4k|                startOp("ConstBaseUri");
  253|  44.4k|                xmlTextReaderConstBaseUri(reader);
  254|  44.4k|                break;
  255|       |
  256|  2.21k|            case OP_CONST_LOCAL_NAME:
  ------------------
  |  Branch (256:13): [True: 2.21k, False: 738k]
  ------------------
  257|  2.21k|                startOp("ConstLocalName");
  258|  2.21k|                xmlTextReaderConstLocalName(reader);
  259|  2.21k|                break;
  260|       |
  261|  6.02k|            case OP_CONST_NAME:
  ------------------
  |  Branch (261:13): [True: 6.02k, False: 734k]
  ------------------
  262|  6.02k|                startOp("ConstName");
  263|  6.02k|                xmlTextReaderConstName(reader);
  264|  6.02k|                break;
  265|       |
  266|  5.34k|            case OP_CONST_NAMESPACE_URI:
  ------------------
  |  Branch (266:13): [True: 5.34k, False: 734k]
  ------------------
  267|  5.34k|                startOp("ConstNamespaceUri");
  268|  5.34k|                xmlTextReaderConstNamespaceUri(reader);
  269|  5.34k|                break;
  270|       |
  271|  12.2k|            case OP_CONST_PREFIX:
  ------------------
  |  Branch (271:13): [True: 12.2k, False: 728k]
  ------------------
  272|  12.2k|                startOp("ConstPrefix");
  273|  12.2k|                xmlTextReaderConstPrefix(reader);
  274|  12.2k|                break;
  275|       |
  276|  6.79k|            case OP_CONST_XML_LANG:
  ------------------
  |  Branch (276:13): [True: 6.79k, False: 733k]
  ------------------
  277|  6.79k|                startOp("ConstXmlLang");
  278|  6.79k|                xmlTextReaderConstXmlLang(reader);
  279|  6.79k|                oomReport = -1;
  280|  6.79k|                break;
  281|       |
  282|  6.31k|            case OP_CONST_VALUE:
  ------------------
  |  Branch (282:13): [True: 6.31k, False: 733k]
  ------------------
  283|  6.31k|                startOp("ConstValue");
  284|  6.31k|                xmlTextReaderConstValue(reader);
  285|  6.31k|                break;
  286|       |
  287|  9.00k|            case OP_BASE_URI: {
  ------------------
  |  Branch (287:13): [True: 9.00k, False: 731k]
  ------------------
  288|  9.00k|                xmlChar *result;
  289|       |
  290|  9.00k|                startOp("BaseUri");
  291|  9.00k|                result = xmlTextReaderBaseUri(reader);
  292|  9.00k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.00k|    do { \
  |  |  156|  9.00k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.43k, False: 6.56k]
  |  |  ------------------
  |  |  157|  2.43k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.43k|            xmlFree(str); \
  |  |  159|  2.43k|        } \
  |  |  160|  9.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.00k]
  |  |  ------------------
  ------------------
  293|  9.00k|                break;
  294|  47.6k|            }
  295|       |
  296|  5.54k|            case OP_LOCAL_NAME: {
  ------------------
  |  Branch (296:13): [True: 5.54k, False: 734k]
  ------------------
  297|  5.54k|                xmlChar *result;
  298|       |
  299|  5.54k|                startOp("LocalName");
  300|  5.54k|                result = xmlTextReaderLocalName(reader);
  301|  5.54k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.54k|    do { \
  |  |  156|  5.54k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.74k, False: 1.80k]
  |  |  ------------------
  |  |  157|  3.74k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.74k|            xmlFree(str); \
  |  |  159|  3.74k|        } \
  |  |  160|  5.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.54k]
  |  |  ------------------
  ------------------
  302|  5.54k|                break;
  303|  47.6k|            }
  304|       |
  305|  6.33k|            case OP_NAME: {
  ------------------
  |  Branch (305:13): [True: 6.33k, False: 733k]
  ------------------
  306|  6.33k|                xmlChar *result;
  307|       |
  308|  6.33k|                startOp("Name");
  309|  6.33k|                result = xmlTextReaderName(reader);
  310|  6.33k|                FREE_STRING(result);
  ------------------
  |  |  155|  6.33k|    do { \
  |  |  156|  6.33k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 4.25k, False: 2.07k]
  |  |  ------------------
  |  |  157|  4.25k|            totalStringSize += strlen((char *) str); \
  |  |  158|  4.25k|            xmlFree(str); \
  |  |  159|  4.25k|        } \
  |  |  160|  6.33k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 6.33k]
  |  |  ------------------
  ------------------
  311|  6.33k|                break;
  312|  47.6k|            }
  313|       |
  314|  3.87k|            case OP_NAMESPACE_URI: {
  ------------------
  |  Branch (314:13): [True: 3.87k, False: 736k]
  ------------------
  315|  3.87k|                xmlChar *result;
  316|       |
  317|  3.87k|                startOp("NamespaceUri");
  318|  3.87k|                result = xmlTextReaderNamespaceUri(reader);
  319|  3.87k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.87k|    do { \
  |  |  156|  3.87k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 495, False: 3.37k]
  |  |  ------------------
  |  |  157|    495|            totalStringSize += strlen((char *) str); \
  |  |  158|    495|            xmlFree(str); \
  |  |  159|    495|        } \
  |  |  160|  3.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.87k]
  |  |  ------------------
  ------------------
  320|  3.87k|                break;
  321|  47.6k|            }
  322|       |
  323|  4.30k|            case OP_PREFIX: {
  ------------------
  |  Branch (323:13): [True: 4.30k, False: 735k]
  ------------------
  324|  4.30k|                xmlChar *result;
  325|       |
  326|  4.30k|                startOp("Prefix");
  327|  4.30k|                result = xmlTextReaderPrefix(reader);
  328|  4.30k|                FREE_STRING(result);
  ------------------
  |  |  155|  4.30k|    do { \
  |  |  156|  4.30k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 810, False: 3.49k]
  |  |  ------------------
  |  |  157|    810|            totalStringSize += strlen((char *) str); \
  |  |  158|    810|            xmlFree(str); \
  |  |  159|    810|        } \
  |  |  160|  4.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 4.30k]
  |  |  ------------------
  ------------------
  329|  4.30k|                break;
  330|  47.6k|            }
  331|       |
  332|  3.35k|            case OP_XML_LANG: {
  ------------------
  |  Branch (332:13): [True: 3.35k, False: 736k]
  ------------------
  333|  3.35k|                xmlChar *result;
  334|       |
  335|  3.35k|                startOp("XmlLang");
  336|  3.35k|                result = xmlTextReaderXmlLang(reader);
  337|  3.35k|                oomReport = -1;
  338|  3.35k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.35k|    do { \
  |  |  156|  3.35k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 331, False: 3.02k]
  |  |  ------------------
  |  |  157|    331|            totalStringSize += strlen((char *) str); \
  |  |  158|    331|            xmlFree(str); \
  |  |  159|    331|        } \
  |  |  160|  3.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  339|  3.35k|                break;
  340|  47.6k|            }
  341|       |
  342|  8.93k|            case OP_VALUE: {
  ------------------
  |  Branch (342:13): [True: 8.93k, False: 731k]
  ------------------
  343|  8.93k|                xmlChar *result;
  344|       |
  345|  8.93k|                startOp("Value");
  346|  8.93k|                result = xmlTextReaderValue(reader);
  347|  8.93k|                FREE_STRING(result);
  ------------------
  |  |  155|  8.93k|    do { \
  |  |  156|  8.93k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.67k, False: 6.26k]
  |  |  ------------------
  |  |  157|  2.67k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.67k|            xmlFree(str); \
  |  |  159|  2.67k|        } \
  |  |  160|  8.93k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 8.93k]
  |  |  ------------------
  ------------------
  348|  8.93k|                break;
  349|  47.6k|            }
  350|       |
  351|  1.49k|            case OP_CLOSE:
  ------------------
  |  Branch (351:13): [True: 1.49k, False: 738k]
  ------------------
  352|  1.49k|                startOp("Close");
  353|  1.49k|                if (doc == NULL)
  ------------------
  |  Branch (353:21): [True: 557, False: 940]
  ------------------
  354|    557|                    doc = xmlTextReaderCurrentDoc(reader);
  355|  1.49k|                xmlTextReaderClose(reader);
  356|  1.49k|                break;
  357|       |
  358|  5.79k|            case OP_GET_ATTRIBUTE_NO: {
  ------------------
  |  Branch (358:13): [True: 5.79k, False: 734k]
  ------------------
  359|  5.79k|                xmlChar *result;
  360|  5.79k|                int no = READ_BYTE();
  ------------------
  |  |  153|  5.79k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 5.71k, False: 81]
  |  |  ------------------
  ------------------
  361|       |
  362|  5.79k|                startOp("GetAttributeNo");
  363|  5.79k|                result = xmlTextReaderGetAttributeNo(reader, no);
  364|  5.79k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.79k|    do { \
  |  |  156|  5.79k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 448, False: 5.35k]
  |  |  ------------------
  |  |  157|    448|            totalStringSize += strlen((char *) str); \
  |  |  158|    448|            xmlFree(str); \
  |  |  159|    448|        } \
  |  |  160|  5.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.79k]
  |  |  ------------------
  ------------------
  365|  5.79k|                break;
  366|  47.6k|            }
  367|       |
  368|  28.4k|            case OP_GET_ATTRIBUTE: {
  ------------------
  |  Branch (368:13): [True: 28.4k, False: 711k]
  ------------------
  369|  28.4k|                const xmlChar *name = xmlTextReaderConstName(reader);
  370|  28.4k|                xmlChar *result;
  371|       |
  372|  28.4k|                startOp("GetAttribute");
  373|  28.4k|                result = xmlTextReaderGetAttribute(reader, name);
  374|  28.4k|                FREE_STRING(result);
  ------------------
  |  |  155|  28.4k|    do { \
  |  |  156|  28.4k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 878, False: 27.5k]
  |  |  ------------------
  |  |  157|    878|            totalStringSize += strlen((char *) str); \
  |  |  158|    878|            xmlFree(str); \
  |  |  159|    878|        } \
  |  |  160|  28.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 28.4k]
  |  |  ------------------
  ------------------
  375|  28.4k|                break;
  376|  47.6k|            }
  377|       |
  378|  24.8k|            case OP_GET_ATTRIBUTE_NS: {
  ------------------
  |  Branch (378:13): [True: 24.8k, False: 715k]
  ------------------
  379|  24.8k|                const xmlChar *localName, *namespaceUri;
  380|  24.8k|                xmlChar *result;
  381|       |
  382|  24.8k|                startOp("GetAttributeNs");
  383|  24.8k|                localName = xmlTextReaderConstLocalName(reader);
  384|  24.8k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  385|  24.8k|                result = xmlTextReaderGetAttributeNs(reader, localName,
  386|  24.8k|                                                     namespaceUri);
  387|  24.8k|                FREE_STRING(result);
  ------------------
  |  |  155|  24.8k|    do { \
  |  |  156|  24.8k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 971, False: 23.9k]
  |  |  ------------------
  |  |  157|    971|            totalStringSize += strlen((char *) str); \
  |  |  158|    971|            xmlFree(str); \
  |  |  159|    971|        } \
  |  |  160|  24.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 24.8k]
  |  |  ------------------
  ------------------
  388|  24.8k|                break;
  389|  47.6k|            }
  390|       |
  391|  4.03k|            case OP_GET_REMAINDER:
  ------------------
  |  Branch (391:13): [True: 4.03k, False: 736k]
  ------------------
  392|  4.03k|                startOp("GetRemainder");
  393|  4.03k|                if (doc == NULL)
  ------------------
  |  Branch (393:21): [True: 1.85k, False: 2.17k]
  ------------------
  394|  1.85k|                    doc = xmlTextReaderCurrentDoc(reader);
  395|  4.03k|                xmlFreeParserInputBuffer(xmlTextReaderGetRemainder(reader));
  396|  4.03k|                break;
  397|       |
  398|  8.53k|            case OP_LOOKUP_NAMESPACE: {
  ------------------
  |  Branch (398:13): [True: 8.53k, False: 731k]
  ------------------
  399|  8.53k|                const xmlChar *prefix = xmlTextReaderConstPrefix(reader);
  400|  8.53k|                xmlChar *result;
  401|       |
  402|  8.53k|                startOp("LookupNamespace");
  403|  8.53k|                result = xmlTextReaderLookupNamespace(reader, prefix);
  404|  8.53k|                FREE_STRING(result);
  ------------------
  |  |  155|  8.53k|    do { \
  |  |  156|  8.53k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 1.10k, False: 7.43k]
  |  |  ------------------
  |  |  157|  1.10k|            totalStringSize += strlen((char *) str); \
  |  |  158|  1.10k|            xmlFree(str); \
  |  |  159|  1.10k|        } \
  |  |  160|  8.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 8.53k]
  |  |  ------------------
  ------------------
  405|  8.53k|                break;
  406|  47.6k|            }
  407|       |
  408|  7.52k|            case OP_MOVE_TO_ATTRIBUTE_NO: {
  ------------------
  |  Branch (408:13): [True: 7.52k, False: 732k]
  ------------------
  409|  7.52k|                int no = READ_BYTE();
  ------------------
  |  |  153|  7.52k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.44k, False: 80]
  |  |  ------------------
  ------------------
  410|       |
  411|  7.52k|                startOp("MoveToAttributeNo");
  412|  7.52k|                xmlTextReaderMoveToAttributeNo(reader, no);
  413|  7.52k|                break;
  414|  47.6k|            }
  415|       |
  416|  11.7k|            case OP_MOVE_TO_ATTRIBUTE: {
  ------------------
  |  Branch (416:13): [True: 11.7k, False: 728k]
  ------------------
  417|  11.7k|                const xmlChar *name = xmlTextReaderConstName(reader);
  418|       |
  419|  11.7k|                startOp("MoveToAttribute");
  420|  11.7k|                xmlTextReaderMoveToAttribute(reader, name);
  421|  11.7k|                break;
  422|  47.6k|            }
  423|       |
  424|  9.43k|            case OP_MOVE_TO_ATTRIBUTE_NS: {
  ------------------
  |  Branch (424:13): [True: 9.43k, False: 730k]
  ------------------
  425|  9.43k|                const xmlChar *localName, *namespaceUri;
  426|       |
  427|  9.43k|                startOp("MoveToAttributeNs");
  428|  9.43k|                localName = xmlTextReaderConstLocalName(reader);
  429|  9.43k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  430|  9.43k|                xmlTextReaderMoveToAttributeNs(reader, localName,
  431|  9.43k|                                               namespaceUri);
  432|  9.43k|                break;
  433|  47.6k|            }
  434|       |
  435|  12.9k|            case OP_MOVE_TO_FIRST_ATTRIBUTE:
  ------------------
  |  Branch (435:13): [True: 12.9k, False: 727k]
  ------------------
  436|  12.9k|                startOp("MoveToFirstAttribute");
  437|  12.9k|                xmlTextReaderMoveToFirstAttribute(reader);
  438|  12.9k|                break;
  439|       |
  440|  8.18k|            case OP_MOVE_TO_NEXT_ATTRIBUTE:
  ------------------
  |  Branch (440:13): [True: 8.18k, False: 732k]
  ------------------
  441|  8.18k|                startOp("MoveToNextAttribute");
  442|  8.18k|                xmlTextReaderMoveToNextAttribute(reader);
  443|  8.18k|                break;
  444|       |
  445|  5.38k|            case OP_MOVE_TO_ELEMENT:
  ------------------
  |  Branch (445:13): [True: 5.38k, False: 734k]
  ------------------
  446|  5.38k|                startOp("MoveToElement");
  447|  5.38k|                xmlTextReaderMoveToElement(reader);
  448|  5.38k|                break;
  449|       |
  450|  2.05k|            case OP_NORMALIZATION:
  ------------------
  |  Branch (450:13): [True: 2.05k, False: 738k]
  ------------------
  451|  2.05k|                startOp("Normalization");
  452|  2.05k|                xmlTextReaderNormalization(reader);
  453|  2.05k|                break;
  454|       |
  455|  3.87k|            case OP_CONST_ENCODING:
  ------------------
  |  Branch (455:13): [True: 3.87k, False: 736k]
  ------------------
  456|  3.87k|                startOp("ConstEncoding");
  457|  3.87k|                xmlTextReaderConstEncoding(reader);
  458|  3.87k|                break;
  459|       |
  460|  7.95k|            case OP_GET_PARSER_PROP: {
  ------------------
  |  Branch (460:13): [True: 7.95k, False: 732k]
  ------------------
  461|  7.95k|                int prop = READ_BYTE();
  ------------------
  |  |  153|  7.95k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.74k, False: 214]
  |  |  ------------------
  ------------------
  462|       |
  463|  7.95k|                startOp("GetParserProp");
  464|  7.95k|                xmlTextReaderGetParserProp(reader, prop);
  465|  7.95k|                break;
  466|  47.6k|            }
  467|       |
  468|  12.0k|            case OP_CURRENT_NODE:
  ------------------
  |  Branch (468:13): [True: 12.0k, False: 728k]
  ------------------
  469|  12.0k|                startOp("CurrentNode");
  470|  12.0k|                xmlTextReaderCurrentNode(reader);
  471|  12.0k|                break;
  472|       |
  473|  5.41k|            case OP_GET_PARSER_LINE_NUMBER:
  ------------------
  |  Branch (473:13): [True: 5.41k, False: 734k]
  ------------------
  474|  5.41k|                startOp("GetParserLineNumber");
  475|  5.41k|                xmlTextReaderGetParserLineNumber(reader);
  476|  5.41k|                break;
  477|       |
  478|  9.33k|            case OP_GET_PARSER_COLUMN_NUMBER:
  ------------------
  |  Branch (478:13): [True: 9.33k, False: 730k]
  ------------------
  479|  9.33k|                startOp("GetParserColumnNumber");
  480|  9.33k|                xmlTextReaderGetParserColumnNumber(reader);
  481|  9.33k|                break;
  482|       |
  483|  7.78k|            case OP_PRESERVE:
  ------------------
  |  Branch (483:13): [True: 7.78k, False: 732k]
  ------------------
  484|  7.78k|                startOp("Preserve");
  485|  7.78k|                xmlTextReaderPreserve(reader);
  486|  7.78k|                break;
  487|       |
  488|  6.47k|            case OP_CURRENT_DOC: {
  ------------------
  |  Branch (488:13): [True: 6.47k, False: 733k]
  ------------------
  489|  6.47k|                xmlDocPtr result;
  490|       |
  491|  6.47k|                startOp("CurrentDoc");
  492|  6.47k|                result = xmlTextReaderCurrentDoc(reader);
  493|  6.47k|                if (doc == NULL)
  ------------------
  |  Branch (493:21): [True: 2.66k, False: 3.81k]
  ------------------
  494|  2.66k|                    doc = result;
  495|  6.47k|                break;
  496|  47.6k|            }
  497|       |
  498|  8.19k|            case OP_EXPAND:
  ------------------
  |  Branch (498:13): [True: 8.19k, False: 732k]
  ------------------
  499|  8.19k|                startOp("Expand");
  500|  8.19k|                xmlTextReaderExpand(reader);
  501|  8.19k|                break;
  502|       |
  503|  19.9k|            case OP_NEXT:
  ------------------
  |  Branch (503:13): [True: 19.9k, False: 720k]
  ------------------
  504|  19.9k|                startOp("Next");
  505|  19.9k|                xmlTextReaderNext(reader);
  506|  19.9k|                break;
  507|       |
  508|  7.56k|            case OP_NEXT_SIBLING:
  ------------------
  |  Branch (508:13): [True: 7.56k, False: 732k]
  ------------------
  509|  7.56k|                startOp("NextSibling");
  510|  7.56k|                xmlTextReaderNextSibling(reader);
  511|  7.56k|                break;
  512|       |
  513|  3.54k|            case OP_IS_VALID:
  ------------------
  |  Branch (513:13): [True: 3.54k, False: 736k]
  ------------------
  514|  3.54k|                startOp("IsValid");
  515|  3.54k|                xmlTextReaderIsValid(reader);
  516|  3.54k|                break;
  517|       |
  518|  4.04k|            case OP_CONST_XML_VERSION:
  ------------------
  |  Branch (518:13): [True: 4.04k, False: 736k]
  ------------------
  519|  4.04k|                startOp("ConstXmlVersion");
  520|  4.04k|                xmlTextReaderConstXmlVersion(reader);
  521|  4.04k|                break;
  522|       |
  523|  4.10k|            case OP_STANDALONE:
  ------------------
  |  Branch (523:13): [True: 4.10k, False: 736k]
  ------------------
  524|  4.10k|                startOp("Standalone");
  525|  4.10k|                xmlTextReaderStandalone(reader);
  526|  4.10k|                break;
  527|       |
  528|  5.89k|            case OP_BYTE_CONSUMED:
  ------------------
  |  Branch (528:13): [True: 5.89k, False: 734k]
  ------------------
  529|  5.89k|                startOp("ByteConsumed");
  530|  5.89k|                xmlTextReaderByteConsumed(reader);
  531|  5.89k|                oomReport = -1;
  532|  5.89k|                break;
  533|   740k|        }
  534|       |
  535|   740k|        if (totalStringSize > docSize * 2)
  ------------------
  |  Branch (535:13): [True: 1.18k, False: 739k]
  ------------------
  536|  1.18k|            break;
  537|   740k|    }
  538|       |
  539|  35.5k|    error = xmlTextReaderGetLastError(reader);
  540|  35.5k|    if (error->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (540:9): [True: 8.71k, False: 26.8k]
  ------------------
  541|  8.71k|        oomReport = 1;
  542|  35.5k|    xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
  543|       |
  544|  35.5k|    xmlFreeTextReader(reader);
  545|       |
  546|  35.5k|    if (doc != NULL)
  ------------------
  |  Branch (546:9): [True: 3.44k, False: 32.1k]
  ------------------
  547|  3.44k|        xmlFreeDoc(doc);
  548|       |
  549|  35.7k|exit:
  550|  35.7k|    xmlFuzzInjectFailure(0);
  551|  35.7k|    xmlFuzzDataCleanup();
  552|  35.7k|    xmlResetLastError();
  553|  35.7k|    return(0);
  554|  35.5k|}
reader.c:startOp:
   83|   740k|startOp(const char *name) {
   84|   740k|    (void) name;
   85|       |#ifdef DEBUG
   86|       |    fprintf(stderr, "%s\n", name);
   87|       |#endif
   88|   740k|}

xmlInitGlobalsInternal:
  357|      2|void xmlInitGlobalsInternal(void) {
  358|      2|    xmlInitMutex(&xmlThrDefMutex);
  359|       |
  360|      2|#ifdef HAVE_POSIX_THREADS
  361|      2|    pthread_key_create(&globalkey, xmlFreeGlobalState);
  362|       |#elif defined(HAVE_WIN32_THREADS)
  363|       |#ifndef USE_TLS
  364|       |    if (globalkey == TLS_OUT_OF_INDEXES)
  365|       |        globalkey = TlsAlloc();
  366|       |#endif
  367|       |#else /* no thread support */
  368|       |    xmlInitGlobalState(&globalState);
  369|       |#endif
  370|      2|}
__xmlDoValidityCheckingDefaultValue:
  633|  44.0k|__xmlDoValidityCheckingDefaultValue(void) {
  634|  44.0k|    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
  635|  44.0k|}
__xmlGetWarningsDefaultValue:
  638|   663k|__xmlGetWarningsDefaultValue(void) {
  639|   663k|    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
  640|   663k|}
__xmlKeepBlanksDefaultValue:
  643|  44.0k|__xmlKeepBlanksDefaultValue(void) {
  644|  44.0k|    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
  645|  44.0k|}
__xmlLoadExtDtdDefaultValue:
  653|  44.0k|__xmlLoadExtDtdDefaultValue(void) {
  654|  44.0k|    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
  655|  44.0k|}
__xmlPedanticParserDefaultValue:
  658|  44.0k|__xmlPedanticParserDefaultValue(void) {
  659|  44.0k|    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
  660|  44.0k|}
__xmlSubstituteEntitiesDefaultValue:
  663|  44.0k|__xmlSubstituteEntitiesDefaultValue(void) {
  664|  44.0k|    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
  665|  44.0k|}
__xmlTreeIndentString:
  674|  32.3k|__xmlTreeIndentString(void) {
  675|  32.3k|    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
  676|  32.3k|}
__xmlSaveNoEmptyTags:
  679|  32.3k|__xmlSaveNoEmptyTags(void) {
  680|  32.3k|    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
  681|  32.3k|}
__xmlStructuredError:
  695|   384k|__xmlStructuredError(void) {
  696|   384k|    return(&xmlGetThreadLocalStorage(0)->structuredError);
  697|   384k|}
xmlGetLocalRngState:
  755|   113k|xmlGetLocalRngState(void) {
  756|   113k|    return(xmlGetThreadLocalStorage(0)->localRngState);
  757|   113k|}
xmlGetLastErrorInternal:
  785|   690k|xmlGetLastErrorInternal(void) {
  786|   690k|    return(&xmlGetThreadLocalStorage(0)->lastError);
  787|   690k|}
globals.c:xmlPosixStrdup:
  200|   465k|xmlPosixStrdup(const char *cur) {
  201|   465k|    return((char*) xmlCharStrdup(cur));
  202|   465k|}
globals.c:xmlGetThreadLocalStorage:
  525|  2.13M|xmlGetThreadLocalStorage(int allowFailure) {
  526|  2.13M|    xmlGlobalState *gs;
  527|       |
  528|  2.13M|    (void) allowFailure;
  529|       |
  530|  2.13M|    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.13M|    if (gs == NULL)
  ------------------
  |  Branch (538:9): [True: 1, False: 2.13M]
  ------------------
  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.13M|    return(gs);
  549|  2.13M|}
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|  69.4k|xmlHashCreate(int size) {
  159|  69.4k|    xmlHashTablePtr hash;
  160|       |
  161|  69.4k|    xmlInitParser();
  162|       |
  163|  69.4k|    hash = xmlMalloc(sizeof(*hash));
  164|  69.4k|    if (hash == NULL)
  ------------------
  |  Branch (164:9): [True: 22, False: 69.4k]
  ------------------
  165|     22|        return(NULL);
  166|  69.4k|    hash->dict = NULL;
  167|  69.4k|    hash->size = 0;
  168|  69.4k|    hash->table = NULL;
  169|  69.4k|    hash->nbElems = 0;
  170|  69.4k|    hash->randomSeed = xmlRandom();
  171|  69.4k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  172|  69.4k|    hash->randomSeed = 0;
  173|  69.4k|#endif
  174|       |
  175|       |    /*
  176|       |     * Unless a larger size is passed, the backing table is created
  177|       |     * lazily with MIN_HASH_SIZE capacity. In practice, there are many
  178|       |     * hash tables which are never filled.
  179|       |     */
  180|  69.4k|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|  69.4k|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (180:9): [True: 5.95k, False: 63.5k]
  ------------------
  181|  5.95k|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|  5.95k|#define MIN_HASH_SIZE 8
  ------------------
  182|       |
  183|  5.98k|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|     35|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (183:16): [True: 35, False: 5.95k]
  |  Branch (183:47): [True: 35, False: 0]
  ------------------
  184|     35|            newSize *= 2;
  185|       |
  186|  5.95k|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (186:13): [True: 3, False: 5.95k]
  ------------------
  187|      3|            xmlFree(hash);
  188|      3|            return(NULL);
  189|      3|        }
  190|  5.95k|    }
  191|       |
  192|  69.4k|    return(hash);
  193|  69.4k|}
xmlHashCreateDict:
  205|  25.4k|xmlHashCreateDict(int size, xmlDict *dict) {
  206|  25.4k|    xmlHashTablePtr hash;
  207|       |
  208|  25.4k|    hash = xmlHashCreate(size);
  209|  25.4k|    if (hash != NULL) {
  ------------------
  |  Branch (209:9): [True: 25.4k, False: 11]
  ------------------
  210|  25.4k|        hash->dict = dict;
  211|  25.4k|        xmlDictReference(dict);
  212|  25.4k|    }
  213|  25.4k|    return(hash);
  214|  25.4k|}
xmlHashFree:
  224|  88.0k|xmlHashFree(xmlHashTable *hash, xmlHashDeallocator dealloc) {
  225|  88.0k|    if (hash == NULL)
  ------------------
  |  Branch (225:9): [True: 18.5k, False: 69.4k]
  ------------------
  226|  18.5k|        return;
  227|       |
  228|  69.4k|    if (hash->table) {
  ------------------
  |  Branch (228:9): [True: 69.1k, False: 281]
  ------------------
  229|  69.1k|        const xmlHashEntry *end = &hash->table[hash->size];
  230|  69.1k|        const xmlHashEntry *entry;
  231|       |
  232|   731k|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (232:35): [True: 662k, False: 69.1k]
  ------------------
  233|   662k|            if (entry->hashValue == 0)
  ------------------
  |  Branch (233:17): [True: 521k, False: 140k]
  ------------------
  234|   521k|                continue;
  235|   140k|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (235:17): [True: 123k, False: 16.2k]
  |  Branch (235:38): [True: 123k, False: 0]
  ------------------
  236|   123k|                dealloc(entry->payload, entry->key);
  237|   140k|            if (hash->dict == NULL) {
  ------------------
  |  Branch (237:17): [True: 87.3k, False: 52.8k]
  ------------------
  238|  87.3k|                if (entry->key)
  ------------------
  |  Branch (238:21): [True: 87.3k, False: 0]
  ------------------
  239|  87.3k|                    xmlFree(entry->key);
  240|  87.3k|                if (entry->key2)
  ------------------
  |  Branch (240:21): [True: 6.58k, False: 80.7k]
  ------------------
  241|  6.58k|                    xmlFree(entry->key2);
  242|  87.3k|                if (entry->key3)
  ------------------
  |  Branch (242:21): [True: 16.1k, False: 71.1k]
  ------------------
  243|  16.1k|                    xmlFree(entry->key3);
  244|  87.3k|            }
  245|   140k|        }
  246|       |
  247|  69.1k|        xmlFree(hash->table);
  248|  69.1k|    }
  249|       |
  250|  69.4k|    if (hash->dict)
  ------------------
  |  Branch (250:9): [True: 17.0k, False: 52.4k]
  ------------------
  251|  17.0k|        xmlDictFree(hash->dict);
  252|       |
  253|  69.4k|    xmlFree(hash);
  254|  69.4k|}
xmlHashDefaultDeallocator:
  592|  51.9k|xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
  593|  51.9k|    xmlFree(entry);
  594|  51.9k|}
xmlHashAdd:
  610|   119k|xmlHashAdd(xmlHashTable *hash, const xmlChar *key, void *payload) {
  611|   119k|    return(xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0));
  612|   119k|}
xmlHashAdd2:
  629|  51.0k|                 const xmlChar *key2, void *payload) {
  630|  51.0k|    return(xmlHashUpdateInternal(hash, key, key2, NULL, payload, NULL, 0));
  631|  51.0k|}
xmlHashAdd3:
  650|  61.5k|                 void *payload) {
  651|       |    return(xmlHashUpdateInternal(hash, key, key2, key3, payload, NULL, 0));
  652|  61.5k|}
xmlHashAddEntry:
  669|  51.6k|xmlHashAddEntry(xmlHashTable *hash, const xmlChar *key, void *payload) {
  670|  51.6k|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0);
  671|       |
  672|  51.6k|    if (res == 0)
  ------------------
  |  Branch (672:9): [True: 0, False: 51.6k]
  ------------------
  673|      0|        res = -1;
  674|  51.6k|    else if (res == 1)
  ------------------
  |  Branch (674:14): [True: 51.6k, False: 4]
  ------------------
  675|  51.6k|        res = 0;
  676|       |
  677|  51.6k|    return(res);
  678|  51.6k|}
xmlHashUpdateEntry:
  742|    472|                   void *payload, xmlHashDeallocator dealloc) {
  743|    472|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload,
  744|    472|                                    dealloc, 1);
  745|       |
  746|    472|    if (res == 1)
  ------------------
  |  Branch (746:9): [True: 44, False: 428]
  ------------------
  747|     44|        res = 0;
  748|       |
  749|    472|    return(res);
  750|    472|}
xmlHashUpdateEntry2:
  767|  3.45k|                   xmlHashDeallocator dealloc) {
  768|  3.45k|    int res = xmlHashUpdateInternal(hash, key, key2, NULL, payload,
  769|  3.45k|                                    dealloc, 1);
  770|       |
  771|  3.45k|    if (res == 1)
  ------------------
  |  Branch (771:9): [True: 2.83k, False: 627]
  ------------------
  772|  2.83k|        res = 0;
  773|       |
  774|  3.45k|    return(res);
  775|  3.45k|}
xmlHashLookup:
  811|  3.02M|xmlHashLookup(xmlHashTable *hash, const xmlChar *key) {
  812|  3.02M|    return(xmlHashLookup3(hash, key, NULL, NULL));
  813|  3.02M|}
xmlHashLookup2:
  825|   745k|              const xmlChar *key2) {
  826|       |    return(xmlHashLookup3(hash, key, key2, NULL));
  827|   745k|}
xmlHashQLookup2:
  856|  32.5k|                const xmlChar *name2) {
  857|  32.5k|    return(xmlHashQLookup3(hash, prefix, name, prefix2, name2, NULL, NULL));
  858|  32.5k|}
xmlHashLookup3:
  871|  4.13M|               const xmlChar *key2, const xmlChar *key3) {
  872|  4.13M|    const xmlHashEntry *entry;
  873|  4.13M|    unsigned hashValue;
  874|  4.13M|    int found;
  875|       |
  876|  4.13M|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (876:9): [True: 11.6k, False: 4.12M]
  |  Branch (876:27): [True: 47.0k, False: 4.07M]
  |  Branch (876:48): [True: 11, False: 4.07M]
  ------------------
  877|  58.7k|        return(NULL);
  878|  4.07M|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
  879|  4.07M|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  880|  4.07M|    if (found)
  ------------------
  |  Branch (880:9): [True: 3.21M, False: 865k]
  ------------------
  881|  3.21M|        return(entry->payload);
  882|   865k|    return(NULL);
  883|  4.07M|}
xmlHashQLookup3:
  902|  32.5k|                const xmlChar *prefix3, const xmlChar *name3) {
  903|  32.5k|    const xmlHashEntry *entry;
  904|  32.5k|    unsigned hashValue, mask, pos, displ;
  905|       |
  906|  32.5k|    if ((hash == NULL) || (hash->size == 0) || (name == NULL))
  ------------------
  |  Branch (906:9): [True: 0, False: 32.5k]
  |  Branch (906:27): [True: 0, False: 32.5k]
  |  Branch (906:48): [True: 0, False: 32.5k]
  ------------------
  907|      0|        return(NULL);
  908|       |
  909|  32.5k|    hashValue = xmlHashQNameValue(hash->randomSeed, prefix, name, prefix2,
  910|  32.5k|                                  name2, prefix3, name3);
  911|  32.5k|    mask = hash->size - 1;
  912|  32.5k|    pos = hashValue & mask;
  913|  32.5k|    entry = &hash->table[pos];
  914|       |
  915|  32.5k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (915:9): [True: 7.60k, False: 24.9k]
  ------------------
  916|  7.60k|        displ = 0;
  917|  7.60k|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  7.60k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  918|       |
  919|  8.88k|        do {
  920|  8.88k|            if ((hashValue == entry->hashValue) &&
  ------------------
  |  Branch (920:17): [True: 4.14k, False: 4.73k]
  ------------------
  921|  4.14k|                (xmlStrQEqual(prefix, name, entry->key)) &&
  ------------------
  |  Branch (921:17): [True: 4.14k, False: 0]
  ------------------
  922|  4.14k|                (xmlStrQEqual(prefix2, name2, entry->key2)) &&
  ------------------
  |  Branch (922:17): [True: 4.14k, False: 0]
  ------------------
  923|  4.14k|                (xmlStrQEqual(prefix3, name3, entry->key3)))
  ------------------
  |  Branch (923:17): [True: 4.14k, False: 0]
  ------------------
  924|  4.14k|                return(entry->payload);
  925|       |
  926|  4.73k|            displ++;
  927|  4.73k|            pos++;
  928|  4.73k|            entry++;
  929|  4.73k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (929:17): [True: 562, False: 4.17k]
  ------------------
  930|    562|                entry = hash->table;
  931|  4.73k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (931:18): [True: 2.13k, False: 2.60k]
  ------------------
  932|  2.13k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (932:18): [True: 1.28k, False: 849]
  ------------------
  933|  7.60k|    }
  934|       |
  935|  28.4k|    return(NULL);
  936|  32.5k|}
xmlHashScan:
  959|  6.80k|xmlHashScan(xmlHashTable *hash, xmlHashScanner scan, void *data) {
  960|  6.80k|    stubData sdata;
  961|  6.80k|    sdata.data = data;
  962|  6.80k|    sdata.scan = scan;
  963|  6.80k|    xmlHashScanFull(hash, stubHashScannerFull, &sdata);
  964|  6.80k|}
xmlHashScanFull:
  974|  9.87k|xmlHashScanFull(xmlHashTable *hash, xmlHashScannerFull scan, void *data) {
  975|  9.87k|    const xmlHashEntry *entry, *end;
  976|  9.87k|    xmlHashEntry old;
  977|  9.87k|    unsigned i;
  978|       |
  979|  9.87k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (979:9): [True: 377, False: 9.49k]
  |  Branch (979:27): [True: 0, False: 9.49k]
  |  Branch (979:48): [True: 0, False: 9.49k]
  ------------------
  980|    377|        return;
  981|       |
  982|       |    /*
  983|       |     * We must handle the case that a scanned entry is removed when executing
  984|       |     * the callback (xmlCleanSpecialAttr and possibly other places).
  985|       |     *
  986|       |     * Find the start of a probe sequence to avoid scanning entries twice if
  987|       |     * a deletion happens.
  988|       |     */
  989|  9.49k|    entry = hash->table;
  990|  9.49k|    end = &hash->table[hash->size];
  991|  12.6k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (991:12): [True: 3.12k, False: 9.49k]
  ------------------
  992|  3.12k|        if (++entry >= end)
  ------------------
  |  Branch (992:13): [True: 0, False: 3.12k]
  ------------------
  993|      0|            entry = hash->table;
  994|  3.12k|    }
  995|       |
  996|   138k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (996:17): [True: 128k, False: 9.49k]
  ------------------
  997|   128k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (997:13): [True: 31.8k, False: 96.8k]
  |  Branch (997:40): [True: 31.8k, False: 0]
  ------------------
  998|       |            /*
  999|       |             * Make sure to rescan after a possible deletion.
 1000|       |             */
 1001|  32.3k|            do {
 1002|  32.3k|                old = *entry;
 1003|  32.3k|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1004|  32.3k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1004:22): [True: 31.1k, False: 1.17k]
  ------------------
 1005|  31.1k|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1005:22): [True: 31.1k, False: 0]
  ------------------
 1006|  31.1k|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1006:23): [True: 455, False: 30.7k]
  ------------------
 1007|  30.7k|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1007:23): [True: 43, False: 30.6k]
  ------------------
 1008|  30.6k|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1008:23): [True: 0, False: 30.6k]
  ------------------
 1009|  31.8k|        }
 1010|   128k|        if (++entry >= end)
  ------------------
  |  Branch (1010:13): [True: 9.49k, False: 119k]
  ------------------
 1011|  9.49k|            entry = hash->table;
 1012|   128k|    }
 1013|  9.49k|}
xmlHashScan3:
 1030|    652|             xmlHashScanner scan, void *data) {
 1031|    652|    stubData sdata;
 1032|    652|    sdata.data = data;
 1033|    652|    sdata.scan = scan;
 1034|    652|    xmlHashScanFull3(hash, key, key2, key3, stubHashScannerFull, &sdata);
 1035|    652|}
xmlHashScanFull3:
 1052|    652|                 xmlHashScannerFull scan, void *data) {
 1053|    652|    const xmlHashEntry *entry, *end;
 1054|    652|    xmlHashEntry old;
 1055|    652|    unsigned i;
 1056|       |
 1057|    652|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (1057:9): [True: 233, False: 419]
  |  Branch (1057:27): [True: 0, False: 419]
  |  Branch (1057:48): [True: 0, False: 419]
  ------------------
 1058|    233|        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|    419|    entry = hash->table;
 1068|    419|    end = &hash->table[hash->size];
 1069|    608|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (1069:12): [True: 189, False: 419]
  ------------------
 1070|    189|        if (++entry >= end)
  ------------------
  |  Branch (1070:13): [True: 0, False: 189]
  ------------------
 1071|      0|            entry = hash->table;
 1072|    189|    }
 1073|       |
 1074|   224k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (1074:17): [True: 223k, False: 419]
  ------------------
 1075|   223k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (1075:13): [True: 113k, False: 110k]
  |  Branch (1075:40): [True: 113k, False: 0]
  ------------------
 1076|       |            /*
 1077|       |             * Make sure to rescan after a possible deletion.
 1078|       |             */
 1079|   113k|            do {
 1080|   113k|                if (((key != NULL) && (strcmp((const char *) key,
  ------------------
  |  Branch (1080:22): [True: 0, False: 113k]
  |  Branch (1080:39): [True: 0, False: 0]
  ------------------
 1081|      0|                                              (const char *) entry->key) != 0)) ||
 1082|   113k|                    ((key2 != NULL) && (!xmlFastStrEqual(key2, entry->key2))) ||
  ------------------
  |  Branch (1082:22): [True: 0, False: 113k]
  |  Branch (1082:40): [True: 0, False: 0]
  ------------------
 1083|   113k|                    ((key3 != NULL) && (!xmlFastStrEqual(key3, entry->key3))))
  ------------------
  |  Branch (1083:22): [True: 113k, False: 0]
  |  Branch (1083:40): [True: 113k, False: 60]
  ------------------
 1084|   113k|                    break;
 1085|     60|                old = *entry;
 1086|     60|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1087|     60|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1087:22): [True: 60, False: 0]
  ------------------
 1088|     60|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1088:22): [True: 60, False: 0]
  ------------------
 1089|     60|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1089:23): [True: 0, False: 60]
  ------------------
 1090|     60|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1090:23): [True: 0, False: 60]
  ------------------
 1091|     60|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1091:23): [True: 0, False: 60]
  ------------------
 1092|   113k|        }
 1093|   223k|        if (++entry >= end)
  ------------------
  |  Branch (1093:13): [True: 419, False: 223k]
  ------------------
 1094|    419|            entry = hash->table;
 1095|   223k|    }
 1096|    419|}
xmlHashCopySafe:
 1111|  7.02k|                xmlHashDeallocator deallocFunc) {
 1112|  7.02k|    const xmlHashEntry *entry, *end;
 1113|  7.02k|    xmlHashTablePtr ret;
 1114|       |
 1115|  7.02k|    if ((hash == NULL) || (copyFunc == NULL))
  ------------------
  |  Branch (1115:9): [True: 0, False: 7.02k]
  |  Branch (1115:27): [True: 0, False: 7.02k]
  ------------------
 1116|      0|        return(NULL);
 1117|       |
 1118|  7.02k|    ret = xmlHashCreate(hash->size);
 1119|  7.02k|    if (ret == NULL)
  ------------------
  |  Branch (1119:9): [True: 8, False: 7.02k]
  ------------------
 1120|      8|        return(NULL);
 1121|       |
 1122|  7.02k|    if (hash->size == 0)
  ------------------
  |  Branch (1122:9): [True: 0, False: 7.02k]
  ------------------
 1123|      0|        return(ret);
 1124|       |
 1125|  7.02k|    end = &hash->table[hash->size];
 1126|       |
 1127|  66.1k|    for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (1127:31): [True: 59.2k, False: 6.88k]
  ------------------
 1128|  59.2k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (1128:13): [True: 14.1k, False: 45.1k]
  ------------------
 1129|  14.1k|            void *copy;
 1130|       |
 1131|  14.1k|            copy = copyFunc(entry->payload, entry->key);
 1132|  14.1k|            if (copy == NULL)
  ------------------
  |  Branch (1132:17): [True: 102, False: 14.0k]
  ------------------
 1133|    102|                goto error;
 1134|  14.0k|            if (xmlHashAdd3(ret, entry->key, entry->key2, entry->key3,
  ------------------
  |  Branch (1134:17): [True: 32, False: 14.0k]
  ------------------
 1135|  14.0k|                            copy) <= 0) {
 1136|     32|                if (deallocFunc != NULL)
  ------------------
  |  Branch (1136:21): [True: 32, False: 0]
  ------------------
 1137|     32|                    deallocFunc(copy, entry->key);
 1138|     32|                goto error;
 1139|     32|            }
 1140|  14.0k|        }
 1141|  59.2k|    }
 1142|       |
 1143|  6.88k|    return(ret);
 1144|       |
 1145|    134|error:
 1146|    134|    xmlHashFree(ret, deallocFunc);
 1147|       |    return(NULL);
 1148|  7.02k|}
xmlHashSize:
 1173|  3.06k|xmlHashSize(xmlHashTable *hash) {
 1174|  3.06k|    if (hash == NULL)
  ------------------
  |  Branch (1174:9): [True: 0, False: 3.06k]
  ------------------
 1175|      0|        return(-1);
 1176|  3.06k|    return(hash->nbElems);
 1177|  3.06k|}
xmlHashRemoveEntry:
 1189|  1.88k|                       xmlHashDeallocator dealloc) {
 1190|  1.88k|    return(xmlHashRemoveEntry3(hash, key, NULL, NULL, dealloc));
 1191|  1.88k|}
xmlHashRemoveEntry2:
 1206|  1.86k|                    const xmlChar *key2, xmlHashDeallocator dealloc) {
 1207|       |    return(xmlHashRemoveEntry3(hash, key, key2, NULL, dealloc));
 1208|  1.86k|}
xmlHashRemoveEntry3:
 1226|  3.74k|                    xmlHashDeallocator dealloc) {
 1227|  3.74k|    xmlHashEntry *entry, *cur, *next;
 1228|  3.74k|    unsigned hashValue, mask, pos, nextpos;
 1229|  3.74k|    int found;
 1230|       |
 1231|  3.74k|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (1231:9): [True: 0, False: 3.74k]
  |  Branch (1231:27): [True: 0, False: 3.74k]
  |  Branch (1231:48): [True: 0, False: 3.74k]
  ------------------
 1232|      0|        return(-1);
 1233|       |
 1234|  3.74k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
 1235|  3.74k|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
 1236|  3.74k|    if (!found)
  ------------------
  |  Branch (1236:9): [True: 0, False: 3.74k]
  ------------------
 1237|      0|        return(-1);
 1238|       |
 1239|  3.74k|    if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (1239:9): [True: 1.88k, False: 1.86k]
  |  Branch (1239:30): [True: 1.88k, False: 0]
  ------------------
 1240|  1.88k|        dealloc(entry->payload, entry->key);
 1241|  3.74k|    if (hash->dict == NULL) {
  ------------------
  |  Branch (1241:9): [True: 1.96k, False: 1.77k]
  ------------------
 1242|  1.96k|        if (entry->key)
  ------------------
  |  Branch (1242:13): [True: 1.96k, False: 0]
  ------------------
 1243|  1.96k|            xmlFree(entry->key);
 1244|  1.96k|        if (entry->key2)
  ------------------
  |  Branch (1244:13): [True: 9, False: 1.95k]
  ------------------
 1245|      9|            xmlFree(entry->key2);
 1246|  1.96k|        if (entry->key3)
  ------------------
  |  Branch (1246:13): [True: 0, False: 1.96k]
  ------------------
 1247|      0|            xmlFree(entry->key3);
 1248|  1.96k|    }
 1249|       |
 1250|       |    /*
 1251|       |     * Find end of probe sequence. Entries at their initial probe
 1252|       |     * position start a new sequence.
 1253|       |     */
 1254|  3.74k|    mask = hash->size - 1;
 1255|  3.74k|    pos = entry - hash->table;
 1256|  3.74k|    cur = entry;
 1257|       |
 1258|  6.80k|    while (1) {
  ------------------
  |  Branch (1258:12): [True: 6.80k, Folded]
  ------------------
 1259|  6.80k|        nextpos = pos + 1;
 1260|  6.80k|        next = cur + 1;
 1261|  6.80k|        if ((nextpos & mask) == 0)
  ------------------
  |  Branch (1261:13): [True: 583, False: 6.22k]
  ------------------
 1262|    583|            next = hash->table;
 1263|       |
 1264|  6.80k|        if ((next->hashValue == 0) ||
  ------------------
  |  Branch (1264:13): [True: 2.59k, False: 4.20k]
  ------------------
 1265|  4.20k|            (((next->hashValue - nextpos) & mask) == 0))
  ------------------
  |  Branch (1265:13): [True: 1.15k, False: 3.05k]
  ------------------
 1266|  3.74k|            break;
 1267|       |
 1268|  3.05k|        cur = next;
 1269|  3.05k|        pos = nextpos;
 1270|  3.05k|    }
 1271|       |
 1272|       |    /*
 1273|       |     * Backward shift
 1274|       |     */
 1275|  3.74k|    next = entry + 1;
 1276|       |
 1277|  3.74k|    if (cur < entry) {
  ------------------
  |  Branch (1277:9): [True: 259, False: 3.48k]
  ------------------
 1278|    259|        xmlHashEntry *end = &hash->table[hash->size];
 1279|       |
 1280|    259|        memmove(entry, next, (char *) end - (char *) next);
 1281|    259|        entry = hash->table;
 1282|    259|        end[-1] = *entry;
 1283|    259|        next = entry + 1;
 1284|    259|    }
 1285|       |
 1286|  3.74k|    memmove(entry, next, (char *) cur - (char *) entry);
 1287|       |
 1288|       |    /*
 1289|       |     * Update entry
 1290|       |     */
 1291|  3.74k|    cur->hashValue = 0;
 1292|       |
 1293|  3.74k|    hash->nbElems--;
 1294|       |
 1295|  3.74k|    return(0);
 1296|  3.74k|}
hash.c:xmlHashGrow:
  345|  71.2k|xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
  346|  71.2k|    const xmlHashEntry *oldentry, *oldend, *end;
  347|  71.2k|    xmlHashEntry *table;
  348|  71.2k|    unsigned oldsize, i;
  349|       |
  350|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  351|  71.2k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (351:9): [True: 0, False: 71.2k]
  ------------------
  352|      0|        return(-1);
  353|  71.2k|    table = xmlMalloc(size * sizeof(table[0]));
  354|  71.2k|    if (table == NULL)
  ------------------
  |  Branch (354:9): [True: 25, False: 71.1k]
  ------------------
  355|     25|        return(-1);
  356|  71.1k|    memset(table, 0, size * sizeof(table[0]));
  357|       |
  358|  71.1k|    oldsize = hash->size;
  359|  71.1k|    if (oldsize == 0)
  ------------------
  |  Branch (359:9): [True: 69.1k, False: 2.01k]
  ------------------
  360|  69.1k|        goto done;
  361|       |
  362|  2.01k|    oldend = &hash->table[oldsize];
  363|  2.01k|    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.01k|    oldentry = hash->table;
  373|  12.9k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (373:12): [True: 10.8k, False: 2.01k]
  ------------------
  374|  10.8k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (374:13): [True: 0, False: 10.8k]
  ------------------
  375|      0|            oldentry = hash->table;
  376|  10.8k|    }
  377|       |
  378|  62.5k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (378:17): [True: 60.5k, False: 2.01k]
  ------------------
  379|  60.5k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (379:13): [True: 52.9k, False: 7.56k]
  ------------------
  380|  52.9k|            xmlHashEntry *entry = &table[oldentry->hashValue & (size - 1)];
  381|       |
  382|  72.2k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (382:20): [True: 19.3k, False: 52.9k]
  ------------------
  383|  19.3k|                if (++entry >= end)
  ------------------
  |  Branch (383:21): [True: 315, False: 19.0k]
  ------------------
  384|    315|                    entry = table;
  385|  19.3k|            }
  386|  52.9k|            *entry = *oldentry;
  387|  52.9k|        }
  388|       |
  389|  60.5k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (389:13): [True: 2.01k, False: 58.4k]
  ------------------
  390|  2.01k|            oldentry = hash->table;
  391|  60.5k|    }
  392|       |
  393|  2.01k|    xmlFree(hash->table);
  394|       |
  395|  71.1k|done:
  396|  71.1k|    hash->table = table;
  397|  71.1k|    hash->size = size;
  398|       |
  399|  71.1k|    return(0);
  400|  2.01k|}
hash.c:xmlHashUpdateInternal:
  417|   287k|                      void *payload, xmlHashDeallocator dealloc, int update) {
  418|   287k|    xmlChar *copy, *copy2, *copy3;
  419|   287k|    xmlHashEntry *entry = NULL;
  420|   287k|    size_t lengths[3] = {0, 0, 0};
  421|   287k|    unsigned hashValue, newSize;
  422|       |
  423|   287k|    if ((hash == NULL) || (key == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 287k]
  |  Branch (423:27): [True: 0, False: 287k]
  ------------------
  424|      0|        return(-1);
  425|       |
  426|   287k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
  427|       |
  428|       |    /*
  429|       |     * Check for an existing entry
  430|       |     */
  431|   287k|    if (hash->size == 0) {
  ------------------
  |  Branch (431:9): [True: 63.2k, False: 224k]
  ------------------
  432|  63.2k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   30|  63.2k|#define MIN_HASH_SIZE 8
  ------------------
  433|   224k|    } else {
  434|   224k|        int found = 0;
  435|       |
  436|   224k|        entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  437|       |
  438|   224k|        if (found) {
  ------------------
  |  Branch (438:13): [True: 143k, False: 80.7k]
  ------------------
  439|   143k|            if (update) {
  ------------------
  |  Branch (439:17): [True: 1.05k, False: 142k]
  ------------------
  440|  1.05k|                if (dealloc)
  ------------------
  |  Branch (440:21): [True: 426, False: 627]
  ------------------
  441|    426|                    dealloc(entry->payload, entry->key);
  442|  1.05k|                entry->payload = payload;
  443|  1.05k|            }
  444|       |
  445|   143k|            return(0);
  446|   143k|        }
  447|       |
  448|  80.7k|        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   29|  80.7k|#define MAX_FILL_DENOM 8
  ------------------
                      if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   28|  80.7k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (448:13): [True: 2.02k, False: 78.7k]
  ------------------
  449|       |            /* This guarantees that nbElems < INT_MAX */
  450|  2.02k|            if (hash->size >= MAX_HASH_SIZE)
  ------------------
  |  |   31|  2.02k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (450:17): [True: 0, False: 2.02k]
  ------------------
  451|      0|                return(-1);
  452|  2.02k|            newSize = hash->size * 2;
  453|  78.7k|        } else {
  454|  78.7k|            newSize = 0;
  455|  78.7k|        }
  456|  80.7k|    }
  457|       |
  458|       |    /*
  459|       |     * Grow the hash table if needed
  460|       |     */
  461|   143k|    if (newSize > 0) {
  ------------------
  |  Branch (461:9): [True: 65.2k, False: 78.7k]
  ------------------
  462|  65.2k|        unsigned mask, displ, pos;
  463|       |
  464|  65.2k|        if (xmlHashGrow(hash, newSize) != 0)
  ------------------
  |  Branch (464:13): [True: 22, False: 65.2k]
  ------------------
  465|     22|            return(-1);
  466|       |
  467|       |        /*
  468|       |         * Find new entry
  469|       |         */
  470|  65.2k|        mask = hash->size - 1;
  471|  65.2k|        displ = 0;
  472|  65.2k|        pos = hashValue & mask;
  473|  65.2k|        entry = &hash->table[pos];
  474|       |
  475|  65.2k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (475:13): [True: 870, False: 64.3k]
  ------------------
  476|  1.22k|            do {
  477|  1.22k|                displ++;
  478|  1.22k|                pos++;
  479|  1.22k|                entry++;
  480|  1.22k|                if ((pos & mask) == 0)
  ------------------
  |  Branch (480:21): [True: 54, False: 1.16k]
  ------------------
  481|     54|                    entry = hash->table;
  482|  1.22k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (482:22): [True: 716, False: 507]
  ------------------
  483|    716|                     ((pos - entry->hashValue) & mask) >= displ);
  ------------------
  |  Branch (483:22): [True: 353, False: 363]
  ------------------
  484|    870|        }
  485|  65.2k|    }
  486|       |
  487|       |    /*
  488|       |     * Copy keys
  489|       |     */
  490|   143k|    if (hash->dict != NULL) {
  ------------------
  |  Branch (490:9): [True: 54.6k, False: 89.3k]
  ------------------
  491|  54.6k|        if (xmlDictOwns(hash->dict, key)) {
  ------------------
  |  Branch (491:13): [True: 54.6k, False: 0]
  ------------------
  492|  54.6k|            copy = (xmlChar *) key;
  493|  54.6k|        } else {
  494|      0|            copy = (xmlChar *) xmlDictLookup(hash->dict, key, -1);
  495|      0|            if (copy == NULL)
  ------------------
  |  Branch (495:17): [True: 0, False: 0]
  ------------------
  496|      0|                return(-1);
  497|      0|        }
  498|       |
  499|  54.6k|        if ((key2 == NULL) || (xmlDictOwns(hash->dict, key2))) {
  ------------------
  |  Branch (499:13): [True: 33.6k, False: 21.0k]
  |  Branch (499:31): [True: 20.4k, False: 588]
  ------------------
  500|  54.0k|            copy2 = (xmlChar *) key2;
  501|  54.0k|        } else {
  502|    588|            copy2 = (xmlChar *) xmlDictLookup(hash->dict, key2, -1);
  503|    588|            if (copy2 == NULL)
  ------------------
  |  Branch (503:17): [True: 1, False: 587]
  ------------------
  504|      1|                return(-1);
  505|    588|        }
  506|  54.6k|        if ((key3 == NULL) || (xmlDictOwns(hash->dict, key3))) {
  ------------------
  |  Branch (506:13): [True: 41.2k, False: 13.4k]
  |  Branch (506:31): [True: 13.4k, False: 0]
  ------------------
  507|  54.6k|            copy3 = (xmlChar *) key3;
  508|  54.6k|        } else {
  509|      0|            copy3 = (xmlChar *) xmlDictLookup(hash->dict, key3, -1);
  510|      0|            if (copy3 == NULL)
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                return(-1);
  512|      0|        }
  513|  89.3k|    } else {
  514|  89.3k|        copy = xmlMalloc(lengths[0] + 1);
  515|  89.3k|        if (copy == NULL)
  ------------------
  |  Branch (515:13): [True: 23, False: 89.2k]
  ------------------
  516|     23|            return(-1);
  517|  89.2k|        memcpy(copy, key, lengths[0] + 1);
  518|       |
  519|  89.2k|        if (key2 != NULL) {
  ------------------
  |  Branch (519:13): [True: 6.60k, False: 82.6k]
  ------------------
  520|  6.60k|            copy2 = xmlMalloc(lengths[1] + 1);
  521|  6.60k|            if (copy2 == NULL) {
  ------------------
  |  Branch (521:17): [True: 4, False: 6.59k]
  ------------------
  522|      4|                xmlFree(copy);
  523|      4|                return(-1);
  524|      4|            }
  525|  6.59k|            memcpy(copy2, key2, lengths[1] + 1);
  526|  82.6k|        } else {
  527|  82.6k|            copy2 = NULL;
  528|  82.6k|        }
  529|       |
  530|  89.2k|        if (key3 != NULL) {
  ------------------
  |  Branch (530:13): [True: 16.1k, False: 73.1k]
  ------------------
  531|  16.1k|            copy3 = xmlMalloc(lengths[2] + 1);
  532|  16.1k|            if (copy3 == NULL) {
  ------------------
  |  Branch (532:17): [True: 14, False: 16.1k]
  ------------------
  533|     14|                xmlFree(copy);
  534|     14|                xmlFree(copy2);
  535|     14|                return(-1);
  536|     14|            }
  537|  16.1k|            memcpy(copy3, key3, lengths[2] + 1);
  538|  73.1k|        } else {
  539|  73.1k|            copy3 = NULL;
  540|  73.1k|        }
  541|  89.2k|    }
  542|       |
  543|       |    /*
  544|       |     * Shift the remainder of the probe sequence to the right
  545|       |     */
  546|   143k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (546:9): [True: 15.4k, False: 128k]
  ------------------
  547|  15.4k|        const xmlHashEntry *end = &hash->table[hash->size];
  548|  15.4k|        const xmlHashEntry *cur = entry;
  549|       |
  550|  70.3k|        do {
  551|  70.3k|            cur++;
  552|  70.3k|            if (cur >= end)
  ------------------
  |  Branch (552:17): [True: 2.16k, False: 68.1k]
  ------------------
  553|  2.16k|                cur = hash->table;
  554|  70.3k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (554:18): [True: 54.8k, False: 15.4k]
  ------------------
  555|       |
  556|  15.4k|        if (cur < entry) {
  ------------------
  |  Branch (556:13): [True: 2.16k, False: 13.2k]
  ------------------
  557|       |            /*
  558|       |             * If we traversed the end of the buffer, handle the part
  559|       |             * at the start of the buffer.
  560|       |             */
  561|  2.16k|            memmove(&hash->table[1], hash->table,
  562|  2.16k|                    (char *) cur - (char *) hash->table);
  563|  2.16k|            cur = end - 1;
  564|  2.16k|            hash->table[0] = *cur;
  565|  2.16k|        }
  566|       |
  567|  15.4k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  568|  15.4k|    }
  569|       |
  570|       |    /*
  571|       |     * Populate entry
  572|       |     */
  573|   143k|    entry->key = copy;
  574|   143k|    entry->key2 = copy2;
  575|   143k|    entry->key3 = copy3;
  576|   143k|    entry->payload = payload;
  577|       |    /* OR with MAX_HASH_SIZE to make sure that the value is non-zero */
  578|   143k|    entry->hashValue = hashValue | MAX_HASH_SIZE;
  ------------------
  |  |   31|   143k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  579|       |
  580|   143k|    hash->nbElems++;
  581|       |
  582|   143k|    return(1);
  583|   143k|}
hash.c:xmlHashValue:
   62|  4.36M|             const xmlChar *key3, size_t *lengths) {
   63|  4.36M|    unsigned h1, h2;
   64|  4.36M|    size_t i;
   65|       |
   66|  4.36M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  4.36M|    do { \
  |  |   24|  4.36M|        h1 = seed ^ 0x3b00; \
  |  |   25|  4.36M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  4.36M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  4.36M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 4.36M]
  |  |  ------------------
  ------------------
   67|       |
   68|  30.1M|    for (i = 0; key[i] != 0; i++) {
  ------------------
  |  Branch (68:17): [True: 25.7M, False: 4.36M]
  ------------------
   69|  25.7M|        HASH_UPDATE(h1, h2, key[i]);
  ------------------
  |  |   29|  25.7M|    do { \
  |  |   30|  25.7M|        h1 += ch; \
  |  |   31|  25.7M|        h1 += h1 << 3; \
  |  |   32|  25.7M|        h2 += h1; \
  |  |   33|  25.7M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  25.7M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  25.7M|        h2 += h2 << 2; \
  |  |   35|  25.7M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 25.7M]
  |  |  ------------------
  ------------------
   70|  25.7M|    }
   71|  4.36M|    if (lengths)
  ------------------
  |  Branch (71:9): [True: 287k, False: 4.08M]
  ------------------
   72|   287k|        lengths[0] = i;
   73|       |
   74|  4.36M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  4.36M|    do { \
  |  |   30|  4.36M|        h1 += ch; \
  |  |   31|  4.36M|        h1 += h1 << 3; \
  |  |   32|  4.36M|        h2 += h1; \
  |  |   33|  4.36M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.36M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.36M|        h2 += h2 << 2; \
  |  |   35|  4.36M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.36M]
  |  |  ------------------
  ------------------
   75|       |
   76|  4.36M|    if (key2 != NULL) {
  ------------------
  |  Branch (76:9): [True: 203k, False: 4.16M]
  ------------------
   77|   932k|        for (i = 0; key2[i] != 0; i++) {
  ------------------
  |  Branch (77:21): [True: 729k, False: 203k]
  ------------------
   78|   729k|            HASH_UPDATE(h1, h2, key2[i]);
  ------------------
  |  |   29|   729k|    do { \
  |  |   30|   729k|        h1 += ch; \
  |  |   31|   729k|        h1 += h1 << 3; \
  |  |   32|   729k|        h2 += h1; \
  |  |   33|   729k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   729k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   729k|        h2 += h2 << 2; \
  |  |   35|   729k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 729k]
  |  |  ------------------
  ------------------
   79|   729k|        }
   80|   203k|        if (lengths)
  ------------------
  |  Branch (80:13): [True: 48.2k, False: 155k]
  ------------------
   81|  48.2k|            lengths[1] = i;
   82|   203k|    }
   83|       |
   84|  4.36M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  4.36M|    do { \
  |  |   30|  4.36M|        h1 += ch; \
  |  |   31|  4.36M|        h1 += h1 << 3; \
  |  |   32|  4.36M|        h2 += h1; \
  |  |   33|  4.36M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.36M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.36M|        h2 += h2 << 2; \
  |  |   35|  4.36M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.36M]
  |  |  ------------------
  ------------------
   85|       |
   86|  4.36M|    if (key3 != NULL) {
  ------------------
  |  Branch (86:9): [True: 415k, False: 3.95M]
  ------------------
   87|  1.47M|        for (i = 0; key3[i] != 0; i++) {
  ------------------
  |  Branch (87:21): [True: 1.05M, False: 415k]
  ------------------
   88|  1.05M|            HASH_UPDATE(h1, h2, key3[i]);
  ------------------
  |  |   29|  1.05M|    do { \
  |  |   30|  1.05M|        h1 += ch; \
  |  |   31|  1.05M|        h1 += h1 << 3; \
  |  |   32|  1.05M|        h2 += h1; \
  |  |   33|  1.05M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.05M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.05M|        h2 += h2 << 2; \
  |  |   35|  1.05M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.05M]
  |  |  ------------------
  ------------------
   89|  1.05M|        }
   90|   415k|        if (lengths)
  ------------------
  |  Branch (90:13): [True: 53.8k, False: 361k]
  ------------------
   91|  53.8k|            lengths[2] = i;
   92|   415k|    }
   93|       |
   94|  4.36M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  4.36M|    do { \
  |  |   40|  4.36M|        h1 ^= h2; \
  |  |   41|  4.36M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  4.36M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  4.36M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  4.36M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  4.36M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  4.36M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  4.36M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  4.36M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  4.36M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  4.36M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 4.36M]
  |  |  ------------------
  ------------------
   95|       |
   96|  4.36M|    return(h2);
   97|  4.36M|}
hash.c:xmlHashFindEntry:
  287|  4.30M|                 unsigned hashValue, int *pfound) {
  288|  4.30M|    xmlHashEntry *entry;
  289|  4.30M|    unsigned mask, pos, displ;
  290|  4.30M|    int found = 0;
  291|       |
  292|  4.30M|    mask = hash->size - 1;
  293|  4.30M|    pos = hashValue & mask;
  294|  4.30M|    entry = &hash->table[pos];
  295|       |
  296|  4.30M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (296:9): [True: 3.70M, False: 604k]
  ------------------
  297|       |        /*
  298|       |         * Robin hood hashing: abort if the displacement of the entry
  299|       |         * is smaller than the displacement of the key we look for.
  300|       |         * This also stops at the correct position when inserting.
  301|       |         */
  302|  3.70M|        displ = 0;
  303|  3.70M|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  3.70M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  304|       |
  305|  4.15M|        do {
  306|  4.15M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (306:17): [True: 3.35M, False: 793k]
  ------------------
  307|  3.35M|                if (hash->dict) {
  ------------------
  |  Branch (307:21): [True: 1.63M, False: 1.72M]
  ------------------
  308|  1.63M|                    if ((entry->key == key) &&
  ------------------
  |  Branch (308:25): [True: 901k, False: 737k]
  ------------------
  309|   901k|                        (entry->key2 == key2) &&
  ------------------
  |  Branch (309:25): [True: 879k, False: 22.8k]
  ------------------
  310|   879k|                        (entry->key3 == key3)) {
  ------------------
  |  Branch (310:25): [True: 877k, False: 1.15k]
  ------------------
  311|   877k|                        found = 1;
  312|   877k|                        break;
  313|   877k|                    }
  314|  1.63M|                }
  315|  2.48M|                if ((strcmp((const char *) entry->key,
  ------------------
  |  Branch (315:21): [True: 2.48M, False: 64]
  ------------------
  316|  2.48M|                            (const char *) key) == 0) &&
  317|  2.48M|                    (xmlFastStrEqual(entry->key2, key2)) &&
  ------------------
  |  Branch (317:21): [True: 2.48M, False: 0]
  ------------------
  318|  2.48M|                    (xmlFastStrEqual(entry->key3, key3))) {
  ------------------
  |  Branch (318:21): [True: 2.48M, False: 0]
  ------------------
  319|  2.48M|                    found = 1;
  320|  2.48M|                    break;
  321|  2.48M|                }
  322|  2.48M|            }
  323|       |
  324|   793k|            displ++;
  325|   793k|            pos++;
  326|   793k|            entry++;
  327|   793k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (327:17): [True: 29.9k, False: 763k]
  ------------------
  328|  29.9k|                entry = hash->table;
  329|   793k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (329:18): [True: 559k, False: 234k]
  ------------------
  330|   559k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (330:18): [True: 451k, False: 107k]
  ------------------
  331|  3.70M|    }
  332|       |
  333|  4.30M|    *pfound = found;
  334|  4.30M|    return(entry);
  335|  4.30M|}
hash.c:xmlHashQNameValue:
  104|  32.5k|                  const xmlChar *prefix3, const xmlChar *name3) {
  105|  32.5k|    unsigned h1, h2, ch;
  106|       |
  107|  32.5k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  32.5k|    do { \
  |  |   24|  32.5k|        h1 = seed ^ 0x3b00; \
  |  |   25|  32.5k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  32.5k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  32.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 32.5k]
  |  |  ------------------
  ------------------
  108|       |
  109|  32.5k|    if (prefix != NULL) {
  ------------------
  |  Branch (109:9): [True: 5.83k, False: 26.7k]
  ------------------
  110|  35.3k|        while ((ch = *prefix++) != 0) {
  ------------------
  |  Branch (110:16): [True: 29.5k, False: 5.83k]
  ------------------
  111|  29.5k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  29.5k|    do { \
  |  |   30|  29.5k|        h1 += ch; \
  |  |   31|  29.5k|        h1 += h1 << 3; \
  |  |   32|  29.5k|        h2 += h1; \
  |  |   33|  29.5k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  29.5k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  29.5k|        h2 += h2 << 2; \
  |  |   35|  29.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 29.5k]
  |  |  ------------------
  ------------------
  112|  29.5k|        }
  113|  5.83k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  5.83k|    do { \
  |  |   30|  5.83k|        h1 += ch; \
  |  |   31|  5.83k|        h1 += h1 << 3; \
  |  |   32|  5.83k|        h2 += h1; \
  |  |   33|  5.83k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  5.83k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  5.83k|        h2 += h2 << 2; \
  |  |   35|  5.83k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 5.83k]
  |  |  ------------------
  ------------------
  114|  5.83k|    }
  115|  32.5k|    if (name != NULL) {
  ------------------
  |  Branch (115:9): [True: 32.5k, False: 0]
  ------------------
  116|  3.45M|        while ((ch = *name++) != 0) {
  ------------------
  |  Branch (116:16): [True: 3.41M, False: 32.5k]
  ------------------
  117|  3.41M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  3.41M|    do { \
  |  |   30|  3.41M|        h1 += ch; \
  |  |   31|  3.41M|        h1 += h1 << 3; \
  |  |   32|  3.41M|        h2 += h1; \
  |  |   33|  3.41M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  3.41M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  3.41M|        h2 += h2 << 2; \
  |  |   35|  3.41M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 3.41M]
  |  |  ------------------
  ------------------
  118|  3.41M|        }
  119|  32.5k|    }
  120|  32.5k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  32.5k|    do { \
  |  |   30|  32.5k|        h1 += ch; \
  |  |   31|  32.5k|        h1 += h1 << 3; \
  |  |   32|  32.5k|        h2 += h1; \
  |  |   33|  32.5k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  32.5k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  32.5k|        h2 += h2 << 2; \
  |  |   35|  32.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 32.5k]
  |  |  ------------------
  ------------------
  121|  32.5k|    if (prefix2 != NULL) {
  ------------------
  |  Branch (121:9): [True: 6.12k, False: 26.4k]
  ------------------
  122|  31.2k|        while ((ch = *prefix2++) != 0) {
  ------------------
  |  Branch (122:16): [True: 25.1k, False: 6.12k]
  ------------------
  123|  25.1k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  25.1k|    do { \
  |  |   30|  25.1k|        h1 += ch; \
  |  |   31|  25.1k|        h1 += h1 << 3; \
  |  |   32|  25.1k|        h2 += h1; \
  |  |   33|  25.1k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  25.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  25.1k|        h2 += h2 << 2; \
  |  |   35|  25.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 25.1k]
  |  |  ------------------
  ------------------
  124|  25.1k|        }
  125|  6.12k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  6.12k|    do { \
  |  |   30|  6.12k|        h1 += ch; \
  |  |   31|  6.12k|        h1 += h1 << 3; \
  |  |   32|  6.12k|        h2 += h1; \
  |  |   33|  6.12k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  6.12k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  6.12k|        h2 += h2 << 2; \
  |  |   35|  6.12k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 6.12k]
  |  |  ------------------
  ------------------
  126|  6.12k|    }
  127|  32.5k|    if (name2 != NULL) {
  ------------------
  |  Branch (127:9): [True: 32.5k, False: 0]
  ------------------
  128|   723k|        while ((ch = *name2++) != 0) {
  ------------------
  |  Branch (128:16): [True: 691k, False: 32.5k]
  ------------------
  129|   691k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|   691k|    do { \
  |  |   30|   691k|        h1 += ch; \
  |  |   31|   691k|        h1 += h1 << 3; \
  |  |   32|   691k|        h2 += h1; \
  |  |   33|   691k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   691k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   691k|        h2 += h2 << 2; \
  |  |   35|   691k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 691k]
  |  |  ------------------
  ------------------
  130|   691k|        }
  131|  32.5k|    }
  132|  32.5k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  32.5k|    do { \
  |  |   30|  32.5k|        h1 += ch; \
  |  |   31|  32.5k|        h1 += h1 << 3; \
  |  |   32|  32.5k|        h2 += h1; \
  |  |   33|  32.5k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  32.5k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  32.5k|        h2 += h2 << 2; \
  |  |   35|  32.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 32.5k]
  |  |  ------------------
  ------------------
  133|  32.5k|    if (prefix3 != NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 32.5k]
  ------------------
  134|      0|        while ((ch = *prefix3++) != 0) {
  ------------------
  |  Branch (134:16): [True: 0, False: 0]
  ------------------
  135|      0|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  136|      0|        }
  137|      0|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  138|      0|    }
  139|  32.5k|    if (name3 != NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 32.5k]
  ------------------
  140|      0|        while ((ch = *name3++) != 0) {
  ------------------
  |  Branch (140:16): [True: 0, False: 0]
  ------------------
  141|      0|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  142|      0|        }
  143|      0|    }
  144|       |
  145|  32.5k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  32.5k|    do { \
  |  |   40|  32.5k|        h1 ^= h2; \
  |  |   41|  32.5k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  32.5k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  32.5k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  32.5k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  32.5k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  32.5k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  32.5k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  32.5k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  32.5k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  32.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 32.5k]
  |  |  ------------------
  ------------------
  146|       |
  147|  32.5k|    return(h2);
  148|  32.5k|}
hash.c:stubHashScannerFull:
  946|  14.4k|                    const xmlChar *key3 ATTRIBUTE_UNUSED) {
  947|  14.4k|    stubData *sdata = (stubData *) data;
  948|  14.4k|    sdata->scan(payload, sdata->data, key);
  949|  14.4k|}
hash.c:xmlFastStrEqual:
  263|  5.07M|xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
  264|  5.07M|    if (s1 == NULL)
  ------------------
  |  Branch (264:9): [True: 4.71M, False: 356k]
  ------------------
  265|  4.71M|        return(s2 == NULL);
  266|   356k|    else
  267|   356k|        return((s2 != NULL) &&
  ------------------
  |  Branch (267:16): [True: 356k, False: 0]
  ------------------
  268|   356k|               (strcmp((const char *) s1, (const char *) s2) == 0));
  ------------------
  |  Branch (268:16): [True: 243k, False: 113k]
  ------------------
  269|  5.07M|}

tree.c:xmlGrowCapacity:
   32|  32.9k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  32.9k|    int extra;
   34|       |
   35|  32.9k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 32.5k, False: 370]
  ------------------
   36|  32.5k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  32.5k|        (void) min;
   38|  32.5k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  32.5k|    }
   43|       |
   44|    370|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 370]
  ------------------
   45|    370|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 370]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    370|    extra = (capacity + 1) / 2;
   50|       |
   51|    370|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 370]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    370|    return(capacity + extra);
   55|    370|}
uri.c:xmlGrowCapacity:
   32|  9.54k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  9.54k|    int extra;
   34|       |
   35|  9.54k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 9.54k]
  ------------------
   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|  9.54k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 24, False: 9.52k]
  ------------------
   45|  9.52k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 9.52k]
  ------------------
   46|     24|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  9.52k|    extra = (capacity + 1) / 2;
   50|       |
   51|  9.52k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 40, False: 9.48k]
  ------------------
   52|     40|        return(max);
   53|       |
   54|  9.48k|    return(capacity + extra);
   55|  9.52k|}
valid.c:xmlGrowCapacity:
   32|  8.21k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  8.21k|    int extra;
   34|       |
   35|  8.21k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 3.09k, False: 5.12k]
  ------------------
   36|  3.09k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  3.09k|        (void) min;
   38|  3.09k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  3.09k|    }
   43|       |
   44|  5.12k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 5.12k]
  ------------------
   45|  5.12k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 5.12k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  5.12k|    extra = (capacity + 1) / 2;
   50|       |
   51|  5.12k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 5.12k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  5.12k|    return(capacity + extra);
   55|  5.12k|}
xmlreader.c:xmlGrowCapacity:
   32|    457|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|    457|    int extra;
   34|       |
   35|    457|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 214, False: 243]
  ------------------
   36|    214|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|    214|        (void) min;
   38|    214|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|    214|    }
   43|       |
   44|    243|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 243]
  ------------------
   45|    243|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 243]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    243|    extra = (capacity + 1) / 2;
   50|       |
   51|    243|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 243]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    243|    return(capacity + extra);
   55|    243|}
xmlregexp.c:xmlGrowCapacity:
   32|  1.66M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.66M|    int extra;
   34|       |
   35|  1.66M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 759k, False: 908k]
  ------------------
   36|   759k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   759k|        (void) min;
   38|   759k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   759k|    }
   43|       |
   44|   908k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 908k]
  ------------------
   45|   908k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 908k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   908k|    extra = (capacity + 1) / 2;
   50|       |
   51|   908k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 908k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|   908k|    return(capacity + extra);
   55|   908k|}
xinclude.c:xmlGrowCapacity:
   32|  20.0k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  20.0k|    int extra;
   34|       |
   35|  20.0k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 18.1k, False: 1.89k]
  ------------------
   36|  18.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  18.1k|        (void) min;
   38|  18.1k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  18.1k|    }
   43|       |
   44|  1.89k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.89k]
  ------------------
   45|  1.89k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.89k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.89k|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.89k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1.89k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  1.89k|    return(capacity + extra);
   55|  1.89k|}
xpath.c:xmlGrowCapacity:
   32|  1.28M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.28M|    int extra;
   34|       |
   35|  1.28M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 328k, False: 954k]
  ------------------
   36|   328k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   328k|        (void) min;
   38|   328k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   328k|    }
   43|       |
   44|   954k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 954k]
  ------------------
   45|   954k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 954k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   954k|    extra = (capacity + 1) / 2;
   50|       |
   51|   954k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 1, False: 954k]
  ------------------
   52|      1|        return(max);
   53|       |
   54|   954k|    return(capacity + extra);
   55|   954k|}
parser.c:xmlGrowCapacity:
   32|   329k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|   329k|    int extra;
   34|       |
   35|   329k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 31.6k, False: 298k]
  ------------------
   36|  31.6k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  31.6k|        (void) min;
   38|  31.6k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  31.6k|    }
   43|       |
   44|   298k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 207, False: 297k]
  ------------------
   45|   297k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 297k]
  ------------------
   46|    207|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   297k|    extra = (capacity + 1) / 2;
   50|       |
   51|   297k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 400, False: 297k]
  ------------------
   52|    400|        return(max);
   53|       |
   54|   297k|    return(capacity + extra);
   55|   297k|}

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

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

xmlWarningMsg:
  276|  41.4k|{
  277|  41.4k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  278|       |               str1, str2, NULL, 0, msg, str1, str2);
  279|  41.4k|}
xmlCheckLanguageID:
 1267|  45.3k|{
 1268|  45.3k|    const xmlChar *cur = lang, *nxt;
 1269|       |
 1270|  45.3k|    if (cur == NULL)
  ------------------
  |  Branch (1270:9): [True: 291, False: 45.0k]
  ------------------
 1271|    291|        return (0);
 1272|  45.0k|    if (((cur[0] == 'i') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1272:10): [True: 662, False: 44.3k]
  |  Branch (1272:29): [True: 143, False: 519]
  ------------------
 1273|  44.8k|        ((cur[0] == 'I') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1273:10): [True: 23.3k, False: 21.5k]
  |  Branch (1273:29): [True: 1.27k, False: 22.1k]
  ------------------
 1274|  43.6k|        ((cur[0] == 'x') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1274:10): [True: 493, False: 43.1k]
  |  Branch (1274:29): [True: 31, False: 462]
  ------------------
 1275|  43.5k|        ((cur[0] == 'X') && (cur[1] == '-'))) {
  ------------------
  |  Branch (1275:10): [True: 51, False: 43.5k]
  |  Branch (1275:29): [True: 38, False: 13]
  ------------------
 1276|       |        /*
 1277|       |         * Still allow IANA code and user code which were coming
 1278|       |         * from the previous version of the XML-1.0 specification
 1279|       |         * it's deprecated but we should not fail
 1280|       |         */
 1281|  1.48k|        cur += 2;
 1282|  3.68k|        while (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
  ------------------
  |  Branch (1282:17): [True: 2.27k, False: 1.41k]
  |  Branch (1282:36): [True: 1.97k, False: 300]
  ------------------
 1283|  1.71k|               ((cur[0] >= 'a') && (cur[0] <= 'z')))
  ------------------
  |  Branch (1283:17): [True: 300, False: 1.41k]
  |  Branch (1283:36): [True: 229, False: 71]
  ------------------
 1284|  2.20k|            cur++;
 1285|  1.48k|        return(cur[0] == 0);
 1286|  1.48k|    }
 1287|  43.5k|    nxt = cur;
 1288|   211k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1288:13): [True: 168k, False: 42.1k]
  |  Branch (1288:32): [True: 153k, False: 15.7k]
  ------------------
 1289|  57.8k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1289:13): [True: 15.7k, False: 42.1k]
  |  Branch (1289:32): [True: 14.2k, False: 1.43k]
  ------------------
 1290|   167k|           nxt++;
 1291|  43.5k|    if (nxt - cur >= 4) {
  ------------------
  |  Branch (1291:9): [True: 2.26k, False: 41.2k]
  ------------------
 1292|       |        /*
 1293|       |         * Reserved
 1294|       |         */
 1295|  2.26k|        if ((nxt - cur > 8) || (nxt[0] != 0))
  ------------------
  |  Branch (1295:13): [True: 1.18k, False: 1.08k]
  |  Branch (1295:32): [True: 559, False: 522]
  ------------------
 1296|  1.74k|            return(0);
 1297|    522|        return(1);
 1298|  2.26k|    }
 1299|  41.2k|    if (nxt - cur < 2)
  ------------------
  |  Branch (1299:9): [True: 2.28k, False: 38.9k]
  ------------------
 1300|  2.28k|        return(0);
 1301|       |    /* we got an ISO 639 code */
 1302|  38.9k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1302:9): [True: 2.35k, False: 36.6k]
  ------------------
 1303|  2.35k|        return(1);
 1304|  36.6k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1304:9): [True: 3.00k, False: 33.6k]
  ------------------
 1305|  3.00k|        return(0);
 1306|       |
 1307|  33.6k|    nxt++;
 1308|  33.6k|    cur = nxt;
 1309|       |    /* now we can have extlang or script or region or variant */
 1310|  33.6k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1310:9): [True: 31.4k, False: 2.19k]
  |  Branch (1310:28): [True: 9.65k, False: 21.7k]
  ------------------
 1311|  9.65k|        goto region_m49;
 1312|       |
 1313|  90.1k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1313:13): [True: 67.2k, False: 22.9k]
  |  Branch (1313:32): [True: 63.0k, False: 4.22k]
  ------------------
 1314|  27.1k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1314:13): [True: 4.00k, False: 23.1k]
  |  Branch (1314:32): [True: 3.19k, False: 813]
  ------------------
 1315|  66.2k|           nxt++;
 1316|  23.9k|    if (nxt - cur == 4)
  ------------------
  |  Branch (1316:9): [True: 1.20k, False: 22.7k]
  ------------------
 1317|  1.20k|        goto script;
 1318|  22.7k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1318:9): [True: 1.17k, False: 21.6k]
  ------------------
 1319|  1.17k|        goto region;
 1320|  21.6k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1320:9): [True: 540, False: 21.0k]
  |  Branch (1320:29): [True: 465, False: 75]
  ------------------
 1321|    465|        goto variant;
 1322|  21.1k|    if (nxt - cur != 3)
  ------------------
  |  Branch (1322:9): [True: 3.09k, False: 18.0k]
  ------------------
 1323|  3.09k|        return(0);
 1324|       |    /* we parsed an extlang */
 1325|  18.0k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1325:9): [True: 191, False: 17.8k]
  ------------------
 1326|    191|        return(1);
 1327|  17.8k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1327:9): [True: 6.28k, False: 11.5k]
  ------------------
 1328|  6.28k|        return(0);
 1329|       |
 1330|  11.5k|    nxt++;
 1331|  11.5k|    cur = nxt;
 1332|       |    /* now we can have script or region or variant */
 1333|  11.5k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1333:9): [True: 11.2k, False: 360]
  |  Branch (1333:28): [True: 759, False: 10.4k]
  ------------------
 1334|    759|        goto region_m49;
 1335|       |
 1336|  43.6k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1336:13): [True: 33.7k, False: 9.85k]
  |  Branch (1336:32): [True: 28.2k, False: 5.56k]
  ------------------
 1337|  15.4k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1337:13): [True: 5.53k, False: 9.88k]
  |  Branch (1337:32): [True: 4.61k, False: 926]
  ------------------
 1338|  32.8k|           nxt++;
 1339|  10.8k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1339:9): [True: 7.47k, False: 3.33k]
  ------------------
 1340|  7.47k|        goto region;
 1341|  3.33k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1341:9): [True: 1.33k, False: 2.00k]
  |  Branch (1341:29): [True: 974, False: 358]
  ------------------
 1342|    974|        goto variant;
 1343|  2.36k|    if (nxt - cur != 4)
  ------------------
  |  Branch (1343:9): [True: 881, False: 1.48k]
  ------------------
 1344|    881|        return(0);
 1345|       |    /* we parsed a script */
 1346|  2.69k|script:
 1347|  2.69k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1347:9): [True: 1.16k, False: 1.52k]
  ------------------
 1348|  1.16k|        return(1);
 1349|  1.52k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1349:9): [True: 373, False: 1.15k]
  ------------------
 1350|    373|        return(0);
 1351|       |
 1352|  1.15k|    nxt++;
 1353|  1.15k|    cur = nxt;
 1354|       |    /* now we can have region or variant */
 1355|  1.15k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1355:9): [True: 915, False: 237]
  |  Branch (1355:28): [True: 78, False: 837]
  ------------------
 1356|     78|        goto region_m49;
 1357|       |
 1358|  8.57k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1358:13): [True: 7.72k, False: 857]
  |  Branch (1358:32): [True: 6.66k, False: 1.05k]
  ------------------
 1359|  1.90k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1359:13): [True: 1.03k, False: 875]
  |  Branch (1359:32): [True: 835, False: 199]
  ------------------
 1360|  7.50k|           nxt++;
 1361|       |
 1362|  1.07k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1362:9): [True: 310, False: 764]
  |  Branch (1362:29): [True: 217, False: 93]
  ------------------
 1363|    217|        goto variant;
 1364|    857|    if (nxt - cur != 2)
  ------------------
  |  Branch (1364:9): [True: 500, False: 357]
  ------------------
 1365|    500|        return(0);
 1366|       |    /* we parsed a region */
 1367|  9.23k|region:
 1368|  9.23k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1368:9): [True: 523, False: 8.70k]
  ------------------
 1369|    523|        return(1);
 1370|  8.70k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1370:9): [True: 7.60k, False: 1.09k]
  ------------------
 1371|  7.60k|        return(0);
 1372|       |
 1373|  1.09k|    nxt++;
 1374|  1.09k|    cur = nxt;
 1375|       |    /* now we can just have a variant */
 1376|  7.54k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1376:13): [True: 6.55k, False: 986]
  |  Branch (1376:32): [True: 2.95k, False: 3.60k]
  ------------------
 1377|  4.58k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1377:13): [True: 3.60k, False: 987]
  |  Branch (1377:32): [True: 3.48k, False: 112]
  ------------------
 1378|  6.44k|           nxt++;
 1379|       |
 1380|  1.09k|    if ((nxt - cur < 5) || (nxt - cur > 8))
  ------------------
  |  Branch (1380:9): [True: 598, False: 501]
  |  Branch (1380:28): [True: 254, False: 247]
  ------------------
 1381|    852|        return(0);
 1382|       |
 1383|       |    /* we parsed a variant */
 1384|  1.90k|variant:
 1385|  1.90k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1385:9): [True: 369, False: 1.53k]
  ------------------
 1386|    369|        return(1);
 1387|  1.53k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1387:9): [True: 1.08k, False: 452]
  ------------------
 1388|  1.08k|        return(0);
 1389|       |    /* extensions and private use subtags not checked */
 1390|    452|    return (1);
 1391|       |
 1392|  10.4k|region_m49:
 1393|  10.4k|    if (((nxt[1] >= '0') && (nxt[1] <= '9')) &&
  ------------------
  |  Branch (1393:10): [True: 9.36k, False: 1.12k]
  |  Branch (1393:29): [True: 7.64k, False: 1.71k]
  ------------------
 1394|  7.64k|        ((nxt[2] >= '0') && (nxt[2] <= '9'))) {
  ------------------
  |  Branch (1394:10): [True: 5.52k, False: 2.12k]
  |  Branch (1394:29): [True: 233, False: 5.29k]
  ------------------
 1395|    233|        nxt += 3;
 1396|    233|        goto region;
 1397|    233|    }
 1398|  10.2k|    return(0);
 1399|  10.4k|}
xmlParserNsCreate:
 1416|  44.0k|xmlParserNsCreate(void) {
 1417|  44.0k|    xmlParserNsData *nsdb = xmlMalloc(sizeof(*nsdb));
 1418|       |
 1419|  44.0k|    if (nsdb == NULL)
  ------------------
  |  Branch (1419:9): [True: 3, False: 44.0k]
  ------------------
 1420|      3|        return(NULL);
 1421|  44.0k|    memset(nsdb, 0, sizeof(*nsdb));
 1422|  44.0k|    nsdb->defaultNsIndex = INT_MAX;
 1423|       |
 1424|  44.0k|    return(nsdb);
 1425|  44.0k|}
xmlParserNsFree:
 1433|  44.0k|xmlParserNsFree(xmlParserNsData *nsdb) {
 1434|  44.0k|    if (nsdb == NULL)
  ------------------
  |  Branch (1434:9): [True: 0, False: 44.0k]
  ------------------
 1435|      0|        return;
 1436|       |
 1437|  44.0k|    xmlFree(nsdb->extra);
 1438|  44.0k|    xmlFree(nsdb->hash);
 1439|  44.0k|    xmlFree(nsdb);
 1440|  44.0k|}
xmlParserNsLookupSax:
 1566|   105k|xmlParserNsLookupSax(xmlParserCtxt *ctxt, const xmlChar *prefix) {
 1567|   105k|    xmlHashedString hprefix;
 1568|   105k|    int nsIndex;
 1569|       |
 1570|   105k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1570:9): [True: 63.2k, False: 42.6k]
  ------------------
 1571|  63.2k|        return(NULL);
 1572|       |
 1573|  42.6k|    hprefix.name = prefix;
 1574|  42.6k|    if (prefix != NULL)
  ------------------
  |  Branch (1574:9): [True: 30.7k, False: 11.8k]
  ------------------
 1575|  30.7k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1576|  11.8k|    else
 1577|  11.8k|        hprefix.hashValue = 0;
 1578|  42.6k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1579|  42.6k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1579:9): [True: 0, False: 42.6k]
  |  Branch (1579:33): [True: 0, False: 42.6k]
  ------------------
 1580|      0|        return(NULL);
 1581|       |
 1582|  42.6k|    return(ctxt->nsdb->extra[nsIndex].saxData);
 1583|  42.6k|}
xmlParserNsUpdateSax:
 1597|   177k|                     void *saxData) {
 1598|   177k|    xmlHashedString hprefix;
 1599|   177k|    int nsIndex;
 1600|       |
 1601|   177k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1601:9): [True: 0, False: 177k]
  ------------------
 1602|      0|        return(-1);
 1603|       |
 1604|   177k|    hprefix.name = prefix;
 1605|   177k|    if (prefix != NULL)
  ------------------
  |  Branch (1605:9): [True: 141k, False: 35.7k]
  ------------------
 1606|   141k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1607|  35.7k|    else
 1608|  35.7k|        hprefix.hashValue = 0;
 1609|   177k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1610|   177k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1610:9): [True: 0, False: 177k]
  |  Branch (1610:33): [True: 0, False: 177k]
  ------------------
 1611|      0|        return(-1);
 1612|       |
 1613|   177k|    ctxt->nsdb->extra[nsIndex].saxData = saxData;
 1614|   177k|    return(0);
 1615|   177k|}
xmlCtxtPushInput:
 1892|   301k|{
 1893|   301k|    char *directory = NULL;
 1894|   301k|    int maxDepth;
 1895|       |
 1896|   301k|    if ((ctxt == NULL) || (value == NULL))
  ------------------
  |  Branch (1896:9): [True: 0, False: 301k]
  |  Branch (1896:27): [True: 1.95k, False: 299k]
  ------------------
 1897|  1.95k|        return(-1);
 1898|       |
 1899|   299k|    maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (1899:16): [True: 87.6k, False: 211k]
  ------------------
 1900|       |
 1901|   299k|    if (ctxt->inputNr >= ctxt->inputMax) {
  ------------------
  |  Branch (1901:9): [True: 7.14k, False: 292k]
  ------------------
 1902|  7.14k|        xmlParserInputPtr *tmp;
 1903|  7.14k|        int newSize;
 1904|       |
 1905|  7.14k|        newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]),
 1906|  7.14k|                                  5, maxDepth);
 1907|  7.14k|        if (newSize < 0) {
  ------------------
  |  Branch (1907:13): [True: 1, False: 7.14k]
  ------------------
 1908|      1|            xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 1909|      1|                           "Maximum entity nesting depth exceeded");
 1910|      1|            return(-1);
 1911|      1|        }
 1912|  7.14k|        tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0]));
 1913|  7.14k|        if (tmp == NULL) {
  ------------------
  |  Branch (1913:13): [True: 1, False: 7.13k]
  ------------------
 1914|      1|            xmlErrMemory(ctxt);
 1915|      1|            return(-1);
 1916|      1|        }
 1917|  7.13k|        ctxt->inputTab = tmp;
 1918|  7.13k|        ctxt->inputMax = newSize;
 1919|  7.13k|    }
 1920|       |
 1921|   299k|    if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
  ------------------
  |  Branch (1921:9): [True: 192k, False: 107k]
  |  Branch (1921:33): [True: 156k, False: 35.5k]
  ------------------
 1922|   156k|        directory = xmlParserGetDirectory(value->filename);
 1923|   156k|        if (directory == NULL) {
  ------------------
  |  Branch (1923:13): [True: 9, False: 156k]
  ------------------
 1924|      9|            xmlErrMemory(ctxt);
 1925|      9|            return(-1);
 1926|      9|        }
 1927|   156k|    }
 1928|       |
 1929|   299k|    if (ctxt->input_id >= INT_MAX) {
  ------------------
  |  Branch (1929:9): [True: 0, False: 299k]
  ------------------
 1930|      0|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, "Input ID overflow\n");
 1931|      0|        return(-1);
 1932|      0|    }
 1933|       |
 1934|   299k|    ctxt->inputTab[ctxt->inputNr] = value;
 1935|   299k|    ctxt->input = value;
 1936|       |
 1937|   299k|    if (ctxt->inputNr == 0) {
  ------------------
  |  Branch (1937:9): [True: 192k, False: 107k]
  ------------------
 1938|   192k|        xmlFree(ctxt->directory);
 1939|   192k|        ctxt->directory = directory;
 1940|   192k|    }
 1941|       |
 1942|       |    /*
 1943|       |     * The input ID is unused internally, but there are entity
 1944|       |     * loaders in downstream code that detect the main document
 1945|       |     * by checking for "input_id == 1".
 1946|       |     */
 1947|   299k|    value->id = ctxt->input_id++;
 1948|       |
 1949|   299k|    return(ctxt->inputNr++);
 1950|   299k|}
xmlCtxtPopInput:
 1960|   386k|{
 1961|   386k|    xmlParserInputPtr ret;
 1962|       |
 1963|   386k|    if (ctxt == NULL)
  ------------------
  |  Branch (1963:9): [True: 0, False: 386k]
  ------------------
 1964|      0|        return(NULL);
 1965|   386k|    if (ctxt->inputNr <= 0)
  ------------------
  |  Branch (1965:9): [True: 88.1k, False: 297k]
  ------------------
 1966|  88.1k|        return (NULL);
 1967|   297k|    ctxt->inputNr--;
 1968|   297k|    if (ctxt->inputNr > 0)
  ------------------
  |  Branch (1968:9): [True: 107k, False: 190k]
  ------------------
 1969|   107k|        ctxt->input = ctxt->inputTab[ctxt->inputNr - 1];
 1970|   190k|    else
 1971|   190k|        ctxt->input = NULL;
 1972|   297k|    ret = ctxt->inputTab[ctxt->inputNr];
 1973|       |    ctxt->inputTab[ctxt->inputNr] = NULL;
 1974|   297k|    return (ret);
 1975|   386k|}
nodePush:
 1988|   684k|{
 1989|   684k|    if (ctxt == NULL)
  ------------------
  |  Branch (1989:9): [True: 0, False: 684k]
  ------------------
 1990|      0|        return(0);
 1991|       |
 1992|   684k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (1992:9): [True: 46.5k, False: 637k]
  ------------------
 1993|  46.5k|        int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (1993:24): [True: 23.2k, False: 23.2k]
  ------------------
 1994|  46.5k|        xmlNodePtr *tmp;
 1995|  46.5k|        int newSize;
 1996|       |
 1997|  46.5k|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
 1998|  46.5k|                                  10, maxDepth);
 1999|  46.5k|        if (newSize < 0) {
  ------------------
  |  Branch (1999:13): [True: 50, False: 46.4k]
  ------------------
 2000|     50|            xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 2001|     50|                    "Excessive depth in document: %d,"
 2002|     50|                    " use XML_PARSE_HUGE option\n",
 2003|     50|                    ctxt->nodeNr);
 2004|     50|            return(-1);
 2005|     50|        }
 2006|       |
 2007|  46.4k|	tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
 2008|  46.4k|        if (tmp == NULL) {
  ------------------
  |  Branch (2008:13): [True: 16, False: 46.4k]
  ------------------
 2009|     16|            xmlErrMemory(ctxt);
 2010|     16|            return (-1);
 2011|     16|        }
 2012|  46.4k|        ctxt->nodeTab = tmp;
 2013|  46.4k|	ctxt->nodeMax = newSize;
 2014|  46.4k|    }
 2015|       |
 2016|   684k|    ctxt->nodeTab[ctxt->nodeNr] = value;
 2017|   684k|    ctxt->node = value;
 2018|   684k|    return (ctxt->nodeNr++);
 2019|   684k|}
nodePop:
 2031|   630k|{
 2032|   630k|    xmlNodePtr ret;
 2033|       |
 2034|   630k|    if (ctxt == NULL) return(NULL);
  ------------------
  |  Branch (2034:9): [True: 0, False: 630k]
  ------------------
 2035|   630k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (2035:9): [True: 70.8k, False: 559k]
  ------------------
 2036|  70.8k|        return (NULL);
 2037|   559k|    ctxt->nodeNr--;
 2038|   559k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (2038:9): [True: 544k, False: 15.2k]
  ------------------
 2039|   544k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
 2040|  15.2k|    else
 2041|  15.2k|        ctxt->node = NULL;
 2042|   559k|    ret = ctxt->nodeTab[ctxt->nodeNr];
 2043|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
 2044|   559k|    return (ret);
 2045|   630k|}
xmlSkipBlankChars:
 2318|  4.33M|xmlSkipBlankChars(xmlParserCtxt *ctxt) {
 2319|  4.33M|    const xmlChar *cur;
 2320|  4.33M|    int res = 0;
 2321|       |
 2322|  4.33M|    cur = ctxt->input->cur;
 2323|  4.33M|    while (IS_BLANK_CH(*cur)) {
 2324|  1.82M|        if (*cur == '\n') {
  ------------------
  |  Branch (2324:13): [True: 656k, False: 1.16M]
  ------------------
 2325|   656k|            ctxt->input->line++; ctxt->input->col = 1;
 2326|  1.16M|        } else {
 2327|  1.16M|            ctxt->input->col++;
 2328|  1.16M|        }
 2329|  1.82M|        cur++;
 2330|  1.82M|        if (res < INT_MAX)
  ------------------
  |  Branch (2330:13): [True: 1.82M, False: 0]
  ------------------
 2331|  1.82M|            res++;
 2332|  1.82M|        if (*cur == 0) {
  ------------------
  |  Branch (2332:13): [True: 24.1k, False: 1.80M]
  ------------------
 2333|  24.1k|            ctxt->input->cur = cur;
 2334|  24.1k|            xmlParserGrow(ctxt);
 2335|  24.1k|            cur = ctxt->input->cur;
 2336|  24.1k|        }
 2337|  1.82M|    }
 2338|  4.33M|    ctxt->input->cur = cur;
 2339|       |
 2340|  4.33M|    if (res > 4)
  ------------------
  |  Branch (2340:9): [True: 36.6k, False: 4.29M]
  ------------------
 2341|  36.6k|        GROW;
  ------------------
  |  | 2271|  36.6k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  36.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  36.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 34.3k, False: 2.39k]
  |  |  ------------------
  |  | 2272|  36.6k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  34.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 2.45k, False: 31.8k]
  |  |  ------------------
  |  | 2273|  36.6k|	xmlParserGrow(ctxt);
  ------------------
 2342|       |
 2343|  4.33M|    return(res);
 2344|  4.33M|}
xmlParseCharRef:
 2529|  61.5k|xmlParseCharRef(xmlParserCtxt *ctxt) {
 2530|  61.5k|    int val = 0;
 2531|  61.5k|    int count = 0;
 2532|       |
 2533|       |    /*
 2534|       |     * Using RAW/CUR/NEXT is okay since we are working on ASCII range here
 2535|       |     */
 2536|  61.5k|    if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2224|  61.5k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2226|  61.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2536:9): [True: 61.5k, False: 0]
  |  Branch (2536:25): [True: 61.5k, False: 0]
  ------------------
 2537|  61.5k|        (NXT(2) == 'x')) {
  ------------------
  |  | 2226|  61.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2537:9): [True: 14.5k, False: 47.0k]
  ------------------
 2538|  14.5k|	SKIP(3);
  ------------------
  |  | 2248|  14.5k|#define SKIP(val) do {							\
  |  | 2249|  14.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  14.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 241, False: 14.3k]
  |  |  ------------------
  |  | 2251|  14.5k|        xmlParserGrow(ctxt);						\
  |  | 2252|  14.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 14.5k]
  |  |  ------------------
  ------------------
 2539|  14.5k|	GROW;
  ------------------
  |  | 2271|  14.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  14.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  14.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.82k, False: 6.72k]
  |  |  ------------------
  |  | 2272|  14.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.82k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 1.74k, False: 6.07k]
  |  |  ------------------
  |  | 2273|  14.5k|	xmlParserGrow(ctxt);
  ------------------
 2540|  59.5k|	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|  59.5k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  47.0k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2540:9): [True: 47.0k, False: 12.5k]
  |  Branch (2540:25): [True: 47.0k, False: 0]
  ------------------
 2541|  47.0k|	    if (count++ > 20) {
  ------------------
  |  Branch (2541:10): [True: 1.41k, False: 45.6k]
  ------------------
 2542|  1.41k|		count = 0;
 2543|  1.41k|		GROW;
  ------------------
  |  | 2271|  1.41k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.41k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.41k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 1.12k, False: 285]
  |  |  ------------------
  |  | 2272|  1.41k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.12k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 96, False: 1.03k]
  |  |  ------------------
  |  | 2273|  1.41k|	xmlParserGrow(ctxt);
  ------------------
 2544|  1.41k|	    }
 2545|  47.0k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|  47.0k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|  46.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2545:10): [True: 46.4k, False: 577]
  |  Branch (2545:26): [True: 34.1k, False: 12.3k]
  ------------------
 2546|  34.1k|	        val = val * 16 + (CUR - '0');
  ------------------
  |  | 2225|  34.1k|#define CUR (*ctxt->input->cur)
  ------------------
 2547|  12.9k|	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2224|  12.9k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2224|  9.36k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2547:15): [True: 9.36k, False: 3.54k]
  |  Branch (2547:31): [True: 8.46k, False: 903]
  |  Branch (2547:47): [True: 8.25k, False: 210]
  ------------------
 2548|  8.25k|	        val = val * 16 + (CUR - 'a') + 10;
  ------------------
  |  | 2225|  8.25k|#define CUR (*ctxt->input->cur)
  ------------------
 2549|  4.65k|	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2224|  4.65k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2224|  3.94k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2549:15): [True: 3.94k, False: 709]
  |  Branch (2549:31): [True: 2.73k, False: 1.21k]
  |  Branch (2549:47): [True: 2.64k, False: 94]
  ------------------
 2550|  2.64k|	        val = val * 16 + (CUR - 'A') + 10;
  ------------------
  |  | 2225|  2.64k|#define CUR (*ctxt->input->cur)
  ------------------
 2551|  2.01k|	    else {
 2552|  2.01k|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2553|  2.01k|		val = 0;
 2554|  2.01k|		break;
 2555|  2.01k|	    }
 2556|  45.0k|	    if (val > 0x110000)
  ------------------
  |  Branch (2556:10): [True: 15.0k, False: 29.9k]
  ------------------
 2557|  15.0k|	        val = 0x110000;
 2558|       |
 2559|  45.0k|	    NEXT;
  ------------------
  |  | 2279|  45.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2560|  45.0k|	    count++;
 2561|  45.0k|	}
 2562|  14.5k|	if (RAW == ';') {
  ------------------
  |  | 2224|  14.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2562:6): [True: 12.5k, False: 2.01k]
  ------------------
 2563|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2564|  12.5k|	    ctxt->input->col++;
 2565|  12.5k|	    ctxt->input->cur++;
 2566|  12.5k|	}
 2567|  47.0k|    } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2224|  47.0k|#define RAW (*ctxt->input->cur)
  ------------------
                  } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2226|  47.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2567:17): [True: 47.0k, False: 0]
  |  Branch (2567:33): [True: 47.0k, False: 0]
  ------------------
 2568|  47.0k|	SKIP(2);
  ------------------
  |  | 2248|  47.0k|#define SKIP(val) do {							\
  |  | 2249|  47.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  47.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 371, False: 46.6k]
  |  |  ------------------
  |  | 2251|  47.0k|        xmlParserGrow(ctxt);						\
  |  | 2252|  47.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 47.0k]
  |  |  ------------------
  ------------------
 2569|  47.0k|	GROW;
  ------------------
  |  | 2271|  47.0k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  47.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  47.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 28.4k, False: 18.5k]
  |  |  ------------------
  |  | 2272|  47.0k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  28.4k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 7.89k, False: 20.5k]
  |  |  ------------------
  |  | 2273|  47.0k|	xmlParserGrow(ctxt);
  ------------------
 2570|   228k|	while (RAW != ';') { /* loop blocked by count */
  ------------------
  |  | 2224|   228k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2570:9): [True: 185k, False: 43.5k]
  ------------------
 2571|   185k|	    if (count++ > 20) {
  ------------------
  |  Branch (2571:10): [True: 8.12k, False: 176k]
  ------------------
 2572|  8.12k|		count = 0;
 2573|  8.12k|		GROW;
  ------------------
  |  | 2271|  8.12k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.12k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.12k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.82k, False: 300]
  |  |  ------------------
  |  | 2272|  8.12k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.82k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 612, False: 7.21k]
  |  |  ------------------
  |  | 2273|  8.12k|	xmlParserGrow(ctxt);
  ------------------
 2574|  8.12k|	    }
 2575|   185k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|   185k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2224|   183k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2575:10): [True: 183k, False: 1.38k]
  |  Branch (2575:26): [True: 181k, False: 2.04k]
  ------------------
 2576|   181k|	        val = val * 10 + (CUR - '0');
  ------------------
  |  | 2225|   181k|#define CUR (*ctxt->input->cur)
  ------------------
 2577|  3.42k|	    else {
 2578|  3.42k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2579|  3.42k|		val = 0;
 2580|  3.42k|		break;
 2581|  3.42k|	    }
 2582|   181k|	    if (val > 0x110000)
  ------------------
  |  Branch (2582:10): [True: 80.4k, False: 101k]
  ------------------
 2583|  80.4k|	        val = 0x110000;
 2584|       |
 2585|   181k|	    NEXT;
  ------------------
  |  | 2279|   181k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2586|   181k|	    count++;
 2587|   181k|	}
 2588|  47.0k|	if (RAW == ';') {
  ------------------
  |  | 2224|  47.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2588:6): [True: 43.5k, False: 3.42k]
  ------------------
 2589|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2590|  43.5k|	    ctxt->input->col++;
 2591|  43.5k|	    ctxt->input->cur++;
 2592|  43.5k|	}
 2593|  47.0k|    } else {
 2594|      0|        if (RAW == '&')
  ------------------
  |  | 2224|      0|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2594:13): [True: 0, False: 0]
  ------------------
 2595|      0|            SKIP(1);
  ------------------
  |  | 2248|      0|#define SKIP(val) do {							\
  |  | 2249|      0|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      0|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2251|      0|        xmlParserGrow(ctxt);						\
  |  | 2252|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2596|      0|        xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2597|      0|    }
 2598|       |
 2599|       |    /*
 2600|       |     * [ WFC: Legal Character ]
 2601|       |     * Characters referred to using character references must match the
 2602|       |     * production for Char.
 2603|       |     */
 2604|  61.5k|    if (val >= 0x110000) {
  ------------------
  |  Branch (2604:9): [True: 494, False: 61.0k]
  ------------------
 2605|    494|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2606|    494|                "xmlParseCharRef: character reference out of bounds\n",
 2607|    494|	        val);
 2608|    494|        val = 0xFFFD;
 2609|  61.0k|    } else if (!IS_CHAR(val)) {
  ------------------
  |  |  115|  61.0k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  61.0k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 59.5k, False: 1.50k]
  |  |  |  |  ------------------
  |  |  |  |  118|  61.0k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  59.5k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 53.1k, False: 6.37k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 16.8k, False: 36.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  59.5k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 8.51k, False: 34.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  59.5k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 26.8k, False: 7.32k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  61.0k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.50k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 454, False: 1.05k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.50k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 844, False: 211]
  |  |  |  |  |  Branch (120:26): [True: 127, False: 717]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.50k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 633, False: 295]
  |  |  |  |  |  Branch (121:27): [True: 633, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2609:16): [True: 7.62k, False: 53.4k]
  ------------------
 2610|  7.62k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2611|  7.62k|                          "xmlParseCharRef: invalid xmlChar value %d\n",
 2612|  7.62k|	                  val);
 2613|  7.62k|    }
 2614|  61.5k|    return(val);
 2615|  61.5k|}
xmlScanName:
 3051|  3.28M|xmlScanName(const xmlChar *ptr, size_t maxSize, int flags) {
 3052|  3.28M|    int stop = flags & XML_SCAN_NC ? ':' : 0;
  ------------------
  |  |   69|  3.28M|#define XML_SCAN_NC         1
  ------------------
  |  Branch (3052:16): [True: 97.9k, False: 3.18M]
  ------------------
 3053|  3.28M|    int old10 = flags & XML_SCAN_OLD10 ? 1 : 0;
  ------------------
  |  |   71|  3.28M|#define XML_SCAN_OLD10      4
  ------------------
  |  Branch (3053:17): [True: 1.10M, False: 2.18M]
  ------------------
 3054|       |
 3055|  12.5M|    while (1) {
  ------------------
  |  Branch (3055:12): [True: 12.5M, Folded]
  ------------------
 3056|  12.5M|        int c, len;
 3057|       |
 3058|  12.5M|        c = *ptr;
 3059|  12.5M|        if (c < 0x80) {
  ------------------
  |  Branch (3059:13): [True: 10.4M, False: 2.08M]
  ------------------
 3060|  10.4M|            if (c == stop)
  ------------------
  |  Branch (3060:17): [True: 68.9k, False: 10.3M]
  ------------------
 3061|  68.9k|                break;
 3062|  10.3M|            len = 1;
 3063|  10.3M|        } else {
 3064|  2.08M|            len = 4;
 3065|  2.08M|            c = xmlGetUTF8Char(ptr, &len);
 3066|  2.08M|            if (c < 0)
  ------------------
  |  Branch (3066:17): [True: 3.21k, False: 2.08M]
  ------------------
 3067|  3.21k|                break;
 3068|  2.08M|        }
 3069|       |
 3070|  12.4M|        if (flags & XML_SCAN_NMTOKEN ?
  ------------------
  |  |   70|  12.4M|#define XML_SCAN_NMTOKEN    2
  ------------------
  |  Branch (3070:13): [True: 9.20M, False: 3.22M]
  |  Branch (3070:13): [True: 3.21M, False: 9.22M]
  ------------------
 3071|  9.20M|                !xmlIsNameChar(c, old10) :
 3072|  12.4M|                !xmlIsNameStartChar(c, old10))
 3073|  3.21M|            break;
 3074|       |
 3075|  9.22M|        if ((size_t) len > maxSize)
  ------------------
  |  Branch (3075:13): [True: 59, False: 9.22M]
  ------------------
 3076|     59|            return(NULL);
 3077|  9.22M|        ptr += len;
 3078|  9.22M|        maxSize -= len;
 3079|  9.22M|        flags |= XML_SCAN_NMTOKEN;
  ------------------
  |  |   70|  9.22M|#define XML_SCAN_NMTOKEN    2
  ------------------
 3080|  9.22M|    }
 3081|       |
 3082|  3.28M|    return(ptr);
 3083|  3.28M|}
xmlParseName:
 3150|  2.30M|xmlParseName(xmlParserCtxt *ctxt) {
 3151|  2.30M|    const xmlChar *in;
 3152|  2.30M|    const xmlChar *ret;
 3153|  2.30M|    size_t count = 0;
 3154|  2.30M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3154:24): [True: 1.06M, False: 1.23M]
  ------------------
 3155|  1.06M|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.06M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3156|  2.30M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  3.53M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3157|       |
 3158|  2.30M|    GROW;
  ------------------
  |  | 2271|  2.30M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  2.30M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  2.30M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 1.27M, False: 1.02M]
  |  |  ------------------
  |  | 2272|  2.30M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.27M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 524k, False: 746k]
  |  |  ------------------
  |  | 2273|  2.30M|	xmlParserGrow(ctxt);
  ------------------
 3159|       |
 3160|       |    /*
 3161|       |     * Accelerator for simple ASCII names
 3162|       |     */
 3163|  2.30M|    in = ctxt->input->cur;
 3164|  2.30M|    if (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3164:10): [True: 2.05M, False: 243k]
  |  Branch (3164:27): [True: 2.02M, False: 34.9k]
  ------------------
 3165|   278k|	((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3165:3): [True: 125k, False: 153k]
  |  Branch (3165:20): [True: 86.1k, False: 38.9k]
  ------------------
 3166|  2.11M|	(*in == '_') || (*in == ':')) {
  ------------------
  |  Branch (3166:2): [True: 1.41k, False: 191k]
  |  Branch (3166:18): [True: 5.73k, False: 185k]
  ------------------
 3167|  2.11M|	in++;
 3168|  13.9M|	while (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3168:10): [True: 3.60M, False: 10.3M]
  |  Branch (3168:27): [True: 3.54M, False: 53.2k]
  ------------------
 3169|  10.3M|	       ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3169:10): [True: 5.37M, False: 5.00M]
  |  Branch (3169:27): [True: 5.30M, False: 70.5k]
  ------------------
 3170|  5.07M|	       ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3170:10): [True: 4.29M, False: 779k]
  |  Branch (3170:27): [True: 2.72M, False: 1.56M]
  ------------------
 3171|  2.34M|	       (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3171:9): [True: 6.35k, False: 2.34M]
  |  Branch (3171:25): [True: 84.9k, False: 2.25M]
  ------------------
 3172|  2.25M|	       (*in == ':') || (*in == '.'))
  ------------------
  |  Branch (3172:9): [True: 127k, False: 2.12M]
  |  Branch (3172:25): [True: 13.9k, False: 2.11M]
  ------------------
 3173|  11.8M|	    in++;
 3174|  2.11M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3174:6): [True: 2.08M, False: 31.3k]
  |  Branch (3174:19): [True: 2.06M, False: 15.8k]
  ------------------
 3175|  2.06M|	    count = in - ctxt->input->cur;
 3176|  2.06M|            if (count > maxLength) {
  ------------------
  |  Branch (3176:17): [True: 66, False: 2.06M]
  ------------------
 3177|     66|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3178|     66|                return(NULL);
 3179|     66|            }
 3180|  2.06M|	    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
 3181|  2.06M|	    ctxt->input->cur = in;
 3182|  2.06M|	    ctxt->input->col += count;
 3183|  2.06M|	    if (ret == NULL)
  ------------------
  |  Branch (3183:10): [True: 3, False: 2.06M]
  ------------------
 3184|      3|	        xmlErrMemory(ctxt);
 3185|  2.06M|	    return(ret);
 3186|  2.06M|	}
 3187|  2.11M|    }
 3188|       |    /* accelerator for special cases */
 3189|   232k|    return(xmlParseNameComplex(ctxt));
 3190|  2.30M|}
xmlParseNmtoken:
 3380|  36.2k|xmlParseNmtoken(xmlParserCtxt *ctxt) {
 3381|  36.2k|    xmlChar buf[XML_MAX_NAMELEN + 5];
 3382|  36.2k|    xmlChar *ret;
 3383|  36.2k|    int len = 0, l;
 3384|  36.2k|    int c;
 3385|  36.2k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3385:21): [True: 17.0k, False: 19.2k]
  ------------------
 3386|  17.0k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  17.0k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3387|  36.2k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  19.2k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3388|  36.2k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3388:17): [True: 13.2k, False: 23.0k]
  ------------------
 3389|       |
 3390|  36.2k|    c = xmlCurrentChar(ctxt, &l);
 3391|       |
 3392|   152k|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3392:12): [True: 117k, False: 35.3k]
  ------------------
 3393|   117k|	COPY_BUF(buf, len, c);
  ------------------
  |  | 2296|   117k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 85.1k, False: 32.4k]
  |  |  ------------------
  |  | 2297|   117k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3394|   117k|	NEXTL(l);
  ------------------
  |  | 2288|   117k|#define NEXTL(l) do {							\
  |  | 2289|   117k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 117k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   117k|    } else ctxt->input->col++;						\
  |  | 2292|   117k|    ctxt->input->cur += l;				\
  |  | 2293|   117k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 117k]
  |  |  ------------------
  ------------------
 3395|   117k|	c = xmlCurrentChar(ctxt, &l);
 3396|   117k|	if (len >= XML_MAX_NAMELEN) {
  ------------------
  |  |   87|   117k|#define XML_MAX_NAMELEN 100
  ------------------
  |  Branch (3396:6): [True: 975, False: 116k]
  ------------------
 3397|       |	    /*
 3398|       |	     * Okay someone managed to make a huge token, so he's ready to pay
 3399|       |	     * for the processing speed.
 3400|       |	     */
 3401|    975|	    xmlChar *buffer;
 3402|    975|	    int max = len * 2;
 3403|       |
 3404|    975|	    buffer = xmlMalloc(max);
 3405|    975|	    if (buffer == NULL) {
  ------------------
  |  Branch (3405:10): [True: 1, False: 974]
  ------------------
 3406|      1|	        xmlErrMemory(ctxt);
 3407|      1|		return(NULL);
 3408|      1|	    }
 3409|    974|	    memcpy(buffer, buf, len);
 3410|  3.32M|	    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3410:13): [True: 3.32M, False: 903]
  ------------------
 3411|  3.32M|		if (len + 10 > max) {
  ------------------
  |  Branch (3411:7): [True: 2.57k, False: 3.31M]
  ------------------
 3412|  2.57k|		    xmlChar *tmp;
 3413|  2.57k|                    int newSize;
 3414|       |
 3415|  2.57k|                    newSize = xmlGrowCapacity(max, 1, 1, maxLength);
 3416|  2.57k|                    if (newSize < 0) {
  ------------------
  |  Branch (3416:25): [True: 70, False: 2.50k]
  ------------------
 3417|     70|                        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3418|     70|                        xmlFree(buffer);
 3419|     70|                        return(NULL);
 3420|     70|                    }
 3421|  2.50k|		    tmp = xmlRealloc(buffer, newSize);
 3422|  2.50k|		    if (tmp == NULL) {
  ------------------
  |  Branch (3422:11): [True: 1, False: 2.49k]
  ------------------
 3423|      1|			xmlErrMemory(ctxt);
 3424|      1|			xmlFree(buffer);
 3425|      1|			return(NULL);
 3426|      1|		    }
 3427|  2.49k|		    buffer = tmp;
 3428|  2.49k|                    max = newSize;
 3429|  2.49k|		}
 3430|  3.32M|		COPY_BUF(buffer, len, c);
  ------------------
  |  | 2296|  3.32M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 1.22M, False: 2.09M]
  |  |  ------------------
  |  | 2297|  3.32M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3431|  3.32M|		NEXTL(l);
  ------------------
  |  | 2288|  3.32M|#define NEXTL(l) do {							\
  |  | 2289|  3.32M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 3.32M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  3.32M|    } else ctxt->input->col++;						\
  |  | 2292|  3.32M|    ctxt->input->cur += l;				\
  |  | 2293|  3.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 3.32M]
  |  |  ------------------
  ------------------
 3432|  3.32M|		c = xmlCurrentChar(ctxt, &l);
 3433|  3.32M|	    }
 3434|    903|	    buffer[len] = 0;
 3435|    903|	    return(buffer);
 3436|    974|	}
 3437|   117k|    }
 3438|  35.3k|    if (len == 0)
  ------------------
  |  Branch (3438:9): [True: 8.28k, False: 27.0k]
  ------------------
 3439|  8.28k|        return(NULL);
 3440|  27.0k|    if (len > maxLength) {
  ------------------
  |  Branch (3440:9): [True: 0, False: 27.0k]
  ------------------
 3441|      0|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3442|      0|        return(NULL);
 3443|      0|    }
 3444|  27.0k|    ret = xmlStrndup(buf, len);
 3445|  27.0k|    if (ret == NULL)
  ------------------
  |  Branch (3445:9): [True: 5, False: 27.0k]
  ------------------
 3446|      5|        xmlErrMemory(ctxt);
 3447|  27.0k|    return(ret);
 3448|  27.0k|}
xmlParseEntityValue:
 3610|   109k|xmlParseEntityValue(xmlParserCtxt *ctxt, xmlChar **orig) {
 3611|   109k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3611:26): [True: 27.2k, False: 81.9k]
  ------------------
 3612|  27.2k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  27.2k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3613|   109k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   191k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3614|   109k|    xmlSBuf buf;
 3615|   109k|    const xmlChar *start;
 3616|   109k|    int quote, length;
 3617|       |
 3618|   109k|    xmlSBufInit(&buf, maxLength);
 3619|       |
 3620|   109k|    GROW;
  ------------------
  |  | 2271|   109k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   109k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   109k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 99.4k, False: 9.69k]
  |  |  ------------------
  |  | 2272|   109k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  99.4k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 23.7k, False: 75.7k]
  |  |  ------------------
  |  | 2273|   109k|	xmlParserGrow(ctxt);
  ------------------
 3621|       |
 3622|   109k|    quote = CUR;
  ------------------
  |  | 2225|   109k|#define CUR (*ctxt->input->cur)
  ------------------
 3623|   109k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (3623:9): [True: 5.58k, False: 103k]
  |  Branch (3623:27): [True: 0, False: 5.58k]
  ------------------
 3624|      0|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 3625|      0|	return(NULL);
 3626|      0|    }
 3627|   109k|    CUR_PTR++;
  ------------------
  |  | 2227|   109k|#define CUR_PTR ctxt->input->cur
  ------------------
 3628|       |
 3629|   109k|    length = 0;
 3630|       |
 3631|       |    /*
 3632|       |     * Copy raw content of the entity into a buffer
 3633|       |     */
 3634|  46.4M|    while (1) {
  ------------------
  |  Branch (3634:12): [True: 46.4M, Folded]
  ------------------
 3635|  46.4M|        int c;
 3636|       |
 3637|  46.4M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  46.4M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 4, False: 46.4M]
  |  |  ------------------
  ------------------
 3638|      4|            goto error;
 3639|       |
 3640|  46.4M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2227|  46.4M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3640:13): [True: 2.51k, False: 46.4M]
  ------------------
 3641|  2.51k|            xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL);
 3642|  2.51k|            goto error;
 3643|  2.51k|        }
 3644|       |
 3645|  46.4M|        c = CUR;
  ------------------
  |  | 2225|  46.4M|#define CUR (*ctxt->input->cur)
  ------------------
 3646|       |
 3647|  46.4M|        if (c == 0) {
  ------------------
  |  Branch (3647:13): [True: 284, False: 46.4M]
  ------------------
 3648|    284|            xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3649|    284|                    "invalid character in entity value\n");
 3650|    284|            goto error;
 3651|    284|        }
 3652|  46.4M|        if (c == quote)
  ------------------
  |  Branch (3652:13): [True: 106k, False: 46.3M]
  ------------------
 3653|   106k|            break;
 3654|  46.3M|        NEXTL(1);
  ------------------
  |  | 2288|  46.3M|#define NEXTL(l) do {							\
  |  | 2289|  46.3M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.43M, False: 44.9M]
  |  |  ------------------
  |  | 2290|  1.43M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  44.9M|    } else ctxt->input->col++;						\
  |  | 2292|  46.3M|    ctxt->input->cur += l;				\
  |  | 2293|  46.3M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 46.3M]
  |  |  ------------------
  ------------------
 3655|  46.3M|        length += 1;
 3656|       |
 3657|       |        /*
 3658|       |         * TODO: Check growth threshold
 3659|       |         */
 3660|  46.3M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2227|  46.3M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3660:13): [True: 59.2k, False: 46.3M]
  ------------------
 3661|  59.2k|            GROW;
  ------------------
  |  | 2271|  59.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  59.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  59.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 56.8k, False: 2.37k]
  |  |  ------------------
  |  | 2272|  59.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  56.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 56.8k, False: 0]
  |  |  ------------------
  |  | 2273|  59.2k|	xmlParserGrow(ctxt);
  ------------------
 3662|  46.3M|    }
 3663|       |
 3664|   106k|    start = CUR_PTR - length;
  ------------------
  |  | 2227|   106k|#define CUR_PTR ctxt->input->cur
  ------------------
 3665|       |
 3666|   106k|    if (orig != NULL) {
  ------------------
  |  Branch (3666:9): [True: 106k, False: 0]
  ------------------
 3667|   106k|        *orig = xmlStrndup(start, length);
 3668|   106k|        if (*orig == NULL)
  ------------------
  |  Branch (3668:13): [True: 4, False: 106k]
  ------------------
 3669|      4|            xmlErrMemory(ctxt);
 3670|   106k|    }
 3671|       |
 3672|   106k|    xmlExpandPEsInEntityValue(ctxt, &buf, start, length, ctxt->inputNr);
 3673|       |
 3674|   106k|    NEXTL(1);
  ------------------
  |  | 2288|   106k|#define NEXTL(l) do {							\
  |  | 2289|   106k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 106k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   106k|    } else ctxt->input->col++;						\
  |  | 2292|   106k|    ctxt->input->cur += l;				\
  |  | 2293|   106k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 106k]
  |  |  ------------------
  ------------------
 3675|       |
 3676|   106k|    return(xmlSBufFinish(&buf, NULL, ctxt, "entity length too long"));
 3677|       |
 3678|  2.80k|error:
 3679|  2.80k|    xmlSBufCleanup(&buf, ctxt, "entity length too long");
 3680|       |    return(NULL);
 3681|   109k|}
xmlExpandEntitiesInAttValue:
 3963|  24.5k|                            int normalize) {
 3964|  24.5k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3964:26): [True: 14.4k, False: 10.1k]
  ------------------
 3965|  14.4k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  14.4k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3966|  24.5k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  34.7k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3967|  24.5k|    xmlSBuf buf;
 3968|  24.5k|    int inSpace = 1;
 3969|       |
 3970|  24.5k|    xmlSBufInit(&buf, maxLength);
 3971|       |
 3972|  24.5k|    xmlExpandEntityInAttValue(ctxt, &buf, str, NULL, normalize, &inSpace,
 3973|  24.5k|                              ctxt->inputNr, /* check */ 0);
 3974|       |
 3975|  24.5k|    if ((normalize) && (inSpace) && (buf.size > 0))
  ------------------
  |  Branch (3975:9): [True: 0, False: 24.5k]
  |  Branch (3975:24): [True: 0, False: 0]
  |  Branch (3975:37): [True: 0, False: 0]
  ------------------
 3976|      0|        buf.size--;
 3977|       |
 3978|       |    return(xmlSBufFinish(&buf, NULL, ctxt, "AttValue length too long"));
 3979|  24.5k|}
xmlParseAttValue:
 4296|   162k|xmlParseAttValue(xmlParserCtxt *ctxt) {
 4297|   162k|    if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
  ------------------
  |  Branch (4297:9): [True: 0, False: 162k]
  |  Branch (4297:27): [True: 0, False: 162k]
  ------------------
 4298|   162k|    return(xmlParseAttValueInternal(ctxt, NULL, NULL, 0, 0));
 4299|   162k|}
xmlParseSystemLiteral:
 4313|  20.7k|xmlParseSystemLiteral(xmlParserCtxt *ctxt) {
 4314|  20.7k|    xmlChar *buf = NULL;
 4315|  20.7k|    int len = 0;
 4316|  20.7k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  20.7k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4317|  20.7k|    int cur, l;
 4318|  20.7k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4318:21): [True: 9.47k, False: 11.2k]
  ------------------
 4319|  9.47k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  9.47k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4320|  20.7k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  11.2k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4321|  20.7k|    xmlChar stop;
 4322|       |
 4323|  20.7k|    if (RAW == '"') {
  ------------------
  |  | 2224|  20.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4323:9): [True: 10.5k, False: 10.2k]
  ------------------
 4324|  10.5k|        NEXT;
  ------------------
  |  | 2279|  10.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4325|  10.5k|	stop = '"';
 4326|  10.5k|    } else if (RAW == '\'') {
  ------------------
  |  | 2224|  10.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4326:16): [True: 7.66k, False: 2.55k]
  ------------------
 4327|  7.66k|        NEXT;
  ------------------
  |  | 2279|  7.66k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4328|  7.66k|	stop = '\'';
 4329|  7.66k|    } else {
 4330|  2.55k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4331|  2.55k|	return(NULL);
 4332|  2.55k|    }
 4333|       |
 4334|  18.1k|    buf = xmlMalloc(size);
 4335|  18.1k|    if (buf == NULL) {
  ------------------
  |  Branch (4335:9): [True: 4, False: 18.1k]
  ------------------
 4336|      4|        xmlErrMemory(ctxt);
 4337|      4|	return(NULL);
 4338|      4|    }
 4339|  18.1k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4340|  4.93M|    while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */
  ------------------
  |  |  115|  4.93M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  4.93M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 1.33M, False: 3.60M]
  |  |  |  |  ------------------
  |  |  |  |  118|  4.93M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.33M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.33M, False: 1.63k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.06k, False: 1.33M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.33M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.33M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.33M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.33M, False: 1.64k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  4.93M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.60M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 3.25k, False: 3.59M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.60M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.59M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.59M, False: 1.32k]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.60M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.32k, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 1.32k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4340:12): [True: 4.93M, False: 1.64k]
  |  Branch (4340:30): [True: 4.91M, False: 16.4k]
  ------------------
 4341|  4.91M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4341:6): [True: 5.26k, False: 4.91M]
  ------------------
 4342|  5.26k|	    xmlChar *tmp;
 4343|  5.26k|            int newSize;
 4344|       |
 4345|  5.26k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4346|  5.26k|            if (newSize < 0) {
  ------------------
  |  Branch (4346:17): [True: 83, False: 5.18k]
  ------------------
 4347|     83|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral");
 4348|     83|                xmlFree(buf);
 4349|     83|                return(NULL);
 4350|     83|            }
 4351|  5.18k|	    tmp = xmlRealloc(buf, newSize);
 4352|  5.18k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4352:10): [True: 2, False: 5.18k]
  ------------------
 4353|      2|	        xmlFree(buf);
 4354|      2|		xmlErrMemory(ctxt);
 4355|      2|		return(NULL);
 4356|      2|	    }
 4357|  5.18k|	    buf = tmp;
 4358|  5.18k|            size = newSize;
 4359|  5.18k|	}
 4360|  4.91M|	COPY_BUF(buf, len, cur);
  ------------------
  |  | 2296|  4.91M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 136k, False: 4.78M]
  |  |  ------------------
  |  | 2297|  4.91M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4361|  4.91M|	NEXTL(l);
  ------------------
  |  | 2288|  4.91M|#define NEXTL(l) do {							\
  |  | 2289|  4.91M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.59k, False: 4.91M]
  |  |  ------------------
  |  | 2290|  1.59k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  4.91M|    } else ctxt->input->col++;						\
  |  | 2292|  4.91M|    ctxt->input->cur += l;				\
  |  | 2293|  4.91M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 4.91M]
  |  |  ------------------
  ------------------
 4362|  4.91M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4363|  4.91M|    }
 4364|  18.1k|    buf[len] = 0;
 4365|  18.1k|    if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|  18.1k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  18.1k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 18.1k, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  118|  18.1k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  18.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 16.4k, False: 1.63k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 16.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.1k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 18.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  18.1k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 16.4k, False: 1.64k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  18.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 (4365:9): [True: 1.64k, False: 16.4k]
  ------------------
 4366|  1.64k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4367|  16.4k|    } else {
 4368|  16.4k|	NEXT;
  ------------------
  |  | 2279|  16.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4369|  16.4k|    }
 4370|  18.1k|    return(buf);
 4371|  18.1k|}
xmlParsePubidLiteral:
 4385|  9.07k|xmlParsePubidLiteral(xmlParserCtxt *ctxt) {
 4386|  9.07k|    xmlChar *buf = NULL;
 4387|  9.07k|    int len = 0;
 4388|  9.07k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  9.07k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4389|  9.07k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4389:21): [True: 3.47k, False: 5.59k]
  ------------------
 4390|  3.47k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  3.47k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4391|  9.07k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  5.59k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4392|  9.07k|    xmlChar cur;
 4393|  9.07k|    xmlChar stop;
 4394|       |
 4395|  9.07k|    if (RAW == '"') {
  ------------------
  |  | 2224|  9.07k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4395:9): [True: 1.02k, False: 8.04k]
  ------------------
 4396|  1.02k|        NEXT;
  ------------------
  |  | 2279|  1.02k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4397|  1.02k|	stop = '"';
 4398|  8.04k|    } else if (RAW == '\'') {
  ------------------
  |  | 2224|  8.04k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4398:16): [True: 6.41k, False: 1.62k]
  ------------------
 4399|  6.41k|        NEXT;
  ------------------
  |  | 2279|  6.41k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4400|  6.41k|	stop = '\'';
 4401|  6.41k|    } else {
 4402|  1.62k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4403|  1.62k|	return(NULL);
 4404|  1.62k|    }
 4405|  7.44k|    buf = xmlMalloc(size);
 4406|  7.44k|    if (buf == NULL) {
  ------------------
  |  Branch (4406:9): [True: 1, False: 7.44k]
  ------------------
 4407|      1|	xmlErrMemory(ctxt);
 4408|      1|	return(NULL);
 4409|      1|    }
 4410|  7.44k|    cur = CUR;
  ------------------
  |  | 2225|  7.44k|#define CUR (*ctxt->input->cur)
  ------------------
 4411|   695k|    while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop) &&
  ------------------
  |  |  246|   695k|#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
  |  |  ------------------
  |  |  |  |  180|   695k|#define xmlIsPubidChar_ch(c)	(xmlIsPubidChar_tab[(c)])
  |  |  ------------------
  ------------------
  |  Branch (4411:12): [True: 694k, False: 1.34k]
  |  Branch (4411:38): [True: 688k, False: 6.09k]
  ------------------
 4412|   688k|           (PARSER_STOPPED(ctxt) == 0)) { /* checked */
  ------------------
  |  |   44|   688k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (4412:12): [True: 688k, False: 1]
  ------------------
 4413|   688k|	if (len + 1 >= size) {
  ------------------
  |  Branch (4413:6): [True: 234, False: 688k]
  ------------------
 4414|    234|	    xmlChar *tmp;
 4415|    234|            int newSize;
 4416|       |
 4417|    234|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4418|    234|            if (newSize < 0) {
  ------------------
  |  Branch (4418:17): [True: 1, False: 233]
  ------------------
 4419|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID");
 4420|      1|                xmlFree(buf);
 4421|      1|                return(NULL);
 4422|      1|            }
 4423|    233|	    tmp = xmlRealloc(buf, newSize);
 4424|    233|	    if (tmp == NULL) {
  ------------------
  |  Branch (4424:10): [True: 1, False: 232]
  ------------------
 4425|      1|		xmlErrMemory(ctxt);
 4426|      1|		xmlFree(buf);
 4427|      1|		return(NULL);
 4428|      1|	    }
 4429|    232|	    buf = tmp;
 4430|    232|            size = newSize;
 4431|    232|	}
 4432|   688k|	buf[len++] = cur;
 4433|   688k|	NEXT;
  ------------------
  |  | 2279|   688k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4434|   688k|	cur = CUR;
  ------------------
  |  | 2225|   688k|#define CUR (*ctxt->input->cur)
  ------------------
 4435|   688k|    }
 4436|  7.44k|    buf[len] = 0;
 4437|  7.44k|    if (cur != stop) {
  ------------------
  |  Branch (4437:9): [True: 672, False: 6.76k]
  ------------------
 4438|    672|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4439|  6.76k|    } else {
 4440|  6.76k|	NEXTL(1);
  ------------------
  |  | 2288|  6.76k|#define NEXTL(l) do {							\
  |  | 2289|  6.76k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 6.76k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  6.76k|    } else ctxt->input->col++;						\
  |  | 2292|  6.76k|    ctxt->input->cur += l;				\
  |  | 2293|  6.76k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
 4441|  6.76k|    }
 4442|  7.44k|    return(buf);
 4443|  7.44k|}
xmlParseExternalID:
 4755|  41.1k|xmlParseExternalID(xmlParserCtxt *ctxt, xmlChar **publicId, int strict) {
 4756|  41.1k|    xmlChar *URI = NULL;
 4757|       |
 4758|  41.1k|    *publicId = NULL;
 4759|  41.1k|    if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
  ------------------
  |  | 2236|  41.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  82.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  82.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 13.8k, False: 27.2k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 13.8k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  41.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 13.8k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 13.8k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 13.8k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 13.8k, False: 3]
  |  |  ------------------
  ------------------
 4760|  13.8k|        SKIP(6);
  ------------------
  |  | 2248|  13.8k|#define SKIP(val) do {							\
  |  | 2249|  13.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  13.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 197, False: 13.6k]
  |  |  ------------------
  |  | 2251|  13.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  13.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
 4761|  13.8k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  13.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4761:6): [True: 476, False: 13.3k]
  ------------------
 4762|    476|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4763|    476|	                   "Space required after 'SYSTEM'\n");
 4764|    476|	}
 4765|  13.8k|	URI = xmlParseSystemLiteral(ctxt);
 4766|  13.8k|	if (URI == NULL) {
  ------------------
  |  Branch (4766:6): [True: 691, False: 13.1k]
  ------------------
 4767|    691|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4768|    691|        }
 4769|  27.3k|    } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) {
  ------------------
  |  | 2236|  27.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  54.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  54.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 9.08k, False: 18.2k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 9.08k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  27.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 9.08k, False: 3]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 9.07k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 9.07k, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 9.07k, False: 1]
  |  |  ------------------
  ------------------
 4770|  9.07k|        SKIP(6);
  ------------------
  |  | 2248|  9.07k|#define SKIP(val) do {							\
  |  | 2249|  9.07k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  9.07k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 106, False: 8.96k]
  |  |  ------------------
  |  | 2251|  9.07k|        xmlParserGrow(ctxt);						\
  |  | 2252|  9.07k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 9.07k]
  |  |  ------------------
  ------------------
 4771|  9.07k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  9.07k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4771:6): [True: 2.03k, False: 7.03k]
  ------------------
 4772|  2.03k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4773|  2.03k|		    "Space required after 'PUBLIC'\n");
 4774|  2.03k|	}
 4775|  9.07k|	*publicId = xmlParsePubidLiteral(ctxt);
 4776|  9.07k|	if (*publicId == NULL) {
  ------------------
  |  Branch (4776:6): [True: 1.63k, False: 7.44k]
  ------------------
 4777|  1.63k|	    xmlFatalErr(ctxt, XML_ERR_PUBID_REQUIRED, NULL);
 4778|  1.63k|	}
 4779|  9.07k|	if (strict) {
  ------------------
  |  Branch (4779:6): [True: 6.85k, False: 2.21k]
  ------------------
 4780|       |	    /*
 4781|       |	     * We don't handle [83] so "S SystemLiteral" is required.
 4782|       |	     */
 4783|  6.85k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  6.85k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4783:10): [True: 2.65k, False: 4.19k]
  ------------------
 4784|  2.65k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4785|  2.65k|			"Space required after the Public Identifier\n");
 4786|  2.65k|	    }
 4787|  6.85k|	} else {
 4788|       |	    /*
 4789|       |	     * We handle [83] so we return immediately, if
 4790|       |	     * "S SystemLiteral" is not detected. We skip blanks if no
 4791|       |             * system literal was found, but this is harmless since we must
 4792|       |             * be at the end of a NotationDecl.
 4793|       |	     */
 4794|  2.21k|	    if (SKIP_BLANKS == 0) return(NULL);
  ------------------
  |  | 2275|  2.21k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4794:10): [True: 1.45k, False: 765]
  ------------------
 4795|    765|	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2225|    765|#define CUR (*ctxt->input->cur)
  ------------------
              	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2225|    723|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4795:10): [True: 723, False: 42]
  |  Branch (4795:27): [True: 713, False: 10]
  ------------------
 4796|    765|	}
 4797|  6.90k|	URI = xmlParseSystemLiteral(ctxt);
 4798|  6.90k|	if (URI == NULL) {
  ------------------
  |  Branch (4798:6): [True: 1.94k, False: 4.95k]
  ------------------
 4799|  1.94k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4800|  1.94k|        }
 4801|  6.90k|    }
 4802|  38.9k|    return(URI);
 4803|  41.1k|}
xmlParseComment:
 4932|   491k|xmlParseComment(xmlParserCtxt *ctxt) {
 4933|   491k|    xmlChar *buf = NULL;
 4934|   491k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   491k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4935|   491k|    size_t len = 0;
 4936|   491k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4936:24): [True: 145k, False: 346k]
  ------------------
 4937|   145k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   145k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4938|   491k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   838k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4939|   491k|    const xmlChar *in;
 4940|   491k|    size_t nbchar = 0;
 4941|   491k|    int ccol;
 4942|       |
 4943|       |    /*
 4944|       |     * Check that there is a comment right here.
 4945|       |     */
 4946|   491k|    if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2224|   491k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|   491k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4946:9): [True: 0, False: 491k]
  |  Branch (4946:25): [True: 0, False: 491k]
  ------------------
 4947|      0|        return;
 4948|   491k|    SKIP(2);
  ------------------
  |  | 2248|   491k|#define SKIP(val) do {							\
  |  | 2249|   491k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   491k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 491k]
  |  |  ------------------
  |  | 2251|   491k|        xmlParserGrow(ctxt);						\
  |  | 2252|   491k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 491k]
  |  |  ------------------
  ------------------
 4949|   491k|    if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2224|   491k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2226|   491k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4949:9): [True: 0, False: 491k]
  |  Branch (4949:25): [True: 11, False: 491k]
  ------------------
 4950|     11|        return;
 4951|   491k|    SKIP(2);
  ------------------
  |  | 2248|   491k|#define SKIP(val) do {							\
  |  | 2249|   491k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   491k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 204, False: 491k]
  |  |  ------------------
  |  | 2251|   491k|        xmlParserGrow(ctxt);						\
  |  | 2252|   491k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 491k]
  |  |  ------------------
  ------------------
 4952|   491k|    GROW;
  ------------------
  |  | 2271|   491k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   491k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   491k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 343k, False: 148k]
  |  |  ------------------
  |  | 2272|   491k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   343k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 130k, False: 213k]
  |  |  ------------------
  |  | 2273|   491k|	xmlParserGrow(ctxt);
  ------------------
 4953|       |
 4954|       |    /*
 4955|       |     * Accelerated common case where input don't need to be
 4956|       |     * modified before passing it to the handler.
 4957|       |     */
 4958|   491k|    in = ctxt->input->cur;
 4959|   492k|    do {
 4960|   492k|	if (*in == 0xA) {
  ------------------
  |  Branch (4960:6): [True: 700, False: 491k]
  ------------------
 4961|  4.86k|	    do {
 4962|  4.86k|		ctxt->input->line++; ctxt->input->col = 1;
 4963|  4.86k|		in++;
 4964|  4.86k|	    } while (*in == 0xA);
  ------------------
  |  Branch (4964:15): [True: 4.16k, False: 700]
  ------------------
 4965|    700|	}
 4966|   877k|get_more:
 4967|   877k|        ccol = ctxt->input->col;
 4968|  5.46M|	while (((*in > '-') && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4968:10): [True: 3.64M, False: 1.81M]
  |  Branch (4968:25): [True: 3.58M, False: 62.0k]
  ------------------
 4969|  1.87M|	       ((*in >= 0x20) && (*in < '-')) ||
  ------------------
  |  Branch (4969:10): [True: 1.73M, False: 139k]
  |  Branch (4969:27): [True: 992k, False: 746k]
  ------------------
 4970|  4.58M|	       (*in == 0x09)) {
  ------------------
  |  Branch (4970:9): [True: 8.78k, False: 877k]
  ------------------
 4971|  4.58M|		    in++;
 4972|  4.58M|		    ccol++;
 4973|  4.58M|	}
 4974|   877k|	ctxt->input->col = ccol;
 4975|   877k|	if (*in == 0xA) {
  ------------------
  |  Branch (4975:6): [True: 28.2k, False: 849k]
  ------------------
 4976|   278k|	    do {
 4977|   278k|		ctxt->input->line++; ctxt->input->col = 1;
 4978|   278k|		in++;
 4979|   278k|	    } while (*in == 0xA);
  ------------------
  |  Branch (4979:15): [True: 250k, False: 28.2k]
  ------------------
 4980|  28.2k|	    goto get_more;
 4981|  28.2k|	}
 4982|   849k|	nbchar = in - ctxt->input->cur;
 4983|       |	/*
 4984|       |	 * save current set of data
 4985|       |	 */
 4986|   849k|	if (nbchar > 0) {
  ------------------
  |  Branch (4986:6): [True: 518k, False: 330k]
  ------------------
 4987|   518k|            if (nbchar > maxLength - len) {
  ------------------
  |  Branch (4987:17): [True: 0, False: 518k]
  ------------------
 4988|      0|                xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4989|      0|                                  "Comment too big found", NULL);
 4990|      0|                xmlFree(buf);
 4991|      0|                return;
 4992|      0|            }
 4993|   518k|            if (buf == NULL) {
  ------------------
  |  Branch (4993:17): [True: 194k, False: 323k]
  ------------------
 4994|   194k|                if ((*in == '-') && (in[1] == '-'))
  ------------------
  |  Branch (4994:21): [True: 100k, False: 94.5k]
  |  Branch (4994:37): [True: 72.6k, False: 27.8k]
  ------------------
 4995|  72.6k|                    size = nbchar + 1;
 4996|   122k|                else
 4997|   122k|                    size = XML_PARSER_BUFFER_SIZE + nbchar;
  ------------------
  |  |  172|   122k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4998|   194k|                buf = xmlMalloc(size);
 4999|   194k|                if (buf == NULL) {
  ------------------
  |  Branch (4999:21): [True: 5, False: 194k]
  ------------------
 5000|      5|                    xmlErrMemory(ctxt);
 5001|      5|                    return;
 5002|      5|                }
 5003|   194k|                len = 0;
 5004|   323k|            } else if (len + nbchar + 1 >= size) {
  ------------------
  |  Branch (5004:24): [True: 13.2k, False: 310k]
  ------------------
 5005|  13.2k|                xmlChar *new_buf;
 5006|  13.2k|                size += len + nbchar + XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  13.2k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5007|  13.2k|                new_buf = xmlRealloc(buf, size);
 5008|  13.2k|                if (new_buf == NULL) {
  ------------------
  |  Branch (5008:21): [True: 5, False: 13.2k]
  ------------------
 5009|      5|                    xmlErrMemory(ctxt);
 5010|      5|                    xmlFree(buf);
 5011|      5|                    return;
 5012|      5|                }
 5013|  13.2k|                buf = new_buf;
 5014|  13.2k|            }
 5015|   518k|            memcpy(&buf[len], ctxt->input->cur, nbchar);
 5016|   518k|            len += nbchar;
 5017|   518k|            buf[len] = 0;
 5018|   518k|	}
 5019|   849k|	ctxt->input->cur = in;
 5020|   849k|	if (*in == 0xA) {
  ------------------
  |  Branch (5020:6): [True: 0, False: 849k]
  ------------------
 5021|      0|	    in++;
 5022|      0|	    ctxt->input->line++; ctxt->input->col = 1;
 5023|      0|	}
 5024|   849k|	if (*in == 0xD) {
  ------------------
  |  Branch (5024:6): [True: 100k, False: 748k]
  ------------------
 5025|   100k|	    in++;
 5026|   100k|	    if (*in == 0xA) {
  ------------------
  |  Branch (5026:10): [True: 12.0k, False: 88.2k]
  ------------------
 5027|  12.0k|		ctxt->input->cur = in;
 5028|  12.0k|		in++;
 5029|  12.0k|		ctxt->input->line++; ctxt->input->col = 1;
 5030|  12.0k|		goto get_more;
 5031|  12.0k|	    }
 5032|  88.2k|	    in--;
 5033|  88.2k|	}
 5034|   837k|	SHRINK;
  ------------------
  |  | 2267|   837k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   837k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   837k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 678k, False: 159k]
  |  |  ------------------
  |  | 2268|   837k|	xmlParserShrink(ctxt);
  ------------------
 5035|   837k|	GROW;
  ------------------
  |  | 2271|   837k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   837k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   837k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 678k, False: 159k]
  |  |  ------------------
  |  | 2272|   837k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   678k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 141k, False: 536k]
  |  |  ------------------
  |  | 2273|   837k|	xmlParserGrow(ctxt);
  ------------------
 5036|   837k|	in = ctxt->input->cur;
 5037|   837k|	if (*in == '-') {
  ------------------
  |  Branch (5037:6): [True: 684k, False: 152k]
  ------------------
 5038|   684k|	    if (in[1] == '-') {
  ------------------
  |  Branch (5038:10): [True: 514k, False: 170k]
  ------------------
 5039|   514k|	        if (in[2] == '>') {
  ------------------
  |  Branch (5039:14): [True: 339k, False: 174k]
  ------------------
 5040|   339k|		    SKIP(3);
  ------------------
  |  | 2248|   339k|#define SKIP(val) do {							\
  |  | 2249|   339k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   339k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 531, False: 339k]
  |  |  ------------------
  |  | 2251|   339k|        xmlParserGrow(ctxt);						\
  |  | 2252|   339k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 339k]
  |  |  ------------------
  ------------------
 5041|   339k|		    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (5041:11): [True: 339k, False: 0]
  |  Branch (5041:34): [True: 339k, False: 0]
  ------------------
 5042|   339k|		        (!ctxt->disableSAX)) {
  ------------------
  |  Branch (5042:11): [True: 323k, False: 16.0k]
  ------------------
 5043|   323k|			if (buf != NULL)
  ------------------
  |  Branch (5043:8): [True: 64.4k, False: 259k]
  ------------------
 5044|  64.4k|			    ctxt->sax->comment(ctxt->userData, buf);
 5045|   259k|			else
 5046|   259k|			    ctxt->sax->comment(ctxt->userData, BAD_CAST "");
  ------------------
  |  |   34|   259k|#define BAD_CAST (xmlChar *)
  ------------------
 5047|   323k|		    }
 5048|   339k|		    if (buf != NULL)
  ------------------
  |  Branch (5048:11): [True: 71.4k, False: 268k]
  ------------------
 5049|  71.4k|		        xmlFree(buf);
 5050|   339k|		    return;
 5051|   339k|		}
 5052|   174k|		if (buf != NULL) {
  ------------------
  |  Branch (5052:7): [True: 147k, False: 27.1k]
  ------------------
 5053|   147k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5054|   147k|		                      "Double hyphen within comment: "
 5055|   147k|                                      "<!--%.50s\n",
 5056|   147k|				      buf);
 5057|   147k|		} else
 5058|  27.1k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5059|  27.1k|		                      "Double hyphen within comment\n", NULL);
 5060|   174k|		in++;
 5061|   174k|		ctxt->input->col++;
 5062|   174k|	    }
 5063|   344k|	    in++;
 5064|   344k|	    ctxt->input->col++;
 5065|   344k|	    goto get_more;
 5066|   684k|	}
 5067|   837k|    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (5067:15): [True: 62.4k, False: 89.9k]
  |  Branch (5067:32): [True: 322, False: 62.0k]
  |  Branch (5067:50): [True: 103, False: 151k]
  |  Branch (5067:67): [True: 0, False: 151k]
  ------------------
 5068|   151k|    xmlParseCommentComplex(ctxt, buf, len, size);
 5069|   151k|}
xmlParsePITarget:
 5084|  91.4k|xmlParsePITarget(xmlParserCtxt *ctxt) {
 5085|  91.4k|    const xmlChar *name;
 5086|       |
 5087|  91.4k|    name = xmlParseName(ctxt);
 5088|  91.4k|    if ((name != NULL) &&
  ------------------
  |  Branch (5088:9): [True: 86.7k, False: 4.64k]
  ------------------
 5089|  86.7k|        ((name[0] == 'x') || (name[0] == 'X')) &&
  ------------------
  |  Branch (5089:10): [True: 20.2k, False: 66.4k]
  |  Branch (5089:30): [True: 512, False: 65.9k]
  ------------------
 5090|  20.7k|        ((name[1] == 'm') || (name[1] == 'M')) &&
  ------------------
  |  Branch (5090:10): [True: 18.5k, False: 2.21k]
  |  Branch (5090:30): [True: 541, False: 1.67k]
  ------------------
 5091|  19.1k|        ((name[2] == 'l') || (name[2] == 'L'))) {
  ------------------
  |  Branch (5091:10): [True: 14.1k, False: 4.99k]
  |  Branch (5091:30): [True: 215, False: 4.78k]
  ------------------
 5092|  14.3k|	int i;
 5093|  14.3k|	if ((name[0] == 'x') && (name[1] == 'm') &&
  ------------------
  |  Branch (5093:6): [True: 13.9k, False: 365]
  |  Branch (5093:26): [True: 13.6k, False: 284]
  ------------------
 5094|  13.6k|	    (name[2] == 'l') && (name[3] == 0)) {
  ------------------
  |  Branch (5094:6): [True: 13.4k, False: 197]
  |  Branch (5094:26): [True: 12.7k, False: 759]
  ------------------
 5095|  12.7k|	    xmlFatalErrMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5096|  12.7k|		 "XML declaration allowed only at the start of the document\n");
 5097|  12.7k|	    return(name);
 5098|  12.7k|	} else if (name[3] == 0) {
  ------------------
  |  Branch (5098:13): [True: 652, False: 953]
  ------------------
 5099|    652|	    xmlFatalErr(ctxt, XML_ERR_RESERVED_XML_NAME, NULL);
 5100|    652|	    return(name);
 5101|    652|	}
 5102|  2.72k|	for (i = 0;;i++) {
 5103|  2.72k|	    if (xmlW3CPIs[i] == NULL) break;
  ------------------
  |  Branch (5103:10): [True: 865, False: 1.86k]
  ------------------
 5104|  1.86k|	    if (xmlStrEqual(name, (const xmlChar *)xmlW3CPIs[i]))
  ------------------
  |  Branch (5104:10): [True: 88, False: 1.77k]
  ------------------
 5105|     88|	        return(name);
 5106|  1.86k|	}
 5107|    865|	xmlWarningMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5108|    865|		      "xmlParsePITarget: invalid name prefix 'xml'\n",
 5109|    865|		      NULL, NULL);
 5110|    865|    }
 5111|  77.9k|    if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
  ------------------
  |  Branch (5111:9): [True: 73.2k, False: 4.64k]
  |  Branch (5111:27): [True: 564, False: 72.7k]
  ------------------
 5112|    564|	xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5113|    564|		 "colons are forbidden from PI names '%s'\n", name, NULL, NULL);
 5114|    564|    }
 5115|  77.9k|    return(name);
 5116|  91.4k|}
xmlParsePI:
 5198|  91.4k|xmlParsePI(xmlParserCtxt *ctxt) {
 5199|  91.4k|    xmlChar *buf = NULL;
 5200|  91.4k|    size_t len = 0;
 5201|  91.4k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  91.4k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5202|  91.4k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (5202:24): [True: 42.4k, False: 48.9k]
  ------------------
 5203|  42.4k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  42.4k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 5204|  91.4k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   140k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 5205|  91.4k|    int cur, l;
 5206|  91.4k|    const xmlChar *target;
 5207|       |
 5208|  91.4k|    if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2224|  91.4k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2226|  91.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5208:9): [True: 91.4k, False: 0]
  |  Branch (5208:25): [True: 91.4k, False: 0]
  ------------------
 5209|       |	/*
 5210|       |	 * this is a Processing Instruction.
 5211|       |	 */
 5212|  91.4k|	SKIP(2);
  ------------------
  |  | 2248|  91.4k|#define SKIP(val) do {							\
  |  | 2249|  91.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  91.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 799, False: 90.6k]
  |  |  ------------------
  |  | 2251|  91.4k|        xmlParserGrow(ctxt);						\
  |  | 2252|  91.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 91.4k]
  |  |  ------------------
  ------------------
 5213|       |
 5214|       |	/*
 5215|       |	 * Parse the target name and check for special support like
 5216|       |	 * namespace.
 5217|       |	 */
 5218|  91.4k|        target = xmlParsePITarget(ctxt);
 5219|  91.4k|	if (target != NULL) {
  ------------------
  |  Branch (5219:6): [True: 86.7k, False: 4.64k]
  ------------------
 5220|  86.7k|	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|  86.7k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  60.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5220:10): [True: 60.2k, False: 26.4k]
  |  Branch (5220:26): [True: 59.8k, False: 462]
  ------------------
 5221|  59.8k|		SKIP(2);
  ------------------
  |  | 2248|  59.8k|#define SKIP(val) do {							\
  |  | 2249|  59.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  59.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 540, False: 59.2k]
  |  |  ------------------
  |  | 2251|  59.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  59.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 59.8k]
  |  |  ------------------
  ------------------
 5222|       |
 5223|       |		/*
 5224|       |		 * SAX: PI detected.
 5225|       |		 */
 5226|  59.8k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5226:7): [True: 59.8k, False: 0]
  |  Branch (5226:22): [True: 59.2k, False: 612]
  ------------------
 5227|  59.2k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5227:7): [True: 59.2k, False: 0]
  ------------------
 5228|  59.2k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5229|  59.2k|		                                     target, NULL);
 5230|  59.8k|		return;
 5231|  59.8k|	    }
 5232|  26.9k|	    buf = xmlMalloc(size);
 5233|  26.9k|	    if (buf == NULL) {
  ------------------
  |  Branch (5233:10): [True: 7, False: 26.9k]
  ------------------
 5234|      7|		xmlErrMemory(ctxt);
 5235|      7|		return;
 5236|      7|	    }
 5237|  26.9k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  26.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (5237:10): [True: 8.32k, False: 18.5k]
  ------------------
 5238|  8.32k|		xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED,
 5239|  8.32k|			  "ParsePI: PI %s space expected\n", target);
 5240|  8.32k|	    }
 5241|  26.9k|	    cur = xmlCurrentCharRecover(ctxt, &l);
 5242|  4.38M|	    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  4.38M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  8.77M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 4.37M, False: 9.07k]
  |  |  |  |  |  Branch (117:25): [True: 1.21M, False: 3.16M]
  |  |  |  |  ------------------
  |  |  |  |  118|  8.77M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.21M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.20M, False: 8.72k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 87.7k, False: 1.12M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.21M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.13M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.21M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.12M, False: 8.85k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  8.77M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.16M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.36M, False: 801k]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.16M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 801k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 800k, False: 1.07k]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.16M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 855, False: 216]
  |  |  |  |  |  Branch (121:27): [True: 855, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5243|  4.37M|		   ((cur != '?') || (NXT(1) != '>'))) {
  ------------------
  |  | 2226|  27.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5243:7): [True: 4.35M, False: 27.6k]
  |  Branch (5243:23): [True: 9.84k, False: 17.8k]
  ------------------
 5244|  4.36M|		if (len + 5 >= size) {
  ------------------
  |  Branch (5244:7): [True: 19.5k, False: 4.34M]
  ------------------
 5245|  19.5k|		    xmlChar *tmp;
 5246|  19.5k|                    int newSize;
 5247|       |
 5248|  19.5k|                    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 5249|  19.5k|                    if (newSize < 0) {
  ------------------
  |  Branch (5249:25): [True: 0, False: 19.5k]
  ------------------
 5250|      0|                        xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5251|      0|                                          "PI %s too big found", target);
 5252|      0|                        xmlFree(buf);
 5253|      0|                        return;
 5254|      0|                    }
 5255|  19.5k|		    tmp = xmlRealloc(buf, newSize);
 5256|  19.5k|		    if (tmp == NULL) {
  ------------------
  |  Branch (5256:11): [True: 8, False: 19.5k]
  ------------------
 5257|      8|			xmlErrMemory(ctxt);
 5258|      8|			xmlFree(buf);
 5259|      8|			return;
 5260|      8|		    }
 5261|  19.5k|		    buf = tmp;
 5262|  19.5k|                    size = newSize;
 5263|  19.5k|		}
 5264|  4.36M|		COPY_BUF(buf, len, cur);
  ------------------
  |  | 2296|  4.36M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 1.17M, False: 3.18M]
  |  |  ------------------
  |  | 2297|  4.36M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 5265|  4.36M|		NEXTL(l);
  ------------------
  |  | 2288|  4.36M|#define NEXTL(l) do {							\
  |  | 2289|  4.36M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 84.3k, False: 4.27M]
  |  |  ------------------
  |  | 2290|  84.3k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  4.27M|    } else ctxt->input->col++;						\
  |  | 2292|  4.36M|    ctxt->input->cur += l;				\
  |  | 2293|  4.36M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 4.36M]
  |  |  ------------------
  ------------------
 5266|  4.36M|		cur = xmlCurrentCharRecover(ctxt, &l);
 5267|  4.36M|	    }
 5268|  26.9k|	    buf[len] = 0;
 5269|  26.9k|	    if (cur != '?') {
  ------------------
  |  Branch (5269:10): [True: 9.07k, False: 17.8k]
  ------------------
 5270|  9.07k|		xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5271|  9.07k|		      "ParsePI: PI %s never end ...\n", target);
 5272|  17.8k|	    } else {
 5273|  17.8k|		SKIP(2);
  ------------------
  |  | 2248|  17.8k|#define SKIP(val) do {							\
  |  | 2249|  17.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  17.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 251, False: 17.5k]
  |  |  ------------------
  |  | 2251|  17.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  17.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 17.8k]
  |  |  ------------------
  ------------------
 5274|       |
 5275|  17.8k|#ifdef LIBXML_CATALOG_ENABLED
 5276|  17.8k|		if ((ctxt->inSubset == 0) &&
  ------------------
  |  Branch (5276:7): [True: 7.81k, False: 10.0k]
  ------------------
 5277|  7.81k|		    (xmlStrEqual(target, XML_CATALOG_PI))) {
  ------------------
  |  |   44|  7.81k|    (const xmlChar *) "oasis-xml-catalog"
  ------------------
  |  Branch (5277:7): [True: 391, False: 7.41k]
  ------------------
 5278|    391|		    xmlCatalogAllow allow = xmlCatalogGetDefaults();
 5279|       |
 5280|    391|		    if ((ctxt->options & XML_PARSE_CATALOG_PI) &&
  ------------------
  |  Branch (5280:11): [True: 193, False: 198]
  ------------------
 5281|    193|                        ((allow == XML_CATA_ALLOW_DOCUMENT) ||
  ------------------
  |  Branch (5281:26): [True: 0, False: 193]
  ------------------
 5282|    193|			 (allow == XML_CATA_ALLOW_ALL)))
  ------------------
  |  Branch (5282:5): [True: 0, False: 193]
  ------------------
 5283|      0|			xmlParseCatalogPI(ctxt, buf);
 5284|    391|		}
 5285|  17.8k|#endif
 5286|       |
 5287|       |		/*
 5288|       |		 * SAX: PI detected.
 5289|       |		 */
 5290|  17.8k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5290:7): [True: 17.8k, False: 0]
  |  Branch (5290:22): [True: 17.1k, False: 686]
  ------------------
 5291|  17.1k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5291:7): [True: 17.1k, False: 0]
  ------------------
 5292|  17.1k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5293|  17.1k|		                                     target, buf);
 5294|  17.8k|	    }
 5295|  26.9k|	    xmlFree(buf);
 5296|  26.9k|	} else {
 5297|       |	    xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
 5298|  4.64k|	}
 5299|  91.4k|    }
 5300|  91.4k|}
xmlParseNotationDecl:
 5322|  5.12k|xmlParseNotationDecl(xmlParserCtxt *ctxt) {
 5323|  5.12k|    const xmlChar *name;
 5324|  5.12k|    xmlChar *Pubid;
 5325|  5.12k|    xmlChar *Systemid;
 5326|       |
 5327|  5.12k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  5.12k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  5.12k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5327:9): [True: 0, False: 5.12k]
  |  Branch (5327:25): [True: 0, False: 5.12k]
  ------------------
 5328|      0|        return;
 5329|  5.12k|    SKIP(2);
  ------------------
  |  | 2248|  5.12k|#define SKIP(val) do {							\
  |  | 2249|  5.12k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  5.12k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 5.12k]
  |  |  ------------------
  |  | 2251|  5.12k|        xmlParserGrow(ctxt);						\
  |  | 2252|  5.12k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 5.12k]
  |  |  ------------------
  ------------------
 5330|       |
 5331|  5.12k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2240|  5.12k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|  10.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|  10.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|  10.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|  10.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 5.12k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 5.11k, False: 10]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  5.12k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 5.10k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 5.10k, False: 5]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 5.10k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 5.10k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 5.10k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 5.09k, False: 4]
  |  |  ------------------
  ------------------
 5332|  5.09k|#ifdef LIBXML_VALID_ENABLED
 5333|  5.09k|	int oldInputNr = ctxt->inputNr;
 5334|  5.09k|#endif
 5335|       |
 5336|  5.09k|	SKIP(8);
  ------------------
  |  | 2248|  5.09k|#define SKIP(val) do {							\
  |  | 2249|  5.09k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  5.09k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 72, False: 5.02k]
  |  |  ------------------
  |  | 2251|  5.09k|        xmlParserGrow(ctxt);						\
  |  | 2252|  5.09k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 5.09k]
  |  |  ------------------
  ------------------
 5337|  5.09k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  5.09k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5337:6): [True: 542, False: 4.55k]
  ------------------
 5338|    542|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5339|    542|			   "Space required after '<!NOTATION'\n");
 5340|    542|	    return;
 5341|    542|	}
 5342|       |
 5343|  4.55k|        name = xmlParseName(ctxt);
 5344|  4.55k|	if (name == NULL) {
  ------------------
  |  Branch (5344:6): [True: 391, False: 4.16k]
  ------------------
 5345|    391|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5346|    391|	    return;
 5347|    391|	}
 5348|  4.16k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5348:6): [True: 279, False: 3.88k]
  ------------------
 5349|    279|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5350|    279|		     "colons are forbidden from notation names '%s'\n",
 5351|    279|		     name, NULL, NULL);
 5352|    279|	}
 5353|  4.16k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  4.16k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5353:6): [True: 301, False: 3.86k]
  ------------------
 5354|    301|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5355|    301|		     "Space required after the NOTATION name'\n");
 5356|    301|	    return;
 5357|    301|	}
 5358|       |
 5359|       |	/*
 5360|       |	 * Parse the IDs.
 5361|       |	 */
 5362|  3.86k|	Systemid = xmlParseExternalID(ctxt, &Pubid, 0);
 5363|  3.86k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  3.86k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5364|       |
 5365|  3.86k|	if (RAW == '>') {
  ------------------
  |  | 2224|  3.86k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5365:6): [True: 3.09k, False: 764]
  ------------------
 5366|  3.09k|#ifdef LIBXML_VALID_ENABLED
 5367|  3.09k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5367:10): [True: 1.70k, False: 1.39k]
  |  Branch (5367:30): [True: 10, False: 1.69k]
  ------------------
 5368|     10|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5369|     10|	                         "Notation declaration doesn't start and stop"
 5370|     10|                                 " in the same entity\n",
 5371|     10|                                 NULL, NULL);
 5372|     10|	    }
 5373|  3.09k|#endif
 5374|  3.09k|	    NEXT;
  ------------------
  |  | 2279|  3.09k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5375|  3.09k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5375:10): [True: 3.09k, False: 0]
  |  Branch (5375:33): [True: 1.99k, False: 1.10k]
  ------------------
 5376|  1.99k|		(ctxt->sax->notationDecl != NULL))
  ------------------
  |  Branch (5376:3): [True: 1.99k, False: 0]
  ------------------
 5377|  1.99k|		ctxt->sax->notationDecl(ctxt->userData, name, Pubid, Systemid);
 5378|  3.09k|	} else {
 5379|    764|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5380|    764|	}
 5381|  3.86k|	if (Systemid != NULL) xmlFree(Systemid);
  ------------------
  |  Branch (5381:6): [True: 1.42k, False: 2.44k]
  ------------------
 5382|  3.86k|	if (Pubid != NULL) xmlFree(Pubid);
  ------------------
  |  Branch (5382:6): [True: 1.96k, False: 1.90k]
  ------------------
 5383|  3.86k|    }
 5384|  5.12k|}
xmlParseEntityDecl:
 5410|   157k|xmlParseEntityDecl(xmlParserCtxt *ctxt) {
 5411|   157k|    const xmlChar *name = NULL;
 5412|   157k|    xmlChar *value = NULL;
 5413|   157k|    xmlChar *URI = NULL, *literal = NULL;
 5414|   157k|    const xmlChar *ndata = NULL;
 5415|   157k|    int isParameter = 0;
 5416|   157k|    xmlChar *orig = NULL;
 5417|       |
 5418|   157k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|   157k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|   157k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5418:9): [True: 0, False: 157k]
  |  Branch (5418:25): [True: 0, False: 157k]
  ------------------
 5419|      0|        return;
 5420|   157k|    SKIP(2);
  ------------------
  |  | 2248|   157k|#define SKIP(val) do {							\
  |  | 2249|   157k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   157k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 157k]
  |  |  ------------------
  |  | 2251|   157k|        xmlParserGrow(ctxt);						\
  |  | 2252|   157k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 157k]
  |  |  ------------------
  ------------------
 5421|       |
 5422|       |    /* GROW; done in the caller */
 5423|   157k|    if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2236|   157k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   314k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   314k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 157k, False: 0]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 157k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|   157k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 157k, False: 13]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 157k, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 157k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 157k, False: 3]
  |  |  ------------------
  ------------------
 5424|   157k|#ifdef LIBXML_VALID_ENABLED
 5425|   157k|	int oldInputNr = ctxt->inputNr;
 5426|   157k|#endif
 5427|       |
 5428|   157k|	SKIP(6);
  ------------------
  |  | 2248|   157k|#define SKIP(val) do {							\
  |  | 2249|   157k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   157k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 217, False: 157k]
  |  |  ------------------
  |  | 2251|   157k|        xmlParserGrow(ctxt);						\
  |  | 2252|   157k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 157k]
  |  |  ------------------
  ------------------
 5429|   157k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|   157k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5429:6): [True: 2.13k, False: 155k]
  ------------------
 5430|  2.13k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5431|  2.13k|			   "Space required after '<!ENTITY'\n");
 5432|  2.13k|	}
 5433|       |
 5434|   157k|	if (RAW == '%') {
  ------------------
  |  | 2224|   157k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5434:6): [True: 64.9k, False: 92.3k]
  ------------------
 5435|  64.9k|	    NEXT;
  ------------------
  |  | 2279|  64.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5436|  64.9k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  64.9k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5436:10): [True: 361, False: 64.6k]
  ------------------
 5437|    361|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5438|    361|			       "Space required after '%%'\n");
 5439|    361|	    }
 5440|  64.9k|	    isParameter = 1;
 5441|  64.9k|	}
 5442|       |
 5443|   157k|        name = xmlParseName(ctxt);
 5444|   157k|	if (name == NULL) {
  ------------------
  |  Branch (5444:6): [True: 28.9k, False: 128k]
  ------------------
 5445|  28.9k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5446|  28.9k|	                   "xmlParseEntityDecl: no name\n");
 5447|  28.9k|            return;
 5448|  28.9k|	}
 5449|   128k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5449:6): [True: 1.54k, False: 126k]
  ------------------
 5450|  1.54k|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5451|  1.54k|		     "colons are forbidden from entities names '%s'\n",
 5452|  1.54k|		     name, NULL, NULL);
 5453|  1.54k|	}
 5454|   128k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|   128k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5454:6): [True: 2.71k, False: 125k]
  ------------------
 5455|  2.71k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5456|  2.71k|			   "Space required after the entity name\n");
 5457|  2.71k|	}
 5458|       |
 5459|       |	/*
 5460|       |	 * handle the various case of definitions...
 5461|       |	 */
 5462|   128k|	if (isParameter) {
  ------------------
  |  Branch (5462:6): [True: 64.3k, False: 63.9k]
  ------------------
 5463|  64.3k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  64.3k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  8.74k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5463:10): [True: 55.6k, False: 8.74k]
  |  Branch (5463:26): [True: 1.31k, False: 7.43k]
  ------------------
 5464|  56.9k|	        value = xmlParseEntityValue(ctxt, &orig);
 5465|  56.9k|		if (value) {
  ------------------
  |  Branch (5465:7): [True: 55.9k, False: 937]
  ------------------
 5466|  55.9k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5466:11): [True: 55.9k, False: 0]
  ------------------
 5467|  55.9k|			(!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5467:4): [True: 53.0k, False: 2.88k]
  |  Branch (5467:27): [True: 53.0k, False: 0]
  ------------------
 5468|  53.0k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5469|  53.0k|		                    XML_INTERNAL_PARAMETER_ENTITY,
 5470|  53.0k|				    NULL, NULL, value);
 5471|  55.9k|		}
 5472|  56.9k|	    } else {
 5473|  7.43k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5474|  7.43k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5474:7): [True: 696, False: 6.74k]
  |  Branch (5474:24): [True: 570, False: 126]
  ------------------
 5475|    570|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5476|    570|		}
 5477|  7.43k|		if (URI) {
  ------------------
  |  Branch (5477:7): [True: 6.74k, False: 696]
  ------------------
 5478|  6.74k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5478:25): [True: 483, False: 6.25k]
  ------------------
 5479|    483|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5480|  6.25k|                    } else {
 5481|  6.25k|                        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5481:29): [True: 6.25k, False: 0]
  ------------------
 5482|  6.25k|                            (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5482:29): [True: 5.94k, False: 315]
  ------------------
 5483|  5.94k|                            (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5483:29): [True: 5.94k, False: 0]
  ------------------
 5484|  5.94k|                            ctxt->sax->entityDecl(ctxt->userData, name,
 5485|  5.94k|                                        XML_EXTERNAL_PARAMETER_ENTITY,
 5486|  5.94k|                                        literal, URI, NULL);
 5487|  6.25k|                    }
 5488|  6.74k|		}
 5489|  7.43k|	    }
 5490|  64.3k|	} else {
 5491|  63.9k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  63.9k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2224|  15.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5491:10): [True: 47.9k, False: 15.9k]
  |  Branch (5491:26): [True: 4.27k, False: 11.7k]
  ------------------
 5492|  52.2k|	        value = xmlParseEntityValue(ctxt, &orig);
 5493|  52.2k|		if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5493:7): [True: 52.2k, False: 0]
  ------------------
 5494|  52.2k|		    (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5494:7): [True: 50.8k, False: 1.40k]
  |  Branch (5494:30): [True: 50.8k, False: 0]
  ------------------
 5495|  50.8k|		    ctxt->sax->entityDecl(ctxt->userData, name,
 5496|  50.8k|				XML_INTERNAL_GENERAL_ENTITY,
 5497|  50.8k|				NULL, NULL, value);
 5498|       |		/*
 5499|       |		 * For expat compatibility in SAX mode.
 5500|       |		 */
 5501|  52.2k|		if ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5501:7): [True: 10, False: 52.2k]
  ------------------
 5502|  52.2k|		    (xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  52.2k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  52.2k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5502:7): [True: 71, False: 52.1k]
  ------------------
 5503|     81|		    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5503:11): [True: 10, False: 71]
  ------------------
 5504|     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 *)
  |  |  ------------------
  ------------------
 5505|     10|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5505:8): [True: 1, False: 9]
  ------------------
 5506|      1|			    xmlErrMemory(ctxt);
 5507|      1|			    goto done;
 5508|      1|			}
 5509|      9|			ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5510|      9|		    }
 5511|     80|		    if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5511:11): [True: 9, False: 71]
  ------------------
 5512|      9|			ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5513|      9|					    BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|      9|#define BAD_CAST (xmlChar *)
  ------------------
 5514|      9|                        if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5514:29): [True: 1, False: 8]
  ------------------
 5515|      1|                            xmlErrMemory(ctxt);
 5516|      1|                            goto done;
 5517|      1|                        }
 5518|      9|                    }
 5519|       |
 5520|     79|		    xmlSAX2EntityDecl(ctxt, name, XML_INTERNAL_GENERAL_ENTITY,
 5521|     79|			              NULL, NULL, value);
 5522|     79|		}
 5523|  52.2k|	    } else {
 5524|  11.7k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5525|  11.7k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5525:7): [True: 4.46k, False: 7.24k]
  |  Branch (5525:24): [True: 4.04k, False: 426]
  ------------------
 5526|  4.04k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5527|  4.04k|		}
 5528|  11.7k|		if (URI) {
  ------------------
  |  Branch (5528:7): [True: 7.24k, False: 4.46k]
  ------------------
 5529|  7.24k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5529:25): [True: 300, False: 6.94k]
  ------------------
 5530|    300|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5531|    300|                    }
 5532|  7.24k|		}
 5533|  11.7k|		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2224|  11.7k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2277|  5.91k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5533:7): [True: 5.91k, False: 5.79k]
  |  Branch (5533:23): [True: 3.89k, False: 2.02k]
  ------------------
 5534|  3.89k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5535|  3.89k|				   "Space required before 'NDATA'\n");
 5536|  3.89k|		}
 5537|  11.7k|		if (CMP5(CUR_PTR, 'N', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2234|  11.7k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  23.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 1.04k, False: 10.6k]
  |  |  |  |  |  Branch (2231:41): [True: 1.03k, False: 4]
  |  |  |  |  ------------------
  |  |  |  | 2232|  11.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 1.03k, False: 2]
  |  |  |  |  |  Branch (2232:41): [True: 1.03k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 1.03k, False: 1]
  |  |  ------------------
  ------------------
 5538|  1.03k|		    SKIP(5);
  ------------------
  |  | 2248|  1.03k|#define SKIP(val) do {							\
  |  | 2249|  1.03k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.03k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 75, False: 960]
  |  |  ------------------
  |  | 2251|  1.03k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.03k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.03k]
  |  |  ------------------
  ------------------
 5539|  1.03k|		    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  1.03k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5539:11): [True: 248, False: 787]
  ------------------
 5540|    248|			xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5541|    248|				       "Space required after 'NDATA'\n");
 5542|    248|		    }
 5543|  1.03k|		    ndata = xmlParseName(ctxt);
 5544|  1.03k|		    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5544:11): [True: 1.03k, False: 0]
  |  Branch (5544:34): [True: 711, False: 324]
  ------------------
 5545|    711|		        (ctxt->sax->unparsedEntityDecl != NULL))
  ------------------
  |  Branch (5545:11): [True: 711, False: 0]
  ------------------
 5546|    711|			ctxt->sax->unparsedEntityDecl(ctxt->userData, name,
 5547|    711|				    literal, URI, ndata);
 5548|  10.6k|		} else {
 5549|  10.6k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5549:11): [True: 10.6k, False: 0]
  ------------------
 5550|  10.6k|		        (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5550:11): [True: 9.45k, False: 1.22k]
  |  Branch (5550:34): [True: 9.45k, False: 0]
  ------------------
 5551|  9.45k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5552|  9.45k|				    XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5553|  9.45k|				    literal, URI, NULL);
 5554|       |		    /*
 5555|       |		     * For expat compatibility in SAX mode.
 5556|       |		     * assuming the entity replacement was asked for
 5557|       |		     */
 5558|  10.6k|		    if ((ctxt->replaceEntities != 0) &&
  ------------------
  |  Branch (5558:11): [True: 4.33k, False: 6.34k]
  ------------------
 5559|  4.33k|			((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5559:5): [True: 11, False: 4.32k]
  ------------------
 5560|  4.32k|			(xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE)))) {
  ------------------
  |  |  173|  4.32k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  4.32k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5560:4): [True: 218, False: 4.10k]
  ------------------
 5561|    229|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5561:8): [True: 11, False: 218]
  ------------------
 5562|     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 *)
  |  |  ------------------
  ------------------
 5563|     11|			    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5563:12): [True: 1, False: 10]
  ------------------
 5564|      1|			        xmlErrMemory(ctxt);
 5565|      1|				goto done;
 5566|      1|			    }
 5567|     10|			    ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5568|     10|			}
 5569|       |
 5570|    228|			if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5570:8): [True: 10, False: 218]
  ------------------
 5571|     10|			    ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5572|     10|						BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|     10|#define BAD_CAST (xmlChar *)
  ------------------
 5573|     10|                            if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5573:33): [True: 1, False: 9]
  ------------------
 5574|      1|                                xmlErrMemory(ctxt);
 5575|      1|                                goto done;
 5576|      1|                            }
 5577|     10|                        }
 5578|    227|			xmlSAX2EntityDecl(ctxt, name,
 5579|    227|				          XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5580|    227|				          literal, URI, NULL);
 5581|    227|		    }
 5582|  10.6k|		}
 5583|  11.7k|	    }
 5584|  63.9k|	}
 5585|   128k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|   128k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5586|   128k|	if (RAW != '>') {
  ------------------
  |  | 2224|   128k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5586:6): [True: 9.72k, False: 118k]
  ------------------
 5587|  9.72k|	    xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
 5588|  9.72k|	            "xmlParseEntityDecl: entity %s not terminated\n", name);
 5589|   118k|	} else {
 5590|   118k|#ifdef LIBXML_VALID_ENABLED
 5591|   118k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5591:10): [True: 86.4k, False: 32.1k]
  |  Branch (5591:30): [True: 22, False: 86.4k]
  ------------------
 5592|     22|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5593|     22|	                         "Entity declaration doesn't start and stop in"
 5594|     22|                                 " the same entity\n",
 5595|     22|                                 NULL, NULL);
 5596|     22|	    }
 5597|   118k|#endif
 5598|   118k|	    NEXT;
  ------------------
  |  | 2279|   118k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5599|   118k|	}
 5600|   128k|	if (orig != NULL) {
  ------------------
  |  Branch (5600:6): [True: 106k, False: 21.9k]
  ------------------
 5601|       |	    /*
 5602|       |	     * Ugly mechanism to save the raw entity value.
 5603|       |	     */
 5604|   106k|	    xmlEntityPtr cur = NULL;
 5605|       |
 5606|   106k|	    if (isParameter) {
  ------------------
  |  Branch (5606:10): [True: 55.9k, False: 50.3k]
  ------------------
 5607|  55.9k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5607:14): [True: 55.9k, False: 0]
  ------------------
 5608|  55.9k|		    (ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (5608:7): [True: 55.9k, False: 0]
  ------------------
 5609|  55.9k|		    cur = ctxt->sax->getParameterEntity(ctxt->userData, name);
 5610|  55.9k|	    } else {
 5611|  50.3k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5611:14): [True: 50.3k, False: 0]
  ------------------
 5612|  50.3k|		    (ctxt->sax->getEntity != NULL))
  ------------------
  |  Branch (5612:7): [True: 50.3k, False: 0]
  ------------------
 5613|  50.3k|		    cur = ctxt->sax->getEntity(ctxt->userData, name);
 5614|  50.3k|		if ((cur == NULL) && (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (5614:7): [True: 1.05k, False: 49.3k]
  |  Branch (5614:24): [True: 1.05k, False: 0]
  ------------------
 5615|  1.05k|		    cur = xmlSAX2GetEntity(ctxt, name);
 5616|  1.05k|		}
 5617|  50.3k|	    }
 5618|   106k|            if ((cur != NULL) && (cur->orig == NULL)) {
  ------------------
  |  Branch (5618:17): [True: 102k, False: 3.63k]
  |  Branch (5618:34): [True: 12.0k, False: 90.7k]
  ------------------
 5619|  12.0k|		cur->orig = orig;
 5620|  12.0k|                orig = NULL;
 5621|  12.0k|	    }
 5622|   106k|	}
 5623|       |
 5624|   128k|done:
 5625|   128k|	if (value != NULL) xmlFree(value);
  ------------------
  |  Branch (5625:6): [True: 106k, False: 21.9k]
  ------------------
 5626|   128k|	if (URI != NULL) xmlFree(URI);
  ------------------
  |  Branch (5626:6): [True: 13.9k, False: 114k]
  ------------------
 5627|   128k|	if (literal != NULL) xmlFree(literal);
  ------------------
  |  Branch (5627:6): [True: 4.72k, False: 123k]
  ------------------
 5628|   128k|        if (orig != NULL) xmlFree(orig);
  ------------------
  |  Branch (5628:13): [True: 94.3k, False: 33.9k]
  ------------------
 5629|   128k|    }
 5630|   157k|}
xmlParseDefaultDecl:
 5662|  88.4k|xmlParseDefaultDecl(xmlParserCtxt *ctxt, xmlChar **value) {
 5663|  88.4k|    int val;
 5664|  88.4k|    xmlChar *ret;
 5665|       |
 5666|  88.4k|    *value = NULL;
 5667|  88.4k|    if (CMP9(CUR_PTR, '#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D')) {
  ------------------
  |  | 2242|  88.4k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|   176k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|   176k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|   176k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|   176k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|   176k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 30.4k, False: 57.9k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 6.29k, False: 24.1k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|  88.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 6.29k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 6.29k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 6.28k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 6.28k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 6.28k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 6.28k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|  88.4k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 6.28k, False: 1]
  |  |  ------------------
  ------------------
 5668|  6.28k|	SKIP(9);
  ------------------
  |  | 2248|  6.28k|#define SKIP(val) do {							\
  |  | 2249|  6.28k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  6.28k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 40, False: 6.24k]
  |  |  ------------------
  |  | 2251|  6.28k|        xmlParserGrow(ctxt);						\
  |  | 2252|  6.28k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 6.28k]
  |  |  ------------------
  ------------------
 5669|  6.28k|	return(XML_ATTRIBUTE_REQUIRED);
 5670|  6.28k|    }
 5671|  82.1k|    if (CMP8(CUR_PTR, '#', 'I', 'M', 'P', 'L', 'I', 'E', 'D')) {
  ------------------
  |  | 2240|  82.1k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   164k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   164k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   164k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   164k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 24.1k, False: 57.9k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 15.0k, False: 9.12k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  82.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 15.0k, False: 8]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 15.0k, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 15.0k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 15.0k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 14.9k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 14.9k, False: 1]
  |  |  ------------------
  ------------------
 5672|  14.9k|	SKIP(8);
  ------------------
  |  | 2248|  14.9k|#define SKIP(val) do {							\
  |  | 2249|  14.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  14.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 559, False: 14.4k]
  |  |  ------------------
  |  | 2251|  14.9k|        xmlParserGrow(ctxt);						\
  |  | 2252|  14.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 14.9k]
  |  |  ------------------
  ------------------
 5673|  14.9k|	return(XML_ATTRIBUTE_IMPLIED);
 5674|  14.9k|    }
 5675|  67.1k|    val = XML_ATTRIBUTE_NONE;
 5676|  67.1k|    if (CMP6(CUR_PTR, '#', 'F', 'I', 'X', 'E', 'D')) {
  ------------------
  |  | 2236|  67.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   134k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   134k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 9.14k, False: 57.9k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 9.10k, False: 42]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  67.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 9.10k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 9.09k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 9.09k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 9.09k, False: 3]
  |  |  ------------------
  ------------------
 5677|  9.09k|	SKIP(6);
  ------------------
  |  | 2248|  9.09k|#define SKIP(val) do {							\
  |  | 2249|  9.09k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  9.09k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 70, False: 9.02k]
  |  |  ------------------
  |  | 2251|  9.09k|        xmlParserGrow(ctxt);						\
  |  | 2252|  9.09k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 9.09k]
  |  |  ------------------
  ------------------
 5678|  9.09k|	val = XML_ATTRIBUTE_FIXED;
 5679|  9.09k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  9.09k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5679:6): [True: 456, False: 8.63k]
  ------------------
 5680|    456|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5681|    456|			   "Space required after '#FIXED'\n");
 5682|    456|	}
 5683|  9.09k|    }
 5684|  67.1k|    ret = xmlParseAttValue(ctxt);
 5685|  67.1k|    if (ret == NULL) {
  ------------------
  |  Branch (5685:9): [True: 37.6k, False: 29.4k]
  ------------------
 5686|  37.6k|	xmlFatalErrMsg(ctxt, (xmlParserErrors)ctxt->errNo,
 5687|  37.6k|		       "Attribute default value declaration error\n");
 5688|  37.6k|    } else
 5689|  29.4k|        *value = ret;
 5690|  67.1k|    return(val);
 5691|  82.1k|}
xmlParseNotationType:
 5711|  2.48k|xmlParseNotationType(xmlParserCtxt *ctxt) {
 5712|  2.48k|    const xmlChar *name;
 5713|  2.48k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5714|       |
 5715|  2.48k|    if (RAW != '(') {
  ------------------
  |  | 2224|  2.48k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5715:9): [True: 342, False: 2.14k]
  ------------------
 5716|    342|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5717|    342|	return(NULL);
 5718|    342|    }
 5719|  2.97k|    do {
 5720|  2.97k|        NEXT;
  ------------------
  |  | 2279|  2.97k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5721|  2.97k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  2.97k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5722|  2.97k|        name = xmlParseName(ctxt);
 5723|  2.97k|	if (name == NULL) {
  ------------------
  |  Branch (5723:6): [True: 273, False: 2.70k]
  ------------------
 5724|    273|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5725|    273|			   "Name expected in NOTATION declaration\n");
 5726|    273|            xmlFreeEnumeration(ret);
 5727|    273|	    return(NULL);
 5728|    273|	}
 5729|  2.70k|        tmp = NULL;
 5730|  2.70k|#ifdef LIBXML_VALID_ENABLED
 5731|  2.70k|        if (ctxt->validate) {
  ------------------
  |  Branch (5731:13): [True: 1.64k, False: 1.05k]
  ------------------
 5732|  1.64k|            tmp = ret;
 5733|  3.86k|            while (tmp != NULL) {
  ------------------
  |  Branch (5733:20): [True: 2.43k, False: 1.42k]
  ------------------
 5734|  2.43k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5734:21): [True: 220, False: 2.21k]
  ------------------
 5735|    220|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5736|    220|              "standalone: attribute notation value token %s duplicated\n",
 5737|    220|                                     name, NULL);
 5738|    220|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5738:25): [True: 0, False: 220]
  ------------------
 5739|      0|                        xmlFree((xmlChar *) name);
 5740|    220|                    break;
 5741|    220|                }
 5742|  2.21k|                tmp = tmp->next;
 5743|  2.21k|            }
 5744|  1.64k|        }
 5745|  2.70k|#endif /* LIBXML_VALID_ENABLED */
 5746|  2.70k|	if (tmp == NULL) {
  ------------------
  |  Branch (5746:6): [True: 2.48k, False: 220]
  ------------------
 5747|  2.48k|	    cur = xmlCreateEnumeration(name);
 5748|  2.48k|	    if (cur == NULL) {
  ------------------
  |  Branch (5748:10): [True: 2, False: 2.48k]
  ------------------
 5749|      2|                xmlErrMemory(ctxt);
 5750|      2|                xmlFreeEnumeration(ret);
 5751|      2|                return(NULL);
 5752|      2|            }
 5753|  2.48k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5753:10): [True: 1.87k, False: 609]
  ------------------
 5754|    609|	    else {
 5755|    609|		last->next = cur;
 5756|    609|		last = cur;
 5757|    609|	    }
 5758|  2.48k|	}
 5759|  2.70k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  2.70k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5760|  2.70k|    } while (RAW == '|');
  ------------------
  |  | 2224|  2.70k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5760:14): [True: 832, False: 1.86k]
  ------------------
 5761|  1.86k|    if (RAW != ')') {
  ------------------
  |  | 2224|  1.86k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5761:9): [True: 429, False: 1.44k]
  ------------------
 5762|    429|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5763|    429|        xmlFreeEnumeration(ret);
 5764|    429|	return(NULL);
 5765|    429|    }
 5766|  1.44k|    NEXT;
  ------------------
  |  | 2279|  1.44k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5767|  1.44k|    return(ret);
 5768|  1.86k|}
xmlParseEnumerationType:
 5786|  17.5k|xmlParseEnumerationType(xmlParserCtxt *ctxt) {
 5787|  17.5k|    xmlChar *name;
 5788|  17.5k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5789|       |
 5790|  17.5k|    if (RAW != '(') {
  ------------------
  |  | 2224|  17.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5790:9): [True: 3.26k, False: 14.2k]
  ------------------
 5791|  3.26k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
 5792|  3.26k|	return(NULL);
 5793|  3.26k|    }
 5794|  20.5k|    do {
 5795|  20.5k|        NEXT;
  ------------------
  |  | 2279|  20.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5796|  20.5k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  20.5k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5797|  20.5k|        name = xmlParseNmtoken(ctxt);
 5798|  20.5k|	if (name == NULL) {
  ------------------
  |  Branch (5798:6): [True: 258, False: 20.2k]
  ------------------
 5799|    258|	    xmlFatalErr(ctxt, XML_ERR_NMTOKEN_REQUIRED, NULL);
 5800|    258|	    return(ret);
 5801|    258|	}
 5802|  20.2k|        tmp = NULL;
 5803|  20.2k|#ifdef LIBXML_VALID_ENABLED
 5804|  20.2k|        if (ctxt->validate) {
  ------------------
  |  Branch (5804:13): [True: 12.6k, False: 7.58k]
  ------------------
 5805|  12.6k|            tmp = ret;
 5806|  30.6k|            while (tmp != NULL) {
  ------------------
  |  Branch (5806:20): [True: 18.5k, False: 12.1k]
  ------------------
 5807|  18.5k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5807:21): [True: 528, False: 18.0k]
  ------------------
 5808|    528|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5809|    528|              "standalone: attribute enumeration value token %s duplicated\n",
 5810|    528|                                     name, NULL);
 5811|    528|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5811:25): [True: 528, False: 0]
  ------------------
 5812|    528|                        xmlFree(name);
 5813|    528|                    break;
 5814|    528|                }
 5815|  18.0k|                tmp = tmp->next;
 5816|  18.0k|            }
 5817|  12.6k|        }
 5818|  20.2k|#endif /* LIBXML_VALID_ENABLED */
 5819|  20.2k|	if (tmp == NULL) {
  ------------------
  |  Branch (5819:6): [True: 19.7k, False: 528]
  ------------------
 5820|  19.7k|	    cur = xmlCreateEnumeration(name);
 5821|  19.7k|	    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5821:10): [True: 19.7k, False: 0]
  ------------------
 5822|  19.7k|		xmlFree(name);
 5823|  19.7k|	    if (cur == NULL) {
  ------------------
  |  Branch (5823:10): [True: 7, False: 19.7k]
  ------------------
 5824|      7|                xmlErrMemory(ctxt);
 5825|      7|                xmlFreeEnumeration(ret);
 5826|      7|                return(NULL);
 5827|      7|            }
 5828|  19.7k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5828:10): [True: 14.0k, False: 5.72k]
  ------------------
 5829|  5.72k|	    else {
 5830|  5.72k|		last->next = cur;
 5831|  5.72k|		last = cur;
 5832|  5.72k|	    }
 5833|  19.7k|	}
 5834|  20.2k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  20.2k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5835|  20.2k|    } while (RAW == '|');
  ------------------
  |  | 2224|  20.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5835:14): [True: 6.26k, False: 13.9k]
  ------------------
 5836|  13.9k|    if (RAW != ')') {
  ------------------
  |  | 2224|  13.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5836:9): [True: 564, False: 13.4k]
  ------------------
 5837|    564|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_FINISHED, NULL);
 5838|    564|	return(ret);
 5839|    564|    }
 5840|  13.4k|    NEXT;
  ------------------
  |  | 2279|  13.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5841|  13.4k|    return(ret);
 5842|  13.9k|}
xmlParseEnumeratedType:
 5859|  20.2k|xmlParseEnumeratedType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5860|  20.2k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2240|  20.2k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|  40.5k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|  40.5k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|  40.5k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|  40.5k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 2.76k, False: 17.4k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 2.75k, False: 11]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  20.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 2.74k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 2.74k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 2.73k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 2.73k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 2.73k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 2.73k, False: 1]
  |  |  ------------------
  ------------------
 5861|  2.73k|	SKIP(8);
  ------------------
  |  | 2248|  2.73k|#define SKIP(val) do {							\
  |  | 2249|  2.73k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.73k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 212, False: 2.52k]
  |  |  ------------------
  |  | 2251|  2.73k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.73k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.73k]
  |  |  ------------------
  ------------------
 5862|  2.73k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  2.73k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5862:6): [True: 250, False: 2.48k]
  ------------------
 5863|    250|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5864|    250|			   "Space required after 'NOTATION'\n");
 5865|    250|	    return(0);
 5866|    250|	}
 5867|  2.48k|	*tree = xmlParseNotationType(ctxt);
 5868|  2.48k|	if (*tree == NULL) return(0);
  ------------------
  |  Branch (5868:6): [True: 1.04k, False: 1.44k]
  ------------------
 5869|  1.44k|	return(XML_ATTRIBUTE_NOTATION);
 5870|  2.48k|    }
 5871|  17.5k|    *tree = xmlParseEnumerationType(ctxt);
 5872|  17.5k|    if (*tree == NULL) return(0);
  ------------------
  |  Branch (5872:9): [True: 3.51k, False: 14.0k]
  ------------------
 5873|  14.0k|    return(XML_ATTRIBUTE_ENUMERATION);
 5874|  17.5k|}
xmlParseAttributeType:
 5922|  95.4k|xmlParseAttributeType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5923|  95.4k|    if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2234|  95.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   190k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 11.3k, False: 84.1k]
  |  |  |  |  |  Branch (2231:41): [True: 11.3k, False: 2]
  |  |  |  |  ------------------
  |  |  |  | 2232|  95.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 11.3k, False: 6]
  |  |  |  |  |  Branch (2232:41): [True: 11.3k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 11.3k, False: 2]
  |  |  ------------------
  ------------------
 5924|  11.3k|	SKIP(5);
  ------------------
  |  | 2248|  11.3k|#define SKIP(val) do {							\
  |  | 2249|  11.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  11.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 222, False: 11.1k]
  |  |  ------------------
  |  | 2251|  11.3k|        xmlParserGrow(ctxt);						\
  |  | 2252|  11.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 11.3k]
  |  |  ------------------
  ------------------
 5925|  11.3k|	return(XML_ATTRIBUTE_CDATA);
 5926|  84.1k|     } else if (CMP6(CUR_PTR, 'I', 'D', 'R', 'E', 'F', 'S')) {
  ------------------
  |  | 2236|  84.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   168k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   168k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 15.8k, False: 68.2k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 15.8k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  84.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 5.04k, False: 10.8k]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 5.04k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 5.04k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 1.88k, False: 3.16k]
  |  |  ------------------
  ------------------
 5927|  1.88k|	SKIP(6);
  ------------------
  |  | 2248|  1.88k|#define SKIP(val) do {							\
  |  | 2249|  1.88k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.88k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 67, False: 1.81k]
  |  |  ------------------
  |  | 2251|  1.88k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.88k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.88k]
  |  |  ------------------
  ------------------
 5928|  1.88k|	return(XML_ATTRIBUTE_IDREFS);
 5929|  82.2k|     } else if (CMP5(CUR_PTR, 'I', 'D', 'R', 'E', 'F')) {
  ------------------
  |  | 2234|  82.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   164k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 13.9k, False: 68.2k]
  |  |  |  |  |  Branch (2231:41): [True: 13.9k, False: 4]
  |  |  |  |  ------------------
  |  |  |  | 2232|  82.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 3.16k, False: 10.8k]
  |  |  |  |  |  Branch (2232:41): [True: 3.16k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 3.16k, False: 4]
  |  |  ------------------
  ------------------
 5930|  3.16k|	SKIP(5);
  ------------------
  |  | 2248|  3.16k|#define SKIP(val) do {							\
  |  | 2249|  3.16k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  3.16k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 248, False: 2.91k]
  |  |  ------------------
  |  | 2251|  3.16k|        xmlParserGrow(ctxt);						\
  |  | 2252|  3.16k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 3.16k]
  |  |  ------------------
  ------------------
 5931|  3.16k|	return(XML_ATTRIBUTE_IDREF);
 5932|  79.0k|     } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2224|  79.0k|#define RAW (*ctxt->input->cur)
  ------------------
                   } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2226|  10.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5932:17): [True: 10.8k, False: 68.2k]
  |  Branch (5932:33): [True: 10.8k, False: 4]
  ------------------
 5933|  10.8k|        SKIP(2);
  ------------------
  |  | 2248|  10.8k|#define SKIP(val) do {							\
  |  | 2249|  10.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  10.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 229, False: 10.5k]
  |  |  ------------------
  |  | 2251|  10.8k|        xmlParserGrow(ctxt);						\
  |  | 2252|  10.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 10.8k]
  |  |  ------------------
  ------------------
 5934|  10.8k|	return(XML_ATTRIBUTE_ID);
 5935|  68.2k|     } else if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2236|  68.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|   136k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|   136k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 8.98k, False: 59.2k]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 8.98k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  68.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 8.98k, False: 1]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 8.98k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 8.97k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 7.41k, False: 1.56k]
  |  |  ------------------
  ------------------
 5936|  7.41k|	SKIP(6);
  ------------------
  |  | 2248|  7.41k|#define SKIP(val) do {							\
  |  | 2249|  7.41k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  7.41k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 71, False: 7.34k]
  |  |  ------------------
  |  | 2251|  7.41k|        xmlParserGrow(ctxt);						\
  |  | 2252|  7.41k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 7.41k]
  |  |  ------------------
  ------------------
 5937|  7.41k|	return(XML_ATTRIBUTE_ENTITY);
 5938|  60.8k|     } else if (CMP8(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S')) {
  ------------------
  |  | 2240|  60.8k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   121k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   121k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   121k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   121k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 1.57k, False: 59.2k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 1.56k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  60.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 1.56k, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 1.56k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 1.56k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 1.55k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 1.55k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 1.55k, False: 2]
  |  |  ------------------
  ------------------
 5939|  1.55k|	SKIP(8);
  ------------------
  |  | 2248|  1.55k|#define SKIP(val) do {							\
  |  | 2249|  1.55k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.55k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 204, False: 1.34k]
  |  |  ------------------
  |  | 2251|  1.55k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.55k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.55k]
  |  |  ------------------
  ------------------
 5940|  1.55k|	return(XML_ATTRIBUTE_ENTITIES);
 5941|  59.3k|     } else if (CMP8(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S')) {
  ------------------
  |  | 2240|  59.3k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   118k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   118k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   118k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   118k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 41.8k, False: 17.4k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 39.0k, False: 2.75k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|  59.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 39.0k, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 39.0k, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 39.0k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 39.0k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 39.0k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 33.0k, False: 5.96k]
  |  |  ------------------
  ------------------
 5942|  33.0k|	SKIP(8);
  ------------------
  |  | 2248|  33.0k|#define SKIP(val) do {							\
  |  | 2249|  33.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  33.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 291, False: 32.7k]
  |  |  ------------------
  |  | 2251|  33.0k|        xmlParserGrow(ctxt);						\
  |  | 2252|  33.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 33.0k]
  |  |  ------------------
  ------------------
 5943|  33.0k|	return(XML_ATTRIBUTE_NMTOKENS);
 5944|  33.0k|     } else if (CMP7(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N')) {
  ------------------
  |  | 2238|  26.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  52.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  52.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  52.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 8.72k, False: 17.4k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 5.97k, False: 2.75k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  26.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 5.96k, False: 1]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 5.96k, False: 2]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 5.96k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 5.96k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 5.96k, False: 1]
  |  |  ------------------
  ------------------
 5945|  5.96k|	SKIP(7);
  ------------------
  |  | 2248|  5.96k|#define SKIP(val) do {							\
  |  | 2249|  5.96k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  5.96k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 198, False: 5.76k]
  |  |  ------------------
  |  | 2251|  5.96k|        xmlParserGrow(ctxt);						\
  |  | 2252|  5.96k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 5.96k]
  |  |  ------------------
  ------------------
 5946|  5.96k|	return(XML_ATTRIBUTE_NMTOKEN);
 5947|  5.96k|     }
 5948|  20.2k|     return(xmlParseEnumeratedType(ctxt, tree));
 5949|  95.4k|}
xmlParseAttributeListDecl:
 5962|  83.4k|xmlParseAttributeListDecl(xmlParserCtxt *ctxt) {
 5963|  83.4k|    const xmlChar *elemName;
 5964|  83.4k|    const xmlChar *attrName;
 5965|  83.4k|    xmlEnumerationPtr tree;
 5966|       |
 5967|  83.4k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  83.4k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  83.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5967:9): [True: 0, False: 83.4k]
  |  Branch (5967:25): [True: 0, False: 83.4k]
  ------------------
 5968|      0|        return;
 5969|  83.4k|    SKIP(2);
  ------------------
  |  | 2248|  83.4k|#define SKIP(val) do {							\
  |  | 2249|  83.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  83.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 83.4k]
  |  |  ------------------
  |  | 2251|  83.4k|        xmlParserGrow(ctxt);						\
  |  | 2252|  83.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 83.4k]
  |  |  ------------------
  ------------------
 5970|       |
 5971|  83.4k|    if (CMP7(CUR_PTR, 'A', 'T', 'T', 'L', 'I', 'S', 'T')) {
  ------------------
  |  | 2238|  83.4k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|   166k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|   166k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|   166k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 83.4k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 83.4k, False: 9]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  83.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 83.4k, False: 16]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 83.4k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 83.4k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 83.4k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 83.4k, False: 6]
  |  |  ------------------
  ------------------
 5972|  83.4k|#ifdef LIBXML_VALID_ENABLED
 5973|  83.4k|	int oldInputNr = ctxt->inputNr;
 5974|  83.4k|#endif
 5975|       |
 5976|  83.4k|	SKIP(7);
  ------------------
  |  | 2248|  83.4k|#define SKIP(val) do {							\
  |  | 2249|  83.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  83.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 321, False: 83.1k]
  |  |  ------------------
  |  | 2251|  83.4k|        xmlParserGrow(ctxt);						\
  |  | 2252|  83.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 83.4k]
  |  |  ------------------
  ------------------
 5977|  83.4k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  83.4k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5977:6): [True: 2.76k, False: 80.6k]
  ------------------
 5978|  2.76k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5979|  2.76k|		                 "Space required after '<!ATTLIST'\n");
 5980|  2.76k|	}
 5981|  83.4k|        elemName = xmlParseName(ctxt);
 5982|  83.4k|	if (elemName == NULL) {
  ------------------
  |  Branch (5982:6): [True: 1.96k, False: 81.4k]
  ------------------
 5983|  1.96k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5984|  1.96k|			   "ATTLIST: no name for Element\n");
 5985|  1.96k|	    return;
 5986|  1.96k|	}
 5987|  81.4k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  81.4k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5988|  81.4k|	GROW;
  ------------------
  |  | 2271|  81.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  81.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  81.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 76.3k, False: 5.14k]
  |  |  ------------------
  |  | 2272|  81.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  76.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 37.9k, False: 38.3k]
  |  |  ------------------
  |  | 2273|  81.4k|	xmlParserGrow(ctxt);
  ------------------
 5989|   132k|	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|   132k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   103k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (5989:9): [True: 103k, False: 28.9k]
  |  Branch (5989:25): [True: 103k, False: 28]
  ------------------
 5990|   103k|	    int type;
 5991|   103k|	    int def;
 5992|   103k|	    xmlChar *defaultValue = NULL;
 5993|       |
 5994|   103k|	    GROW;
  ------------------
  |  | 2271|   103k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   103k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   103k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 91.7k, False: 11.9k]
  |  |  ------------------
  |  | 2272|   103k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  91.7k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 46.3k, False: 45.3k]
  |  |  ------------------
  |  | 2273|   103k|	xmlParserGrow(ctxt);
  ------------------
 5995|   103k|            tree = NULL;
 5996|   103k|	    attrName = xmlParseName(ctxt);
 5997|   103k|	    if (attrName == NULL) {
  ------------------
  |  Branch (5997:10): [True: 4.50k, False: 99.1k]
  ------------------
 5998|  4.50k|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5999|  4.50k|			       "ATTLIST: no name for Attribute\n");
 6000|  4.50k|		break;
 6001|  4.50k|	    }
 6002|  99.1k|	    GROW;
  ------------------
  |  | 2271|  99.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  99.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  99.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 87.3k, False: 11.8k]
  |  |  ------------------
  |  | 2272|  99.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  87.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 44.4k, False: 42.8k]
  |  |  ------------------
  |  | 2273|  99.1k|	xmlParserGrow(ctxt);
  ------------------
 6003|  99.1k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  99.1k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6003:10): [True: 3.67k, False: 95.4k]
  ------------------
 6004|  3.67k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6005|  3.67k|		        "Space required after the attribute name\n");
 6006|  3.67k|		break;
 6007|  3.67k|	    }
 6008|       |
 6009|  95.4k|	    type = xmlParseAttributeType(ctxt, &tree);
 6010|  95.4k|	    if (type <= 0) {
  ------------------
  |  Branch (6010:10): [True: 4.81k, False: 90.6k]
  ------------------
 6011|  4.81k|	        break;
 6012|  4.81k|	    }
 6013|       |
 6014|  90.6k|	    GROW;
  ------------------
  |  | 2271|  90.6k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  90.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  90.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 79.2k, False: 11.4k]
  |  |  ------------------
  |  | 2272|  90.6k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  79.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 39.4k, False: 39.7k]
  |  |  ------------------
  |  | 2273|  90.6k|	xmlParserGrow(ctxt);
  ------------------
 6015|  90.6k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  90.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6015:10): [True: 2.25k, False: 88.4k]
  ------------------
 6016|  2.25k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6017|  2.25k|			       "Space required after the attribute type\n");
 6018|  2.25k|	        if (tree != NULL)
  ------------------
  |  Branch (6018:14): [True: 689, False: 1.56k]
  ------------------
 6019|    689|		    xmlFreeEnumeration(tree);
 6020|  2.25k|		break;
 6021|  2.25k|	    }
 6022|       |
 6023|  88.4k|	    def = xmlParseDefaultDecl(ctxt, &defaultValue);
 6024|  88.4k|	    if (def <= 0) {
  ------------------
  |  Branch (6024:10): [True: 0, False: 88.4k]
  ------------------
 6025|      0|                if (defaultValue != NULL)
  ------------------
  |  Branch (6025:21): [True: 0, False: 0]
  ------------------
 6026|      0|		    xmlFree(defaultValue);
 6027|      0|	        if (tree != NULL)
  ------------------
  |  Branch (6027:14): [True: 0, False: 0]
  ------------------
 6028|      0|		    xmlFreeEnumeration(tree);
 6029|      0|	        break;
 6030|      0|	    }
 6031|  88.4k|	    if ((type != XML_ATTRIBUTE_CDATA) && (defaultValue != NULL))
  ------------------
  |  Branch (6031:10): [True: 77.2k, False: 11.1k]
  |  Branch (6031:43): [True: 26.4k, False: 50.8k]
  ------------------
 6032|  26.4k|	        xmlAttrNormalizeSpace(defaultValue, defaultValue);
 6033|       |
 6034|  88.4k|	    GROW;
  ------------------
  |  | 2271|  88.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  88.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  88.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 77.0k, False: 11.3k]
  |  |  ------------------
  |  | 2272|  88.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  77.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 55.9k, False: 21.1k]
  |  |  ------------------
  |  | 2273|  88.4k|	xmlParserGrow(ctxt);
  ------------------
 6035|  88.4k|            if (RAW != '>') {
  ------------------
  |  | 2224|  88.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6035:17): [True: 64.4k, False: 23.9k]
  ------------------
 6036|  64.4k|		if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  64.4k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6036:7): [True: 37.2k, False: 27.2k]
  ------------------
 6037|  37.2k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6038|  37.2k|			"Space required after the attribute default value\n");
 6039|  37.2k|		    if (defaultValue != NULL)
  ------------------
  |  Branch (6039:11): [True: 614, False: 36.5k]
  ------------------
 6040|    614|			xmlFree(defaultValue);
 6041|  37.2k|		    if (tree != NULL)
  ------------------
  |  Branch (6041:11): [True: 1.40k, False: 35.8k]
  ------------------
 6042|  1.40k|			xmlFreeEnumeration(tree);
 6043|  37.2k|		    break;
 6044|  37.2k|		}
 6045|  64.4k|	    }
 6046|  51.2k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6046:10): [True: 51.2k, False: 0]
  |  Branch (6046:33): [True: 48.3k, False: 2.85k]
  ------------------
 6047|  48.3k|		(ctxt->sax->attributeDecl != NULL))
  ------------------
  |  Branch (6047:3): [True: 48.3k, False: 0]
  ------------------
 6048|  48.3k|		ctxt->sax->attributeDecl(ctxt->userData, elemName, attrName,
 6049|  48.3k|	                        type, def, defaultValue, tree);
 6050|  2.85k|	    else if (tree != NULL)
  ------------------
  |  Branch (6050:15): [True: 1.08k, False: 1.77k]
  ------------------
 6051|  1.08k|		xmlFreeEnumeration(tree);
 6052|       |
 6053|  51.2k|	    if ((ctxt->sax2) && (defaultValue != NULL) &&
  ------------------
  |  Branch (6053:10): [True: 37.2k, False: 14.0k]
  |  Branch (6053:26): [True: 21.3k, False: 15.8k]
  ------------------
 6054|  21.3k|	        (def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (6054:10): [True: 21.3k, False: 0]
  ------------------
 6055|  21.3k|		(def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (6055:3): [True: 21.3k, False: 0]
  ------------------
 6056|  21.3k|		xmlAddDefAttrs(ctxt, elemName, attrName, defaultValue);
 6057|  21.3k|	    }
 6058|  51.2k|	    if (ctxt->sax2) {
  ------------------
  |  Branch (6058:10): [True: 37.2k, False: 14.0k]
  ------------------
 6059|  37.2k|		xmlAddSpecialAttr(ctxt, elemName, attrName, type);
 6060|  37.2k|	    }
 6061|  51.2k|	    if (defaultValue != NULL)
  ------------------
  |  Branch (6061:10): [True: 28.8k, False: 22.3k]
  ------------------
 6062|  28.8k|	        xmlFree(defaultValue);
 6063|  51.2k|	    GROW;
  ------------------
  |  | 2271|  51.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  51.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  51.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 40.0k, False: 11.2k]
  |  |  ------------------
  |  | 2272|  51.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  40.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 18.7k, False: 21.2k]
  |  |  ------------------
  |  | 2273|  51.2k|	xmlParserGrow(ctxt);
  ------------------
 6064|  51.2k|	}
 6065|  81.4k|	if (RAW == '>') {
  ------------------
  |  | 2224|  81.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6065:6): [True: 29.7k, False: 51.6k]
  ------------------
 6066|  29.7k|#ifdef LIBXML_VALID_ENABLED
 6067|  29.7k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6067:10): [True: 21.5k, False: 8.25k]
  |  Branch (6067:30): [True: 132, False: 21.4k]
  ------------------
 6068|    132|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6069|    132|                                 "Attribute list declaration doesn't start and"
 6070|    132|                                 " stop in the same entity\n",
 6071|    132|                                 NULL, NULL);
 6072|    132|	    }
 6073|  29.7k|#endif
 6074|  29.7k|	    NEXT;
  ------------------
  |  | 2279|  29.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6075|  29.7k|	}
 6076|  81.4k|    }
 6077|  83.4k|}
xmlParseElementMixedContentDecl:
 6142|  6.21k|xmlParseElementMixedContentDecl(xmlParserCtxt *ctxt, int openInputNr) {
 6143|  6.21k|    xmlElementContentPtr ret = NULL, cur = NULL, n;
 6144|  6.21k|    const xmlChar *elem = NULL;
 6145|       |
 6146|  6.21k|    GROW;
  ------------------
  |  | 2271|  6.21k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.21k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.21k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 4.84k, False: 1.36k]
  |  |  ------------------
  |  | 2272|  6.21k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.84k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 2.36k, False: 2.47k]
  |  |  ------------------
  |  | 2273|  6.21k|	xmlParserGrow(ctxt);
  ------------------
 6147|  6.21k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2238|  6.21k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  12.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  12.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  12.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 6.21k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 6.21k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  6.21k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 6.21k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 6.21k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 6.21k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 6.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 6.21k, False: 0]
  |  |  ------------------
  ------------------
 6148|  6.21k|	SKIP(7);
  ------------------
  |  | 2248|  6.21k|#define SKIP(val) do {							\
  |  | 2249|  6.21k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  6.21k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 205, False: 6.01k]
  |  |  ------------------
  |  | 2251|  6.21k|        xmlParserGrow(ctxt);						\
  |  | 2252|  6.21k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 6.21k]
  |  |  ------------------
  ------------------
 6149|  6.21k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6150|  6.21k|	if (RAW == ')') {
  ------------------
  |  | 2224|  6.21k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6150:6): [True: 2.98k, False: 3.23k]
  ------------------
 6151|  2.98k|#ifdef LIBXML_VALID_ENABLED
 6152|  2.98k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6152:10): [True: 1.97k, False: 1.01k]
  |  Branch (6152:30): [True: 10, False: 1.96k]
  ------------------
 6153|     10|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6154|     10|                                 "Element content declaration doesn't start "
 6155|     10|                                 "and stop in the same entity\n",
 6156|     10|                                 NULL, NULL);
 6157|     10|	    }
 6158|  2.98k|#endif
 6159|  2.98k|	    NEXT;
  ------------------
  |  | 2279|  2.98k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6160|  2.98k|	    ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6161|  2.98k|	    if (ret == NULL)
  ------------------
  |  Branch (6161:10): [True: 2, False: 2.98k]
  ------------------
 6162|      2|                goto mem_error;
 6163|  2.98k|	    if (RAW == '*') {
  ------------------
  |  | 2224|  2.98k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6163:10): [True: 274, False: 2.70k]
  ------------------
 6164|    274|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6165|    274|		NEXT;
  ------------------
  |  | 2279|    274|#define NEXT xmlNextChar(ctxt)
  ------------------
 6166|    274|	    }
 6167|  2.98k|	    return(ret);
 6168|  2.98k|	}
 6169|  3.23k|	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2224|  3.23k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2224|  3.23k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6169:6): [True: 1, False: 3.23k]
  |  Branch (6169:22): [True: 2.18k, False: 1.04k]
  ------------------
 6170|  2.18k|	    ret = cur = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6171|  2.18k|	    if (ret == NULL)
  ------------------
  |  Branch (6171:10): [True: 1, False: 2.18k]
  ------------------
 6172|      1|                goto mem_error;
 6173|  2.18k|	}
 6174|  17.8k|	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2224|  17.8k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  14.7k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6174:9): [True: 14.7k, False: 3.14k]
  |  Branch (6174:25): [True: 14.7k, False: 0]
  ------------------
 6175|  14.7k|	    NEXT;
  ------------------
  |  | 2279|  14.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6176|  14.7k|            n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6177|  14.7k|            if (n == NULL)
  ------------------
  |  Branch (6177:17): [True: 2, False: 14.7k]
  ------------------
 6178|      2|                goto mem_error;
 6179|  14.7k|	    if (elem == NULL) {
  ------------------
  |  Branch (6179:10): [True: 2.18k, False: 12.5k]
  ------------------
 6180|  2.18k|		n->c1 = cur;
 6181|  2.18k|		if (cur != NULL)
  ------------------
  |  Branch (6181:7): [True: 2.18k, False: 0]
  ------------------
 6182|  2.18k|		    cur->parent = n;
 6183|  2.18k|		ret = cur = n;
 6184|  12.5k|	    } else {
 6185|  12.5k|	        cur->c2 = n;
 6186|  12.5k|		n->parent = cur;
 6187|  12.5k|		n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6188|  12.5k|                if (n->c1 == NULL)
  ------------------
  |  Branch (6188:21): [True: 1, False: 12.5k]
  ------------------
 6189|      1|                    goto mem_error;
 6190|  12.5k|		n->c1->parent = n;
 6191|  12.5k|		cur = n;
 6192|  12.5k|	    }
 6193|  14.7k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6194|  14.7k|	    elem = xmlParseName(ctxt);
 6195|  14.7k|	    if (elem == NULL) {
  ------------------
  |  Branch (6195:10): [True: 88, False: 14.6k]
  ------------------
 6196|     88|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6197|     88|			"xmlParseElementMixedContentDecl : Name expected\n");
 6198|     88|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6199|     88|		return(NULL);
 6200|     88|	    }
 6201|  14.6k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6202|  14.6k|	}
 6203|  3.14k|	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2224|  3.14k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2226|  1.91k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6203:6): [True: 1.91k, False: 1.22k]
  |  Branch (6203:22): [True: 1.91k, False: 6]
  ------------------
 6204|  1.91k|	    if (elem != NULL) {
  ------------------
  |  Branch (6204:10): [True: 1.91k, False: 0]
  ------------------
 6205|  1.91k|		cur->c2 = xmlNewDocElementContent(ctxt->myDoc, elem,
 6206|  1.91k|		                               XML_ELEMENT_CONTENT_ELEMENT);
 6207|  1.91k|		if (cur->c2 == NULL)
  ------------------
  |  Branch (6207:7): [True: 1, False: 1.90k]
  ------------------
 6208|      1|                    goto mem_error;
 6209|  1.90k|		cur->c2->parent = cur;
 6210|  1.90k|            }
 6211|  1.90k|            if (ret != NULL)
  ------------------
  |  Branch (6211:17): [True: 1.90k, False: 0]
  ------------------
 6212|  1.90k|                ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6213|  1.90k|#ifdef LIBXML_VALID_ENABLED
 6214|  1.90k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6214:10): [True: 1.45k, False: 453]
  |  Branch (6214:30): [True: 1, False: 1.45k]
  ------------------
 6215|      1|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6216|      1|                                 "Element content declaration doesn't start "
 6217|      1|                                 "and stop in the same entity\n",
 6218|      1|                                 NULL, NULL);
 6219|      1|	    }
 6220|  1.90k|#endif
 6221|  1.90k|	    SKIP(2);
  ------------------
  |  | 2248|  1.90k|#define SKIP(val) do {							\
  |  | 2249|  1.90k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.90k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 243, False: 1.66k]
  |  |  ------------------
  |  | 2251|  1.90k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.90k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.90k]
  |  |  ------------------
  ------------------
 6222|  1.90k|	} else {
 6223|  1.23k|	    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6224|  1.23k|	    xmlFatalErr(ctxt, XML_ERR_MIXED_NOT_STARTED, NULL);
 6225|  1.23k|	    return(NULL);
 6226|  1.23k|	}
 6227|       |
 6228|  3.14k|    } else {
 6229|      0|	xmlFatalErr(ctxt, XML_ERR_PCDATA_REQUIRED, NULL);
 6230|      0|    }
 6231|  1.90k|    return(ret);
 6232|       |
 6233|      7|mem_error:
 6234|      7|    xmlErrMemory(ctxt);
 6235|      7|    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6236|       |    return(NULL);
 6237|  6.21k|}
xmlParseElementContentDecl:
 6592|  14.5k|                           xmlElementContent **result) {
 6593|       |
 6594|  14.5k|    xmlElementContentPtr tree = NULL;
 6595|  14.5k|    int openInputNr = ctxt->inputNr;
 6596|  14.5k|    int res;
 6597|       |
 6598|  14.5k|    *result = NULL;
 6599|       |
 6600|  14.5k|    if (RAW != '(') {
  ------------------
  |  | 2224|  14.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6600:9): [True: 0, False: 14.5k]
  ------------------
 6601|      0|	xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6602|      0|		"xmlParseElementContentDecl : %s '(' expected\n", name);
 6603|      0|	return(-1);
 6604|      0|    }
 6605|  14.5k|    NEXT;
  ------------------
  |  | 2279|  14.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6606|  14.5k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6607|  14.5k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2238|  14.5k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  29.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  29.1k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  29.1k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 6.22k, False: 8.36k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 6.22k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  14.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 6.22k, False: 1]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 6.22k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 6.21k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 6.21k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 6.21k, False: 2]
  |  |  ------------------
  ------------------
 6608|  6.21k|        tree = xmlParseElementMixedContentDecl(ctxt, openInputNr);
 6609|  6.21k|	res = XML_ELEMENT_TYPE_MIXED;
 6610|  8.37k|    } else {
 6611|  8.37k|        tree = xmlParseElementChildrenContentDeclPriv(ctxt, openInputNr, 1);
 6612|  8.37k|	res = XML_ELEMENT_TYPE_ELEMENT;
 6613|  8.37k|    }
 6614|  14.5k|    if (tree == NULL)
  ------------------
  |  Branch (6614:9): [True: 3.60k, False: 10.9k]
  ------------------
 6615|  3.60k|        return(-1);
 6616|  10.9k|    SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  10.9k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6617|  10.9k|    *result = tree;
 6618|  10.9k|    return(res);
 6619|  14.5k|}
xmlParseElementDecl:
 6635|  21.7k|xmlParseElementDecl(xmlParserCtxt *ctxt) {
 6636|  21.7k|    const xmlChar *name;
 6637|  21.7k|    int ret = -1;
 6638|  21.7k|    xmlElementContentPtr content  = NULL;
 6639|       |
 6640|  21.7k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2225|  21.7k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2226|  21.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6640:9): [True: 0, False: 21.7k]
  |  Branch (6640:25): [True: 0, False: 21.7k]
  ------------------
 6641|      0|        return(ret);
 6642|  21.7k|    SKIP(2);
  ------------------
  |  | 2248|  21.7k|#define SKIP(val) do {							\
  |  | 2249|  21.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  21.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 21.7k]
  |  |  ------------------
  |  | 2251|  21.7k|        xmlParserGrow(ctxt);						\
  |  | 2252|  21.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 21.7k]
  |  |  ------------------
  ------------------
 6643|       |
 6644|       |    /* GROW; done in the caller */
 6645|  21.7k|    if (CMP7(CUR_PTR, 'E', 'L', 'E', 'M', 'E', 'N', 'T')) {
  ------------------
  |  | 2238|  21.7k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  43.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  43.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  43.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 21.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 21.7k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  21.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 21.7k, False: 10]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 21.6k, False: 5]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 21.6k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 21.6k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 21.6k, False: 3]
  |  |  ------------------
  ------------------
 6646|  21.6k|#ifdef LIBXML_VALID_ENABLED
 6647|  21.6k|	int oldInputNr = ctxt->inputNr;
 6648|  21.6k|#endif
 6649|       |
 6650|  21.6k|	SKIP(7);
  ------------------
  |  | 2248|  21.6k|#define SKIP(val) do {							\
  |  | 2249|  21.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  21.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 79, False: 21.6k]
  |  |  ------------------
  |  | 2251|  21.6k|        xmlParserGrow(ctxt);						\
  |  | 2252|  21.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 21.6k]
  |  |  ------------------
  ------------------
 6651|  21.6k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  21.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6651:6): [True: 149, False: 21.5k]
  ------------------
 6652|    149|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6653|    149|		           "Space required after 'ELEMENT'\n");
 6654|    149|	    return(-1);
 6655|    149|	}
 6656|  21.5k|        name = xmlParseName(ctxt);
 6657|  21.5k|	if (name == NULL) {
  ------------------
  |  Branch (6657:6): [True: 407, False: 21.1k]
  ------------------
 6658|    407|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6659|    407|			   "xmlParseElementDecl: no name for Element\n");
 6660|    407|	    return(-1);
 6661|    407|	}
 6662|  21.1k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2277|  21.1k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6662:6): [True: 1.10k, False: 20.0k]
  ------------------
 6663|  1.10k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6664|  1.10k|			   "Space required after the element name\n");
 6665|  1.10k|	}
 6666|  21.1k|	if (CMP5(CUR_PTR, 'E', 'M', 'P', 'T', 'Y')) {
  ------------------
  |  | 2234|  21.1k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  42.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 4.36k, False: 16.7k]
  |  |  |  |  |  Branch (2231:41): [True: 4.35k, False: 4]
  |  |  |  |  ------------------
  |  |  |  | 2232|  21.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 4.35k, False: 2]
  |  |  |  |  |  Branch (2232:41): [True: 4.35k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 4.35k, False: 3]
  |  |  ------------------
  ------------------
 6667|  4.35k|	    SKIP(5);
  ------------------
  |  | 2248|  4.35k|#define SKIP(val) do {							\
  |  | 2249|  4.35k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  4.35k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 89, False: 4.26k]
  |  |  ------------------
  |  | 2251|  4.35k|        xmlParserGrow(ctxt);						\
  |  | 2252|  4.35k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 4.35k]
  |  |  ------------------
  ------------------
 6668|       |	    /*
 6669|       |	     * Element must always be empty.
 6670|       |	     */
 6671|  4.35k|	    ret = XML_ELEMENT_TYPE_EMPTY;
 6672|  16.7k|	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2224|  16.7k|#define RAW (*ctxt->input->cur)
  ------------------
              	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2226|  1.32k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6672:13): [True: 1.32k, False: 15.4k]
  |  Branch (6672:29): [True: 1.32k, False: 1]
  ------------------
 6673|  1.32k|	           (NXT(2) == 'Y')) {
  ------------------
  |  | 2226|  1.32k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6673:13): [True: 1.31k, False: 1]
  ------------------
 6674|  1.31k|	    SKIP(3);
  ------------------
  |  | 2248|  1.31k|#define SKIP(val) do {							\
  |  | 2249|  1.31k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.31k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 260, False: 1.05k]
  |  |  ------------------
  |  | 2251|  1.31k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.31k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.31k]
  |  |  ------------------
  ------------------
 6675|       |	    /*
 6676|       |	     * Element is a generic container.
 6677|       |	     */
 6678|  1.31k|	    ret = XML_ELEMENT_TYPE_ANY;
 6679|  15.4k|	} else if (RAW == '(') {
  ------------------
  |  | 2224|  15.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6679:13): [True: 14.5k, False: 864]
  ------------------
 6680|  14.5k|	    ret = xmlParseElementContentDecl(ctxt, name, &content);
 6681|  14.5k|            if (ret <= 0)
  ------------------
  |  Branch (6681:17): [True: 3.60k, False: 10.9k]
  ------------------
 6682|  3.60k|                return(-1);
 6683|  14.5k|	} else {
 6684|       |	    /*
 6685|       |	     * [ WFC: PEs in Internal Subset ] error handling.
 6686|       |	     */
 6687|    864|            xmlFatalErrMsg(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6688|    864|                  "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
 6689|    864|	    return(-1);
 6690|    864|	}
 6691|       |
 6692|  16.6k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  16.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6693|       |
 6694|  16.6k|	if (RAW != '>') {
  ------------------
  |  | 2224|  16.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6694:6): [True: 1.14k, False: 15.5k]
  ------------------
 6695|  1.14k|	    xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 6696|  1.14k|	    if (content != NULL) {
  ------------------
  |  Branch (6696:10): [True: 679, False: 468]
  ------------------
 6697|    679|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6698|    679|	    }
 6699|  15.5k|	} else {
 6700|  15.5k|#ifdef LIBXML_VALID_ENABLED
 6701|  15.5k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6701:10): [True: 11.0k, False: 4.46k]
  |  Branch (6701:30): [True: 71, False: 10.9k]
  ------------------
 6702|     71|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6703|     71|                                 "Element declaration doesn't start and stop in"
 6704|     71|                                 " the same entity\n",
 6705|     71|                                 NULL, NULL);
 6706|     71|	    }
 6707|  15.5k|#endif
 6708|       |
 6709|  15.5k|	    NEXT;
  ------------------
  |  | 2279|  15.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6710|  15.5k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6710:10): [True: 15.5k, False: 0]
  |  Branch (6710:33): [True: 14.5k, False: 960]
  ------------------
 6711|  14.5k|		(ctxt->sax->elementDecl != NULL)) {
  ------------------
  |  Branch (6711:3): [True: 14.5k, False: 0]
  ------------------
 6712|  14.5k|		if (content != NULL)
  ------------------
  |  Branch (6712:7): [True: 9.74k, False: 4.81k]
  ------------------
 6713|  9.74k|		    content->parent = NULL;
 6714|  14.5k|	        ctxt->sax->elementDecl(ctxt->userData, name, ret,
 6715|  14.5k|		                       content);
 6716|  14.5k|		if ((content != NULL) && (content->parent == NULL)) {
  ------------------
  |  Branch (6716:7): [True: 9.74k, False: 4.81k]
  |  Branch (6716:28): [True: 2.88k, False: 6.85k]
  ------------------
 6717|       |		    /*
 6718|       |		     * this is a trick: if xmlAddElementDecl is called,
 6719|       |		     * instead of copying the full tree it is plugged directly
 6720|       |		     * if called from the parser. Avoid duplicating the
 6721|       |		     * interfaces or change the API/ABI
 6722|       |		     */
 6723|  2.88k|		    xmlFreeDocElementContent(ctxt->myDoc, content);
 6724|  2.88k|		}
 6725|  14.5k|	    } else if (content != NULL) {
  ------------------
  |  Branch (6725:17): [True: 567, False: 393]
  ------------------
 6726|    567|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6727|    567|	    }
 6728|  15.5k|	}
 6729|  16.6k|    }
 6730|  16.6k|    return(ret);
 6731|  21.7k|}
xmlParseMarkupDecl:
 6906|   606k|xmlParseMarkupDecl(xmlParserCtxt *ctxt) {
 6907|   606k|    GROW;
  ------------------
  |  | 2271|   606k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   606k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   606k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 576k, False: 29.6k]
  |  |  ------------------
  |  | 2272|   606k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   576k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 232k, False: 344k]
  |  |  ------------------
  |  | 2273|   606k|	xmlParserGrow(ctxt);
  ------------------
 6908|   606k|    if (CUR == '<') {
  ------------------
  |  | 2225|   606k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6908:9): [True: 606k, False: 0]
  ------------------
 6909|   606k|        if (NXT(1) == '!') {
  ------------------
  |  | 2226|   606k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6909:13): [True: 585k, False: 20.5k]
  ------------------
 6910|   585k|	    switch (NXT(2)) {
  ------------------
  |  | 2226|   585k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
 6911|   179k|	        case 'E':
  ------------------
  |  Branch (6911:10): [True: 179k, False: 406k]
  ------------------
 6912|   179k|		    if (NXT(3) == 'L')
  ------------------
  |  | 2226|   179k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6912:11): [True: 21.7k, False: 157k]
  ------------------
 6913|  21.7k|			xmlParseElementDecl(ctxt);
 6914|   157k|		    else if (NXT(3) == 'N')
  ------------------
  |  | 2226|   157k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6914:16): [True: 157k, False: 25]
  ------------------
 6915|   157k|			xmlParseEntityDecl(ctxt);
 6916|     25|                    else
 6917|     25|                        SKIP(2);
  ------------------
  |  | 2248|     25|#define SKIP(val) do {							\
  |  | 2249|     25|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|     25|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 25]
  |  |  ------------------
  |  | 2251|     25|        xmlParserGrow(ctxt);						\
  |  | 2252|     25|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 25]
  |  |  ------------------
  ------------------
 6918|   179k|		    break;
 6919|  83.4k|	        case 'A':
  ------------------
  |  Branch (6919:10): [True: 83.4k, False: 502k]
  ------------------
 6920|  83.4k|		    xmlParseAttributeListDecl(ctxt);
 6921|  83.4k|		    break;
 6922|  5.12k|	        case 'N':
  ------------------
  |  Branch (6922:10): [True: 5.12k, False: 580k]
  ------------------
 6923|  5.12k|		    xmlParseNotationDecl(ctxt);
 6924|  5.12k|		    break;
 6925|   309k|	        case '-':
  ------------------
  |  Branch (6925:10): [True: 309k, False: 276k]
  ------------------
 6926|   309k|		    xmlParseComment(ctxt);
 6927|   309k|		    break;
 6928|  8.80k|		default:
  ------------------
  |  Branch (6928:3): [True: 8.80k, False: 577k]
  ------------------
 6929|  8.80k|                    xmlFatalErr(ctxt,
 6930|  8.80k|                                ctxt->inSubset == 2 ?
  ------------------
  |  Branch (6930:33): [True: 805, False: 8.00k]
  ------------------
 6931|    805|                                    XML_ERR_EXT_SUBSET_NOT_FINISHED :
 6932|  8.80k|                                    XML_ERR_INT_SUBSET_NOT_FINISHED,
 6933|  8.80k|                                NULL);
 6934|  8.80k|                    SKIP(2);
  ------------------
  |  | 2248|  8.80k|#define SKIP(val) do {							\
  |  | 2249|  8.80k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  8.80k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 406, False: 8.39k]
  |  |  ------------------
  |  | 2251|  8.80k|        xmlParserGrow(ctxt);						\
  |  | 2252|  8.80k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 8.80k]
  |  |  ------------------
  ------------------
 6935|  8.80k|		    break;
 6936|   585k|	    }
 6937|   585k|	} else if (NXT(1) == '?') {
  ------------------
  |  | 2226|  20.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6937:13): [True: 20.5k, False: 0]
  ------------------
 6938|  20.5k|	    xmlParsePI(ctxt);
 6939|  20.5k|	}
 6940|   606k|    }
 6941|   606k|}
xmlParseTextDecl:
 6953|   180k|xmlParseTextDecl(xmlParserCtxt *ctxt) {
 6954|   180k|    xmlChar *version;
 6955|       |
 6956|       |    /*
 6957|       |     * We know that '<?xml' is here.
 6958|       |     */
 6959|   180k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|   180k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   361k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 180k, False: 0]
  |  |  |  |  |  Branch (2231:41): [True: 180k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2232|   180k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 180k, False: 0]
  |  |  |  |  |  Branch (2232:41): [True: 180k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 180k, False: 0]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   180k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   180k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 177k, False: 3.33k]
  |  |  |  |  ------------------
  |  |  |  |   91|   180k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 3.33k, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 1.13k, False: 2.19k]
  |  |  |  |  ------------------
  |  |  |  |   92|   180k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 2.19k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6960|   180k|	SKIP(5);
  ------------------
  |  | 2248|   180k|#define SKIP(val) do {							\
  |  | 2249|   180k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   180k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 180k]
  |  |  ------------------
  |  | 2251|   180k|        xmlParserGrow(ctxt);						\
  |  | 2252|   180k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 180k]
  |  |  ------------------
  ------------------
 6961|   180k|    } else {
 6962|      4|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL);
 6963|      4|	return;
 6964|      4|    }
 6965|       |
 6966|   180k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|   180k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (6966:9): [True: 0, False: 180k]
  ------------------
 6967|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6968|      0|		       "Space needed after '<?xml'\n");
 6969|      0|    }
 6970|       |
 6971|       |    /*
 6972|       |     * We may have the VersionInfo here.
 6973|       |     */
 6974|   180k|    version = xmlParseVersionInfo(ctxt);
 6975|   180k|    if (version == NULL) {
  ------------------
  |  Branch (6975:9): [True: 174k, False: 6.59k]
  ------------------
 6976|   174k|	version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|   174k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
 6977|   174k|        if (version == NULL) {
  ------------------
  |  Branch (6977:13): [True: 6, False: 174k]
  ------------------
 6978|      6|            xmlErrMemory(ctxt);
 6979|      6|            return;
 6980|      6|        }
 6981|   174k|    } else {
 6982|  6.59k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  6.59k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (6982:6): [True: 635, False: 5.96k]
  ------------------
 6983|    635|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6984|    635|		           "Space needed here\n");
 6985|    635|	}
 6986|  6.59k|    }
 6987|   180k|    ctxt->input->version = version;
 6988|       |
 6989|       |    /*
 6990|       |     * We must have the encoding declaration
 6991|       |     */
 6992|   180k|    xmlParseEncodingDecl(ctxt);
 6993|       |
 6994|   180k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   180k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6995|   180k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   180k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  3.58k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6995:9): [True: 3.58k, False: 177k]
  |  Branch (6995:25): [True: 2.66k, False: 918]
  ------------------
 6996|  2.66k|        SKIP(2);
  ------------------
  |  | 2248|  2.66k|#define SKIP(val) do {							\
  |  | 2249|  2.66k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.66k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 506, False: 2.15k]
  |  |  ------------------
  |  | 2251|  2.66k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.66k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.66k]
  |  |  ------------------
  ------------------
 6997|   178k|    } else if (RAW == '>') {
  ------------------
  |  | 2224|   178k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6997:16): [True: 215, False: 177k]
  ------------------
 6998|       |        /* Deprecated old WD ... */
 6999|    215|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7000|    215|	NEXT;
  ------------------
  |  | 2279|    215|#define NEXT xmlNextChar(ctxt)
  ------------------
 7001|   177k|    } else {
 7002|   177k|        int c;
 7003|       |
 7004|   177k|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7005|   438M|        while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  |   44|   438M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
                      while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  | 2225|   438M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (7005:16): [True: 438M, False: 44]
  |  Branch (7005:47): [True: 438M, False: 8.72k]
  ------------------
 7006|   438M|            NEXT;
  ------------------
  |  | 2279|   438M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7007|   438M|            if (c == '>')
  ------------------
  |  Branch (7007:17): [True: 169k, False: 438M]
  ------------------
 7008|   169k|                break;
 7009|   438M|        }
 7010|   177k|    }
 7011|   180k|}
xmlParseExternalSubset:
 7028|  1.37k|                       const xmlChar *systemId) {
 7029|  1.37k|    int oldInputNr;
 7030|       |
 7031|  1.37k|    xmlCtxtInitializeLate(ctxt);
 7032|       |
 7033|  1.37k|    xmlDetectEncoding(ctxt);
 7034|       |
 7035|  1.37k|    if (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) {
  ------------------
  |  | 2234|  1.37k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  2.74k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 1.26k, False: 109]
  |  |  |  |  |  Branch (2231:41): [True: 138, False: 1.12k]
  |  |  |  |  ------------------
  |  |  |  | 2232|  1.37k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 98, False: 40]
  |  |  |  |  |  Branch (2232:41): [True: 96, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 87, False: 9]
  |  |  ------------------
  ------------------
 7036|     87|	xmlParseTextDecl(ctxt);
 7037|     87|    }
 7038|  1.37k|    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7038:9): [True: 0, False: 1.37k]
  ------------------
 7039|      0|        ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 7040|      0|	if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7040:6): [True: 0, False: 0]
  ------------------
 7041|      0|	    xmlErrMemory(ctxt);
 7042|      0|	    return;
 7043|      0|	}
 7044|      0|	ctxt->myDoc->properties = XML_DOC_INTERNAL;
 7045|      0|    }
 7046|  1.37k|    if ((ctxt->myDoc->intSubset == NULL) &&
  ------------------
  |  Branch (7046:9): [True: 0, False: 1.37k]
  ------------------
 7047|      0|        (xmlCreateIntSubset(ctxt->myDoc, NULL, publicId, systemId) == NULL)) {
  ------------------
  |  Branch (7047:9): [True: 0, False: 0]
  ------------------
 7048|      0|        xmlErrMemory(ctxt);
 7049|      0|    }
 7050|       |
 7051|  1.37k|    ctxt->inSubset = 2;
 7052|  1.37k|    oldInputNr = ctxt->inputNr;
 7053|       |
 7054|  1.37k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.37k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7055|   214k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   214k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (7055:12): [True: 213k, False: 152]
  ------------------
 7056|   213k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (7056:13): [True: 1.58k, False: 212k]
  ------------------
 7057|  1.58k|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (7057:17): [True: 636, False: 949]
  ------------------
 7058|    636|                xmlParserCheckEOF(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED);
 7059|    636|                break;
 7060|    636|            }
 7061|       |
 7062|    949|            xmlPopPE(ctxt);
 7063|   212k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|   212k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   209k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   198k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7063:20): [True: 209k, False: 2.42k]
  |  Branch (7063:36): [True: 198k, False: 11.4k]
  |  Branch (7063:55): [True: 981, False: 197k]
  ------------------
 7064|    981|            xmlParseConditionalSections(ctxt);
 7065|   211k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|   211k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|   208k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  11.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7065:20): [True: 208k, False: 2.42k]
  |  Branch (7065:37): [True: 197k, False: 11.4k]
  |  Branch (7065:56): [True: 11.3k, False: 46]
  ------------------
 7066|   208k|            xmlParseMarkupDecl(ctxt);
 7067|   208k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  2.46k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7067:20): [True: 1.88k, False: 583]
  ------------------
 7068|  1.88k|            xmlParsePERefInternal(ctxt, 1);
 7069|  1.88k|        } else {
 7070|    583|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 7071|       |
 7072|    710|            while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (7072:20): [True: 127, False: 583]
  ------------------
 7073|    127|                xmlPopPE(ctxt);
 7074|    583|            break;
 7075|    583|        }
 7076|   212k|        SKIP_BLANKS;
  ------------------
  |  | 2275|   212k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7077|   212k|        SHRINK;
  ------------------
  |  | 2267|   212k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   212k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   212k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 212k, False: 0]
  |  |  ------------------
  |  | 2268|   212k|	xmlParserShrink(ctxt);
  ------------------
 7078|   212k|        GROW;
  ------------------
  |  | 2271|   212k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   212k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   212k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 212k, False: 0]
  |  |  ------------------
  |  | 2272|   212k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   212k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.70k, False: 203k]
  |  |  ------------------
  |  | 2273|   212k|	xmlParserGrow(ctxt);
  ------------------
 7079|   212k|    }
 7080|  1.37k|}
xmlParseReference:
 7096|  98.3k|xmlParseReference(xmlParserCtxt *ctxt) {
 7097|  98.3k|    xmlEntityPtr ent = NULL;
 7098|  98.3k|    const xmlChar *name;
 7099|  98.3k|    xmlChar *val;
 7100|       |
 7101|  98.3k|    if (RAW != '&')
  ------------------
  |  | 2224|  98.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7101:9): [True: 0, False: 98.3k]
  ------------------
 7102|      0|        return;
 7103|       |
 7104|       |    /*
 7105|       |     * Simple case of a CharRef
 7106|       |     */
 7107|  98.3k|    if (NXT(1) == '#') {
  ------------------
  |  | 2226|  98.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7107:9): [True: 17.3k, False: 80.9k]
  ------------------
 7108|  17.3k|	int i = 0;
 7109|  17.3k|	xmlChar out[16];
 7110|  17.3k|	int value = xmlParseCharRef(ctxt);
 7111|       |
 7112|  17.3k|	if (value == 0)
  ------------------
  |  Branch (7112:6): [True: 4.79k, False: 12.5k]
  ------------------
 7113|  4.79k|	    return;
 7114|       |
 7115|       |        /*
 7116|       |         * Just encode the value in UTF-8
 7117|       |         */
 7118|  12.5k|        COPY_BUF(out, i, value);
  ------------------
  |  | 2296|  12.5k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 11.7k, False: 798]
  |  |  ------------------
  |  | 2297|  12.5k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 7119|  12.5k|        out[i] = 0;
 7120|  12.5k|        if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7120:13): [True: 12.5k, False: 0]
  |  Branch (7120:36): [True: 12.5k, False: 0]
  ------------------
 7121|  12.5k|            (!ctxt->disableSAX))
  ------------------
  |  Branch (7121:13): [True: 6.01k, False: 6.58k]
  ------------------
 7122|  6.01k|            ctxt->sax->characters(ctxt->userData, out, i);
 7123|  12.5k|	return;
 7124|  17.3k|    }
 7125|       |
 7126|       |    /*
 7127|       |     * We are seeing an entity reference
 7128|       |     */
 7129|  80.9k|    name = xmlParseEntityRefInternal(ctxt);
 7130|  80.9k|    if (name == NULL)
  ------------------
  |  Branch (7130:9): [True: 17.8k, False: 63.1k]
  ------------------
 7131|  17.8k|        return;
 7132|  63.1k|    ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 0);
 7133|  63.1k|    if (ent == NULL) {
  ------------------
  |  Branch (7133:9): [True: 38.9k, False: 24.1k]
  ------------------
 7134|       |        /*
 7135|       |         * Create a reference for undeclared entities.
 7136|       |         */
 7137|  38.9k|        if ((ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7137:13): [True: 33.3k, False: 5.61k]
  ------------------
 7138|  33.3k|            (ctxt->sax != NULL) &&
  ------------------
  |  Branch (7138:13): [True: 33.3k, False: 0]
  ------------------
 7139|  33.3k|            (ctxt->disableSAX == 0) &&
  ------------------
  |  Branch (7139:13): [True: 22.9k, False: 10.3k]
  ------------------
 7140|  22.9k|            (ctxt->sax->reference != NULL)) {
  ------------------
  |  Branch (7140:13): [True: 22.9k, False: 0]
  ------------------
 7141|  22.9k|            ctxt->sax->reference(ctxt->userData, name);
 7142|  22.9k|        }
 7143|  38.9k|        return;
 7144|  38.9k|    }
 7145|  24.1k|    if (!ctxt->wellFormed)
  ------------------
  |  Branch (7145:9): [True: 5.48k, False: 18.6k]
  ------------------
 7146|  5.48k|	return;
 7147|       |
 7148|       |    /* special case of predefined entities */
 7149|  18.6k|    if ((ent->name == NULL) ||
  ------------------
  |  Branch (7149:9): [True: 0, False: 18.6k]
  ------------------
 7150|  18.6k|        (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (7150:9): [True: 1.33k, False: 17.3k]
  ------------------
 7151|  1.33k|	val = ent->content;
 7152|  1.33k|	if (val == NULL) return;
  ------------------
  |  Branch (7152:6): [True: 0, False: 1.33k]
  ------------------
 7153|       |	/*
 7154|       |	 * inline the entity.
 7155|       |	 */
 7156|  1.33k|	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7156:6): [True: 1.33k, False: 0]
  |  Branch (7156:29): [True: 1.33k, False: 0]
  ------------------
 7157|  1.33k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (7157:6): [True: 1.33k, False: 0]
  ------------------
 7158|  1.33k|	    ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
 7159|  1.33k|	return;
 7160|  1.33k|    }
 7161|       |
 7162|       |    /*
 7163|       |     * Some users try to parse entities on their own and used to set
 7164|       |     * the renamed "checked" member. Fix the flags to cover this
 7165|       |     * case.
 7166|       |     */
 7167|  17.3k|    if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
  ------------------
  |  |   19|  17.3k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7167:9): [True: 4.18k, False: 13.1k]
  |  Branch (7167:49): [True: 0, False: 4.18k]
  ------------------
 7168|      0|        ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|      0|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 7169|       |
 7170|       |    /*
 7171|       |     * The first reference to the entity trigger a parsing phase
 7172|       |     * where the ent->children is filled with the result from
 7173|       |     * the parsing.
 7174|       |     * Note: external parsed entities will not be loaded, it is not
 7175|       |     * required for a non-validating parser, unless the parsing option
 7176|       |     * of validating, or substituting entities were given. Doing so is
 7177|       |     * far more secure as the parser will only process data coming from
 7178|       |     * the document entity by default.
 7179|       |     *
 7180|       |     * FIXME: This doesn't work correctly since entities can be
 7181|       |     * expanded with different namespace declarations in scope.
 7182|       |     * For example:
 7183|       |     *
 7184|       |     * <!DOCTYPE doc [
 7185|       |     *   <!ENTITY ent "<ns:elem/>">
 7186|       |     * ]>
 7187|       |     * <doc>
 7188|       |     *   <decl1 xmlns:ns="urn:ns1">
 7189|       |     *     &ent;
 7190|       |     *   </decl1>
 7191|       |     *   <decl2 xmlns:ns="urn:ns2">
 7192|       |     *     &ent;
 7193|       |     *   </decl2>
 7194|       |     * </doc>
 7195|       |     *
 7196|       |     * Proposed fix:
 7197|       |     *
 7198|       |     * - Ignore current namespace declarations when parsing the
 7199|       |     *   entity. If a prefix can't be resolved, don't report an error
 7200|       |     *   but mark it as unresolved.
 7201|       |     * - Try to resolve these prefixes when expanding the entity.
 7202|       |     *   This will require a specialized version of xmlStaticCopyNode
 7203|       |     *   which can also make use of the namespace hash table to avoid
 7204|       |     *   quadratic behavior.
 7205|       |     *
 7206|       |     * Alternatively, we could simply reparse the entity on each
 7207|       |     * expansion like we already do with custom SAX callbacks.
 7208|       |     * External entity content should be cached in this case.
 7209|       |     */
 7210|  17.3k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (7210:9): [True: 8.35k, False: 9.00k]
  ------------------
 7211|  9.00k|        (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (7211:10): [True: 8.75k, False: 248]
  ------------------
 7212|  8.75k|         ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (7212:11): [True: 6.34k, False: 2.41k]
  ------------------
 7213|  16.6k|          (ctxt->validate)))) {
  ------------------
  |  Branch (7213:11): [True: 1.98k, False: 432]
  ------------------
 7214|  16.6k|        if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  16.6k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7214:13): [True: 3.50k, False: 13.1k]
  ------------------
 7215|  3.50k|            xmlCtxtParseEntity(ctxt, ent);
 7216|  13.1k|        } else if (ent->children == NULL) {
  ------------------
  |  Branch (7216:20): [True: 3.96k, False: 9.22k]
  ------------------
 7217|       |            /*
 7218|       |             * Probably running in SAX mode and the callbacks don't
 7219|       |             * build the entity content. Parse the entity again.
 7220|       |             *
 7221|       |             * This will also be triggered in normal tree builder mode
 7222|       |             * if an entity happens to be empty, causing unnecessary
 7223|       |             * reloads. It's hard to come up with a reliable check in
 7224|       |             * which mode we're running.
 7225|       |             */
 7226|  3.96k|            xmlCtxtParseEntity(ctxt, ent);
 7227|  3.96k|        }
 7228|  16.6k|    }
 7229|       |
 7230|       |    /*
 7231|       |     * We also check for amplification if entities aren't substituted.
 7232|       |     * They might be expanded later.
 7233|       |     */
 7234|  17.3k|    if (xmlParserEntityCheck(ctxt, ent->expandedSize))
  ------------------
  |  Branch (7234:9): [True: 41, False: 17.3k]
  ------------------
 7235|     41|        return;
 7236|       |
 7237|  17.3k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (7237:9): [True: 0, False: 17.3k]
  |  Branch (7237:32): [True: 819, False: 16.5k]
  ------------------
 7238|    819|        return;
 7239|       |
 7240|  16.5k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (7240:9): [True: 5.95k, False: 10.5k]
  ------------------
 7241|       |	/*
 7242|       |	 * Create a reference
 7243|       |	 */
 7244|  5.95k|        if (ctxt->sax->reference != NULL)
  ------------------
  |  Branch (7244:13): [True: 5.95k, False: 0]
  ------------------
 7245|  5.95k|	    ctxt->sax->reference(ctxt->userData, ent->name);
 7246|  10.5k|    } else if ((ent->children != NULL) && (ctxt->node != NULL)) {
  ------------------
  |  Branch (7246:16): [True: 6.87k, False: 3.67k]
  |  Branch (7246:43): [True: 6.87k, False: 0]
  ------------------
 7247|  6.87k|        xmlNodePtr copy, cur;
 7248|       |
 7249|       |        /*
 7250|       |         * Seems we are generating the DOM content, copy the tree
 7251|       |	 */
 7252|  6.87k|        cur = ent->children;
 7253|       |
 7254|       |        /*
 7255|       |         * Handle first text node with SAX to coalesce text efficiently
 7256|       |         */
 7257|  6.87k|        if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7257:13): [True: 5.44k, False: 1.43k]
  ------------------
 7258|  5.61k|            (cur->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (7258:13): [True: 169, False: 1.26k]
  ------------------
 7259|  5.61k|            int len = xmlStrlen(cur->content);
 7260|       |
 7261|  5.61k|            if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7261:17): [True: 5.44k, False: 169]
  ------------------
 7262|  5.44k|                (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7262:17): [True: 0, False: 169]
  ------------------
 7263|  5.44k|                if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7263:21): [True: 5.44k, False: 0]
  ------------------
 7264|  5.44k|                    ctxt->sax->characters(ctxt->userData, cur->content, len);
 7265|  5.44k|            } else {
 7266|    169|                if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7266:21): [True: 169, False: 0]
  ------------------
 7267|    169|                    ctxt->sax->cdataBlock(ctxt->userData, cur->content, len);
 7268|    169|            }
 7269|       |
 7270|  5.61k|            cur = cur->next;
 7271|  5.61k|        }
 7272|       |
 7273|  49.3k|        while (cur != NULL) {
  ------------------
  |  Branch (7273:16): [True: 44.3k, False: 4.99k]
  ------------------
 7274|  44.3k|            xmlNodePtr last;
 7275|       |
 7276|       |            /*
 7277|       |             * Handle last text node with SAX to coalesce text efficiently
 7278|       |             */
 7279|  44.3k|            if ((cur->next == NULL) &&
  ------------------
  |  Branch (7279:17): [True: 3.72k, False: 40.6k]
  ------------------
 7280|  3.72k|                ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7280:18): [True: 1.67k, False: 2.05k]
  ------------------
 7281|  2.05k|                 (cur->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (7281:18): [True: 173, False: 1.88k]
  ------------------
 7282|  1.84k|                int len = xmlStrlen(cur->content);
 7283|       |
 7284|  1.84k|                if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7284:21): [True: 1.67k, False: 173]
  ------------------
 7285|  1.67k|                    (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7285:21): [True: 0, False: 173]
  ------------------
 7286|  1.67k|                    if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7286:25): [True: 1.67k, False: 0]
  ------------------
 7287|  1.67k|                        ctxt->sax->characters(ctxt->userData, cur->content,
 7288|  1.67k|                                              len);
 7289|  1.67k|                } else {
 7290|    173|                    if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7290:25): [True: 173, False: 0]
  ------------------
 7291|    173|                        ctxt->sax->cdataBlock(ctxt->userData, cur->content,
 7292|    173|                                              len);
 7293|    173|                }
 7294|       |
 7295|  1.84k|                break;
 7296|  1.84k|            }
 7297|       |
 7298|       |            /*
 7299|       |             * Reset coalesce buffer stats only for non-text nodes.
 7300|       |             */
 7301|  42.5k|            ctxt->nodemem = 0;
 7302|  42.5k|            ctxt->nodelen = 0;
 7303|       |
 7304|  42.5k|            copy = xmlDocCopyNode(cur, ctxt->myDoc, 1);
 7305|       |
 7306|  42.5k|            if (copy == NULL) {
  ------------------
  |  Branch (7306:17): [True: 37, False: 42.4k]
  ------------------
 7307|     37|                xmlErrMemory(ctxt);
 7308|     37|                break;
 7309|     37|            }
 7310|       |
 7311|  42.4k|            if (ctxt->parseMode == XML_PARSE_READER) {
  ------------------
  |  Branch (7311:17): [True: 41.5k, False: 913]
  ------------------
 7312|       |                /* Needed for reader */
 7313|  41.5k|                copy->extra = cur->extra;
 7314|       |                /* Maybe needed for reader */
 7315|  41.5k|                copy->_private = cur->_private;
 7316|  41.5k|            }
 7317|       |
 7318|  42.4k|            copy->parent = ctxt->node;
 7319|  42.4k|            last = ctxt->node->last;
 7320|  42.4k|            if (last == NULL) {
  ------------------
  |  Branch (7320:17): [True: 384, False: 42.0k]
  ------------------
 7321|    384|                ctxt->node->children = copy;
 7322|  42.0k|            } else {
 7323|  42.0k|                last->next = copy;
 7324|  42.0k|                copy->prev = last;
 7325|  42.0k|            }
 7326|  42.4k|            ctxt->node->last = copy;
 7327|       |
 7328|  42.4k|            cur = cur->next;
 7329|  42.4k|        }
 7330|  6.87k|    }
 7331|  16.5k|}
xmlParseDocTypeDecl:
 7934|  18.1k|xmlParseDocTypeDecl(xmlParserCtxt *ctxt) {
 7935|  18.1k|    const xmlChar *name = NULL;
 7936|  18.1k|    xmlChar *publicId = NULL;
 7937|  18.1k|    xmlChar *URI = NULL;
 7938|       |
 7939|       |    /*
 7940|       |     * We know that '<!DOCTYPE' has been detected.
 7941|       |     */
 7942|  18.1k|    SKIP(9);
  ------------------
  |  | 2248|  18.1k|#define SKIP(val) do {							\
  |  | 2249|  18.1k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  18.1k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 4, False: 18.1k]
  |  |  ------------------
  |  | 2251|  18.1k|        xmlParserGrow(ctxt);						\
  |  | 2252|  18.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 18.1k]
  |  |  ------------------
  ------------------
 7943|       |
 7944|  18.1k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  18.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7944:9): [True: 1.15k, False: 16.9k]
  ------------------
 7945|  1.15k|        xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7946|  1.15k|                       "Space required after 'DOCTYPE'\n");
 7947|  1.15k|    }
 7948|       |
 7949|       |    /*
 7950|       |     * Parse the DOCTYPE name.
 7951|       |     */
 7952|  18.1k|    name = xmlParseName(ctxt);
 7953|  18.1k|    if (name == NULL) {
  ------------------
  |  Branch (7953:9): [True: 924, False: 17.2k]
  ------------------
 7954|    924|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7955|    924|		       "xmlParseDocTypeDecl : no DOCTYPE name !\n");
 7956|    924|    }
 7957|  18.1k|    ctxt->intSubName = name;
 7958|       |
 7959|  18.1k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  18.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7960|       |
 7961|       |    /*
 7962|       |     * Check for public and system identifier (URI)
 7963|       |     */
 7964|  18.1k|    URI = xmlParseExternalID(ctxt, &publicId, 1);
 7965|       |
 7966|  18.1k|    if ((URI != NULL) || (publicId != NULL)) {
  ------------------
  |  Branch (7966:9): [True: 2.70k, False: 15.4k]
  |  Branch (7966:26): [True: 20, False: 15.4k]
  ------------------
 7967|  2.72k|        ctxt->hasExternalSubset = 1;
 7968|  2.72k|    }
 7969|  18.1k|    ctxt->extSubURI = URI;
 7970|  18.1k|    ctxt->extSubSystem = publicId;
 7971|       |
 7972|  18.1k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  18.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7973|       |
 7974|       |    /*
 7975|       |     * Create and update the internal subset.
 7976|       |     */
 7977|  18.1k|    if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) &&
  ------------------
  |  Branch (7977:9): [True: 18.1k, False: 0]
  |  Branch (7977:32): [True: 18.1k, False: 0]
  ------------------
 7978|  18.1k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (7978:2): [True: 17.9k, False: 149]
  ------------------
 7979|  17.9k|	ctxt->sax->internalSubset(ctxt->userData, name, publicId, URI);
 7980|       |
 7981|  18.1k|    if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2224|  18.1k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2224|  5.25k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7981:9): [True: 5.25k, False: 12.8k]
  |  Branch (7981:25): [True: 235, False: 5.02k]
  ------------------
 7982|       |	xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 7983|    235|    }
 7984|  18.1k|}
xmlParseAttribute:
 8090|   158k|xmlParseAttribute(xmlParserCtxt *ctxt, xmlChar **value) {
 8091|   158k|    const xmlChar *name;
 8092|   158k|    xmlChar *val;
 8093|       |
 8094|   158k|    *value = NULL;
 8095|   158k|    GROW;
  ------------------
  |  | 2271|   158k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   158k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   158k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 88.7k, False: 69.8k]
  |  |  ------------------
  |  | 2272|   158k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  88.7k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 10.0k, False: 78.6k]
  |  |  ------------------
  |  | 2273|   158k|	xmlParserGrow(ctxt);
  ------------------
 8096|   158k|    name = xmlParseName(ctxt);
 8097|   158k|    if (name == NULL) {
  ------------------
  |  Branch (8097:9): [True: 50.1k, False: 108k]
  ------------------
 8098|  50.1k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8099|  50.1k|	               "error parsing attribute name\n");
 8100|  50.1k|        return(NULL);
 8101|  50.1k|    }
 8102|       |
 8103|       |    /*
 8104|       |     * read the value
 8105|       |     */
 8106|   108k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   108k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8107|   108k|    if (RAW == '=') {
  ------------------
  |  | 2224|   108k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8107:9): [True: 95.0k, False: 13.4k]
  ------------------
 8108|  95.0k|        NEXT;
  ------------------
  |  | 2279|  95.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8109|  95.0k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  95.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8110|  95.0k|	val = xmlParseAttValue(ctxt);
 8111|  95.0k|    } else {
 8112|  13.4k|	xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8113|  13.4k|	       "Specification mandates value for attribute %s\n", name);
 8114|  13.4k|	return(name);
 8115|  13.4k|    }
 8116|       |
 8117|       |    /*
 8118|       |     * Check that xml:lang conforms to the specification
 8119|       |     * No more registered as an error, just generate a warning now
 8120|       |     * since this was deprecated in XML second edition
 8121|       |     */
 8122|  95.0k|    if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) {
  ------------------
  |  |   34|  39.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8122:9): [True: 39.0k, False: 55.9k]
  |  Branch (8122:29): [True: 9.61k, False: 29.4k]
  ------------------
 8123|  9.61k|	if (!xmlCheckLanguageID(val)) {
  ------------------
  |  Branch (8123:6): [True: 6.45k, False: 3.15k]
  ------------------
 8124|  6.45k|	    xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8125|  6.45k|		          "Malformed value for xml:lang : %s\n",
 8126|  6.45k|			  val, NULL);
 8127|  6.45k|	}
 8128|  9.61k|    }
 8129|       |
 8130|       |    /*
 8131|       |     * Check that xml:space conforms to the specification
 8132|       |     */
 8133|  95.0k|    if (xmlStrEqual(name, BAD_CAST "xml:space")) {
  ------------------
  |  |   34|  95.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8133:9): [True: 934, False: 94.0k]
  ------------------
 8134|    934|	if (xmlStrEqual(val, BAD_CAST "default"))
  ------------------
  |  |   34|    934|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8134:6): [True: 112, False: 822]
  ------------------
 8135|    112|	    *(ctxt->space) = 0;
 8136|    822|	else if (xmlStrEqual(val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    822|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8136:11): [True: 463, False: 359]
  ------------------
 8137|    463|	    *(ctxt->space) = 1;
 8138|    359|	else {
 8139|    359|		xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8140|    359|"Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8141|    359|                                 val, NULL);
 8142|    359|	}
 8143|    934|    }
 8144|       |
 8145|  95.0k|    *value = val;
 8146|  95.0k|    return(name);
 8147|   108k|}
xmlParseStartTag:
 8177|   288k|xmlParseStartTag(xmlParserCtxt *ctxt) {
 8178|   288k|    const xmlChar *name;
 8179|   288k|    const xmlChar *attname;
 8180|   288k|    xmlChar *attvalue;
 8181|   288k|    const xmlChar **atts = ctxt->atts;
 8182|   288k|    int nbatts = 0;
 8183|   288k|    int maxatts = ctxt->maxatts;
 8184|   288k|    int i;
 8185|       |
 8186|   288k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2224|   288k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8186:9): [True: 0, False: 288k]
  ------------------
 8187|   288k|    NEXT1;
  ------------------
  |  | 2281|   288k|#define NEXT1 {								\
  |  | 2282|   288k|	ctxt->input->col++;						\
  |  | 2283|   288k|	ctxt->input->cur++;						\
  |  | 2284|   288k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 763, False: 287k]
  |  |  ------------------
  |  | 2285|   288k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   288k|    }
  ------------------
 8188|       |
 8189|   288k|    name = xmlParseName(ctxt);
 8190|   288k|    if (name == NULL) {
  ------------------
  |  Branch (8190:9): [True: 15.3k, False: 272k]
  ------------------
 8191|  15.3k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8192|  15.3k|	     "xmlParseStartTag: invalid element name\n");
 8193|  15.3k|        return(NULL);
 8194|  15.3k|    }
 8195|       |
 8196|       |    /*
 8197|       |     * Now parse the attributes, it ends up with the ending
 8198|       |     *
 8199|       |     * (S Attribute)* S?
 8200|       |     */
 8201|   272k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   272k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8202|   272k|    GROW;
  ------------------
  |  | 2271|   272k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   272k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   272k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 168k, False: 104k]
  |  |  ------------------
  |  | 2272|   272k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   168k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 23.8k, False: 144k]
  |  |  ------------------
  |  | 2273|   272k|	xmlParserGrow(ctxt);
  ------------------
 8203|       |
 8204|   332k|    while (((RAW != '>') &&
  ------------------
  |  | 2224|   332k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8204:13): [True: 214k, False: 118k]
  ------------------
 8205|   214k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2224|   214k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2226|  53.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8205:6): [True: 161k, False: 53.0k]
  |  Branch (8205:22): [True: 4.08k, False: 49.0k]
  ------------------
 8206|   165k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   165k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   165k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 159k, False: 5.50k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 159k]
  |  |  |  |  ------------------
  |  |  |  |  109|   165k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 165k]
  |  |  |  |  ------------------
  |  |  |  |  110|   165k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 158k, False: 6.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   158k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8206:29): [True: 158k, False: 108]
  ------------------
 8207|   158k|	attname = xmlParseAttribute(ctxt, &attvalue);
 8208|   158k|        if (attname == NULL)
  ------------------
  |  Branch (8208:13): [True: 50.1k, False: 108k]
  ------------------
 8209|  50.1k|	    break;
 8210|   108k|        if (attvalue != NULL) {
  ------------------
  |  Branch (8210:13): [True: 91.8k, False: 16.6k]
  ------------------
 8211|       |	    /*
 8212|       |	     * [ WFC: Unique Att Spec ]
 8213|       |	     * No attribute name may appear more than once in the same
 8214|       |	     * start-tag or empty-element tag.
 8215|       |	     */
 8216|   212k|	    for (i = 0; i < nbatts;i += 2) {
  ------------------
  |  Branch (8216:18): [True: 129k, False: 82.3k]
  ------------------
 8217|   129k|	        if (xmlStrEqual(atts[i], attname)) {
  ------------------
  |  Branch (8217:14): [True: 9.43k, False: 120k]
  ------------------
 8218|  9.43k|		    xmlErrAttributeDup(ctxt, NULL, attname);
 8219|  9.43k|		    goto failed;
 8220|  9.43k|		}
 8221|   129k|	    }
 8222|       |	    /*
 8223|       |	     * Add the pair to atts
 8224|       |	     */
 8225|  82.3k|	    if (nbatts + 4 > maxatts) {
  ------------------
  |  Branch (8225:10): [True: 18.2k, False: 64.1k]
  ------------------
 8226|  18.2k|	        const xmlChar **n;
 8227|  18.2k|                int newSize;
 8228|       |
 8229|  18.2k|                newSize = xmlGrowCapacity(maxatts, sizeof(n[0]) * 2,
 8230|  18.2k|                                          11, XML_MAX_ATTRS);
  ------------------
  |  |   93|  18.2k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 8231|  18.2k|                if (newSize < 0) {
  ------------------
  |  Branch (8231:21): [True: 0, False: 18.2k]
  ------------------
 8232|      0|		    xmlErrMemory(ctxt);
 8233|      0|		    goto failed;
 8234|      0|		}
 8235|  18.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 8236|  18.2k|                if (newSize < 2)
  ------------------
  |  Branch (8236:21): [True: 11.3k, False: 6.89k]
  ------------------
 8237|  11.3k|                    newSize = 2;
 8238|  18.2k|#endif
 8239|  18.2k|	        n = xmlRealloc(atts, newSize * sizeof(n[0]) * 2);
 8240|  18.2k|		if (n == NULL) {
  ------------------
  |  Branch (8240:7): [True: 2, False: 18.2k]
  ------------------
 8241|      2|		    xmlErrMemory(ctxt);
 8242|      2|		    goto failed;
 8243|      2|		}
 8244|  18.2k|		atts = n;
 8245|  18.2k|                maxatts = newSize * 2;
 8246|  18.2k|		ctxt->atts = atts;
 8247|  18.2k|		ctxt->maxatts = maxatts;
 8248|  18.2k|	    }
 8249|       |
 8250|  82.3k|	    atts[nbatts++] = attname;
 8251|  82.3k|	    atts[nbatts++] = attvalue;
 8252|  82.3k|	    atts[nbatts] = NULL;
 8253|  82.3k|	    atts[nbatts + 1] = NULL;
 8254|       |
 8255|  82.3k|            attvalue = NULL;
 8256|  82.3k|	}
 8257|       |
 8258|   108k|failed:
 8259|       |
 8260|   108k|        if (attvalue != NULL)
  ------------------
  |  Branch (8260:13): [True: 9.43k, False: 98.9k]
  ------------------
 8261|  9.43k|            xmlFree(attvalue);
 8262|       |
 8263|   108k|	GROW
  ------------------
  |  | 2271|   108k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   108k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   108k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 51.3k, False: 57.0k]
  |  |  ------------------
  |  | 2272|   108k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  51.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.31k, False: 42.0k]
  |  |  ------------------
  |  | 2273|   108k|	xmlParserGrow(ctxt);
  ------------------
 8264|   108k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   108k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|  80.4k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2226|  21.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8264:6): [True: 27.9k, False: 80.4k]
  |  Branch (8264:24): [True: 21.2k, False: 59.2k]
  |  Branch (8264:40): [True: 20.6k, False: 654]
  ------------------
 8265|  48.5k|	    break;
 8266|  59.8k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|  59.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (8266:6): [True: 21.7k, False: 38.1k]
  ------------------
 8267|  21.7k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 8268|  21.7k|			   "attributes construct error\n");
 8269|  21.7k|	}
 8270|  59.8k|	SHRINK;
  ------------------
  |  | 2267|  59.8k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  59.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  59.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 25.4k, False: 34.4k]
  |  |  ------------------
  |  | 2268|  59.8k|	xmlParserShrink(ctxt);
  ------------------
 8271|  59.8k|        GROW;
  ------------------
  |  | 2271|  59.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  59.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  59.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 25.4k, False: 34.4k]
  |  |  ------------------
  |  | 2272|  59.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  25.4k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.99k, False: 20.4k]
  |  |  ------------------
  |  | 2273|  59.8k|	xmlParserGrow(ctxt);
  ------------------
 8272|  59.8k|    }
 8273|       |
 8274|       |    /*
 8275|       |     * SAX: Start of Element !
 8276|       |     */
 8277|   272k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL) &&
  ------------------
  |  Branch (8277:9): [True: 272k, False: 0]
  |  Branch (8277:32): [True: 272k, False: 0]
  ------------------
 8278|   272k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (8278:2): [True: 219k, False: 52.9k]
  ------------------
 8279|   219k|	if (nbatts > 0)
  ------------------
  |  Branch (8279:6): [True: 52.6k, False: 167k]
  ------------------
 8280|  52.6k|	    ctxt->sax->startElement(ctxt->userData, name, atts);
 8281|   167k|	else
 8282|   167k|	    ctxt->sax->startElement(ctxt->userData, name, NULL);
 8283|   219k|    }
 8284|       |
 8285|   272k|    if (atts != NULL) {
  ------------------
  |  Branch (8285:9): [True: 204k, False: 67.9k]
  ------------------
 8286|       |        /* Free only the content strings */
 8287|   287k|        for (i = 1;i < nbatts;i+=2)
  ------------------
  |  Branch (8287:20): [True: 82.3k, False: 204k]
  ------------------
 8288|  82.3k|	    if (atts[i] != NULL)
  ------------------
  |  Branch (8288:10): [True: 82.3k, False: 0]
  ------------------
 8289|  82.3k|	       xmlFree((xmlChar *) atts[i]);
 8290|   204k|    }
 8291|   272k|    return(name);
 8292|   272k|}
xmlParseCDSect:
 9443|  36.0k|xmlParseCDSect(xmlParserCtxt *ctxt) {
 9444|  36.0k|    xmlChar *buf = NULL;
 9445|  36.0k|    int len = 0;
 9446|  36.0k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  36.0k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 9447|  36.0k|    int r, rl;
 9448|  36.0k|    int	s, sl;
 9449|  36.0k|    int cur, l;
 9450|  36.0k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9450:21): [True: 15.1k, False: 20.8k]
  ------------------
 9451|  15.1k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  15.1k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 9452|  36.0k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  20.8k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9453|       |
 9454|  36.0k|    if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2225|  36.0k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2226|  36.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2226|  36.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9454:9): [True: 0, False: 36.0k]
  |  Branch (9454:25): [True: 0, False: 36.0k]
  |  Branch (9454:44): [True: 0, False: 36.0k]
  ------------------
 9455|      0|        return;
 9456|  36.0k|    SKIP(3);
  ------------------
  |  | 2248|  36.0k|#define SKIP(val) do {							\
  |  | 2249|  36.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  36.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 36.0k]
  |  |  ------------------
  |  | 2251|  36.0k|        xmlParserGrow(ctxt);						\
  |  | 2252|  36.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 36.0k]
  |  |  ------------------
  ------------------
 9457|       |
 9458|  36.0k|    if (!CMP6(CUR_PTR, 'C', 'D', 'A', 'T', 'A', '['))
  ------------------
  |  | 2236|  36.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  72.1k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  72.1k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 36.0k, False: 0]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 36.0k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  36.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 36.0k, False: 0]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 36.0k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 36.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 36.0k, False: 0]
  |  |  ------------------
  ------------------
 9459|      0|        return;
 9460|  36.0k|    SKIP(6);
  ------------------
  |  | 2248|  36.0k|#define SKIP(val) do {							\
  |  | 2249|  36.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  36.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 93, False: 35.9k]
  |  |  ------------------
  |  | 2251|  36.0k|        xmlParserGrow(ctxt);						\
  |  | 2252|  36.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 36.0k]
  |  |  ------------------
  ------------------
 9461|       |
 9462|  36.0k|    r = xmlCurrentCharRecover(ctxt, &rl);
 9463|  36.0k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|  36.0k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  36.0k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 31.4k, False: 4.60k]
  |  |  |  |  ------------------
  |  |  |  |  118|  36.0k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  31.4k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 31.2k, False: 224]
  |  |  |  |  |  |  |  Branch (108:44): [True: 4.06k, False: 27.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  31.4k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 27.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  31.4k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 27.1k, False: 249]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  36.0k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 4.60k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.73k, False: 1.87k]
  |  |  |  |  ------------------
  |  |  |  |  120|  4.60k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.87k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.36k, False: 505]
  |  |  |  |  ------------------
  |  |  |  |  121|  4.60k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 437, False: 68]
  |  |  |  |  |  Branch (121:27): [True: 437, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9463:9): [True: 317, False: 35.7k]
  ------------------
 9464|    317|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9465|    317|        goto out;
 9466|    317|    }
 9467|  35.7k|    NEXTL(rl);
  ------------------
  |  | 2288|  35.7k|#define NEXTL(l) do {							\
  |  | 2289|  35.7k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 4.05k, False: 31.6k]
  |  |  ------------------
  |  | 2290|  4.05k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  31.6k|    } else ctxt->input->col++;						\
  |  | 2292|  35.7k|    ctxt->input->cur += l;				\
  |  | 2293|  35.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 35.7k]
  |  |  ------------------
  ------------------
 9468|  35.7k|    s = xmlCurrentCharRecover(ctxt, &sl);
 9469|  35.7k|    if (!IS_CHAR(s)) {
  ------------------
  |  |  115|  35.7k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  35.7k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 30.5k, False: 5.19k]
  |  |  |  |  ------------------
  |  |  |  |  118|  35.7k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  30.5k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 27.5k, False: 3.02k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 341, False: 27.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  30.5k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 30.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  30.5k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 27.0k, False: 3.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  35.7k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 5.19k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 455, False: 4.73k]
  |  |  |  |  ------------------
  |  |  |  |  120|  5.19k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 4.73k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.34k, False: 3.39k]
  |  |  |  |  ------------------
  |  |  |  |  121|  5.19k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 216, False: 3.17k]
  |  |  |  |  |  Branch (121:27): [True: 216, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9469:9): [True: 6.38k, False: 29.3k]
  ------------------
 9470|  6.38k|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9471|  6.38k|        goto out;
 9472|  6.38k|    }
 9473|  29.3k|    NEXTL(sl);
  ------------------
  |  | 2288|  29.3k|#define NEXTL(l) do {							\
  |  | 2289|  29.3k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 322, False: 29.0k]
  |  |  ------------------
  |  | 2290|    322|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  29.0k|    } else ctxt->input->col++;						\
  |  | 2292|  29.3k|    ctxt->input->cur += l;				\
  |  | 2293|  29.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 29.3k]
  |  |  ------------------
  ------------------
 9474|  29.3k|    cur = xmlCurrentCharRecover(ctxt, &l);
 9475|  29.3k|    buf = xmlMalloc(size);
 9476|  29.3k|    if (buf == NULL) {
  ------------------
  |  Branch (9476:9): [True: 4, False: 29.3k]
  ------------------
 9477|      4|	xmlErrMemory(ctxt);
 9478|      4|        goto out;
 9479|      4|    }
 9480|  1.02M|    while (IS_CHAR(cur) &&
  ------------------
  |  |  115|  1.02M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  2.04M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.01M, False: 3.97k]
  |  |  |  |  |  Branch (117:25): [True: 983k, False: 39.8k]
  |  |  |  |  ------------------
  |  |  |  |  118|  2.04M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   983k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 981k, False: 2.18k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.99k, False: 978k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   983k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 980k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   983k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 977k, False: 3.52k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  2.04M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 39.8k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.14k, False: 38.7k]
  |  |  |  |  ------------------
  |  |  |  |  120|  39.8k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 38.7k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 37.7k, False: 932]
  |  |  |  |  ------------------
  |  |  |  |  121|  39.8k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 484, False: 448]
  |  |  |  |  |  Branch (121:27): [True: 484, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9481|  1.01M|           ((r != ']') || (s != ']') || (cur != '>'))) {
  ------------------
  |  Branch (9481:13): [True: 991k, False: 28.4k]
  |  Branch (9481:27): [True: 1.38k, False: 27.1k]
  |  Branch (9481:41): [True: 1.73k, False: 25.3k]
  ------------------
 9482|   994k|	if (len + 5 >= size) {
  ------------------
  |  Branch (9482:6): [True: 1.32k, False: 992k]
  ------------------
 9483|  1.32k|	    xmlChar *tmp;
 9484|  1.32k|            int newSize;
 9485|       |
 9486|  1.32k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9487|  1.32k|            if (newSize < 0) {
  ------------------
  |  Branch (9487:17): [True: 0, False: 1.32k]
  ------------------
 9488|      0|                xmlFatalErrMsg(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9489|      0|                               "CData section too big found\n");
 9490|      0|                goto out;
 9491|      0|            }
 9492|  1.32k|	    tmp = xmlRealloc(buf, newSize);
 9493|  1.32k|	    if (tmp == NULL) {
  ------------------
  |  Branch (9493:10): [True: 1, False: 1.32k]
  ------------------
 9494|      1|		xmlErrMemory(ctxt);
 9495|      1|                goto out;
 9496|      1|	    }
 9497|  1.32k|	    buf = tmp;
 9498|  1.32k|	    size = newSize;
 9499|  1.32k|	}
 9500|   994k|	COPY_BUF(buf, len, r);
  ------------------
  |  | 2296|   994k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 134k, False: 860k]
  |  |  ------------------
  |  | 2297|   994k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 9501|   994k|	r = s;
 9502|   994k|	rl = sl;
 9503|   994k|	s = cur;
 9504|   994k|	sl = l;
 9505|   994k|	NEXTL(l);
  ------------------
  |  | 2288|   994k|#define NEXTL(l) do {							\
  |  | 2289|   994k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 2.80k, False: 991k]
  |  |  ------------------
  |  | 2290|  2.80k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   991k|    } else ctxt->input->col++;						\
  |  | 2292|   994k|    ctxt->input->cur += l;				\
  |  | 2293|   994k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 994k]
  |  |  ------------------
  ------------------
 9506|   994k|	cur = xmlCurrentCharRecover(ctxt, &l);
 9507|   994k|    }
 9508|  29.3k|    buf[len] = 0;
 9509|  29.3k|    if (cur != '>') {
  ------------------
  |  Branch (9509:9): [True: 3.97k, False: 25.3k]
  ------------------
 9510|  3.97k|	xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9511|  3.97k|	                     "CData section not finished\n%.50s\n", buf);
 9512|  3.97k|        goto out;
 9513|  3.97k|    }
 9514|  25.3k|    NEXTL(l);
  ------------------
  |  | 2288|  25.3k|#define NEXTL(l) do {							\
  |  | 2289|  25.3k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 25.3k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  25.3k|    } else ctxt->input->col++;						\
  |  | 2292|  25.3k|    ctxt->input->cur += l;				\
  |  | 2293|  25.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 25.3k]
  |  |  ------------------
  ------------------
 9515|       |
 9516|       |    /*
 9517|       |     * OK the buffer is to be consumed as cdata.
 9518|       |     */
 9519|  25.3k|    if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
  ------------------
  |  Branch (9519:9): [True: 25.3k, False: 0]
  |  Branch (9519:32): [True: 24.9k, False: 391]
  ------------------
 9520|  24.9k|        if ((ctxt->sax->cdataBlock != NULL) &&
  ------------------
  |  Branch (9520:13): [True: 24.9k, False: 0]
  ------------------
 9521|  24.9k|            ((ctxt->options & XML_PARSE_NOCDATA) == 0)) {
  ------------------
  |  Branch (9521:13): [True: 19.5k, False: 5.46k]
  ------------------
 9522|  19.5k|            ctxt->sax->cdataBlock(ctxt->userData, buf, len);
 9523|  19.5k|        } else if (ctxt->sax->characters != NULL) {
  ------------------
  |  Branch (9523:20): [True: 5.46k, False: 0]
  ------------------
 9524|  5.46k|            ctxt->sax->characters(ctxt->userData, buf, len);
 9525|  5.46k|        }
 9526|  24.9k|    }
 9527|       |
 9528|  36.0k|out:
 9529|  36.0k|    xmlFree(buf);
 9530|  36.0k|}
xmlParseElement:
 9670|  7.53k|xmlParseElement(xmlParserCtxt *ctxt) {
 9671|  7.53k|    if (xmlParseElementStart(ctxt) != 0)
  ------------------
  |  Branch (9671:9): [True: 3.07k, False: 4.45k]
  ------------------
 9672|  3.07k|        return;
 9673|       |
 9674|  4.45k|    xmlParseContentInternal(ctxt);
 9675|       |
 9676|  4.45k|    if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (9676:9): [True: 418, False: 4.03k]
  ------------------
 9677|    418|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (9677:13): [True: 2, False: 416]
  ------------------
 9678|      2|            const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9679|      2|            int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9680|      2|            xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9681|      2|                    "Premature end of data in tag %s line %d\n",
 9682|      2|                    name, line, NULL);
 9683|      2|        }
 9684|    418|        return;
 9685|    418|    }
 9686|       |
 9687|  4.03k|    xmlParseElementEnd(ctxt);
 9688|  4.03k|}
xmlParseVersionNum:
 9868|  12.1k|xmlParseVersionNum(xmlParserCtxt *ctxt) {
 9869|  12.1k|    xmlChar *buf = NULL;
 9870|  12.1k|    int len = 0;
 9871|  12.1k|    int size = 10;
 9872|  12.1k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9872:21): [True: 4.36k, False: 7.80k]
  ------------------
 9873|  4.36k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  4.36k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9874|  12.1k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  7.80k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9875|  12.1k|    xmlChar cur;
 9876|       |
 9877|  12.1k|    buf = xmlMalloc(size);
 9878|  12.1k|    if (buf == NULL) {
  ------------------
  |  Branch (9878:9): [True: 2, False: 12.1k]
  ------------------
 9879|      2|	xmlErrMemory(ctxt);
 9880|      2|	return(NULL);
 9881|      2|    }
 9882|  12.1k|    cur = CUR;
  ------------------
  |  | 2225|  12.1k|#define CUR (*ctxt->input->cur)
  ------------------
 9883|  12.1k|    if (!((cur >= '0') && (cur <= '9'))) {
  ------------------
  |  Branch (9883:11): [True: 11.8k, False: 321]
  |  Branch (9883:27): [True: 11.6k, False: 222]
  ------------------
 9884|    543|	xmlFree(buf);
 9885|    543|	return(NULL);
 9886|    543|    }
 9887|  11.6k|    buf[len++] = cur;
 9888|  11.6k|    NEXT;
  ------------------
  |  | 2279|  11.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9889|  11.6k|    cur=CUR;
  ------------------
  |  | 2225|  11.6k|#define CUR (*ctxt->input->cur)
  ------------------
 9890|  11.6k|    if (cur != '.') {
  ------------------
  |  Branch (9890:9): [True: 2.57k, False: 9.05k]
  ------------------
 9891|  2.57k|	xmlFree(buf);
 9892|  2.57k|	return(NULL);
 9893|  2.57k|    }
 9894|  9.05k|    buf[len++] = cur;
 9895|  9.05k|    NEXT;
  ------------------
  |  | 2279|  9.05k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9896|  9.05k|    cur=CUR;
  ------------------
  |  | 2225|  9.05k|#define CUR (*ctxt->input->cur)
  ------------------
 9897|   104k|    while ((cur >= '0') && (cur <= '9')) {
  ------------------
  |  Branch (9897:12): [True: 95.7k, False: 8.75k]
  |  Branch (9897:28): [True: 95.4k, False: 295]
  ------------------
 9898|  95.4k|	if (len + 1 >= size) {
  ------------------
  |  Branch (9898:6): [True: 190, False: 95.2k]
  ------------------
 9899|    190|	    xmlChar *tmp;
 9900|    190|            int newSize;
 9901|       |
 9902|    190|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9903|    190|            if (newSize < 0) {
  ------------------
  |  Branch (9903:17): [True: 1, False: 189]
  ------------------
 9904|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "VersionNum");
 9905|      1|                xmlFree(buf);
 9906|      1|                return(NULL);
 9907|      1|            }
 9908|    189|	    tmp = xmlRealloc(buf, newSize);
 9909|    189|	    if (tmp == NULL) {
  ------------------
  |  Branch (9909:10): [True: 1, False: 188]
  ------------------
 9910|      1|		xmlErrMemory(ctxt);
 9911|      1|	        xmlFree(buf);
 9912|      1|		return(NULL);
 9913|      1|	    }
 9914|    188|	    buf = tmp;
 9915|    188|            size = newSize;
 9916|    188|	}
 9917|  95.4k|	buf[len++] = cur;
 9918|  95.4k|	NEXT;
  ------------------
  |  | 2279|  95.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9919|  95.4k|	cur=CUR;
  ------------------
  |  | 2225|  95.4k|#define CUR (*ctxt->input->cur)
  ------------------
 9920|  95.4k|    }
 9921|  9.05k|    buf[len] = 0;
 9922|  9.05k|    return(buf);
 9923|  9.05k|}
xmlParseVersionInfo:
 9939|   183k|xmlParseVersionInfo(xmlParserCtxt *ctxt) {
 9940|   183k|    xmlChar *version = NULL;
 9941|       |
 9942|   183k|    if (CMP7(CUR_PTR, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
  ------------------
  |  | 2238|   183k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|   367k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|   367k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|   367k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 16.2k, False: 167k]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 15.6k, False: 598]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|   183k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 14.8k, False: 783]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 14.3k, False: 486]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 13.9k, False: 426]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 13.5k, False: 466]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 13.0k, False: 435]
  |  |  ------------------
  ------------------
 9943|  13.0k|	SKIP(7);
  ------------------
  |  | 2248|  13.0k|#define SKIP(val) do {							\
  |  | 2249|  13.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  13.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 224, False: 12.8k]
  |  |  ------------------
  |  | 2251|  13.0k|        xmlParserGrow(ctxt);						\
  |  | 2252|  13.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 13.0k]
  |  |  ------------------
  ------------------
 9944|  13.0k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  13.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9945|  13.0k|	if (RAW != '=') {
  ------------------
  |  | 2224|  13.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9945:6): [True: 510, False: 12.5k]
  ------------------
 9946|    510|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
 9947|    510|	    return(NULL);
 9948|    510|        }
 9949|  12.5k|	NEXT;
  ------------------
  |  | 2279|  12.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9950|  12.5k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  12.5k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9951|  12.5k|	if (RAW == '"') {
  ------------------
  |  | 2224|  12.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9951:6): [True: 2.87k, False: 9.68k]
  ------------------
 9952|  2.87k|	    NEXT;
  ------------------
  |  | 2279|  2.87k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9953|  2.87k|	    version = xmlParseVersionNum(ctxt);
 9954|  2.87k|	    if (RAW != '"') {
  ------------------
  |  | 2224|  2.87k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9954:10): [True: 367, False: 2.50k]
  ------------------
 9955|    367|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9956|    367|	    } else
 9957|  2.50k|	        NEXT;
  ------------------
  |  | 2279|  2.50k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9958|  9.68k|	} else if (RAW == '\''){
  ------------------
  |  | 2224|  9.68k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9958:13): [True: 9.29k, False: 387]
  ------------------
 9959|  9.29k|	    NEXT;
  ------------------
  |  | 2279|  9.29k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9960|  9.29k|	    version = xmlParseVersionNum(ctxt);
 9961|  9.29k|	    if (RAW != '\'') {
  ------------------
  |  | 2224|  9.29k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9961:10): [True: 3.06k, False: 6.22k]
  ------------------
 9962|  3.06k|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9963|  3.06k|	    } else
 9964|  6.22k|	        NEXT;
  ------------------
  |  | 2279|  6.22k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9965|  9.29k|	} else {
 9966|    387|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
 9967|    387|	}
 9968|  12.5k|    }
 9969|   183k|    return(version);
 9970|   183k|}
xmlParseEncName:
 9983|  6.68k|xmlParseEncName(xmlParserCtxt *ctxt) {
 9984|  6.68k|    xmlChar *buf = NULL;
 9985|  6.68k|    int len = 0;
 9986|  6.68k|    int size = 10;
 9987|  6.68k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9987:21): [True: 2.17k, False: 4.50k]
  ------------------
 9988|  2.17k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  2.17k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9989|  6.68k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.50k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9990|  6.68k|    xmlChar cur;
 9991|       |
 9992|  6.68k|    cur = CUR;
  ------------------
  |  | 2225|  6.68k|#define CUR (*ctxt->input->cur)
  ------------------
 9993|  6.68k|    if (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (9993:10): [True: 655, False: 6.02k]
  |  Branch (9993:26): [True: 569, False: 86]
  ------------------
 9994|  6.36k|        ((cur >= 'A') && (cur <= 'Z'))) {
  ------------------
  |  Branch (9994:10): [True: 5.87k, False: 235]
  |  Branch (9994:26): [True: 5.79k, False: 87]
  ------------------
 9995|  6.36k|	buf = xmlMalloc(size);
 9996|  6.36k|	if (buf == NULL) {
  ------------------
  |  Branch (9996:6): [True: 4, False: 6.35k]
  ------------------
 9997|      4|	    xmlErrMemory(ctxt);
 9998|      4|	    return(NULL);
 9999|      4|	}
10000|       |
10001|  6.35k|	buf[len++] = cur;
10002|  6.35k|	NEXT;
  ------------------
  |  | 2279|  6.35k|#define NEXT xmlNextChar(ctxt)
  ------------------
10003|  6.35k|	cur = CUR;
  ------------------
  |  | 2225|  6.35k|#define CUR (*ctxt->input->cur)
  ------------------
10004|   138k|	while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10004:10): [True: 87.1k, False: 50.9k]
  |  Branch (10004:26): [True: 86.7k, False: 402]
  ------------------
10005|  51.3k|	       ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (10005:10): [True: 16.0k, False: 35.2k]
  |  Branch (10005:26): [True: 15.4k, False: 621]
  ------------------
10006|  35.8k|	       ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (10006:10): [True: 20.9k, False: 14.9k]
  |  Branch (10006:26): [True: 20.2k, False: 676]
  ------------------
10007|  15.6k|	       (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (10007:9): [True: 589, False: 15.0k]
  |  Branch (10007:25): [True: 217, False: 14.8k]
  ------------------
10008|   131k|	       (cur == '-')) {
  ------------------
  |  Branch (10008:9): [True: 8.49k, False: 6.35k]
  ------------------
10009|   131k|	    if (len + 1 >= size) {
  ------------------
  |  Branch (10009:10): [True: 3.97k, False: 127k]
  ------------------
10010|  3.97k|	        xmlChar *tmp;
10011|  3.97k|                int newSize;
10012|       |
10013|  3.97k|                newSize = xmlGrowCapacity(size, 1, 1, maxLength);
10014|  3.97k|                if (newSize < 0) {
  ------------------
  |  Branch (10014:21): [True: 1, False: 3.97k]
  ------------------
10015|      1|                    xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName");
10016|      1|                    xmlFree(buf);
10017|      1|                    return(NULL);
10018|      1|                }
10019|  3.97k|		tmp = xmlRealloc(buf, newSize);
10020|  3.97k|		if (tmp == NULL) {
  ------------------
  |  Branch (10020:7): [True: 5, False: 3.96k]
  ------------------
10021|      5|		    xmlErrMemory(ctxt);
10022|      5|		    xmlFree(buf);
10023|      5|		    return(NULL);
10024|      5|		}
10025|  3.96k|		buf = tmp;
10026|  3.96k|                size = newSize;
10027|  3.96k|	    }
10028|   131k|	    buf[len++] = cur;
10029|   131k|	    NEXT;
  ------------------
  |  | 2279|   131k|#define NEXT xmlNextChar(ctxt)
  ------------------
10030|   131k|	    cur = CUR;
  ------------------
  |  | 2225|   131k|#define CUR (*ctxt->input->cur)
  ------------------
10031|   131k|        }
10032|  6.35k|	buf[len] = 0;
10033|  6.35k|    } else {
10034|    322|	xmlFatalErr(ctxt, XML_ERR_ENCODING_NAME, NULL);
10035|    322|    }
10036|  6.67k|    return(buf);
10037|  6.68k|}
xmlParseEncodingDecl:
10054|   182k|xmlParseEncodingDecl(xmlParserCtxt *ctxt) {
10055|   182k|    xmlChar *encoding = NULL;
10056|       |
10057|   182k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   182k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10058|   182k|    if (CMP8(CUR_PTR, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g') == 0)
  ------------------
  |  | 2240|   182k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2238|   365k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2236|   365k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2234|   365k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2231|   365k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 9.95k, False: 172k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 9.49k, False: 459]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2232|   182k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 9.28k, False: 206]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 9.00k, False: 280]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 8.56k, False: 439]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2236:38): [True: 8.13k, False: 435]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2238:42): [True: 7.77k, False: 363]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2240:46): [True: 7.51k, False: 253]
  |  |  ------------------
  ------------------
  |  Branch (10058:9): [True: 175k, False: 7.51k]
  ------------------
10059|   175k|        return(NULL);
10060|       |
10061|  7.51k|    SKIP(8);
  ------------------
  |  | 2248|  7.51k|#define SKIP(val) do {							\
  |  | 2249|  7.51k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  7.51k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 219, False: 7.29k]
  |  |  ------------------
  |  | 2251|  7.51k|        xmlParserGrow(ctxt);						\
  |  | 2252|  7.51k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 7.51k]
  |  |  ------------------
  ------------------
10062|  7.51k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  7.51k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10063|  7.51k|    if (RAW != '=') {
  ------------------
  |  | 2224|  7.51k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10063:9): [True: 253, False: 7.26k]
  ------------------
10064|    253|        xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10065|    253|        return(NULL);
10066|    253|    }
10067|  7.26k|    NEXT;
  ------------------
  |  | 2279|  7.26k|#define NEXT xmlNextChar(ctxt)
  ------------------
10068|  7.26k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  7.26k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10069|  7.26k|    if (RAW == '"') {
  ------------------
  |  | 2224|  7.26k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10069:9): [True: 1.18k, False: 6.08k]
  ------------------
10070|  1.18k|        NEXT;
  ------------------
  |  | 2279|  1.18k|#define NEXT xmlNextChar(ctxt)
  ------------------
10071|  1.18k|        encoding = xmlParseEncName(ctxt);
10072|  1.18k|        if (RAW != '"') {
  ------------------
  |  | 2224|  1.18k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10072:13): [True: 350, False: 835]
  ------------------
10073|    350|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10074|    350|            xmlFree(encoding);
10075|    350|            return(NULL);
10076|    350|        } else
10077|    835|            NEXT;
  ------------------
  |  | 2279|    835|#define NEXT xmlNextChar(ctxt)
  ------------------
10078|  6.08k|    } else if (RAW == '\''){
  ------------------
  |  | 2224|  6.08k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10078:16): [True: 5.49k, False: 583]
  ------------------
10079|  5.49k|        NEXT;
  ------------------
  |  | 2279|  5.49k|#define NEXT xmlNextChar(ctxt)
  ------------------
10080|  5.49k|        encoding = xmlParseEncName(ctxt);
10081|  5.49k|        if (RAW != '\'') {
  ------------------
  |  | 2224|  5.49k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10081:13): [True: 645, False: 4.85k]
  ------------------
10082|    645|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10083|    645|            xmlFree(encoding);
10084|    645|            return(NULL);
10085|    645|        } else
10086|  4.85k|            NEXT;
  ------------------
  |  | 2279|  4.85k|#define NEXT xmlNextChar(ctxt)
  ------------------
10087|  5.49k|    } else {
10088|    583|        xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10089|    583|    }
10090|       |
10091|  6.27k|    if (encoding == NULL)
  ------------------
  |  Branch (10091:9): [True: 589, False: 5.68k]
  ------------------
10092|    589|        return(NULL);
10093|       |
10094|  5.68k|    xmlSetDeclaredEncoding(ctxt, encoding);
10095|       |
10096|  5.68k|    return(ctxt->encoding);
10097|  6.27k|}
xmlParseSDDecl:
10131|  1.14k|xmlParseSDDecl(xmlParserCtxt *ctxt) {
10132|  1.14k|    int standalone = -2;
10133|       |
10134|  1.14k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.14k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10135|  1.14k|    if (CMP10(CUR_PTR, 's', 't', 'a', 'n', 'd', 'a', 'l', 'o', 'n', 'e')) {
  ------------------
  |  | 2245|  1.14k|  ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
  |  |  ------------------
  |  |  |  | 2242|  2.29k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2240|  2.29k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2238|  2.29k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2236|  2.29k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2234|  2.29k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2231|  2.29k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 291, False: 856]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 286, False: 5]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2232|  1.14k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 284, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 283, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 282, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 281, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2238:42): [True: 280, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2240:46): [True: 279, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2243|  2.29k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2243:5): [True: 275, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2246|  1.14k|    ((unsigned char *) s)[ 9 ] == c10 )
  |  |  ------------------
  |  |  |  Branch (2246:5): [True: 273, False: 2]
  |  |  ------------------
  ------------------
10136|    273|	SKIP(10);
  ------------------
  |  | 2248|    273|#define SKIP(val) do {							\
  |  | 2249|    273|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    273|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 2, False: 271]
  |  |  ------------------
  |  | 2251|    273|        xmlParserGrow(ctxt);						\
  |  | 2252|    273|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 273]
  |  |  ------------------
  ------------------
10137|    273|        SKIP_BLANKS;
  ------------------
  |  | 2275|    273|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10138|    273|	if (RAW != '=') {
  ------------------
  |  | 2224|    273|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10138:6): [True: 2, False: 271]
  ------------------
10139|      2|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10140|      2|	    return(standalone);
10141|      2|        }
10142|    271|	NEXT;
  ------------------
  |  | 2279|    271|#define NEXT xmlNextChar(ctxt)
  ------------------
10143|    271|	SKIP_BLANKS;
  ------------------
  |  | 2275|    271|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10144|    271|        if (RAW == '\''){
  ------------------
  |  | 2224|    271|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10144:13): [True: 261, False: 10]
  ------------------
10145|    261|	    NEXT;
  ------------------
  |  | 2279|    261|#define NEXT xmlNextChar(ctxt)
  ------------------
10146|    261|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2224|    261|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2226|      6|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10146:10): [True: 6, False: 255]
  |  Branch (10146:26): [True: 5, False: 1]
  ------------------
10147|      5|	        standalone = 0;
10148|      5|                SKIP(2);
  ------------------
  |  | 2248|      5|#define SKIP(val) do {							\
  |  | 2249|      5|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      5|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 4]
  |  |  ------------------
  |  | 2251|      5|        xmlParserGrow(ctxt);						\
  |  | 2252|      5|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
10149|    256|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2224|    256|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2226|    252|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10149:17): [True: 252, False: 4]
  |  Branch (10149:33): [True: 251, False: 1]
  ------------------
10150|    251|	               (NXT(2) == 's')) {
  ------------------
  |  | 2226|    251|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10150:17): [True: 250, False: 1]
  ------------------
10151|    250|	        standalone = 1;
10152|    250|		SKIP(3);
  ------------------
  |  | 2248|    250|#define SKIP(val) do {							\
  |  | 2249|    250|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    250|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 249]
  |  |  ------------------
  |  | 2251|    250|        xmlParserGrow(ctxt);						\
  |  | 2252|    250|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 250]
  |  |  ------------------
  ------------------
10153|    250|            } else {
10154|      6|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10155|      6|	    }
10156|    261|	    if (RAW != '\'') {
  ------------------
  |  | 2224|    261|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10156:10): [True: 16, False: 245]
  ------------------
10157|     16|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10158|     16|	    } else
10159|    245|	        NEXT;
  ------------------
  |  | 2279|    245|#define NEXT xmlNextChar(ctxt)
  ------------------
10160|    261|	} else if (RAW == '"'){
  ------------------
  |  | 2224|     10|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10160:13): [True: 9, False: 1]
  ------------------
10161|      9|	    NEXT;
  ------------------
  |  | 2279|      9|#define NEXT xmlNextChar(ctxt)
  ------------------
10162|      9|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2224|      9|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2226|      4|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10162:10): [True: 4, False: 5]
  |  Branch (10162:26): [True: 3, False: 1]
  ------------------
10163|      3|	        standalone = 0;
10164|      3|		SKIP(2);
  ------------------
  |  | 2248|      3|#define SKIP(val) do {							\
  |  | 2249|      3|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      3|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 2]
  |  |  ------------------
  |  | 2251|      3|        xmlParserGrow(ctxt);						\
  |  | 2252|      3|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 3]
  |  |  ------------------
  ------------------
10165|      6|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2224|      6|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2226|      4|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10165:17): [True: 4, False: 2]
  |  Branch (10165:33): [True: 3, False: 1]
  ------------------
10166|      3|	               (NXT(2) == 's')) {
  ------------------
  |  | 2226|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10166:17): [True: 2, False: 1]
  ------------------
10167|      2|	        standalone = 1;
10168|      2|                SKIP(3);
  ------------------
  |  | 2248|      2|#define SKIP(val) do {							\
  |  | 2249|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2251|      2|        xmlParserGrow(ctxt);						\
  |  | 2252|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
10169|      4|            } else {
10170|      4|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10171|      4|	    }
10172|      9|	    if (RAW != '"') {
  ------------------
  |  | 2224|      9|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10172:10): [True: 7, False: 2]
  ------------------
10173|      7|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10174|      7|	    } else
10175|      2|	        NEXT;
  ------------------
  |  | 2279|      2|#define NEXT xmlNextChar(ctxt)
  ------------------
10176|      9|	} else {
10177|      1|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10178|      1|        }
10179|    271|    }
10180|  1.14k|    return(standalone);
10181|  1.14k|}
xmlParseXMLDecl:
10193|  3.22k|xmlParseXMLDecl(xmlParserCtxt *ctxt) {
10194|  3.22k|    xmlChar *version;
10195|       |
10196|       |    /*
10197|       |     * This value for standalone indicates that the document has an
10198|       |     * XML declaration but it does not have a standalone attribute.
10199|       |     * It will be overwritten later if a standalone attribute is found.
10200|       |     */
10201|       |
10202|  3.22k|    ctxt->standalone = -2;
10203|       |
10204|       |    /*
10205|       |     * We know that '<?xml' is here.
10206|       |     */
10207|  3.22k|    SKIP(5);
  ------------------
  |  | 2248|  3.22k|#define SKIP(val) do {							\
  |  | 2249|  3.22k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  3.22k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 0, False: 3.22k]
  |  |  ------------------
  |  | 2251|  3.22k|        xmlParserGrow(ctxt);						\
  |  | 2252|  3.22k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 3.22k]
  |  |  ------------------
  ------------------
10208|       |
10209|  3.22k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.22k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.22k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.18k, False: 40]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.22k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 40, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 27, False: 13]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.22k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10210|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
10211|      0|	               "Blank needed after '<?xml'\n");
10212|      0|    }
10213|  3.22k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  3.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10214|       |
10215|       |    /*
10216|       |     * We must have the VersionInfo here.
10217|       |     */
10218|  3.22k|    version = xmlParseVersionInfo(ctxt);
10219|  3.22k|    if (version == NULL) {
  ------------------
  |  Branch (10219:9): [True: 772, False: 2.45k]
  ------------------
10220|    772|	xmlFatalErr(ctxt, XML_ERR_VERSION_MISSING, NULL);
10221|  2.45k|    } else {
10222|  2.45k|	if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
  ------------------
  |  |   42|  2.45k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
  |  Branch (10222:6): [True: 208, False: 2.24k]
  ------------------
10223|       |	    /*
10224|       |	     * Changed here for XML-1.0 5th edition
10225|       |	     */
10226|    208|	    if (ctxt->options & XML_PARSE_OLD10) {
  ------------------
  |  Branch (10226:10): [True: 30, False: 178]
  ------------------
10227|     30|		xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10228|     30|			          "Unsupported version '%s'\n",
10229|     30|			          version);
10230|    178|	    } else {
10231|    178|	        if ((version[0] == '1') && ((version[1] == '.'))) {
  ------------------
  |  Branch (10231:14): [True: 137, False: 41]
  |  Branch (10231:37): [True: 137, False: 0]
  ------------------
10232|    137|		    xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
10233|    137|		                  "Unsupported version '%s'\n",
10234|    137|				  version, NULL);
10235|    137|		} else {
10236|     41|		    xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10237|     41|				      "Unsupported version '%s'\n",
10238|     41|				      version);
10239|     41|		}
10240|    178|	    }
10241|    208|	}
10242|  2.45k|	if (ctxt->version != NULL)
  ------------------
  |  Branch (10242:6): [True: 0, False: 2.45k]
  ------------------
10243|      0|	    xmlFree(ctxt->version);
10244|  2.45k|	ctxt->version = version;
10245|  2.45k|    }
10246|       |
10247|       |    /*
10248|       |     * We may have the encoding declaration
10249|       |     */
10250|  3.22k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.22k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.22k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.00k, False: 2.21k]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.22k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.20k, False: 19]
  |  |  |  |  |  Branch (91:23): [True: 5, False: 2.19k]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.22k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 16, False: 2.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10251|  2.19k|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|  2.19k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|  1.40k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10251:13): [True: 1.40k, False: 789]
  |  Branch (10251:29): [True: 1.39k, False: 14]
  ------------------
10252|  1.39k|	    SKIP(2);
  ------------------
  |  | 2248|  1.39k|#define SKIP(val) do {							\
  |  | 2249|  1.39k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.39k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 1.39k]
  |  |  ------------------
  |  | 2251|  1.39k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.39k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.39k]
  |  |  ------------------
  ------------------
10253|  1.39k|	    return;
10254|  1.39k|	}
10255|    803|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10256|    803|    }
10257|  1.83k|    xmlParseEncodingDecl(ctxt);
10258|       |
10259|       |    /*
10260|       |     * We may have the standalone status.
10261|       |     */
10262|  1.83k|    if ((ctxt->encoding != NULL) && (!IS_BLANK_CH(RAW))) {
  ------------------
  |  |  137|    814|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    814|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 44, False: 770]
  |  |  |  |  ------------------
  |  |  |  |   91|    814|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 760, False: 10]
  |  |  |  |  |  Branch (91:23): [True: 14, False: 746]
  |  |  |  |  ------------------
  |  |  |  |   92|    814|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 4, False: 752]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (10262:9): [True: 814, False: 1.01k]
  ------------------
10263|    752|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|    752|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|    699|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10263:13): [True: 699, False: 53]
  |  Branch (10263:29): [True: 685, False: 14]
  ------------------
10264|    685|	    SKIP(2);
  ------------------
  |  | 2248|    685|#define SKIP(val) do {							\
  |  | 2249|    685|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    685|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 684]
  |  |  ------------------
  |  | 2251|    685|        xmlParserGrow(ctxt);						\
  |  | 2252|    685|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 685]
  |  |  ------------------
  ------------------
10265|    685|	    return;
10266|    685|	}
10267|     67|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10268|     67|    }
10269|       |
10270|       |    /*
10271|       |     * We can grow the input buffer freely at that point
10272|       |     */
10273|  1.14k|    GROW;
  ------------------
  |  | 2271|  1.14k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.14k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.14k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 48, False: 1.09k]
  |  |  ------------------
  |  | 2272|  1.14k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|     48|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 33, False: 15]
  |  |  ------------------
  |  | 2273|  1.14k|	xmlParserGrow(ctxt);
  ------------------
10274|       |
10275|  1.14k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.14k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10276|  1.14k|    ctxt->standalone = xmlParseSDDecl(ctxt);
10277|       |
10278|  1.14k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  1.14k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10279|  1.14k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|  1.14k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|    336|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10279:9): [True: 336, False: 811]
  |  Branch (10279:25): [True: 306, False: 30]
  ------------------
10280|    306|        SKIP(2);
  ------------------
  |  | 2248|    306|#define SKIP(val) do {							\
  |  | 2249|    306|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    306|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 305]
  |  |  ------------------
  |  | 2251|    306|        xmlParserGrow(ctxt);						\
  |  | 2252|    306|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 306]
  |  |  ------------------
  ------------------
10281|    841|    } else if (RAW == '>') {
  ------------------
  |  | 2224|    841|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10281:16): [True: 27, False: 814]
  ------------------
10282|       |        /* Deprecated old WD ... */
10283|     27|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10284|     27|	NEXT;
  ------------------
  |  | 2279|     27|#define NEXT xmlNextChar(ctxt)
  ------------------
10285|    814|    } else {
10286|    814|        int c;
10287|       |
10288|    814|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10289|   104k|        while ((PARSER_STOPPED(ctxt) == 0) &&
  ------------------
  |  |   44|   104k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10289:16): [True: 104k, False: 33]
  ------------------
10290|   104k|               ((c = CUR) != 0)) {
  ------------------
  |  | 2225|   104k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10290:16): [True: 104k, False: 344]
  ------------------
10291|   104k|            NEXT;
  ------------------
  |  | 2279|   104k|#define NEXT xmlNextChar(ctxt)
  ------------------
10292|   104k|            if (c == '>')
  ------------------
  |  Branch (10292:17): [True: 437, False: 104k]
  ------------------
10293|    437|                break;
10294|   104k|        }
10295|    814|    }
10296|  1.14k|}
xmlParseMisc:
10336|  17.4k|xmlParseMisc(xmlParserCtxt *ctxt) {
10337|  19.4k|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  19.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10337:12): [True: 19.2k, False: 168]
  ------------------
10338|  19.2k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  19.2k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10339|  19.2k|        GROW;
  ------------------
  |  | 2271|  19.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  19.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  19.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 19.2k, False: 0]
  |  |  ------------------
  |  | 2272|  19.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  19.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 15.1k, False: 4.08k]
  |  |  ------------------
  |  | 2273|  19.2k|	xmlParserGrow(ctxt);
  ------------------
10340|  19.2k|        if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2224|  19.2k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2226|  12.1k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10340:13): [True: 12.1k, False: 7.06k]
  |  Branch (10340:29): [True: 887, False: 11.2k]
  ------------------
10341|    887|	    xmlParsePI(ctxt);
10342|  18.3k|        } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) {
  ------------------
  |  | 2231|  18.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2231:5): [True: 11.2k, False: 7.06k]
  |  |  |  Branch (2231:41): [True: 3.44k, False: 7.85k]
  |  |  ------------------
  |  | 2232|  18.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2232:5): [True: 1.08k, False: 2.36k]
  |  |  |  Branch (2232:41): [True: 1.08k, False: 1]
  |  |  ------------------
  ------------------
10343|  1.08k|	    xmlParseComment(ctxt);
10344|  17.2k|        } else {
10345|  17.2k|            break;
10346|  17.2k|        }
10347|  19.2k|    }
10348|  17.4k|}
xmlParseDocument:
10381|  7.62k|xmlParseDocument(xmlParserCtxt *ctxt) {
10382|  7.62k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (10382:9): [True: 0, False: 7.62k]
  |  Branch (10382:27): [True: 0, False: 7.62k]
  ------------------
10383|      0|        return(-1);
10384|       |
10385|  7.62k|    GROW;
  ------------------
  |  | 2271|  7.62k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.62k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.62k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.62k, False: 0]
  |  |  ------------------
  |  | 2272|  7.62k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.62k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.41k, False: 2.20k]
  |  |  ------------------
  |  | 2273|  7.62k|	xmlParserGrow(ctxt);
  ------------------
10386|       |
10387|       |    /*
10388|       |     * SAX: detecting the level.
10389|       |     */
10390|  7.62k|    xmlCtxtInitializeLate(ctxt);
10391|       |
10392|  7.62k|    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10392:9): [True: 7.62k, False: 0]
  |  Branch (10392:24): [True: 7.62k, False: 0]
  ------------------
10393|  7.62k|        ctxt->sax->setDocumentLocator(ctxt->userData,
10394|  7.62k|                (xmlSAXLocator *) &xmlDefaultSAXLocator);
10395|  7.62k|    }
10396|       |
10397|  7.62k|    xmlDetectEncoding(ctxt);
10398|       |
10399|  7.62k|    if (CUR == 0) {
  ------------------
  |  | 2225|  7.62k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10399:9): [True: 4, False: 7.61k]
  ------------------
10400|      4|	xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
10401|      4|	return(-1);
10402|      4|    }
10403|       |
10404|  7.61k|    GROW;
  ------------------
  |  | 2271|  7.61k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.61k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.61k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.61k, False: 0]
  |  |  ------------------
  |  | 2272|  7.61k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.61k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.41k, False: 2.20k]
  |  |  ------------------
  |  | 2273|  7.61k|	xmlParserGrow(ctxt);
  ------------------
10405|  7.61k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|  7.61k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  15.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 7.50k, False: 111]
  |  |  |  |  |  Branch (2231:41): [True: 607, False: 6.90k]
  |  |  |  |  ------------------
  |  |  |  | 2232|  7.61k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 347, False: 260]
  |  |  |  |  |  Branch (2232:41): [True: 173, False: 174]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 168, False: 5]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    168|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    168|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 157, False: 11]
  |  |  |  |  ------------------
  |  |  |  |   91|    168|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 10, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 3, False: 7]
  |  |  |  |  ------------------
  |  |  |  |   92|    168|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 4, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10406|       |
10407|       |	/*
10408|       |	 * Note that we will switch encoding on the fly.
10409|       |	 */
10410|    164|	xmlParseXMLDecl(ctxt);
10411|    164|	SKIP_BLANKS;
  ------------------
  |  | 2275|    164|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10412|  7.45k|    } else {
10413|  7.45k|	ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  7.45k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10414|  7.45k|        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10414:13): [True: 1, False: 7.45k]
  ------------------
10415|      1|            xmlErrMemory(ctxt);
10416|      1|            return(-1);
10417|      1|        }
10418|  7.45k|    }
10419|  7.61k|    if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
  ------------------
  |  Branch (10419:9): [True: 7.61k, False: 0]
  |  Branch (10419:24): [True: 7.61k, False: 0]
  |  Branch (10419:54): [True: 7.56k, False: 52]
  ------------------
10420|  7.56k|        ctxt->sax->startDocument(ctxt->userData);
10421|  7.61k|    if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (10421:9): [True: 7.56k, False: 55]
  |  Branch (10421:34): [True: 7.56k, False: 0]
  ------------------
10422|  7.56k|        (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
  ------------------
  |  Branch (10422:9): [True: 7.56k, False: 0]
  |  Branch (10422:39): [True: 0, False: 7.56k]
  ------------------
10423|      0|	ctxt->myDoc->compression = ctxt->input->buf->compressed;
10424|      0|    }
10425|       |
10426|       |    /*
10427|       |     * The Misc part of the Prolog
10428|       |     */
10429|  7.61k|    xmlParseMisc(ctxt);
10430|       |
10431|       |    /*
10432|       |     * Then possibly doc type declaration(s) and more Misc
10433|       |     * (doctypedecl Misc*)?
10434|       |     */
10435|  7.61k|    GROW;
  ------------------
  |  | 2271|  7.61k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.61k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.61k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.61k, False: 0]
  |  |  ------------------
  |  | 2272|  7.61k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.61k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.44k, False: 2.17k]
  |  |  ------------------
  |  | 2273|  7.61k|	xmlParserGrow(ctxt);
  ------------------
10436|  7.61k|    if (CMP9(CUR_PTR, '<', '!', 'D', 'O', 'C', 'T', 'Y', 'P', 'E')) {
  ------------------
  |  | 2242|  7.61k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|  15.2k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|  15.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|  15.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|  15.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|  15.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 7.60k, False: 10]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 2.32k, False: 5.28k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|  7.61k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 2.31k, False: 9]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 2.31k, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 2.31k, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 2.31k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 2.30k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 2.29k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|  7.61k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 2.29k, False: 4]
  |  |  ------------------
  ------------------
10437|       |
10438|  2.29k|	ctxt->inSubset = 1;
10439|  2.29k|	xmlParseDocTypeDecl(ctxt);
10440|  2.29k|	if (RAW == '[') {
  ------------------
  |  | 2224|  2.29k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10440:6): [True: 704, False: 1.59k]
  ------------------
10441|    704|	    xmlParseInternalSubset(ctxt);
10442|  1.59k|	} else if (RAW == '>') {
  ------------------
  |  | 2224|  1.59k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10442:13): [True: 1.56k, False: 30]
  ------------------
10443|  1.56k|            NEXT;
  ------------------
  |  | 2279|  1.56k|#define NEXT xmlNextChar(ctxt)
  ------------------
10444|  1.56k|        }
10445|       |
10446|       |	/*
10447|       |	 * Create and update the external subset.
10448|       |	 */
10449|  2.29k|	ctxt->inSubset = 2;
10450|  2.29k|	if ((ctxt->sax != NULL) && (ctxt->sax->externalSubset != NULL) &&
  ------------------
  |  Branch (10450:6): [True: 2.29k, False: 0]
  |  Branch (10450:29): [True: 2.29k, False: 0]
  ------------------
10451|  2.29k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (10451:6): [True: 2.20k, False: 89]
  ------------------
10452|  2.20k|	    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
10453|  2.20k|	                              ctxt->extSubSystem, ctxt->extSubURI);
10454|  2.29k|	ctxt->inSubset = 0;
10455|       |
10456|  2.29k|        xmlCleanSpecialAttr(ctxt);
10457|       |
10458|  2.29k|	xmlParseMisc(ctxt);
10459|  2.29k|    }
10460|       |
10461|       |    /*
10462|       |     * Time to start parsing the tree itself
10463|       |     */
10464|  7.61k|    GROW;
  ------------------
  |  | 2271|  7.61k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.61k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.61k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 7.61k, False: 0]
  |  |  ------------------
  |  | 2272|  7.61k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.61k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 5.61k, False: 2.00k]
  |  |  ------------------
  |  | 2273|  7.61k|	xmlParserGrow(ctxt);
  ------------------
10465|  7.61k|    if (RAW != '<') {
  ------------------
  |  | 2224|  7.61k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10465:9): [True: 85, False: 7.53k]
  ------------------
10466|     85|        if (ctxt->wellFormed)
  ------------------
  |  Branch (10466:13): [True: 1, False: 84]
  ------------------
10467|      1|            xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10468|      1|                           "Start tag expected, '<' not found\n");
10469|  7.53k|    } else {
10470|  7.53k|	xmlParseElement(ctxt);
10471|       |
10472|       |	/*
10473|       |	 * The Misc part at the end
10474|       |	 */
10475|  7.53k|	xmlParseMisc(ctxt);
10476|       |
10477|  7.53k|        xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
10478|  7.53k|    }
10479|       |
10480|  7.61k|    ctxt->instate = XML_PARSER_EOF;
10481|  7.61k|    xmlFinishDocument(ctxt);
10482|       |
10483|  7.61k|    if (! ctxt->wellFormed) {
  ------------------
  |  Branch (10483:9): [True: 792, False: 6.82k]
  ------------------
10484|    792|	ctxt->valid = 0;
10485|    792|	return(-1);
10486|    792|    }
10487|       |
10488|  6.82k|    return(0);
10489|  7.61k|}
xmlParseChunk:
11238|   435k|              int terminate) {
11239|   435k|    size_t curBase;
11240|   435k|    size_t maxLength;
11241|   435k|    size_t pos;
11242|   435k|    int end_in_lf = 0;
11243|   435k|    int res;
11244|       |
11245|   435k|    if ((ctxt == NULL) || (size < 0))
  ------------------
  |  Branch (11245:9): [True: 0, False: 435k]
  |  Branch (11245:27): [True: 0, False: 435k]
  ------------------
11246|      0|        return(XML_ERR_ARGUMENT);
11247|   435k|    if ((chunk == NULL) && (size > 0))
  ------------------
  |  Branch (11247:9): [True: 0, False: 435k]
  |  Branch (11247:28): [True: 0, False: 0]
  ------------------
11248|      0|        return(XML_ERR_ARGUMENT);
11249|   435k|    if ((ctxt->input == NULL) || (ctxt->input->buf == NULL))
  ------------------
  |  Branch (11249:9): [True: 0, False: 435k]
  |  Branch (11249:34): [True: 0, False: 435k]
  ------------------
11250|      0|        return(XML_ERR_ARGUMENT);
11251|   435k|    if (ctxt->disableSAX != 0)
  ------------------
  |  Branch (11251:9): [True: 4.00k, False: 431k]
  ------------------
11252|  4.00k|        return(ctxt->errNo);
11253|       |
11254|   431k|    ctxt->input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|   431k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
11255|   431k|    if (ctxt->instate == XML_PARSER_START)
  ------------------
  |  Branch (11255:9): [True: 35.8k, False: 395k]
  ------------------
11256|  35.8k|        xmlCtxtInitializeLate(ctxt);
11257|   431k|    if ((size > 0) && (chunk != NULL) && (!terminate) &&
  ------------------
  |  Branch (11257:9): [True: 404k, False: 27.5k]
  |  Branch (11257:23): [True: 404k, False: 0]
  |  Branch (11257:42): [True: 404k, False: 0]
  ------------------
11258|   404k|        (chunk[size - 1] == '\r')) {
  ------------------
  |  Branch (11258:9): [True: 2.21k, False: 401k]
  ------------------
11259|  2.21k|	end_in_lf = 1;
11260|  2.21k|	size--;
11261|  2.21k|    }
11262|       |
11263|       |    /*
11264|       |     * Also push an empty chunk to make sure that the raw buffer
11265|       |     * will be flushed if there is an encoder.
11266|       |     */
11267|   431k|    pos = ctxt->input->cur - ctxt->input->base;
11268|   431k|    res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
11269|   431k|    xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11270|   431k|    if (res < 0) {
  ------------------
  |  Branch (11270:9): [True: 233, False: 431k]
  ------------------
11271|    233|        xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11272|    233|        return(ctxt->errNo);
11273|    233|    }
11274|       |
11275|   431k|    xmlParseTryOrFinish(ctxt, terminate);
11276|       |
11277|   431k|    curBase = ctxt->input->cur - ctxt->input->base;
11278|   431k|    maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (11278:17): [True: 211k, False: 220k]
  ------------------
11279|   211k|                XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   211k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
11280|   431k|                XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|   651k|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
11281|   431k|    if (curBase > maxLength) {
  ------------------
  |  Branch (11281:9): [True: 0, False: 431k]
  ------------------
11282|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
11283|      0|                    "Buffer size limit exceeded, try XML_PARSE_HUGE\n");
11284|      0|    }
11285|       |
11286|   431k|    if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX != 0))
  ------------------
  |  Branch (11286:9): [True: 90.3k, False: 340k]
  |  Branch (11286:40): [True: 10.8k, False: 79.5k]
  ------------------
11287|  10.8k|        return(ctxt->errNo);
11288|       |
11289|   420k|    if (end_in_lf == 1) {
  ------------------
  |  Branch (11289:9): [True: 2.20k, False: 418k]
  ------------------
11290|  2.20k|	pos = ctxt->input->cur - ctxt->input->base;
11291|  2.20k|	res = xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
11292|  2.20k|	xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11293|  2.20k|        if (res < 0) {
  ------------------
  |  Branch (11293:13): [True: 3, False: 2.20k]
  ------------------
11294|      3|            xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11295|      3|            return(ctxt->errNo);
11296|      3|        }
11297|  2.20k|    }
11298|   420k|    if (terminate) {
  ------------------
  |  Branch (11298:9): [True: 18.9k, False: 401k]
  ------------------
11299|       |	/*
11300|       |	 * Check for termination
11301|       |	 */
11302|  18.9k|        if ((ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (11302:13): [True: 10.0k, False: 8.84k]
  ------------------
11303|  10.0k|            (ctxt->instate != XML_PARSER_EPILOG)) {
  ------------------
  |  Branch (11303:13): [True: 5.07k, False: 5.01k]
  ------------------
11304|  5.07k|            if (ctxt->nameNr > 0) {
  ------------------
  |  Branch (11304:17): [True: 3.80k, False: 1.27k]
  ------------------
11305|  3.80k|                const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
11306|  3.80k|                int line = ctxt->pushTab[ctxt->nameNr - 1].line;
11307|  3.80k|                xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
11308|  3.80k|                        "Premature end of data in tag %s line %d\n",
11309|  3.80k|                        name, line, NULL);
11310|  3.80k|            } else if (ctxt->instate == XML_PARSER_START) {
  ------------------
  |  Branch (11310:24): [True: 16, False: 1.25k]
  ------------------
11311|     16|                xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
11312|  1.25k|            } else {
11313|  1.25k|                xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
11314|  1.25k|                               "Start tag expected, '<' not found\n");
11315|  1.25k|            }
11316|  13.8k|        } else {
11317|  13.8k|            xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
11318|  13.8k|        }
11319|  18.9k|	if (ctxt->instate != XML_PARSER_EOF) {
  ------------------
  |  Branch (11319:6): [True: 9.85k, False: 9.08k]
  ------------------
11320|  9.85k|            ctxt->instate = XML_PARSER_EOF;
11321|  9.85k|            xmlFinishDocument(ctxt);
11322|  9.85k|	}
11323|  18.9k|    }
11324|   420k|    if (ctxt->wellFormed == 0)
  ------------------
  |  Branch (11324:9): [True: 20.2k, False: 400k]
  ------------------
11325|  20.2k|	return((xmlParserErrors) ctxt->errNo);
11326|   400k|    else
11327|   400k|        return(0);
11328|   420k|}
xmlCreatePushParserCtxt:
11359|  35.6k|                        const char *chunk, int size, const char *filename) {
11360|  35.6k|    xmlParserCtxtPtr ctxt;
11361|  35.6k|    xmlParserInputPtr input;
11362|       |
11363|  35.6k|    ctxt = xmlNewSAXParserCtxt(sax, user_data);
11364|  35.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (11364:9): [True: 23, False: 35.6k]
  ------------------
11365|     23|	return(NULL);
11366|       |
11367|  35.6k|    ctxt->options &= ~XML_PARSE_NODICT;
11368|  35.6k|    ctxt->dictNames = 1;
11369|       |
11370|  35.6k|    input = xmlNewPushInput(filename, chunk, size);
11371|  35.6k|    if (input == NULL) {
  ------------------
  |  Branch (11371:9): [True: 10, False: 35.5k]
  ------------------
11372|     10|	xmlFreeParserCtxt(ctxt);
11373|     10|	return(NULL);
11374|     10|    }
11375|  35.5k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (11375:9): [True: 0, False: 35.5k]
  ------------------
11376|      0|        xmlFreeInputStream(input);
11377|      0|        xmlFreeParserCtxt(ctxt);
11378|      0|        return(NULL);
11379|      0|    }
11380|       |
11381|  35.5k|    return(ctxt);
11382|  35.5k|}
xmlStopParser:
11391|  37.7k|xmlStopParser(xmlParserCtxt *ctxt) {
11392|  37.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (11392:9): [True: 0, False: 37.7k]
  ------------------
11393|      0|        return;
11394|       |
11395|       |    /* This stops the parser */
11396|  37.7k|    ctxt->disableSAX = 2;
11397|       |
11398|       |    /*
11399|       |     * xmlStopParser is often called from error handlers,
11400|       |     * so we can't raise an error here to avoid infinite
11401|       |     * loops. Just make sure that an error condition is
11402|       |     * reported.
11403|       |     */
11404|  37.7k|    if (ctxt->errNo == XML_ERR_OK) {
  ------------------
  |  Branch (11404:9): [True: 3.34k, False: 34.3k]
  ------------------
11405|  3.34k|        ctxt->errNo = XML_ERR_USER_STOP;
11406|  3.34k|        ctxt->lastError.code = XML_ERR_USER_STOP;
11407|  3.34k|        ctxt->wellFormed = 0;
11408|  3.34k|    }
11409|  37.7k|}
xmlCtxtUseOptions:
13267|  44.0k|{
13268|  44.0k|    int keepMask;
13269|       |
13270|  44.0k|#ifdef LIBXML_HTML_ENABLED
13271|  44.0k|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13271:9): [True: 44.0k, False: 0]
  |  Branch (13271:27): [True: 0, False: 44.0k]
  ------------------
13272|      0|        return(htmlCtxtUseOptions(ctxt, options));
13273|  44.0k|#endif
13274|       |
13275|       |    /*
13276|       |     * For historic reasons, some options can only be enabled.
13277|       |     */
13278|  44.0k|    keepMask = XML_PARSE_NOERROR |
13279|  44.0k|               XML_PARSE_NOWARNING |
13280|  44.0k|               XML_PARSE_NONET |
13281|  44.0k|               XML_PARSE_NSCLEAN |
13282|  44.0k|               XML_PARSE_NOCDATA |
13283|  44.0k|               XML_PARSE_COMPACT |
13284|  44.0k|               XML_PARSE_OLD10 |
13285|  44.0k|               XML_PARSE_HUGE |
13286|  44.0k|               XML_PARSE_OLDSAX |
13287|  44.0k|               XML_PARSE_IGNORE_ENC |
13288|  44.0k|               XML_PARSE_BIG_LINES;
13289|       |
13290|  44.0k|    return(xmlCtxtSetOptionsInternal(ctxt, options, keepMask));
13291|  44.0k|}
parser.c:xmlParserNsLookup:
 1488|  1.25M|                  xmlParserNsBucket **bucketPtr) {
 1489|  1.25M|    xmlParserNsBucket *bucket, *tombstone;
 1490|  1.25M|    unsigned index, hashValue;
 1491|       |
 1492|  1.25M|    if (prefix->name == NULL)
  ------------------
  |  Branch (1492:9): [True: 562k, False: 696k]
  ------------------
 1493|   562k|        return(ctxt->nsdb->defaultNsIndex);
 1494|       |
 1495|   696k|    if (ctxt->nsdb->hashSize == 0)
  ------------------
  |  Branch (1495:9): [True: 25.1k, False: 671k]
  ------------------
 1496|  25.1k|        return(INT_MAX);
 1497|       |
 1498|   671k|    hashValue = prefix->hashValue;
 1499|   671k|    index = hashValue & (ctxt->nsdb->hashSize - 1);
 1500|   671k|    bucket = &ctxt->nsdb->hash[index];
 1501|   671k|    tombstone = NULL;
 1502|       |
 1503|  1.02M|    while (bucket->hashValue) {
  ------------------
  |  Branch (1503:12): [True: 890k, False: 131k]
  ------------------
 1504|   890k|        if (bucket->index == INT_MAX) {
  ------------------
  |  Branch (1504:13): [True: 57.3k, False: 832k]
  ------------------
 1505|  57.3k|            if (tombstone == NULL)
  ------------------
  |  Branch (1505:17): [True: 44.5k, False: 12.8k]
  ------------------
 1506|  44.5k|                tombstone = bucket;
 1507|   832k|        } else if (bucket->hashValue == hashValue) {
  ------------------
  |  Branch (1507:20): [True: 540k, False: 292k]
  ------------------
 1508|   540k|            if (ctxt->nsTab[bucket->index * 2] == prefix->name) {
  ------------------
  |  Branch (1508:17): [True: 540k, False: 0]
  ------------------
 1509|   540k|                if (bucketPtr != NULL)
  ------------------
  |  Branch (1509:21): [True: 319k, False: 220k]
  ------------------
 1510|   319k|                    *bucketPtr = bucket;
 1511|   540k|                return(bucket->index);
 1512|   540k|            }
 1513|   540k|        }
 1514|       |
 1515|   349k|        index++;
 1516|   349k|        bucket++;
 1517|   349k|        if (index == ctxt->nsdb->hashSize) {
  ------------------
  |  Branch (1517:13): [True: 75.5k, False: 274k]
  ------------------
 1518|  75.5k|            index = 0;
 1519|  75.5k|            bucket = ctxt->nsdb->hash;
 1520|  75.5k|        }
 1521|   349k|    }
 1522|       |
 1523|   131k|    if (bucketPtr != NULL)
  ------------------
  |  Branch (1523:9): [True: 32.2k, False: 98.7k]
  ------------------
 1524|  32.2k|        *bucketPtr = tombstone ? tombstone : bucket;
  ------------------
  |  Branch (1524:22): [True: 28.6k, False: 3.66k]
  ------------------
 1525|       |    return(INT_MAX);
 1526|   671k|}
parser.c:xmlFatalErrMsg:
  259|  32.4M|{
  260|  32.4M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  261|  32.4M|               NULL, NULL, NULL, 0, "%s", msg);
  262|  32.4M|}
parser.c:xmlErrMemory:
  224|    406|xmlErrMemory(xmlParserCtxtPtr ctxt) {
  225|    406|    xmlCtxtErrMemory(ctxt);
  226|    406|}
parser.c:xmlFatalErrMsgInt:
  313|  6.14M|{
  314|  6.14M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  315|  6.14M|               NULL, NULL, NULL, val, msg, val);
  316|  6.14M|}
parser.c:xmlIsNameChar:
 3031|  22.0M|xmlIsNameChar(int c, int old10) {
 3032|  22.0M|    if (!old10)
  ------------------
  |  Branch (3032:9): [True: 17.3M, False: 4.75M]
  ------------------
 3033|  17.3M|        return(xmlIsNameCharNew(c));
 3034|  4.75M|    else
 3035|  4.75M|        return(xmlIsNameCharOld(c));
 3036|  22.0M|}
parser.c:xmlIsNameCharNew:
 2973|  17.3M|xmlIsNameCharNew(int c) {
 2974|       |    /*
 2975|       |     * Use the new checks of production [4] [4a] amd [5] of the
 2976|       |     * Update 5 of XML-1.0
 2977|       |     */
 2978|  17.3M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2978:9): [True: 17.2M, False: 63.9k]
  |  Branch (2978:23): [True: 17.2M, False: 22.2k]
  |  Branch (2978:37): [True: 17.2M, False: 11.7k]
  ------------------
 2979|  17.2M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2979:11): [True: 11.4M, False: 5.73M]
  |  Branch (2979:25): [True: 2.93M, False: 8.55M]
  ------------------
 2980|  14.2M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2980:11): [True: 11.3M, False: 2.91M]
  |  Branch (2980:25): [True: 2.76M, False: 8.60M]
  ------------------
 2981|  11.5M|         ((c >= '0') && (c <= '9')) || /* !start */
  ------------------
  |  Branch (2981:11): [True: 11.3M, False: 188k]
  |  Branch (2981:25): [True: 766k, False: 10.5M]
  ------------------
 2982|  10.7M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2982:10): [True: 38.9k, False: 10.7M]
  |  Branch (2982:24): [True: 15.5k, False: 10.6M]
  ------------------
 2983|  10.6M|         (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
  ------------------
  |  Branch (2983:10): [True: 56.6k, False: 10.6M]
  |  Branch (2983:24): [True: 22.2k, False: 10.6M]
  |  Branch (2983:38): [True: 375, False: 10.6M]
  ------------------
 2984|  10.6M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2984:11): [True: 8.54M, False: 2.07M]
  |  Branch (2984:26): [True: 1.19M, False: 7.34M]
  ------------------
 2985|  9.41M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2985:11): [True: 7.34M, False: 2.07M]
  |  Branch (2985:26): [True: 1.57k, False: 7.34M]
  ------------------
 2986|  9.41M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2986:11): [True: 7.34M, False: 2.07M]
  |  Branch (2986:26): [True: 2.46M, False: 4.87M]
  ------------------
 2987|  6.94M|         ((c >= 0x300) && (c <= 0x36F)) || /* !start */
  ------------------
  |  Branch (2987:11): [True: 4.87M, False: 2.07M]
  |  Branch (2987:27): [True: 1.21k, False: 4.87M]
  ------------------
 2988|  6.94M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2988:11): [True: 4.87M, False: 2.07M]
  |  Branch (2988:27): [True: 418, False: 4.87M]
  ------------------
 2989|  6.94M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2989:11): [True: 4.87M, False: 2.07M]
  |  Branch (2989:27): [True: 2.07M, False: 2.79M]
  ------------------
 2990|  4.87M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2990:11): [True: 2.79M, False: 2.07M]
  |  Branch (2990:28): [True: 372, False: 2.79M]
  ------------------
 2991|  4.86M|         ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
  ------------------
  |  Branch (2991:11): [True: 2.79M, False: 2.07M]
  |  Branch (2991:28): [True: 216, False: 2.79M]
  ------------------
 2992|  4.86M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2992:11): [True: 2.79M, False: 2.07M]
  |  Branch (2992:28): [True: 1.59k, False: 2.79M]
  ------------------
 2993|  4.86M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (2993:11): [True: 2.79M, False: 2.07M]
  |  Branch (2993:28): [True: 2.67k, False: 2.79M]
  ------------------
 2994|  4.86M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (2994:11): [True: 2.79M, False: 2.07M]
  |  Branch (2994:28): [True: 34.3k, False: 2.75M]
  ------------------
 2995|  4.83M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (2995:11): [True: 2.75M, False: 2.07M]
  |  Branch (2995:28): [True: 351, False: 2.75M]
  ------------------
 2996|  4.83M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (2996:11): [True: 2.75M, False: 2.07M]
  |  Branch (2996:28): [True: 2.74M, False: 13.1k]
  ------------------
 2997|  2.08M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (2997:11): [True: 13.1k, False: 2.07M]
  |  Branch (2997:29): [True: 1.80k, False: 11.3k]
  ------------------
 2998|  15.1M|         return(1);
 2999|  2.18M|    return(0);
 3000|  17.3M|}
parser.c:xmlIsNameCharOld:
 3011|  4.75M|xmlIsNameCharOld(int c) {
 3012|  4.75M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3012:9): [True: 4.75M, False: 3.12k]
  |  Branch (3012:23): [True: 4.75M, False: 1.40k]
  |  Branch (3012:37): [True: 4.75M, False: 1.11k]
  ------------------
 3013|  4.75M|        ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  208|  4.75M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  4.75M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  9.50M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 2.75M, False: 2.00M]
  |  |  |  |  |  |  |  Branch (81:28): [True: 4.35M, False: 402k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  9.50M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  4.35M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 2.36M, False: 1.98M]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 130k, False: 2.23M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  4.35M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 2.23M, False: 1.98M]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.01M, False: 1.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  4.35M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 1.21M, False: 1.99M]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 1.21M, False: 5.17k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  4.35M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 5.17k, False: 1.99M]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 1.43k, False: 3.74k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  4.35M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 3.74k, False: 1.99M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  9.50M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  2.00M|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  2.00M|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 2.38k, False: 2.00M]
  |  |  |  |  |  |  |  Branch (169:31): [True: 1.99M, False: 13.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  2.00M|				 0 :\
  |  |  |  |  |  |  171|  2.00M|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.9k, False: 2.37k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 2.20k, False: 8.76k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  13.3k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 78, False: 11.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  13.3k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 9.04k, False: 2.02k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 110, False: 8.93k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  153|  2.00M|#define IS_DIGIT(c) xmlIsDigitQ(c)
  |  |  ------------------
  |  |  |  |  144|  2.00M|#define xmlIsDigitQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:26): [True: 1.99M, False: 10.9k]
  |  |  |  |  ------------------
  |  |  |  |  145|  2.00M|				 xmlIsDigit_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  1.99M|#define xmlIsDigit_ch(c)	(((0x30 <= (c)) && ((c) <= 0x39)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (137:28): [True: 1.97M, False: 19.2k]
  |  |  |  |  |  |  |  Branch (137:45): [True: 868k, False: 1.10M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  146|  2.00M|				 xmlCharInRange((c), &xmlIsDigitGroup))
  |  |  ------------------
  ------------------
  |  Branch (3013:28): [True: 868k, False: 1.13M]
  ------------------
 3014|  1.13M|         (c == '.') || (c == '-') ||
  ------------------
  |  Branch (3014:10): [True: 905, False: 1.13M]
  |  Branch (3014:24): [True: 2.28k, False: 1.12M]
  ------------------
 3015|  1.12M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3015:10): [True: 1.69k, False: 1.12M]
  |  Branch (3015:24): [True: 7.60k, False: 1.12M]
  ------------------
 3016|  1.12M|         (IS_COMBINING(c)) ||
  ------------------
  |  |  168|  1.12M|#define IS_COMBINING(c) xmlIsCombiningQ(c)
  |  |  ------------------
  |  |  |  |  128|  1.12M|#define xmlIsCombiningQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:29): [True: 1.10M, False: 10.7k]
  |  |  |  |  ------------------
  |  |  |  |  129|  1.12M|				 0 : \
  |  |  |  |  130|  1.12M|				 xmlCharInRange((c), &xmlIsCombiningGroup))
  |  |  ------------------
  ------------------
  |  Branch (3016:10): [True: 1.09k, False: 1.11M]
  ------------------
 3017|  1.11M|         (IS_EXTENDER(c))))
  ------------------
  |  |  185|  1.11M|#define IS_EXTENDER(c) xmlIsExtenderQ(c)
  |  |  ------------------
  |  |  |  |  160|  1.11M|#define xmlIsExtenderQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:28): [True: 1.10M, False: 9.61k]
  |  |  |  |  ------------------
  |  |  |  |  161|  1.11M|				 xmlIsExtender_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.10M|#define xmlIsExtender_ch(c)	(((c) == 0xb7))
  |  |  |  |  ------------------
  |  |  |  |  162|  1.11M|				 xmlCharInRange((c), &xmlIsExtenderGroup))
  |  |  ------------------
  ------------------
  |  Branch (3017:10): [True: 870, False: 1.11M]
  ------------------
 3018|  3.63M|        return(1);
 3019|  1.12M|    return(0);
 3020|  4.75M|}
parser.c:xmlIsNameStartChar:
 3023|  3.56M|xmlIsNameStartChar(int c, int old10) {
 3024|  3.56M|    if (!old10)
  ------------------
  |  Branch (3024:9): [True: 2.34M, False: 1.21M]
  ------------------
 3025|  2.34M|        return(xmlIsNameStartCharNew(c));
 3026|  1.21M|    else
 3027|  1.21M|        return(xmlIsNameStartCharOld(c));
 3028|  3.56M|}
parser.c:xmlIsNameStartCharNew:
 2947|  2.34M|xmlIsNameStartCharNew(int c) {
 2948|       |    /*
 2949|       |     * Use the new checks of production [4] [4a] amd [5] of the
 2950|       |     * Update 5 of XML-1.0
 2951|       |     */
 2952|  2.34M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2952:9): [True: 2.34M, False: 1.94k]
  |  Branch (2952:23): [True: 2.34M, False: 3.54k]
  |  Branch (2952:37): [True: 2.34M, False: 3.71k]
  ------------------
 2953|  2.34M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2953:11): [True: 2.12M, False: 211k]
  |  Branch (2953:25): [True: 2.08M, False: 41.4k]
  ------------------
 2954|   252k|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2954:11): [True: 110k, False: 142k]
  |  Branch (2954:25): [True: 57.0k, False: 53.4k]
  ------------------
 2955|   195k|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2955:10): [True: 7.41k, False: 188k]
  |  Branch (2955:24): [True: 2.35k, False: 186k]
  ------------------
 2956|   186k|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2956:11): [True: 38.2k, False: 147k]
  |  Branch (2956:26): [True: 432, False: 37.8k]
  ------------------
 2957|   185k|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2957:11): [True: 37.8k, False: 147k]
  |  Branch (2957:26): [True: 973, False: 36.8k]
  ------------------
 2958|   184k|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2958:11): [True: 36.8k, False: 147k]
  |  Branch (2958:26): [True: 1.53k, False: 35.2k]
  ------------------
 2959|   183k|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2959:11): [True: 35.2k, False: 147k]
  |  Branch (2959:27): [True: 511, False: 34.7k]
  ------------------
 2960|   182k|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2960:11): [True: 34.7k, False: 147k]
  |  Branch (2960:27): [True: 2.94k, False: 31.8k]
  ------------------
 2961|   179k|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2961:11): [True: 31.8k, False: 147k]
  |  Branch (2961:28): [True: 74, False: 31.7k]
  ------------------
 2962|   179k|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2962:11): [True: 31.5k, False: 148k]
  |  Branch (2962:28): [True: 308, False: 31.2k]
  ------------------
 2963|   179k|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (2963:11): [True: 31.1k, False: 148k]
  |  Branch (2963:28): [True: 249, False: 30.9k]
  ------------------
 2964|   179k|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (2964:11): [True: 30.9k, False: 148k]
  |  Branch (2964:28): [True: 2.61k, False: 28.3k]
  ------------------
 2965|   176k|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (2965:11): [True: 28.3k, False: 148k]
  |  Branch (2965:28): [True: 409, False: 27.9k]
  ------------------
 2966|   176k|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (2966:11): [True: 27.8k, False: 148k]
  |  Branch (2966:28): [True: 9.26k, False: 18.6k]
  ------------------
 2967|   166k|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (2967:11): [True: 18.6k, False: 148k]
  |  Branch (2967:29): [True: 853, False: 17.7k]
  ------------------
 2968|  2.17M|        return(1);
 2969|   175k|    return(0);
 2970|  2.34M|}
parser.c:xmlIsNameStartCharOld:
 3003|  1.21M|xmlIsNameStartCharOld(int c) {
 3004|  1.21M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3004:9): [True: 1.21M, False: 2.21k]
  |  Branch (3004:23): [True: 1.20M, False: 2.54k]
  |  Branch (3004:37): [True: 1.20M, False: 1.72k]
  ------------------
 3005|  1.20M|        ((IS_LETTER(c) || (c == '_') || (c == ':'))))
  ------------------
  |  |  208|  2.41M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  1.20M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  2.41M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 1.11M, False: 94.8k]
  |  |  |  |  |  |  |  Branch (81:28): [True: 1.19M, False: 12.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  2.41M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.19M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 1.11M, False: 80.4k]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 3.45k, False: 1.10M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  1.19M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 1.10M, False: 82.5k]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.10M, False: 2.35k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  1.19M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 1.44k, False: 83.4k]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 563, False: 886]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  1.19M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 886, False: 83.4k]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 575, False: 311]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  1.19M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 311, False: 83.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.41M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  94.8k|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  94.8k|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.01k, False: 93.8k]
  |  |  |  |  |  |  |  Branch (169:31): [True: 83.4k, False: 11.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  94.8k|				 0 :\
  |  |  |  |  |  |  171|  94.8k|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.1k, False: 1.21k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 838, False: 9.30k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  11.3k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 83, False: 10.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  11.3k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 9.42k, False: 1.01k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 96, False: 9.33k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3005:27): [True: 724, False: 93.0k]
  |  Branch (3005:41): [True: 4.17k, False: 88.9k]
  ------------------
 3006|  1.11M|        return(1);
 3007|  95.4k|    return(0);
 3008|  1.21M|}
parser.c:xmlParseNameComplex:
 3086|   232k|xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
 3087|   232k|    const xmlChar *ret;
 3088|   232k|    int len = 0, l;
 3089|   232k|    int c;
 3090|   232k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3090:21): [True: 117k, False: 114k]
  ------------------
 3091|   117k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   117k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3092|   232k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   114k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3093|   232k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3093:17): [True: 52.5k, False: 179k]
  ------------------
 3094|       |
 3095|       |    /*
 3096|       |     * Handler for more complex cases
 3097|       |     */
 3098|   232k|    c = xmlCurrentChar(ctxt, &l);
 3099|   232k|    if (!xmlIsNameStartChar(c, old10))
  ------------------
  |  Branch (3099:9): [True: 172k, False: 60.3k]
  ------------------
 3100|   172k|        return(NULL);
 3101|  60.3k|    len += l;
 3102|  60.3k|    NEXTL(l);
  ------------------
  |  | 2288|  60.3k|#define NEXTL(l) do {							\
  |  | 2289|  60.3k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 60.3k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  60.3k|    } else ctxt->input->col++;						\
  |  | 2292|  60.3k|    ctxt->input->cur += l;				\
  |  | 2293|  60.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 60.3k]
  |  |  ------------------
  ------------------
 3103|  60.3k|    c = xmlCurrentChar(ctxt, &l);
 3104|  5.35M|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3104:12): [True: 5.29M, False: 60.3k]
  ------------------
 3105|  5.29M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3105:13): [True: 5.29M, False: 0]
  ------------------
 3106|  5.29M|            len += l;
 3107|  5.29M|        NEXTL(l);
  ------------------
  |  | 2288|  5.29M|#define NEXTL(l) do {							\
  |  | 2289|  5.29M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 5.29M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  5.29M|    } else ctxt->input->col++;						\
  |  | 2292|  5.29M|    ctxt->input->cur += l;				\
  |  | 2293|  5.29M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 5.29M]
  |  |  ------------------
  ------------------
 3108|  5.29M|        c = xmlCurrentChar(ctxt, &l);
 3109|  5.29M|    }
 3110|  60.3k|    if (len > maxLength) {
  ------------------
  |  Branch (3110:9): [True: 50, False: 60.3k]
  ------------------
 3111|     50|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3112|     50|        return(NULL);
 3113|     50|    }
 3114|  60.3k|    if (ctxt->input->cur - ctxt->input->base < len) {
  ------------------
  |  Branch (3114:9): [True: 0, False: 60.3k]
  ------------------
 3115|       |        /*
 3116|       |         * There were a couple of bugs where PERefs lead to to a change
 3117|       |         * of the buffer. Check the buffer size to avoid passing an invalid
 3118|       |         * pointer to xmlDictLookup.
 3119|       |         */
 3120|      0|        xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 3121|      0|                    "unexpected change of input buffer");
 3122|      0|        return (NULL);
 3123|      0|    }
 3124|  60.3k|    if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
  ------------------
  |  Branch (3124:9): [True: 5.29k, False: 55.0k]
  |  Branch (3124:40): [True: 380, False: 4.91k]
  ------------------
 3125|    380|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len);
 3126|  59.9k|    else
 3127|  59.9k|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len);
 3128|  60.3k|    if (ret == NULL)
  ------------------
  |  Branch (3128:9): [True: 2, False: 60.3k]
  ------------------
 3129|      2|        xmlErrMemory(ctxt);
 3130|  60.3k|    return(ret);
 3131|  60.3k|}
parser.c:xmlSBufInit:
  682|   468k|xmlSBufInit(xmlSBuf *buf, unsigned max) {
  683|       |    buf->mem = NULL;
  684|   468k|    buf->size = 0;
  685|   468k|    buf->cap = 0;
  686|   468k|    buf->max = max;
  687|   468k|    buf->code = XML_ERR_OK;
  688|   468k|}
parser.c:xmlExpandPEsInEntityValue:
 3461|   261k|                          const xmlChar *str, int length, int depth) {
 3462|   261k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3462:20): [True: 68.4k, False: 192k]
  ------------------
 3463|   261k|    const xmlChar *end, *chunk;
 3464|   261k|    int c, l;
 3465|       |
 3466|   261k|    if (str == NULL)
  ------------------
  |  Branch (3466:9): [True: 148k, False: 113k]
  ------------------
 3467|   148k|        return;
 3468|       |
 3469|   113k|    depth += 1;
 3470|   113k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3470:9): [True: 0, False: 113k]
  ------------------
 3471|      0|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3472|      0|                       "Maximum entity nesting depth exceeded");
 3473|      0|	return;
 3474|      0|    }
 3475|       |
 3476|   113k|    end = str + length;
 3477|   113k|    chunk = str;
 3478|       |
 3479|  89.4M|    while ((str < end) && (!PARSER_STOPPED(ctxt))) {
  ------------------
  |  |   44|  89.4M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3479:12): [True: 89.4M, False: 49.0k]
  |  Branch (3479:27): [True: 89.4M, False: 125]
  ------------------
 3480|  89.4M|        c = *str;
 3481|       |
 3482|  89.4M|        if (c >= 0x80) {
  ------------------
  |  Branch (3482:13): [True: 44.4M, False: 44.9M]
  ------------------
 3483|  44.4M|            l = xmlUTF8MultibyteLen(ctxt, str,
 3484|  44.4M|                    "invalid character in entity value\n");
 3485|  44.4M|            if (l == 0) {
  ------------------
  |  Branch (3485:17): [True: 15.5M, False: 28.9M]
  ------------------
 3486|  15.5M|                if (chunk < str)
  ------------------
  |  Branch (3486:21): [True: 101k, False: 15.4M]
  ------------------
 3487|   101k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3488|  15.5M|                xmlSBufAddReplChar(buf);
 3489|  15.5M|                str += 1;
 3490|  15.5M|                chunk = str;
 3491|  28.9M|            } else {
 3492|  28.9M|                str += l;
 3493|  28.9M|            }
 3494|  44.9M|        } else if (c == '&') {
  ------------------
  |  Branch (3494:20): [True: 101k, False: 44.8M]
  ------------------
 3495|   101k|            if (str[1] == '#') {
  ------------------
  |  Branch (3495:17): [True: 25.5k, False: 76.4k]
  ------------------
 3496|  25.5k|                if (chunk < str)
  ------------------
  |  Branch (3496:21): [True: 19.5k, False: 6.00k]
  ------------------
 3497|  19.5k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3498|       |
 3499|  25.5k|                c = xmlParseStringCharRef(ctxt, &str);
 3500|  25.5k|                if (c == 0)
  ------------------
  |  Branch (3500:21): [True: 2.21k, False: 23.3k]
  ------------------
 3501|  2.21k|                    return;
 3502|       |
 3503|  23.3k|                xmlSBufAddChar(buf, c);
 3504|       |
 3505|  23.3k|                chunk = str;
 3506|  76.4k|            } else {
 3507|  76.4k|                xmlChar *name;
 3508|       |
 3509|       |                /*
 3510|       |                 * General entity references are checked for
 3511|       |                 * syntactic validity.
 3512|       |                 */
 3513|  76.4k|                str++;
 3514|  76.4k|                name = xmlParseStringName(ctxt, &str);
 3515|       |
 3516|  76.4k|                if ((name == NULL) || (*str++ != ';')) {
  ------------------
  |  Branch (3516:21): [True: 4.95k, False: 71.5k]
  |  Branch (3516:39): [True: 5.82k, False: 65.6k]
  ------------------
 3517|  10.7k|                    xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_CHAR_ERROR,
 3518|  10.7k|                            "EntityValue: '&' forbidden except for entities "
 3519|  10.7k|                            "references\n");
 3520|  10.7k|                    xmlFree(name);
 3521|  10.7k|                    return;
 3522|  10.7k|                }
 3523|       |
 3524|  65.6k|                xmlFree(name);
 3525|  65.6k|            }
 3526|  44.8M|        } else if (c == '%') {
  ------------------
  |  Branch (3526:20): [True: 206k, False: 44.6M]
  ------------------
 3527|   206k|            xmlEntityPtr ent;
 3528|       |
 3529|   206k|            if (chunk < str)
  ------------------
  |  Branch (3529:17): [True: 93.9k, False: 112k]
  ------------------
 3530|  93.9k|                xmlSBufAddString(buf, chunk, str - chunk);
 3531|       |
 3532|   206k|            ent = xmlParseStringPEReference(ctxt, &str);
 3533|   206k|            if (ent == NULL)
  ------------------
  |  Branch (3533:17): [True: 50.9k, False: 155k]
  ------------------
 3534|  50.9k|                return;
 3535|       |
 3536|   155k|            if (!PARSER_EXTERNAL(ctxt)) {
  ------------------
  |  |   55|   155k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 5.68k, False: 149k]
  |  |  ------------------
  |  |   56|   155k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 149k, False: 70]
  |  |  ------------------
  |  |   57|   149k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 149k, False: 0]
  |  |  ------------------
  ------------------
 3537|     70|                xmlFatalErr(ctxt, XML_ERR_ENTITY_PE_INTERNAL, NULL);
 3538|     70|                return;
 3539|     70|            }
 3540|       |
 3541|   155k|            if (ent->content == NULL) {
  ------------------
  |  Branch (3541:17): [True: 148k, False: 6.73k]
  ------------------
 3542|       |                /*
 3543|       |                 * Note: external parsed entities will not be loaded,
 3544|       |                 * it is not required for a non-validating parser to
 3545|       |                 * complete external PEReferences coming from the
 3546|       |                 * internal subset
 3547|       |                 */
 3548|   148k|                if (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (3548:21): [True: 148k, False: 0]
  ------------------
 3549|   148k|                    ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (3549:22): [True: 137k, False: 11.0k]
  ------------------
 3550|   148k|                     (ctxt->validate))) {
  ------------------
  |  Branch (3550:22): [True: 10.7k, False: 221]
  ------------------
 3551|   148k|                    xmlLoadEntityContent(ctxt, ent);
 3552|   148k|                } else {
 3553|    221|                    xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
 3554|    221|                                  "not validating will not read content for "
 3555|    221|                                  "PE entity %s\n", ent->name, NULL);
 3556|    221|                }
 3557|   148k|            }
 3558|       |
 3559|       |            /*
 3560|       |             * TODO: Skip if ent->content is still NULL.
 3561|       |             */
 3562|       |
 3563|   155k|            if (xmlParserEntityCheck(ctxt, ent->length))
  ------------------
  |  Branch (3563:17): [True: 31, False: 155k]
  ------------------
 3564|     31|                return;
 3565|       |
 3566|   155k|            if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   155k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3566:17): [True: 68, False: 154k]
  ------------------
 3567|     68|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3568|     68|                return;
 3569|     68|            }
 3570|       |
 3571|   154k|            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   154k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3572|   154k|            xmlExpandPEsInEntityValue(ctxt, buf, ent->content, ent->length,
 3573|   154k|                                      depth);
 3574|   154k|            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   154k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3575|       |
 3576|   154k|            chunk = str;
 3577|  44.6M|        } else {
 3578|       |            /* Normal ASCII char */
 3579|  44.6M|            if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  44.6M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  44.6M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 43.4M, False: 1.16M]
  |  |  |  |  |  Branch (108:44): [True: 4.65M, False: 38.7M]
  |  |  |  |  ------------------
  |  |  |  |  109|  44.6M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 20.0k, False: 39.9M]
  |  |  |  |  ------------------
  |  |  |  |  110|  44.6M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 38.6M, False: 1.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3580|  1.25M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3581|  1.25M|                        "invalid character in entity value\n");
 3582|  1.25M|                if (chunk < str)
  ------------------
  |  Branch (3582:21): [True: 8.28k, False: 1.25M]
  ------------------
 3583|  8.28k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3584|  1.25M|                xmlSBufAddReplChar(buf);
 3585|  1.25M|                str += 1;
 3586|  1.25M|                chunk = str;
 3587|  43.3M|            } else {
 3588|  43.3M|                str += 1;
 3589|  43.3M|            }
 3590|  44.6M|        }
 3591|  89.4M|    }
 3592|       |
 3593|  49.1k|    if (chunk < str)
  ------------------
  |  Branch (3593:9): [True: 45.0k, False: 4.11k]
  ------------------
 3594|  45.0k|        xmlSBufAddString(buf, chunk, str - chunk);
 3595|  49.1k|}
parser.c:xmlUTF8MultibyteLen:
  817|   106M|                    const char *errMsg) {
  818|   106M|    int c = str[0];
  819|   106M|    int c1 = str[1];
  820|       |
  821|   106M|    if ((c1 & 0xC0) != 0x80)
  ------------------
  |  Branch (821:9): [True: 57.0M, False: 49.8M]
  ------------------
  822|  57.0M|        goto encoding_error;
  823|       |
  824|  49.8M|    if (c < 0xE0) {
  ------------------
  |  Branch (824:9): [True: 16.7M, False: 33.0M]
  ------------------
  825|       |        /* 2-byte sequence */
  826|  16.7M|        if (c < 0xC2)
  ------------------
  |  Branch (826:13): [True: 15.7M, False: 963k]
  ------------------
  827|  15.7M|            goto encoding_error;
  828|       |
  829|   963k|        return(2);
  830|  33.0M|    } else {
  831|  33.0M|        int c2 = str[2];
  832|       |
  833|  33.0M|        if ((c2 & 0xC0) != 0x80)
  ------------------
  |  Branch (833:13): [True: 8.41k, False: 33.0M]
  ------------------
  834|  8.41k|            goto encoding_error;
  835|       |
  836|  33.0M|        if (c < 0xF0) {
  ------------------
  |  Branch (836:13): [True: 33.0M, False: 28.9k]
  ------------------
  837|       |            /* 3-byte sequence */
  838|  33.0M|            if (c == 0xE0) {
  ------------------
  |  Branch (838:17): [True: 4.22M, False: 28.8M]
  ------------------
  839|       |                /* overlong */
  840|  4.22M|                if (c1 < 0xA0)
  ------------------
  |  Branch (840:21): [True: 1.22k, False: 4.22M]
  ------------------
  841|  1.22k|                    goto encoding_error;
  842|  28.8M|            } else if (c == 0xED) {
  ------------------
  |  Branch (842:24): [True: 9.96k, False: 28.8M]
  ------------------
  843|       |                /* surrogate */
  844|  9.96k|                if (c1 >= 0xA0)
  ------------------
  |  Branch (844:21): [True: 214, False: 9.75k]
  ------------------
  845|    214|                    goto encoding_error;
  846|  28.8M|            } else if (c == 0xEF) {
  ------------------
  |  Branch (846:24): [True: 19.0M, False: 9.78M]
  ------------------
  847|       |                /* U+FFFE and U+FFFF are invalid Chars */
  848|  19.0M|                if ((c1 == 0xBF) && (c2 >= 0xBE))
  ------------------
  |  Branch (848:21): [True: 19.0M, False: 3.57k]
  |  Branch (848:37): [True: 222, False: 19.0M]
  ------------------
  849|    222|                    xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, errMsg);
  850|  19.0M|            }
  851|       |
  852|  33.0M|            return(3);
  853|  33.0M|        } else {
  854|       |            /* 4-byte sequence */
  855|  28.9k|            if ((str[3] & 0xC0) != 0x80)
  ------------------
  |  Branch (855:17): [True: 3.04k, False: 25.9k]
  ------------------
  856|  3.04k|                goto encoding_error;
  857|  25.9k|            if (c == 0xF0) {
  ------------------
  |  Branch (857:17): [True: 1.31k, False: 24.6k]
  ------------------
  858|       |                /* overlong */
  859|  1.31k|                if (c1 < 0x90)
  ------------------
  |  Branch (859:21): [True: 786, False: 525]
  ------------------
  860|    786|                    goto encoding_error;
  861|  24.6k|            } else if (c >= 0xF4) {
  ------------------
  |  Branch (861:24): [True: 4.42k, False: 20.2k]
  ------------------
  862|       |                /* greater than 0x10FFFF */
  863|  4.42k|                if ((c > 0xF4) || (c1 >= 0x90))
  ------------------
  |  Branch (863:21): [True: 3.91k, False: 503]
  |  Branch (863:35): [True: 239, False: 264]
  ------------------
  864|  4.15k|                    goto encoding_error;
  865|  4.42k|            }
  866|       |
  867|  21.0k|            return(4);
  868|  25.9k|        }
  869|  33.0M|    }
  870|       |
  871|  72.8M|encoding_error:
  872|       |    /* Only report the first error */
  873|  72.8M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  72.8M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (873:9): [True: 17.3k, False: 72.8M]
  ------------------
  874|  17.3k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  875|  17.3k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  17.3k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  876|  17.3k|    }
  877|       |
  878|  72.8M|    return(0);
  879|  49.8M|}
parser.c:xmlSBufAddString:
  718|   120M|xmlSBufAddString(xmlSBuf *buf, const xmlChar *str, unsigned len) {
  719|   120M|    if (buf->max - buf->size < len) {
  ------------------
  |  Branch (719:9): [True: 0, False: 120M]
  ------------------
  720|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (720:13): [True: 0, False: 0]
  ------------------
  721|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  722|      0|        return;
  723|      0|    }
  724|       |
  725|   120M|    if (buf->cap - buf->size <= len) {
  ------------------
  |  Branch (725:9): [True: 386k, False: 120M]
  ------------------
  726|   386k|        if (xmlSBufGrow(buf, len) < 0)
  ------------------
  |  Branch (726:13): [True: 80, False: 386k]
  ------------------
  727|     80|            return;
  728|   386k|    }
  729|       |
  730|   120M|    if (len > 0)
  ------------------
  |  Branch (730:9): [True: 120M, False: 0]
  ------------------
  731|   120M|        memcpy(buf->mem + buf->size, str, len);
  732|   120M|    buf->size += len;
  733|   120M|}
parser.c:xmlSBufGrow:
  691|   392k|xmlSBufGrow(xmlSBuf *buf, unsigned len) {
  692|   392k|    xmlChar *mem;
  693|   392k|    unsigned cap;
  694|       |
  695|   392k|    if (len >= UINT_MAX / 2 - buf->size) {
  ------------------
  |  Branch (695:9): [True: 0, False: 392k]
  ------------------
  696|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (696:13): [True: 0, False: 0]
  ------------------
  697|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  698|      0|        return(-1);
  699|      0|    }
  700|       |
  701|   392k|    cap = (buf->size + len) * 2;
  702|   392k|    if (cap < 240)
  ------------------
  |  Branch (702:9): [True: 277k, False: 115k]
  ------------------
  703|   277k|        cap = 240;
  704|       |
  705|   392k|    mem = xmlRealloc(buf->mem, cap);
  706|   392k|    if (mem == NULL) {
  ------------------
  |  Branch (706:9): [True: 86, False: 392k]
  ------------------
  707|     86|        buf->code = XML_ERR_NO_MEMORY;
  708|     86|        return(-1);
  709|     86|    }
  710|       |
  711|   392k|    buf->mem = mem;
  712|   392k|    buf->cap = cap;
  713|       |
  714|   392k|    return(0);
  715|   392k|}
parser.c:xmlSBufAddReplChar:
  766|   104M|xmlSBufAddReplChar(xmlSBuf *buf) {
  767|   104M|    xmlSBufAddCString(buf, "\xEF\xBF\xBD", 3);
  768|   104M|}
parser.c:xmlSBufAddCString:
  736|   112M|xmlSBufAddCString(xmlSBuf *buf, const char *str, unsigned len) {
  737|   112M|    xmlSBufAddString(buf, (const xmlChar *) str, len);
  738|   112M|}
parser.c:xmlParseStringCharRef:
 2634|  1.20M|xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 2635|  1.20M|    const xmlChar *ptr;
 2636|  1.20M|    xmlChar cur;
 2637|  1.20M|    int val = 0;
 2638|       |
 2639|  1.20M|    if ((str == NULL) || (*str == NULL)) return(0);
  ------------------
  |  Branch (2639:9): [True: 0, False: 1.20M]
  |  Branch (2639:26): [True: 0, False: 1.20M]
  ------------------
 2640|  1.20M|    ptr = *str;
 2641|  1.20M|    cur = *ptr;
 2642|  1.20M|    if ((cur == '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {
  ------------------
  |  Branch (2642:9): [True: 1.20M, False: 0]
  |  Branch (2642:25): [True: 1.20M, False: 0]
  |  Branch (2642:44): [True: 19.8k, False: 1.18M]
  ------------------
 2643|  19.8k|	ptr += 3;
 2644|  19.8k|	cur = *ptr;
 2645|  76.3k|	while (cur != ';') { /* Non input consuming loop */
  ------------------
  |  Branch (2645:9): [True: 57.1k, False: 19.1k]
  ------------------
 2646|  57.1k|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2646:10): [True: 56.9k, False: 272]
  |  Branch (2646:26): [True: 38.0k, False: 18.8k]
  ------------------
 2647|  38.0k|	        val = val * 16 + (cur - '0');
 2648|  19.0k|	    else if ((cur >= 'a') && (cur <= 'f'))
  ------------------
  |  Branch (2648:15): [True: 6.11k, False: 12.9k]
  |  Branch (2648:31): [True: 5.89k, False: 219]
  ------------------
 2649|  5.89k|	        val = val * 16 + (cur - 'a') + 10;
 2650|  13.2k|	    else if ((cur >= 'A') && (cur <= 'F'))
  ------------------
  |  Branch (2650:15): [True: 12.8k, False: 343]
  |  Branch (2650:31): [True: 12.4k, False: 367]
  ------------------
 2651|  12.4k|	        val = val * 16 + (cur - 'A') + 10;
 2652|    710|	    else {
 2653|    710|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2654|    710|		val = 0;
 2655|    710|		break;
 2656|    710|	    }
 2657|  56.4k|	    if (val > 0x110000)
  ------------------
  |  Branch (2657:10): [True: 9.88k, False: 46.5k]
  ------------------
 2658|  9.88k|	        val = 0x110000;
 2659|       |
 2660|  56.4k|	    ptr++;
 2661|  56.4k|	    cur = *ptr;
 2662|  56.4k|	}
 2663|  19.8k|	if (cur == ';')
  ------------------
  |  Branch (2663:6): [True: 19.1k, False: 710]
  ------------------
 2664|  19.1k|	    ptr++;
 2665|  1.18M|    } else if  ((cur == '&') && (ptr[1] == '#')){
  ------------------
  |  Branch (2665:17): [True: 1.18M, False: 0]
  |  Branch (2665:33): [True: 1.18M, False: 0]
  ------------------
 2666|  1.18M|	ptr += 2;
 2667|  1.18M|	cur = *ptr;
 2668|  3.55M|	while (cur != ';') { /* Non input consuming loops */
  ------------------
  |  Branch (2668:9): [True: 2.37M, False: 1.18M]
  ------------------
 2669|  2.37M|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2669:10): [True: 2.37M, False: 241]
  |  Branch (2669:26): [True: 2.37M, False: 377]
  ------------------
 2670|  2.37M|	        val = val * 10 + (cur - '0');
 2671|    618|	    else {
 2672|    618|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2673|    618|		val = 0;
 2674|    618|		break;
 2675|    618|	    }
 2676|  2.37M|	    if (val > 0x110000)
  ------------------
  |  Branch (2676:10): [True: 1.87k, False: 2.36M]
  ------------------
 2677|  1.87k|	        val = 0x110000;
 2678|       |
 2679|  2.37M|	    ptr++;
 2680|  2.37M|	    cur = *ptr;
 2681|  2.37M|	}
 2682|  1.18M|	if (cur == ';')
  ------------------
  |  Branch (2682:6): [True: 1.18M, False: 618]
  ------------------
 2683|  1.18M|	    ptr++;
 2684|  1.18M|    } else {
 2685|      0|	xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2686|      0|	return(0);
 2687|      0|    }
 2688|  1.20M|    *str = ptr;
 2689|       |
 2690|       |    /*
 2691|       |     * [ WFC: Legal Character ]
 2692|       |     * Characters referred to using character references must match the
 2693|       |     * production for Char.
 2694|       |     */
 2695|  1.20M|    if (val >= 0x110000) {
  ------------------
  |  Branch (2695:9): [True: 224, False: 1.20M]
  ------------------
 2696|    224|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2697|    224|                "xmlParseStringCharRef: character reference out of bounds\n",
 2698|    224|                val);
 2699|  1.20M|    } else if (IS_CHAR(val)) {
  ------------------
  |  |  115|  1.20M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  1.20M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.19M, False: 1.99k]
  |  |  |  |  |  Branch (117:25): [True: 1.19M, False: 8.77k]
  |  |  |  |  ------------------
  |  |  |  |  118|  1.20M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.19M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.19M, False: 1.84k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 1.23k, False: 1.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.19M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 1.27k, False: 1.19M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.19M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.18M, False: 1.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  1.20M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 8.77k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 7.58k, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  120|  8.77k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.07k, False: 113]
  |  |  |  |  |  Branch (120:26): [True: 189, False: 882]
  |  |  |  |  ------------------
  |  |  |  |  121|  8.77k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 872, False: 123]
  |  |  |  |  |  Branch (121:27): [True: 872, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2700|  1.19M|        return(val);
 2701|  1.19M|    } else {
 2702|  1.99k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2703|  1.99k|			  "xmlParseStringCharRef: invalid xmlChar value %d\n",
 2704|  1.99k|			  val);
 2705|  1.99k|    }
 2706|  2.21k|    return(0);
 2707|  1.20M|}
parser.c:xmlSBufAddChar:
  741|  1.22M|xmlSBufAddChar(xmlSBuf *buf, int c) {
  742|  1.22M|    xmlChar *end;
  743|       |
  744|  1.22M|    if (buf->max - buf->size < 4) {
  ------------------
  |  Branch (744:9): [True: 0, False: 1.22M]
  ------------------
  745|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (745:13): [True: 0, False: 0]
  ------------------
  746|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  747|      0|        return;
  748|      0|    }
  749|       |
  750|  1.22M|    if (buf->cap - buf->size <= 4) {
  ------------------
  |  Branch (750:9): [True: 6.13k, False: 1.22M]
  ------------------
  751|  6.13k|        if (xmlSBufGrow(buf, 4) < 0)
  ------------------
  |  Branch (751:13): [True: 6, False: 6.12k]
  ------------------
  752|      6|            return;
  753|  6.13k|    }
  754|       |
  755|  1.22M|    end = buf->mem + buf->size;
  756|       |
  757|  1.22M|    if (c < 0x80) {
  ------------------
  |  Branch (757:9): [True: 1.22M, False: 5.50k]
  ------------------
  758|  1.22M|        *end = (xmlChar) c;
  759|  1.22M|        buf->size += 1;
  760|  1.22M|    } else {
  761|  5.50k|        buf->size += xmlCopyCharMultiByte(end, c);
  762|  5.50k|    }
  763|  1.22M|}
parser.c:xmlParseStringName:
 3340|  3.02M|xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
 3341|  3.02M|    xmlChar *ret;
 3342|  3.02M|    const xmlChar *cur = *str;
 3343|  3.02M|    int flags = 0;
 3344|  3.02M|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3344:21): [True: 1.70M, False: 1.32M]
  ------------------
 3345|  1.70M|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.70M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3346|  3.02M|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  1.32M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3347|       |
 3348|  3.02M|    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (3348:9): [True: 1.08M, False: 1.93M]
  ------------------
 3349|  1.08M|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  1.08M|#define XML_SCAN_OLD10      4
  ------------------
 3350|       |
 3351|  3.02M|    cur = xmlScanName(*str, maxLength, flags);
 3352|  3.02M|    if (cur == NULL) {
  ------------------
  |  Branch (3352:9): [True: 56, False: 3.02M]
  ------------------
 3353|     56|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3354|     56|        return(NULL);
 3355|     56|    }
 3356|  3.02M|    if (cur == *str)
  ------------------
  |  Branch (3356:9): [True: 6.76k, False: 3.02M]
  ------------------
 3357|  6.76k|        return(NULL);
 3358|       |
 3359|  3.02M|    ret = xmlStrndup(*str, cur - *str);
 3360|  3.02M|    if (ret == NULL)
  ------------------
  |  Branch (3360:9): [True: 24, False: 3.02M]
  ------------------
 3361|     24|        xmlErrMemory(ctxt);
 3362|  3.02M|    *str = cur;
 3363|  3.02M|    return(ret);
 3364|  3.02M|}
parser.c:xmlParseStringPEReference:
 7861|   206k|xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 7862|   206k|    const xmlChar *ptr;
 7863|   206k|    xmlChar cur;
 7864|   206k|    xmlChar *name;
 7865|   206k|    xmlEntityPtr entity = NULL;
 7866|       |
 7867|   206k|    if ((str == NULL) || (*str == NULL)) return(NULL);
  ------------------
  |  Branch (7867:9): [True: 0, False: 206k]
  |  Branch (7867:26): [True: 0, False: 206k]
  ------------------
 7868|   206k|    ptr = *str;
 7869|   206k|    cur = *ptr;
 7870|   206k|    if (cur != '%')
  ------------------
  |  Branch (7870:9): [True: 0, False: 206k]
  ------------------
 7871|      0|        return(NULL);
 7872|   206k|    ptr++;
 7873|   206k|    name = xmlParseStringName(ctxt, &ptr);
 7874|   206k|    if (name == NULL) {
  ------------------
  |  Branch (7874:9): [True: 1.86k, False: 204k]
  ------------------
 7875|  1.86k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7876|  1.86k|		       "xmlParseStringPEReference: no name\n");
 7877|  1.86k|	*str = ptr;
 7878|  1.86k|	return(NULL);
 7879|  1.86k|    }
 7880|   204k|    cur = *ptr;
 7881|   204k|    if (cur != ';') {
  ------------------
  |  Branch (7881:9): [True: 3.98k, False: 200k]
  ------------------
 7882|  3.98k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7883|  3.98k|	xmlFree(name);
 7884|  3.98k|	*str = ptr;
 7885|  3.98k|	return(NULL);
 7886|  3.98k|    }
 7887|   200k|    ptr++;
 7888|       |
 7889|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7890|   200k|    ctxt->hasPErefs = 1;
 7891|       |
 7892|       |    /*
 7893|       |     * Request the entity from SAX
 7894|       |     */
 7895|   200k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7895:9): [True: 200k, False: 0]
  ------------------
 7896|   200k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7896:2): [True: 200k, False: 0]
  ------------------
 7897|   200k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7898|       |
 7899|   200k|    if (entity == NULL) {
  ------------------
  |  Branch (7899:9): [True: 45.0k, False: 155k]
  ------------------
 7900|  45.0k|        xmlHandleUndeclaredEntity(ctxt, name);
 7901|   155k|    } else {
 7902|       |	/*
 7903|       |	 * Internal checking in case the entity quest barfed
 7904|       |	 */
 7905|   155k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7905:6): [True: 148k, False: 6.14k]
  ------------------
 7906|   148k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7906:6): [True: 0, False: 148k]
  ------------------
 7907|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7908|      0|			  "%%%s; is not a parameter entity\n",
 7909|      0|			  name, NULL);
 7910|      0|	}
 7911|   155k|    }
 7912|       |
 7913|   200k|    xmlFree(name);
 7914|   200k|    *str = ptr;
 7915|   200k|    return(entity);
 7916|   204k|}
parser.c:xmlHandleUndeclaredEntity:
 7334|   391k|xmlHandleUndeclaredEntity(xmlParserCtxtPtr ctxt, const xmlChar *name) {
 7335|       |    /*
 7336|       |     * [ WFC: Entity Declared ]
 7337|       |     * In a document without any DTD, a document with only an
 7338|       |     * internal DTD subset which contains no parameter entity
 7339|       |     * references, or a document with "standalone='yes'", the
 7340|       |     * Name given in the entity reference must match that in an
 7341|       |     * entity declaration, except that well-formed documents
 7342|       |     * need not declare any of the following entities: amp, lt,
 7343|       |     * gt, apos, quot.
 7344|       |     * The declaration of a parameter entity must precede any
 7345|       |     * reference to it.
 7346|       |     * Similarly, the declaration of a general entity must
 7347|       |     * precede any reference to it which appears in a default
 7348|       |     * value in an attribute-list declaration. Note that if
 7349|       |     * entities are declared in the external subset or in
 7350|       |     * external parameter entities, a non-validating processor
 7351|       |     * is not obligated to read and process their declarations;
 7352|       |     * for such documents, the rule that an entity must be
 7353|       |     * declared is a well-formedness constraint only if
 7354|       |     * standalone='yes'.
 7355|       |     */
 7356|   391k|    if ((ctxt->standalone == 1) ||
  ------------------
  |  Branch (7356:9): [True: 683, False: 391k]
  ------------------
 7357|   391k|        ((ctxt->hasExternalSubset == 0) &&
  ------------------
  |  Branch (7357:10): [True: 386k, False: 4.31k]
  ------------------
 7358|   386k|         (ctxt->hasPErefs == 0))) {
  ------------------
  |  Branch (7358:10): [True: 135k, False: 251k]
  ------------------
 7359|   136k|        xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7360|   136k|                          "Entity '%s' not defined\n", name);
 7361|   136k|#ifdef LIBXML_VALID_ENABLED
 7362|   255k|    } else if (ctxt->validate) {
  ------------------
  |  Branch (7362:16): [True: 216k, False: 38.9k]
  ------------------
 7363|       |        /*
 7364|       |         * [ VC: Entity Declared ]
 7365|       |         * In a document with an external subset or external
 7366|       |         * parameter entities with "standalone='no'", ...
 7367|       |         * ... The declaration of a parameter entity must
 7368|       |         * precede any reference to it...
 7369|       |         */
 7370|   216k|        xmlValidityError(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7371|   216k|                         "Entity '%s' not defined\n", name, NULL);
 7372|   216k|#endif
 7373|   216k|    } else if ((ctxt->loadsubset & ~XML_SKIP_IDS) ||
  ------------------
  |  |  210|  38.9k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7373:16): [True: 30.4k, False: 8.52k]
  ------------------
 7374|  8.52k|               ((ctxt->replaceEntities) &&
  ------------------
  |  Branch (7374:17): [True: 8.02k, False: 499]
  ------------------
 7375|  37.9k|                ((ctxt->options & XML_PARSE_NO_XXE) == 0))) {
  ------------------
  |  Branch (7375:17): [True: 7.46k, False: 556]
  ------------------
 7376|       |        /*
 7377|       |         * Also raise a non-fatal error
 7378|       |         *
 7379|       |         * - if the external subset is loaded and all entity declarations
 7380|       |         *   should be available, or
 7381|       |         * - entity substition was requested without restricting
 7382|       |         *   external entity access.
 7383|       |         */
 7384|  37.9k|        xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7385|  37.9k|                     "Entity '%s' not defined\n", name);
 7386|  37.9k|    } else {
 7387|  1.05k|        xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7388|  1.05k|                      "Entity '%s' not defined\n", name, NULL);
 7389|  1.05k|    }
 7390|       |
 7391|   391k|    ctxt->valid = 0;
 7392|   391k|}
parser.c:xmlErrMsgStr:
  364|  37.9k|{
  365|  37.9k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
  366|  37.9k|               val, NULL, NULL, 0, msg, val);
  367|  37.9k|}
parser.c:xmlLoadEntityContent:
 7698|   148k|xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
 7699|   148k|    xmlParserInputPtr oldinput, input = NULL;
 7700|   148k|    xmlParserInputPtr *oldinputTab;
 7701|   148k|    xmlChar *oldencoding;
 7702|   148k|    xmlChar *content = NULL;
 7703|   148k|    xmlResourceType rtype;
 7704|   148k|    size_t length, i;
 7705|   148k|    int oldinputNr, oldinputMax;
 7706|   148k|    int ret = -1;
 7707|   148k|    int res;
 7708|       |
 7709|   148k|    if ((ctxt == NULL) || (entity == NULL) ||
  ------------------
  |  Branch (7709:9): [True: 0, False: 148k]
  |  Branch (7709:27): [True: 0, False: 148k]
  ------------------
 7710|   148k|        ((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7710:10): [True: 0, False: 148k]
  ------------------
 7711|      0|	 (entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) ||
  ------------------
  |  Branch (7711:3): [True: 0, False: 0]
  ------------------
 7712|   148k|	(entity->content != NULL)) {
  ------------------
  |  Branch (7712:2): [True: 0, False: 148k]
  ------------------
 7713|      0|	xmlFatalErr(ctxt, XML_ERR_ARGUMENT,
 7714|      0|	            "xmlLoadEntityContent parameter error");
 7715|      0|        return(-1);
 7716|      0|    }
 7717|       |
 7718|   148k|    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (7718:9): [True: 148k, False: 0]
  ------------------
 7719|   148k|        rtype = XML_RESOURCE_PARAMETER_ENTITY;
 7720|      0|    else
 7721|      0|        rtype = XML_RESOURCE_GENERAL_ENTITY;
 7722|       |
 7723|   148k|    input = xmlLoadResource(ctxt, (char *) entity->URI,
 7724|   148k|                            (char *) entity->ExternalID, rtype);
 7725|   148k|    if (input == NULL)
  ------------------
  |  Branch (7725:9): [True: 658, False: 147k]
  ------------------
 7726|    658|        return(-1);
 7727|       |
 7728|   147k|    oldinput = ctxt->input;
 7729|   147k|    oldinputNr = ctxt->inputNr;
 7730|   147k|    oldinputMax = ctxt->inputMax;
 7731|   147k|    oldinputTab = ctxt->inputTab;
 7732|   147k|    oldencoding = ctxt->encoding;
 7733|       |
 7734|   147k|    ctxt->input = NULL;
 7735|   147k|    ctxt->inputNr = 0;
 7736|   147k|    ctxt->inputMax = 1;
 7737|   147k|    ctxt->encoding = NULL;
 7738|   147k|    ctxt->inputTab = xmlMalloc(sizeof(xmlParserInputPtr));
 7739|   147k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (7739:9): [True: 6, False: 147k]
  ------------------
 7740|      6|        xmlErrMemory(ctxt);
 7741|      6|        xmlFreeInputStream(input);
 7742|      6|        goto error;
 7743|      6|    }
 7744|       |
 7745|   147k|    xmlBufResetInput(input->buf->buffer, input);
 7746|       |
 7747|   147k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7747:9): [True: 7, False: 147k]
  ------------------
 7748|      7|        xmlFreeInputStream(input);
 7749|      7|        goto error;
 7750|      7|    }
 7751|       |
 7752|   147k|    xmlDetectEncoding(ctxt);
 7753|       |
 7754|       |    /*
 7755|       |     * Parse a possible text declaration first
 7756|       |     */
 7757|   147k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2234|   147k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   294k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 142k, False: 4.67k]
  |  |  |  |  |  Branch (2231:41): [True: 141k, False: 1.58k]
  |  |  |  |  ------------------
  |  |  |  | 2232|   147k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 140k, False: 491]
  |  |  |  |  |  Branch (2232:41): [True: 140k, False: 224]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 139k, False: 521]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   139k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   139k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 137k, False: 2.10k]
  |  |  |  |  ------------------
  |  |  |  |   91|   139k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.89k, False: 211]
  |  |  |  |  |  Branch (91:23): [True: 244, False: 1.65k]
  |  |  |  |  ------------------
  |  |  |  |   92|   139k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.61k, False: 253]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7758|   139k|	xmlParseTextDecl(ctxt);
 7759|       |        /*
 7760|       |         * An XML-1.0 document can't reference an entity not XML-1.0
 7761|       |         */
 7762|   139k|        if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|   139k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7762:13): [True: 1.47k, False: 138k]
  ------------------
 7763|  1.47k|            (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|  1.47k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7763:13): [True: 142, False: 1.33k]
  ------------------
 7764|    142|            xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
 7765|    142|                           "Version mismatch between document and entity\n");
 7766|    142|        }
 7767|   139k|    }
 7768|       |
 7769|   147k|    length = input->cur - input->base;
 7770|   147k|    xmlBufShrink(input->buf->buffer, length);
 7771|   147k|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7772|       |
 7773|   162k|    while ((res = xmlParserInputBufferGrow(input->buf, 4096)) > 0)
  ------------------
  |  Branch (7773:12): [True: 15.4k, False: 147k]
  ------------------
 7774|  15.4k|        ;
 7775|       |
 7776|   147k|    xmlBufResetInput(input->buf->buffer, input);
 7777|       |
 7778|   147k|    if (res < 0) {
  ------------------
  |  Branch (7778:9): [True: 1.38k, False: 146k]
  ------------------
 7779|  1.38k|        xmlCtxtErrIO(ctxt, input->buf->error, NULL);
 7780|  1.38k|        goto error;
 7781|  1.38k|    }
 7782|       |
 7783|   146k|    length = xmlBufUse(input->buf->buffer);
 7784|   146k|    if (length > INT_MAX) {
  ------------------
  |  Branch (7784:9): [True: 0, False: 146k]
  ------------------
 7785|      0|        xmlErrMemory(ctxt);
 7786|      0|        goto error;
 7787|      0|    }
 7788|       |
 7789|   146k|    content = xmlStrndup(xmlBufContent(input->buf->buffer), length);
 7790|   146k|    if (content == NULL) {
  ------------------
  |  Branch (7790:9): [True: 4, False: 146k]
  ------------------
 7791|      4|        xmlErrMemory(ctxt);
 7792|      4|        goto error;
 7793|      4|    }
 7794|       |
 7795|  21.9M|    for (i = 0; i < length; ) {
  ------------------
  |  Branch (7795:17): [True: 21.9M, False: 176]
  ------------------
 7796|  21.9M|        int clen = length - i;
 7797|  21.9M|        int c = xmlGetUTF8Char(content + i, &clen);
 7798|       |
 7799|  21.9M|        if ((c < 0) || (!IS_CHAR(c))) {
  ------------------
  |  |  115|  21.7M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  21.7M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 15.9M, False: 5.81M]
  |  |  |  |  ------------------
  |  |  |  |  118|  21.7M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  15.9M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 15.9M, False: 4.55k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 266k, False: 15.7M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  15.9M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 171k, False: 15.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  15.9M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 15.5M, False: 7.89k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  21.7M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 5.81M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 5.80M, False: 11.0k]
  |  |  |  |  ------------------
  |  |  |  |  120|  5.81M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 11.0k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 7.98k, False: 3.09k]
  |  |  |  |  ------------------
  |  |  |  |  121|  5.81M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 2.17k, False: 919]
  |  |  |  |  |  Branch (121:27): [True: 2.17k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7799:13): [True: 137k, False: 21.7M]
  |  Branch (7799:24): [True: 8.81k, False: 21.7M]
  ------------------
 7800|   145k|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 7801|   145k|                              "xmlLoadEntityContent: invalid char value %d\n",
 7802|   145k|                              content[i]);
 7803|   145k|            goto error;
 7804|   145k|        }
 7805|  21.7M|        i += clen;
 7806|  21.7M|    }
 7807|       |
 7808|    176|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7809|    176|    entity->content = content;
 7810|    176|    entity->length = length;
 7811|    176|    content = NULL;
 7812|    176|    ret = 0;
 7813|       |
 7814|   147k|error:
 7815|   294k|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (7815:12): [True: 147k, False: 147k]
  ------------------
 7816|   147k|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 7817|   147k|    xmlFree(ctxt->inputTab);
 7818|   147k|    xmlFree(ctxt->encoding);
 7819|       |
 7820|   147k|    ctxt->input = oldinput;
 7821|   147k|    ctxt->inputNr = oldinputNr;
 7822|   147k|    ctxt->inputMax = oldinputMax;
 7823|   147k|    ctxt->inputTab = oldinputTab;
 7824|   147k|    ctxt->encoding = oldencoding;
 7825|       |
 7826|   147k|    xmlFree(content);
 7827|       |
 7828|   147k|    return(ret);
 7829|    176|}
parser.c:xmlSBufFinish:
  780|   279k|              const char *errMsg) {
  781|   279k|    if (buf->mem == NULL) {
  ------------------
  |  Branch (781:9): [True: 27.4k, False: 251k]
  ------------------
  782|  27.4k|        buf->mem = xmlMalloc(1);
  783|  27.4k|        if (buf->mem == NULL) {
  ------------------
  |  Branch (783:13): [True: 7, False: 27.4k]
  ------------------
  784|      7|            buf->code = XML_ERR_NO_MEMORY;
  785|  27.4k|        } else {
  786|  27.4k|            buf->mem[0] = 0;
  787|  27.4k|        }
  788|   251k|    } else {
  789|   251k|        buf->mem[buf->size] = 0;
  790|   251k|    }
  791|       |
  792|   279k|    if (buf->code == XML_ERR_OK) {
  ------------------
  |  Branch (792:9): [True: 278k, False: 60]
  ------------------
  793|   278k|        if (sizeOut != NULL)
  ------------------
  |  Branch (793:13): [True: 26.7k, False: 252k]
  ------------------
  794|  26.7k|            *sizeOut = buf->size;
  795|   278k|        return(buf->mem);
  796|   278k|    }
  797|       |
  798|     60|    xmlSBufReportError(buf, ctxt, errMsg);
  799|       |
  800|     60|    xmlFree(buf->mem);
  801|       |
  802|     60|    if (sizeOut != NULL)
  ------------------
  |  Branch (802:9): [True: 13, False: 47]
  ------------------
  803|     13|        *sizeOut = 0;
  804|       |    return(NULL);
  805|   279k|}
parser.c:xmlSBufReportError:
  771|     93|xmlSBufReportError(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  772|     93|    if (buf->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (772:9): [True: 93, False: 0]
  ------------------
  773|     93|        xmlCtxtErrMemory(ctxt);
  774|      0|    else
  775|      0|        xmlFatalErr(ctxt, buf->code, errMsg);
  776|     93|}
parser.c:xmlSBufCleanup:
  808|   180k|xmlSBufCleanup(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  809|   180k|    if (buf->code != XML_ERR_OK)
  ------------------
  |  Branch (809:9): [True: 33, False: 180k]
  ------------------
  810|     33|        xmlSBufReportError(buf, ctxt, errMsg);
  811|       |
  812|   180k|    xmlFree(buf->mem);
  813|   180k|}
parser.c:xmlExpandEntityInAttValue:
 3802|  1.77M|                          int *inSpace, int depth, int check) {
 3803|  1.77M|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3803:20): [True: 1.00M, False: 765k]
  ------------------
 3804|  1.77M|    int c, chunkSize;
 3805|  1.77M|    int normChange = 0;
 3806|       |
 3807|  1.77M|    if (str == NULL)
  ------------------
  |  Branch (3807:9): [True: 149, False: 1.77M]
  ------------------
 3808|    149|        return(0);
 3809|       |
 3810|  1.77M|    depth += 1;
 3811|  1.77M|    if (depth > maxDepth) {
  ------------------
  |  Branch (3811:9): [True: 1, False: 1.77M]
  ------------------
 3812|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3813|      1|                       "Maximum entity nesting depth exceeded");
 3814|      1|	return(0);
 3815|      1|    }
 3816|       |
 3817|  1.77M|    if (pent != NULL) {
  ------------------
  |  Branch (3817:9): [True: 1.75M, False: 24.5k]
  ------------------
 3818|  1.75M|        if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  1.75M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3818:13): [True: 2, False: 1.75M]
  ------------------
 3819|      2|            xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3820|      2|            return(0);
 3821|      2|        }
 3822|       |
 3823|  1.75M|        if (check) {
  ------------------
  |  Branch (3823:13): [True: 1.67M, False: 78.7k]
  ------------------
 3824|  1.67M|            if (xmlParserEntityCheck(ctxt, pent->length))
  ------------------
  |  Branch (3824:17): [True: 40, False: 1.67M]
  ------------------
 3825|     40|                return(0);
 3826|  1.67M|        }
 3827|  1.75M|    }
 3828|       |
 3829|  1.77M|    chunkSize = 0;
 3830|       |
 3831|       |    /*
 3832|       |     * Note that entity values are already validated. No special
 3833|       |     * handling for multi-byte characters is needed.
 3834|       |     */
 3835|   274M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   274M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3835:12): [True: 274M, False: 249]
  ------------------
 3836|   274M|        c = *str;
 3837|       |
 3838|   274M|	if (c != '&') {
  ------------------
  |  Branch (3838:6): [True: 270M, False: 3.90M]
  ------------------
 3839|   270M|            if (c == 0)
  ------------------
  |  Branch (3839:17): [True: 1.67M, False: 269M]
  ------------------
 3840|  1.67M|                break;
 3841|       |
 3842|       |            /*
 3843|       |             * If this function is called without an entity, it is used to
 3844|       |             * expand entities in an attribute content where less-than was
 3845|       |             * already unscaped and is allowed.
 3846|       |             */
 3847|   269M|            if ((pent != NULL) && (c == '<')) {
  ------------------
  |  Branch (3847:17): [True: 265M, False: 3.93M]
  |  Branch (3847:35): [True: 96.7k, False: 265M]
  ------------------
 3848|  96.7k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3849|  96.7k|                        "'<' in entity '%s' is not allowed in attributes "
 3850|  96.7k|                        "values\n", pent->name);
 3851|  96.7k|                break;
 3852|  96.7k|            }
 3853|       |
 3854|   269M|            if (c <= 0x20) {
  ------------------
  |  Branch (3854:17): [True: 14.9M, False: 254M]
  ------------------
 3855|  14.9M|                if ((normalize) && (*inSpace)) {
  ------------------
  |  Branch (3855:21): [True: 296k, False: 14.6M]
  |  Branch (3855:36): [True: 256k, False: 40.1k]
  ------------------
 3856|       |                    /* Skip char */
 3857|   256k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3857:25): [True: 21.6k, False: 235k]
  ------------------
 3858|  21.6k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3859|  21.6k|                        chunkSize = 0;
 3860|  21.6k|                    }
 3861|   256k|                    normChange = 1;
 3862|  14.7M|                } else if (c < 0x20) {
  ------------------
  |  Branch (3862:28): [True: 4.22M, False: 10.5M]
  ------------------
 3863|  4.22M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3863:25): [True: 933k, False: 3.28M]
  ------------------
 3864|   933k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3865|   933k|                        chunkSize = 0;
 3866|   933k|                    }
 3867|       |
 3868|  4.22M|                    xmlSBufAddCString(buf, " ", 1);
 3869|  10.5M|                } else {
 3870|  10.5M|                    chunkSize += 1;
 3871|  10.5M|                }
 3872|       |
 3873|  14.9M|                *inSpace = 1;
 3874|   254M|            } else {
 3875|   254M|                chunkSize += 1;
 3876|   254M|                *inSpace = 0;
 3877|   254M|            }
 3878|       |
 3879|   269M|            str += 1;
 3880|   269M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3880:20): [True: 1.17M, False: 2.73M]
  ------------------
 3881|  1.17M|            int val;
 3882|       |
 3883|  1.17M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3883:17): [True: 1.16M, False: 3.53k]
  ------------------
 3884|  1.16M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3885|  1.16M|                chunkSize = 0;
 3886|  1.16M|            }
 3887|       |
 3888|  1.17M|	    val = xmlParseStringCharRef(ctxt, &str);
 3889|  1.17M|	    if (val == 0) {
  ------------------
  |  Branch (3889:10): [True: 4, False: 1.17M]
  ------------------
 3890|      4|                if (pent != NULL)
  ------------------
  |  Branch (3890:21): [True: 4, False: 0]
  ------------------
 3891|      4|                    pent->content[0] = 0;
 3892|      4|                break;
 3893|      4|            }
 3894|       |
 3895|  1.17M|            if (val == ' ') {
  ------------------
  |  Branch (3895:17): [True: 4.19k, False: 1.16M]
  ------------------
 3896|  4.19k|                if ((normalize) && (*inSpace))
  ------------------
  |  Branch (3896:21): [True: 1.58k, False: 2.60k]
  |  Branch (3896:36): [True: 1.02k, False: 559]
  ------------------
 3897|  1.02k|                    normChange = 1;
 3898|  3.16k|                else
 3899|  3.16k|                    xmlSBufAddCString(buf, " ", 1);
 3900|  4.19k|                *inSpace = 1;
 3901|  1.16M|            } else {
 3902|  1.16M|                xmlSBufAddChar(buf, val);
 3903|  1.16M|                *inSpace = 0;
 3904|  1.16M|            }
 3905|  2.73M|	} else {
 3906|  2.73M|            xmlChar *name;
 3907|  2.73M|            xmlEntityPtr ent;
 3908|       |
 3909|  2.73M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3909:17): [True: 1.52M, False: 1.20M]
  ------------------
 3910|  1.52M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3911|  1.52M|                chunkSize = 0;
 3912|  1.52M|            }
 3913|       |
 3914|  2.73M|	    name = xmlParseStringEntityRef(ctxt, &str);
 3915|  2.73M|            if (name == NULL) {
  ------------------
  |  Branch (3915:17): [True: 22, False: 2.73M]
  ------------------
 3916|     22|                if (pent != NULL)
  ------------------
  |  Branch (3916:21): [True: 21, False: 1]
  ------------------
 3917|     21|                    pent->content[0] = 0;
 3918|     22|                break;
 3919|     22|            }
 3920|       |
 3921|  2.73M|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3922|  2.73M|            xmlFree(name);
 3923|       |
 3924|  2.73M|	    if ((ent != NULL) &&
  ------------------
  |  Branch (3924:10): [True: 2.65M, False: 72.4k]
  ------------------
 3925|  2.65M|		(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3925:3): [True: 1.44M, False: 1.21M]
  ------------------
 3926|  1.44M|		if (ent->content == NULL) {
  ------------------
  |  Branch (3926:7): [True: 0, False: 1.44M]
  ------------------
 3927|      0|		    xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
 3928|      0|			    "predefined entity has no content\n");
 3929|      0|                    break;
 3930|      0|                }
 3931|       |
 3932|  1.44M|                xmlSBufAddString(buf, ent->content, ent->length);
 3933|       |
 3934|  1.44M|                *inSpace = 0;
 3935|  1.44M|	    } else if ((ent != NULL) && (ent->content != NULL)) {
  ------------------
  |  Branch (3935:17): [True: 1.21M, False: 72.4k]
  |  Branch (3935:34): [True: 1.21M, False: 171]
  ------------------
 3936|  1.21M|                if (pent != NULL)
  ------------------
  |  Branch (3936:21): [True: 1.18M, False: 24.1k]
  ------------------
 3937|  1.18M|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.18M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3938|  1.21M|		normChange |= xmlExpandEntityInAttValue(ctxt, buf,
 3939|  1.21M|                        ent->content, ent, normalize, inSpace, depth, check);
 3940|  1.21M|                if (pent != NULL)
  ------------------
  |  Branch (3940:21): [True: 1.18M, False: 24.1k]
  ------------------
 3941|  1.18M|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.18M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3942|  1.21M|	    }
 3943|  2.73M|        }
 3944|   274M|    }
 3945|       |
 3946|  1.77M|    if (chunkSize > 0)
  ------------------
  |  Branch (3946:9): [True: 1.14M, False: 628k]
  ------------------
 3947|  1.14M|        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3948|       |
 3949|  1.77M|    return(normChange);
 3950|  1.77M|}
parser.c:xmlParseStringEntityRef:
 7536|  2.74M|xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
 7537|  2.74M|    xmlChar *name;
 7538|  2.74M|    const xmlChar *ptr;
 7539|  2.74M|    xmlChar cur;
 7540|       |
 7541|  2.74M|    if ((str == NULL) || (*str == NULL))
  ------------------
  |  Branch (7541:9): [True: 0, False: 2.74M]
  |  Branch (7541:26): [True: 0, False: 2.74M]
  ------------------
 7542|      0|        return(NULL);
 7543|  2.74M|    ptr = *str;
 7544|  2.74M|    cur = *ptr;
 7545|  2.74M|    if (cur != '&')
  ------------------
  |  Branch (7545:9): [True: 0, False: 2.74M]
  ------------------
 7546|      0|	return(NULL);
 7547|       |
 7548|  2.74M|    ptr++;
 7549|  2.74M|    name = xmlParseStringName(ctxt, &ptr);
 7550|  2.74M|    if (name == NULL) {
  ------------------
  |  Branch (7550:9): [True: 24, False: 2.74M]
  ------------------
 7551|     24|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7552|     24|		       "xmlParseStringEntityRef: no name\n");
 7553|     24|	*str = ptr;
 7554|     24|	return(NULL);
 7555|     24|    }
 7556|  2.74M|    if (*ptr != ';') {
  ------------------
  |  Branch (7556:9): [True: 7, False: 2.74M]
  ------------------
 7557|      7|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7558|      7|        xmlFree(name);
 7559|      7|	*str = ptr;
 7560|      7|	return(NULL);
 7561|      7|    }
 7562|  2.74M|    ptr++;
 7563|       |
 7564|  2.74M|    *str = ptr;
 7565|  2.74M|    return(name);
 7566|  2.74M|}
parser.c:xmlParseAttValueInternal:
 4019|   335k|                         int special, int isNamespace) {
 4020|   335k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4020:26): [True: 187k, False: 147k]
  ------------------
 4021|   187k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   187k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4022|   335k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   483k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4023|   335k|    xmlSBuf buf;
 4024|   335k|    xmlChar *ret;
 4025|   335k|    int c, l, quote, entFlags, chunkSize;
 4026|   335k|    int inSpace = 1;
 4027|   335k|    int replaceEntities;
 4028|   335k|    int normalize = (special & XML_SPECIAL_TYPE_MASK) > XML_ATTRIBUTE_CDATA;
  ------------------
  |  |   96|   335k|#define XML_SPECIAL_TYPE_MASK   (XML_SPECIAL_EXTERNAL - 1)
  |  |  ------------------
  |  |  |  |   95|   335k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  |  |  ------------------
  ------------------
 4029|   335k|    int attvalFlags = 0;
 4030|       |
 4031|       |    /* Always expand namespace URIs */
 4032|   335k|    replaceEntities = (ctxt->replaceEntities) || (isNamespace);
  ------------------
  |  Branch (4032:23): [True: 214k, False: 120k]
  |  Branch (4032:50): [True: 17.2k, False: 103k]
  ------------------
 4033|       |
 4034|   335k|    xmlSBufInit(&buf, maxLength);
 4035|       |
 4036|   335k|    GROW;
  ------------------
  |  | 2271|   335k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   335k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   335k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 160k, False: 174k]
  |  |  ------------------
  |  | 2272|   335k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   160k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 43.1k, False: 117k]
  |  |  ------------------
  |  | 2273|   335k|	xmlParserGrow(ctxt);
  ------------------
 4037|       |
 4038|   335k|    quote = CUR;
  ------------------
  |  | 2225|   335k|#define CUR (*ctxt->input->cur)
  ------------------
 4039|   335k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (4039:9): [True: 186k, False: 148k]
  |  Branch (4039:27): [True: 9.41k, False: 177k]
  ------------------
 4040|  9.41k|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 4041|  9.41k|	return(NULL);
 4042|  9.41k|    }
 4043|   325k|    NEXTL(1);
  ------------------
  |  | 2288|   325k|#define NEXTL(l) do {							\
  |  | 2289|   325k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 325k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   325k|    } else ctxt->input->col++;						\
  |  | 2292|   325k|    ctxt->input->cur += l;				\
  |  | 2293|   325k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 325k]
  |  |  ------------------
  ------------------
 4044|       |
 4045|   325k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (4045:9): [True: 261k, False: 63.8k]
  ------------------
 4046|   261k|        entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|   261k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|   261k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4047|  63.8k|    else
 4048|  63.8k|        entFlags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|  63.8k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4049|       |
 4050|   325k|    inSpace = 1;
 4051|   325k|    chunkSize = 0;
 4052|       |
 4053|   156M|    while (1) {
  ------------------
  |  Branch (4053:12): [True: 156M, Folded]
  ------------------
 4054|   156M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   156M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 123, False: 156M]
  |  |  ------------------
  ------------------
 4055|    123|            goto error;
 4056|       |
 4057|   156M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2227|   156M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4057:13): [True: 34.9k, False: 156M]
  ------------------
 4058|  34.9k|            xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
 4059|  34.9k|                           "AttValue: ' expected\n");
 4060|  34.9k|            goto error;
 4061|  34.9k|        }
 4062|       |
 4063|       |        /*
 4064|       |         * TODO: Check growth threshold
 4065|       |         */
 4066|   156M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2227|   156M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4066:13): [True: 383k, False: 155M]
  ------------------
 4067|   383k|            GROW;
  ------------------
  |  | 2271|   383k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   383k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   383k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 335k, False: 48.2k]
  |  |  ------------------
  |  | 2272|   383k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   335k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 335k, False: 0]
  |  |  ------------------
  |  | 2273|   383k|	xmlParserGrow(ctxt);
  ------------------
 4068|       |
 4069|   156M|        c = CUR;
  ------------------
  |  | 2225|   156M|#define CUR (*ctxt->input->cur)
  ------------------
 4070|       |
 4071|   156M|        if (c >= 0x80) {
  ------------------
  |  Branch (4071:13): [True: 62.4M, False: 93.7M]
  ------------------
 4072|  62.4M|            l = xmlUTF8MultibyteLen(ctxt, CUR_PTR,
  ------------------
  |  | 2227|  62.4M|#define CUR_PTR ctxt->input->cur
  ------------------
 4073|  62.4M|                    "invalid character in attribute value\n");
 4074|  62.4M|            if (l == 0) {
  ------------------
  |  Branch (4074:17): [True: 57.3M, False: 5.03M]
  ------------------
 4075|  57.3M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4075:21): [True: 262k, False: 57.1M]
  ------------------
 4076|   262k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   262k|#define CUR_PTR ctxt->input->cur
  ------------------
 4077|   262k|                    chunkSize = 0;
 4078|   262k|                }
 4079|  57.3M|                xmlSBufAddReplChar(&buf);
 4080|  57.3M|                NEXTL(1);
  ------------------
  |  | 2288|  57.3M|#define NEXTL(l) do {							\
  |  | 2289|  57.3M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 57.3M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  57.3M|    } else ctxt->input->col++;						\
  |  | 2292|  57.3M|    ctxt->input->cur += l;				\
  |  | 2293|  57.3M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 57.3M]
  |  |  ------------------
  ------------------
 4081|  57.3M|            } else {
 4082|  5.03M|                chunkSize += l;
 4083|  5.03M|                NEXTL(l);
  ------------------
  |  | 2288|  5.03M|#define NEXTL(l) do {							\
  |  | 2289|  5.03M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 5.03M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  5.03M|    } else ctxt->input->col++;						\
  |  | 2292|  5.03M|    ctxt->input->cur += l;				\
  |  | 2293|  5.03M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 5.03M]
  |  |  ------------------
  ------------------
 4084|  5.03M|            }
 4085|       |
 4086|  62.4M|            inSpace = 0;
 4087|  93.7M|        } else if (c != '&') {
  ------------------
  |  Branch (4087:20): [True: 92.8M, False: 957k]
  ------------------
 4088|  92.8M|            if (c > 0x20) {
  ------------------
  |  Branch (4088:17): [True: 56.1M, False: 36.7M]
  ------------------
 4089|  56.1M|                if (c == quote)
  ------------------
  |  Branch (4089:21): [True: 289k, False: 55.8M]
  ------------------
 4090|   289k|                    break;
 4091|       |
 4092|  55.8M|                if (c == '<')
  ------------------
  |  Branch (4092:21): [True: 712k, False: 55.1M]
  ------------------
 4093|   712k|                    xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
 4094|       |
 4095|  55.8M|                chunkSize += 1;
 4096|  55.8M|                inSpace = 0;
 4097|  55.8M|            } else if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  36.7M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  36.7M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 6.26M, False: 30.4M]
  |  |  |  |  |  Branch (108:44): [True: 3.35M, False: 2.91M]
  |  |  |  |  ------------------
  |  |  |  |  109|  36.7M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 336k, False: 33.0M]
  |  |  |  |  ------------------
  |  |  |  |  110|  36.7M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 2.32M, False: 30.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4098|  30.6M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 4099|  30.6M|                        "invalid character in attribute value\n");
 4100|  30.6M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4100:21): [True: 78.0k, False: 30.6M]
  ------------------
 4101|  78.0k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  78.0k|#define CUR_PTR ctxt->input->cur
  ------------------
 4102|  78.0k|                    chunkSize = 0;
 4103|  78.0k|                }
 4104|  30.6M|                xmlSBufAddReplChar(&buf);
 4105|  30.6M|                inSpace = 0;
 4106|  30.6M|            } else {
 4107|       |                /* Whitespace */
 4108|  6.01M|                if ((normalize) && (inSpace)) {
  ------------------
  |  Branch (4108:21): [True: 88.2k, False: 5.92M]
  |  Branch (4108:36): [True: 51.6k, False: 36.5k]
  ------------------
 4109|       |                    /* Skip char */
 4110|  51.6k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4110:25): [True: 21.7k, False: 29.8k]
  ------------------
 4111|  21.7k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  21.7k|#define CUR_PTR ctxt->input->cur
  ------------------
 4112|  21.7k|                        chunkSize = 0;
 4113|  21.7k|                    }
 4114|  51.6k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  51.6k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4115|  5.96M|                } else if (c < 0x20) {
  ------------------
  |  Branch (4115:28): [True: 3.67M, False: 2.28M]
  ------------------
 4116|       |                    /* Convert to space */
 4117|  3.67M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4117:25): [True: 215k, False: 3.46M]
  ------------------
 4118|   215k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   215k|#define CUR_PTR ctxt->input->cur
  ------------------
 4119|   215k|                        chunkSize = 0;
 4120|   215k|                    }
 4121|       |
 4122|  3.67M|                    xmlSBufAddCString(&buf, " ", 1);
 4123|  3.67M|                } else {
 4124|  2.28M|                    chunkSize += 1;
 4125|  2.28M|                }
 4126|       |
 4127|  6.01M|                inSpace = 1;
 4128|       |
 4129|  6.01M|                if ((c == 0xD) && (NXT(1) == 0xA))
  ------------------
  |  | 2226|   336k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4129:21): [True: 336k, False: 5.68M]
  |  Branch (4129:35): [True: 72.9k, False: 263k]
  ------------------
 4130|  72.9k|                    CUR_PTR++;
  ------------------
  |  | 2227|  72.9k|#define CUR_PTR ctxt->input->cur
  ------------------
 4131|  6.01M|            }
 4132|       |
 4133|  92.5M|            NEXTL(1);
  ------------------
  |  | 2288|  92.5M|#define NEXTL(l) do {							\
  |  | 2289|  92.5M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 3.34M, False: 89.1M]
  |  |  ------------------
  |  | 2290|  3.34M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  89.1M|    } else ctxt->input->col++;						\
  |  | 2292|  92.5M|    ctxt->input->cur += l;				\
  |  | 2293|  92.5M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 92.5M]
  |  |  ------------------
  ------------------
 4134|  92.5M|        } else if (NXT(1) == '#') {
  ------------------
  |  | 2226|   957k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4134:20): [True: 44.1k, False: 913k]
  ------------------
 4135|  44.1k|            int val;
 4136|       |
 4137|  44.1k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4137:17): [True: 34.2k, False: 9.92k]
  ------------------
 4138|  34.2k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|  34.2k|#define CUR_PTR ctxt->input->cur
  ------------------
 4139|  34.2k|                chunkSize = 0;
 4140|  34.2k|            }
 4141|       |
 4142|  44.1k|            val = xmlParseCharRef(ctxt);
 4143|  44.1k|            if (val == 0)
  ------------------
  |  Branch (4143:17): [True: 1.38k, False: 42.7k]
  ------------------
 4144|  1.38k|                goto error;
 4145|       |
 4146|  42.7k|            if ((val == '&') && (!replaceEntities)) {
  ------------------
  |  Branch (4146:17): [True: 6.26k, False: 36.5k]
  |  Branch (4146:33): [True: 3.12k, False: 3.13k]
  ------------------
 4147|       |                /*
 4148|       |                 * The reparsing will be done in xmlNodeParseContent()
 4149|       |                 * called from SAX2.c
 4150|       |                 */
 4151|  3.12k|                xmlSBufAddCString(&buf, "&#38;", 5);
 4152|  3.12k|                inSpace = 0;
 4153|  39.6k|            } else if (val == ' ') {
  ------------------
  |  Branch (4153:24): [True: 1.50k, False: 38.1k]
  ------------------
 4154|  1.50k|                if ((normalize) && (inSpace))
  ------------------
  |  Branch (4154:21): [True: 438, False: 1.07k]
  |  Branch (4154:36): [True: 208, False: 230]
  ------------------
 4155|    208|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    208|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4156|  1.30k|                else
 4157|  1.30k|                    xmlSBufAddCString(&buf, " ", 1);
 4158|  1.50k|                inSpace = 1;
 4159|  38.1k|            } else {
 4160|  38.1k|                xmlSBufAddChar(&buf, val);
 4161|  38.1k|                inSpace = 0;
 4162|  38.1k|            }
 4163|   913k|        } else {
 4164|   913k|            const xmlChar *name;
 4165|   913k|            xmlEntityPtr ent;
 4166|       |
 4167|   913k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4167:17): [True: 559k, False: 353k]
  ------------------
 4168|   559k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   559k|#define CUR_PTR ctxt->input->cur
  ------------------
 4169|   559k|                chunkSize = 0;
 4170|   559k|            }
 4171|       |
 4172|   913k|            name = xmlParseEntityRefInternal(ctxt);
 4173|   913k|            if (name == NULL) {
  ------------------
  |  Branch (4173:17): [True: 108k, False: 804k]
  ------------------
 4174|       |                /*
 4175|       |                 * Probably a literal '&' which wasn't escaped.
 4176|       |                 * TODO: Handle gracefully in recovery mode.
 4177|       |                 */
 4178|   108k|                continue;
 4179|   108k|            }
 4180|       |
 4181|   804k|            ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 1);
 4182|   804k|            if (ent == NULL)
  ------------------
  |  Branch (4182:17): [True: 183k, False: 620k]
  ------------------
 4183|   183k|                continue;
 4184|       |
 4185|   620k|            if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (4185:17): [True: 17.3k, False: 603k]
  ------------------
 4186|  17.3k|                if ((ent->content[0] == '&') && (!replaceEntities))
  ------------------
  |  Branch (4186:21): [True: 2.63k, False: 14.7k]
  |  Branch (4186:49): [True: 1.82k, False: 812]
  ------------------
 4187|  1.82k|                    xmlSBufAddCString(&buf, "&#38;", 5);
 4188|  15.5k|                else
 4189|  15.5k|                    xmlSBufAddString(&buf, ent->content, ent->length);
 4190|  17.3k|                inSpace = 0;
 4191|   603k|            } else if (replaceEntities) {
  ------------------
  |  Branch (4191:24): [True: 536k, False: 66.1k]
  ------------------
 4192|   536k|                if (xmlExpandEntityInAttValue(ctxt, &buf,
  ------------------
  |  Branch (4192:21): [True: 4.93k, False: 532k]
  ------------------
 4193|   536k|                        ent->content, ent, normalize, &inSpace, ctxt->inputNr,
 4194|   536k|                        /* check */ 1) > 0)
 4195|  4.93k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  4.93k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4196|   536k|            } else {
 4197|  66.1k|                if ((ent->flags & entFlags) != entFlags)
  ------------------
  |  Branch (4197:21): [True: 853, False: 65.3k]
  ------------------
 4198|    853|                    xmlCheckEntityInAttValue(ctxt, ent, ctxt->inputNr);
 4199|       |
 4200|  66.1k|                if (xmlParserEntityCheck(ctxt, ent->expandedSize)) {
  ------------------
  |  Branch (4200:21): [True: 88, False: 66.0k]
  ------------------
 4201|     88|                    ent->content[0] = 0;
 4202|     88|                    goto error;
 4203|     88|                }
 4204|       |
 4205|       |                /*
 4206|       |                 * Just output the reference
 4207|       |                 */
 4208|  66.0k|                xmlSBufAddCString(&buf, "&", 1);
 4209|  66.0k|                xmlSBufAddString(&buf, ent->name, xmlStrlen(ent->name));
 4210|  66.0k|                xmlSBufAddCString(&buf, ";", 1);
 4211|       |
 4212|  66.0k|                inSpace = 0;
 4213|  66.0k|            }
 4214|   620k|	}
 4215|   156M|    }
 4216|       |
 4217|   289k|    if ((buf.mem == NULL) && (outFlags != NULL)) {
  ------------------
  |  Branch (4217:9): [True: 236k, False: 52.3k]
  |  Branch (4217:30): [True: 141k, False: 95.6k]
  ------------------
 4218|   141k|        ret = (xmlChar *) CUR_PTR - chunkSize;
  ------------------
  |  | 2227|   141k|#define CUR_PTR ctxt->input->cur
  ------------------
 4219|       |
 4220|   141k|        if (attlen != NULL)
  ------------------
  |  Branch (4220:13): [True: 141k, False: 0]
  ------------------
 4221|   141k|            *attlen = chunkSize;
 4222|   141k|        if ((normalize) && (inSpace) && (chunkSize > 0)) {
  ------------------
  |  Branch (4222:13): [True: 1.86k, False: 139k]
  |  Branch (4222:28): [True: 817, False: 1.04k]
  |  Branch (4222:41): [True: 528, False: 289]
  ------------------
 4223|    528|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    528|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4224|    528|            *attlen -= 1;
 4225|    528|        }
 4226|       |
 4227|       |        /* Report potential error */
 4228|   141k|        xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4229|   148k|    } else {
 4230|   148k|        if (chunkSize > 0)
  ------------------
  |  Branch (4230:13): [True: 124k, False: 23.4k]
  ------------------
 4231|   124k|            xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2227|   124k|#define CUR_PTR ctxt->input->cur
  ------------------
 4232|       |
 4233|   148k|        if ((normalize) && (inSpace) && (buf.size > 0)) {
  ------------------
  |  Branch (4233:13): [True: 1.99k, False: 146k]
  |  Branch (4233:28): [True: 412, False: 1.58k]
  |  Branch (4233:41): [True: 412, False: 0]
  ------------------
 4234|    412|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    412|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4235|    412|            buf.size--;
 4236|    412|        }
 4237|       |
 4238|   148k|        ret = xmlSBufFinish(&buf, attlen, ctxt, "AttValue length too long");
 4239|   148k|        attvalFlags |= XML_ATTVAL_ALLOC;
  ------------------
  |  |   98|   148k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 4240|       |
 4241|   148k|        if (ret != NULL) {
  ------------------
  |  Branch (4241:13): [True: 148k, False: 22]
  ------------------
 4242|   148k|            if (attlen != NULL)
  ------------------
  |  Branch (4242:17): [True: 26.7k, False: 121k]
  ------------------
 4243|  26.7k|                *attlen = buf.size;
 4244|   148k|        }
 4245|   148k|    }
 4246|       |
 4247|   289k|    if (outFlags != NULL)
  ------------------
  |  Branch (4247:9): [True: 167k, False: 121k]
  ------------------
 4248|   167k|        *outFlags = attvalFlags;
 4249|       |
 4250|   289k|    NEXTL(1);
  ------------------
  |  | 2288|   289k|#define NEXTL(l) do {							\
  |  | 2289|   289k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 289k]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   289k|    } else ctxt->input->col++;						\
  |  | 2292|   289k|    ctxt->input->cur += l;				\
  |  | 2293|   289k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 289k]
  |  |  ------------------
  ------------------
 4251|       |
 4252|   289k|    return(ret);
 4253|       |
 4254|  36.4k|error:
 4255|  36.4k|    xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4256|       |    return(NULL);
 4257|   325k|}
parser.c:xmlCheckEntityInAttValue:
 3692|  4.05k|xmlCheckEntityInAttValue(xmlParserCtxtPtr ctxt, xmlEntityPtr pent, int depth) {
 3693|  4.05k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3693:20): [True: 3.13k, False: 922]
  ------------------
 3694|  4.05k|    const xmlChar *str;
 3695|  4.05k|    unsigned long expandedSize = pent->length;
 3696|  4.05k|    int c, flags;
 3697|       |
 3698|  4.05k|    depth += 1;
 3699|  4.05k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3699:9): [True: 1, False: 4.05k]
  ------------------
 3700|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3701|      1|                       "Maximum entity nesting depth exceeded");
 3702|      1|	return;
 3703|      1|    }
 3704|       |
 3705|  4.05k|    if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  4.05k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3705:9): [True: 10, False: 4.04k]
  ------------------
 3706|     10|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3707|     10|        return;
 3708|     10|    }
 3709|       |
 3710|       |    /*
 3711|       |     * If we're parsing a default attribute value in DTD content,
 3712|       |     * the entity might reference other entities which weren't
 3713|       |     * defined yet, so the check isn't reliable.
 3714|       |     */
 3715|  4.04k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3715:9): [True: 3.85k, False: 192]
  ------------------
 3716|  3.85k|        flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|  3.85k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|  3.85k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3717|    192|    else
 3718|    192|        flags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|    192|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3719|       |
 3720|  4.04k|    str = pent->content;
 3721|  4.04k|    if (str == NULL)
  ------------------
  |  Branch (3721:9): [True: 4, False: 4.04k]
  ------------------
 3722|      4|        goto done;
 3723|       |
 3724|       |    /*
 3725|       |     * Note that entity values are already validated. We only check
 3726|       |     * for illegal less-than signs and compute the expanded size
 3727|       |     * of the entity. No special handling for multi-byte characters
 3728|       |     * is needed.
 3729|       |     */
 3730|  22.2M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  22.2M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3730:12): [True: 22.2M, False: 100]
  ------------------
 3731|  22.2M|        c = *str;
 3732|       |
 3733|  22.2M|	if (c != '&') {
  ------------------
  |  Branch (3733:6): [True: 22.2M, False: 19.9k]
  ------------------
 3734|  22.2M|            if (c == 0)
  ------------------
  |  Branch (3734:17): [True: 3.93k, False: 22.2M]
  ------------------
 3735|  3.93k|                break;
 3736|       |
 3737|  22.2M|            if (c == '<')
  ------------------
  |  Branch (3737:17): [True: 1.71k, False: 22.2M]
  ------------------
 3738|  1.71k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3739|  1.71k|                        "'<' in entity '%s' is not allowed in attributes "
 3740|  1.71k|                        "values\n", pent->name);
 3741|       |
 3742|  22.2M|            str += 1;
 3743|  22.2M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3743:20): [True: 5.57k, False: 14.3k]
  ------------------
 3744|  5.57k|            int val;
 3745|       |
 3746|  5.57k|	    val = xmlParseStringCharRef(ctxt, &str);
 3747|  5.57k|	    if (val == 0) {
  ------------------
  |  Branch (3747:10): [True: 3, False: 5.57k]
  ------------------
 3748|      3|                pent->content[0] = 0;
 3749|      3|                break;
 3750|      3|            }
 3751|  14.3k|	} else {
 3752|  14.3k|            xmlChar *name;
 3753|  14.3k|            xmlEntityPtr ent;
 3754|       |
 3755|  14.3k|	    name = xmlParseStringEntityRef(ctxt, &str);
 3756|  14.3k|	    if (name == NULL) {
  ------------------
  |  Branch (3756:10): [True: 9, False: 14.3k]
  ------------------
 3757|      9|                pent->content[0] = 0;
 3758|      9|                break;
 3759|      9|            }
 3760|       |
 3761|  14.3k|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3762|  14.3k|            xmlFree(name);
 3763|       |
 3764|  14.3k|            if ((ent != NULL) &&
  ------------------
  |  Branch (3764:17): [True: 7.39k, False: 6.93k]
  ------------------
 3765|  7.39k|                (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3765:17): [True: 6.31k, False: 1.08k]
  ------------------
 3766|  6.31k|                if ((ent->flags & flags) != flags) {
  ------------------
  |  Branch (3766:21): [True: 3.20k, False: 3.10k]
  ------------------
 3767|  3.20k|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  3.20k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3768|  3.20k|                    xmlCheckEntityInAttValue(ctxt, ent, depth);
 3769|  3.20k|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  3.20k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3770|  3.20k|                }
 3771|       |
 3772|  6.31k|                xmlSaturatedAdd(&expandedSize, ent->expandedSize);
 3773|  6.31k|                xmlSaturatedAdd(&expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  6.31k|#define XML_ENT_FIXED_COST 20
  ------------------
 3774|  6.31k|            }
 3775|  14.3k|        }
 3776|  22.2M|    }
 3777|       |
 3778|  4.04k|done:
 3779|  4.04k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3779:9): [True: 3.85k, False: 192]
  ------------------
 3780|  3.85k|        pent->expandedSize = expandedSize;
 3781|       |
 3782|  4.04k|    pent->flags |= flags;
 3783|  4.04k|}
parser.c:xmlCurrentCharRecover:
 2300|  41.9M|xmlCurrentCharRecover(xmlParserCtxtPtr ctxt, int *len) {
 2301|  41.9M|    int c = xmlCurrentChar(ctxt, len);
 2302|       |
 2303|  41.9M|    if (c == XML_INVALID_CHAR)
  ------------------
  |  |    9|  41.9M|#define XML_INVALID_CHAR 0x200000
  ------------------
  |  Branch (2303:9): [True: 6.62M, False: 35.3M]
  ------------------
 2304|  6.62M|        c = 0xFFFD; /* replacement character */
 2305|       |
 2306|  41.9M|    return(c);
 2307|  41.9M|}
parser.c:xmlParseCharDataInternal:
 4533|  6.53M|xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
 4534|  6.53M|    const xmlChar *in;
 4535|  6.53M|    int line = ctxt->input->line;
 4536|  6.53M|    int col = ctxt->input->col;
 4537|  6.53M|    int ccol;
 4538|  6.53M|    int terminate = 0;
 4539|       |
 4540|  6.53M|    GROW;
  ------------------
  |  | 2271|  6.53M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.53M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.53M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 4.07M, False: 2.46M]
  |  |  ------------------
  |  | 2272|  6.53M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.07M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 38.4k, False: 4.03M]
  |  |  ------------------
  |  | 2273|  6.53M|	xmlParserGrow(ctxt);
  ------------------
 4541|       |    /*
 4542|       |     * Accelerated common case where input don't need to be
 4543|       |     * modified before passing it to the handler.
 4544|       |     */
 4545|  6.53M|    in = ctxt->input->cur;
 4546|  6.54M|    do {
 4547|  6.67M|get_more_space:
 4548|  6.83M|        while (*in == 0x20) { in++; ctxt->input->col++; }
  ------------------
  |  Branch (4548:16): [True: 155k, False: 6.67M]
  ------------------
 4549|  6.67M|        if (*in == 0xA) {
  ------------------
  |  Branch (4549:13): [True: 132k, False: 6.54M]
  ------------------
 4550|  4.06M|            do {
 4551|  4.06M|                ctxt->input->line++; ctxt->input->col = 1;
 4552|  4.06M|                in++;
 4553|  4.06M|            } while (*in == 0xA);
  ------------------
  |  Branch (4553:22): [True: 3.92M, False: 132k]
  ------------------
 4554|   132k|            goto get_more_space;
 4555|   132k|        }
 4556|  6.54M|        if (*in == '<') {
  ------------------
  |  Branch (4556:13): [True: 104k, False: 6.44M]
  ------------------
 4557|   208k|            while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4557:20): [True: 104k, False: 104k]
  ------------------
 4558|   104k|                const xmlChar *tmp = ctxt->input->cur;
 4559|   104k|                size_t nbchar = in - tmp;
 4560|       |
 4561|   104k|                if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   104k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4561:21): [True: 0, False: 104k]
  ------------------
 4562|      0|                    nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4563|   104k|                ctxt->input->cur += nbchar;
 4564|       |
 4565|   104k|                xmlCharacters(ctxt, tmp, nbchar, 1);
 4566|   104k|            }
 4567|   104k|            return;
 4568|   104k|        }
 4569|       |
 4570|  7.09M|get_more:
 4571|  7.09M|        ccol = ctxt->input->col;
 4572|  17.1M|        while (test_char_data[*in]) {
  ------------------
  |  Branch (4572:16): [True: 10.0M, False: 7.09M]
  ------------------
 4573|  10.0M|            in++;
 4574|  10.0M|            ccol++;
 4575|  10.0M|        }
 4576|  7.09M|        ctxt->input->col = ccol;
 4577|  7.09M|        if (*in == 0xA) {
  ------------------
  |  Branch (4577:13): [True: 56.4k, False: 7.03M]
  ------------------
 4578|  3.00M|            do {
 4579|  3.00M|                ctxt->input->line++; ctxt->input->col = 1;
 4580|  3.00M|                in++;
 4581|  3.00M|            } while (*in == 0xA);
  ------------------
  |  Branch (4581:22): [True: 2.94M, False: 56.4k]
  ------------------
 4582|  56.4k|            goto get_more;
 4583|  56.4k|        }
 4584|  7.03M|        if (*in == ']') {
  ------------------
  |  Branch (4584:13): [True: 594k, False: 6.44M]
  ------------------
 4585|   594k|            size_t avail = ctxt->input->end - in;
 4586|       |
 4587|   594k|            if (partial && avail < 2) {
  ------------------
  |  Branch (4587:17): [True: 536k, False: 58.0k]
  |  Branch (4587:28): [True: 75, False: 536k]
  ------------------
 4588|     75|                terminate = 1;
 4589|     75|                goto invoke_callback;
 4590|     75|            }
 4591|   594k|            if (in[1] == ']') {
  ------------------
  |  Branch (4591:17): [True: 501k, False: 93.3k]
  ------------------
 4592|   501k|                if (partial && avail < 3) {
  ------------------
  |  Branch (4592:21): [True: 496k, False: 5.10k]
  |  Branch (4592:32): [True: 536, False: 495k]
  ------------------
 4593|    536|                    terminate = 1;
 4594|    536|                    goto invoke_callback;
 4595|    536|                }
 4596|   500k|                if (in[2] == '>')
  ------------------
  |  Branch (4596:21): [True: 2.93k, False: 498k]
  ------------------
 4597|  2.93k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4598|   500k|            }
 4599|       |
 4600|   594k|            in++;
 4601|   594k|            ctxt->input->col++;
 4602|   594k|            goto get_more;
 4603|   594k|        }
 4604|       |
 4605|  6.44M|invoke_callback:
 4606|  6.92M|        while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4606:16): [True: 484k, False: 6.44M]
  ------------------
 4607|   484k|            const xmlChar *tmp = ctxt->input->cur;
 4608|   484k|            size_t nbchar = in - tmp;
 4609|       |
 4610|   484k|            if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   484k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4610:17): [True: 0, False: 484k]
  ------------------
 4611|      0|                nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4612|   484k|            ctxt->input->cur += nbchar;
 4613|       |
 4614|   484k|            xmlCharacters(ctxt, tmp, nbchar, 0);
 4615|       |
 4616|   484k|            line = ctxt->input->line;
 4617|   484k|            col = ctxt->input->col;
 4618|   484k|        }
 4619|  6.44M|        ctxt->input->cur = in;
 4620|  6.44M|        if (*in == 0xD) {
  ------------------
  |  Branch (4620:13): [True: 21.6k, False: 6.41M]
  ------------------
 4621|  21.6k|            in++;
 4622|  21.6k|            if (*in == 0xA) {
  ------------------
  |  Branch (4622:17): [True: 8.55k, False: 13.0k]
  ------------------
 4623|  8.55k|                ctxt->input->cur = in;
 4624|  8.55k|                in++;
 4625|  8.55k|                ctxt->input->line++; ctxt->input->col = 1;
 4626|  8.55k|                continue; /* while */
 4627|  8.55k|            }
 4628|  13.0k|            in--;
 4629|  13.0k|        }
 4630|  6.43M|        if (*in == '<') {
  ------------------
  |  Branch (4630:13): [True: 335k, False: 6.09M]
  ------------------
 4631|   335k|            return;
 4632|   335k|        }
 4633|  6.09M|        if (*in == '&') {
  ------------------
  |  Branch (4633:13): [True: 35.7k, False: 6.06M]
  ------------------
 4634|  35.7k|            return;
 4635|  35.7k|        }
 4636|  6.06M|        if (terminate) {
  ------------------
  |  Branch (4636:13): [True: 611, False: 6.06M]
  ------------------
 4637|    611|            return;
 4638|    611|        }
 4639|  6.06M|        SHRINK;
  ------------------
  |  | 2267|  6.06M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  6.06M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.06M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 3.77M, False: 2.29M]
  |  |  ------------------
  |  | 2268|  6.06M|	xmlParserShrink(ctxt);
  ------------------
 4640|  6.06M|        GROW;
  ------------------
  |  | 2271|  6.06M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.06M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.06M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 3.77M, False: 2.29M]
  |  |  ------------------
  |  | 2272|  6.06M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  3.77M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 17.4k, False: 3.75M]
  |  |  ------------------
  |  | 2273|  6.06M|	xmlParserGrow(ctxt);
  ------------------
 4641|  6.06M|        in = ctxt->input->cur;
 4642|  6.06M|    } while (((*in >= 0x20) && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4642:15): [True: 117k, False: 5.95M]
  |  Branch (4642:32): [True: 1.78k, False: 115k]
  ------------------
 4643|  6.06M|             (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (4643:14): [True: 3.81k, False: 6.06M]
  |  Branch (4643:31): [True: 2.09k, False: 6.06M]
  ------------------
 4644|  6.06M|    ctxt->input->line = line;
 4645|  6.06M|    ctxt->input->col = col;
 4646|  6.06M|    xmlParseCharDataComplex(ctxt, partial);
 4647|  6.06M|}
parser.c:xmlCharacters:
 4487|   769k|              int isBlank) {
 4488|   769k|    int checkBlanks;
 4489|       |
 4490|   769k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (4490:9): [True: 0, False: 769k]
  |  Branch (4490:32): [True: 136k, False: 633k]
  ------------------
 4491|   136k|        return;
 4492|       |
 4493|   633k|    checkBlanks = (!ctxt->keepBlanks) ||
  ------------------
  |  Branch (4493:19): [True: 361k, False: 271k]
  ------------------
 4494|   271k|                  (ctxt->sax->ignorableWhitespace != ctxt->sax->characters);
  ------------------
  |  Branch (4494:19): [True: 0, False: 271k]
  ------------------
 4495|       |
 4496|       |    /*
 4497|       |     * Calling areBlanks with only parts of a text node
 4498|       |     * is fundamentally broken, making the NOBLANKS option
 4499|       |     * essentially unusable.
 4500|       |     */
 4501|   633k|    if ((checkBlanks) &&
  ------------------
  |  Branch (4501:9): [True: 361k, False: 271k]
  ------------------
 4502|   361k|        (areBlanks(ctxt, buf, size, isBlank))) {
  ------------------
  |  Branch (4502:9): [True: 13.9k, False: 347k]
  ------------------
 4503|  13.9k|        if ((ctxt->sax->ignorableWhitespace != NULL) &&
  ------------------
  |  Branch (4503:13): [True: 13.9k, False: 0]
  ------------------
 4504|  13.9k|            (ctxt->keepBlanks))
  ------------------
  |  Branch (4504:13): [True: 0, False: 13.9k]
  ------------------
 4505|      0|            ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
 4506|   619k|    } else {
 4507|   619k|        if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (4507:13): [True: 619k, False: 0]
  ------------------
 4508|   619k|            ctxt->sax->characters(ctxt->userData, buf, size);
 4509|       |
 4510|       |        /*
 4511|       |         * The old code used to update this value for "complex" data
 4512|       |         * even if checkBlanks was false. This was probably a bug.
 4513|       |         */
 4514|   619k|        if ((checkBlanks) && (*ctxt->space == -1))
  ------------------
  |  Branch (4514:13): [True: 347k, False: 271k]
  |  Branch (4514:30): [True: 121k, False: 225k]
  ------------------
 4515|   121k|            *ctxt->space = -2;
 4516|   619k|    }
 4517|   633k|}
parser.c:areBlanks:
 2815|   361k|                     int blank_chars) {
 2816|   361k|    int i;
 2817|   361k|    xmlNodePtr lastChild;
 2818|       |
 2819|       |    /*
 2820|       |     * Check for xml:space value.
 2821|       |     */
 2822|   361k|    if ((ctxt->space == NULL) || (*(ctxt->space) == 1) ||
  ------------------
  |  Branch (2822:9): [True: 0, False: 361k]
  |  Branch (2822:34): [True: 735, False: 360k]
  ------------------
 2823|   360k|        (*(ctxt->space) == -2))
  ------------------
  |  Branch (2823:9): [True: 224k, False: 136k]
  ------------------
 2824|   224k|	return(0);
 2825|       |
 2826|       |    /*
 2827|       |     * Check that the string is made of blanks
 2828|       |     */
 2829|   136k|    if (blank_chars == 0) {
  ------------------
  |  Branch (2829:9): [True: 125k, False: 11.5k]
  ------------------
 2830|   196k|	for (i = 0;i < len;i++)
  ------------------
  |  Branch (2830:13): [True: 190k, False: 5.55k]
  ------------------
 2831|   190k|	    if (!(IS_BLANK_CH(str[i]))) return(0);
  ------------------
  |  |  137|   190k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   190k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 13.9k, False: 176k]
  |  |  |  |  ------------------
  |  |  |  |   91|   190k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 176k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 56.9k, False: 119k]
  |  |  |  |  ------------------
  |  |  |  |   92|   190k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 119k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2832|   125k|    }
 2833|       |
 2834|       |    /*
 2835|       |     * Look if the element is mixed content in the DTD if available
 2836|       |     */
 2837|  17.0k|    if (ctxt->node == NULL) return(0);
  ------------------
  |  Branch (2837:9): [True: 0, False: 17.0k]
  ------------------
 2838|  17.0k|    if (ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2838:9): [True: 17.0k, False: 0]
  ------------------
 2839|  17.0k|        xmlElementPtr elemDecl = NULL;
 2840|  17.0k|        xmlDocPtr doc = ctxt->myDoc;
 2841|  17.0k|        const xmlChar *prefix = NULL;
 2842|       |
 2843|  17.0k|        if (ctxt->node->ns)
  ------------------
  |  Branch (2843:13): [True: 2.63k, False: 14.4k]
  ------------------
 2844|  2.63k|            prefix = ctxt->node->ns->prefix;
 2845|  17.0k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (2845:13): [True: 11.0k, False: 6.02k]
  ------------------
 2846|  11.0k|            elemDecl = xmlHashLookup2(doc->intSubset->elements, ctxt->node->name,
 2847|  11.0k|                                      prefix);
 2848|  17.0k|        if ((elemDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2848:13): [True: 13.8k, False: 3.21k]
  |  Branch (2848:35): [True: 392, False: 13.4k]
  ------------------
 2849|    392|            elemDecl = xmlHashLookup2(doc->extSubset->elements, ctxt->node->name,
 2850|    392|                                      prefix);
 2851|  17.0k|        if (elemDecl != NULL) {
  ------------------
  |  Branch (2851:13): [True: 3.28k, False: 13.8k]
  ------------------
 2852|  3.28k|            if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (2852:17): [True: 1.84k, False: 1.43k]
  ------------------
 2853|  1.84k|                return(1);
 2854|  1.43k|            if ((elemDecl->etype == XML_ELEMENT_TYPE_ANY) ||
  ------------------
  |  Branch (2854:17): [True: 294, False: 1.14k]
  ------------------
 2855|  1.14k|                (elemDecl->etype == XML_ELEMENT_TYPE_MIXED))
  ------------------
  |  Branch (2855:17): [True: 378, False: 766]
  ------------------
 2856|    672|                return(0);
 2857|  1.43k|        }
 2858|  17.0k|    }
 2859|       |
 2860|       |    /*
 2861|       |     * Otherwise, heuristic :-\
 2862|       |     *
 2863|       |     * When push parsing, we could be at the end of a chunk.
 2864|       |     * This makes the look-ahead and consequently the NOBLANKS
 2865|       |     * option unreliable.
 2866|       |     */
 2867|  14.5k|    if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2224|  14.5k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2224|  3.99k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2867:9): [True: 3.99k, False: 10.5k]
  |  Branch (2867:25): [True: 1.47k, False: 2.51k]
  ------------------
 2868|  13.0k|    if ((ctxt->node->children == NULL) &&
  ------------------
  |  Branch (2868:9): [True: 10.7k, False: 2.39k]
  ------------------
 2869|  10.7k|	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2224|  10.7k|#define RAW (*ctxt->input->cur)
  ------------------
              	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2226|  8.37k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2869:2): [True: 8.37k, False: 2.33k]
  |  Branch (2869:18): [True: 414, False: 7.96k]
  ------------------
 2870|       |
 2871|  12.6k|    lastChild = xmlGetLastChild(ctxt->node);
 2872|  12.6k|    if (lastChild == NULL) {
  ------------------
  |  Branch (2872:9): [True: 10.2k, False: 2.39k]
  ------------------
 2873|  10.2k|        if ((ctxt->node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (2873:13): [True: 0, False: 10.2k]
  ------------------
 2874|      0|            (ctxt->node->content != NULL)) return(0);
  ------------------
  |  Branch (2874:13): [True: 0, False: 0]
  ------------------
 2875|  10.2k|    } else if (xmlNodeIsText(lastChild))
  ------------------
  |  Branch (2875:16): [True: 359, False: 2.03k]
  ------------------
 2876|    359|        return(0);
 2877|  2.03k|    else if ((ctxt->node->children != NULL) &&
  ------------------
  |  Branch (2877:14): [True: 2.03k, False: 0]
  ------------------
 2878|  2.03k|             (xmlNodeIsText(ctxt->node->children)))
  ------------------
  |  Branch (2878:14): [True: 220, False: 1.81k]
  ------------------
 2879|    220|        return(0);
 2880|  12.1k|    return(1);
 2881|  12.6k|}
parser.c:xmlParseCharDataComplex:
 4660|  6.06M|xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
 4661|  6.06M|    xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
 4662|  6.06M|    int nbchar = 0;
 4663|  6.06M|    int cur, l;
 4664|       |
 4665|  6.06M|    cur = xmlCurrentCharRecover(ctxt, &l);
 4666|  17.9M|    while ((cur != '<') && /* checked */
  ------------------
  |  Branch (4666:12): [True: 17.8M, False: 59.6k]
  ------------------
 4667|  17.8M|           (cur != '&') &&
  ------------------
  |  Branch (4667:12): [True: 17.8M, False: 6.20k]
  ------------------
 4668|  17.8M|	   (IS_CHAR(cur))) {
  ------------------
  |  |  115|  17.8M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  17.8M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 14.0M, False: 3.83M]
  |  |  |  |  ------------------
  |  |  |  |  118|  17.8M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  14.0M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 8.18M, False: 5.84M]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.52M, False: 5.66M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  14.0M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 11.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  14.0M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 5.51M, False: 5.98M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  17.8M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.83M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.75M, False: 2.07M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.83M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2.07M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 2.06M, False: 12.7k]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.83M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 6.70k, False: 6.04k]
  |  |  |  |  |  Branch (121:27): [True: 6.70k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4668:5): [True: 11.8M, False: 5.99M]
  ------------------
 4669|  11.8M|        if (cur == ']') {
  ------------------
  |  Branch (4669:13): [True: 1.34M, False: 10.5M]
  ------------------
 4670|  1.34M|            size_t avail = ctxt->input->end - ctxt->input->cur;
 4671|       |
 4672|  1.34M|            if (partial && avail < 2)
  ------------------
  |  Branch (4672:17): [True: 1.33M, False: 9.29k]
  |  Branch (4672:28): [True: 75, False: 1.33M]
  ------------------
 4673|     75|                break;
 4674|  1.34M|            if (NXT(1) == ']') {
  ------------------
  |  | 2226|  1.34M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4674:17): [True: 1.32M, False: 27.7k]
  ------------------
 4675|  1.32M|                if (partial && avail < 3)
  ------------------
  |  Branch (4675:21): [True: 1.31M, False: 4.60k]
  |  Branch (4675:32): [True: 3.00k, False: 1.31M]
  ------------------
 4676|  3.00k|                    break;
 4677|  1.31M|                if (NXT(2) == '>')
  ------------------
  |  | 2226|  1.31M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4677:21): [True: 1.05k, False: 1.31M]
  ------------------
 4678|  1.05k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4679|  1.31M|            }
 4680|  1.34M|        }
 4681|       |
 4682|  11.8M|	COPY_BUF(buf, nbchar, cur);
  ------------------
  |  | 2296|  11.8M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 6.62M, False: 5.24M]
  |  |  ------------------
  |  | 2297|  11.8M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4683|       |	/* move current position before possible calling of ctxt->sax->characters */
 4684|  11.8M|	NEXTL(l);
  ------------------
  |  | 2288|  11.8M|#define NEXTL(l) do {							\
  |  | 2289|  11.8M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 2.45M, False: 9.41M]
  |  |  ------------------
  |  | 2290|  2.45M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  9.41M|    } else ctxt->input->col++;						\
  |  | 2292|  11.8M|    ctxt->input->cur += l;				\
  |  | 2293|  11.8M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 11.8M]
  |  |  ------------------
  ------------------
 4685|  11.8M|	if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  11.8M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (4685:6): [True: 58.2k, False: 11.8M]
  ------------------
 4686|  58.2k|	    buf[nbchar] = 0;
 4687|       |
 4688|  58.2k|            xmlCharacters(ctxt, buf, nbchar, 0);
 4689|  58.2k|	    nbchar = 0;
 4690|  58.2k|            SHRINK;
  ------------------
  |  | 2267|  58.2k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  58.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  58.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 42.0k, False: 16.1k]
  |  |  ------------------
  |  | 2268|  58.2k|	xmlParserShrink(ctxt);
  ------------------
 4691|  58.2k|	}
 4692|  11.8M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4693|  11.8M|    }
 4694|  6.06M|    if (nbchar != 0) {
  ------------------
  |  Branch (4694:9): [True: 122k, False: 5.93M]
  ------------------
 4695|   122k|        buf[nbchar] = 0;
 4696|       |
 4697|   122k|        xmlCharacters(ctxt, buf, nbchar, 0);
 4698|   122k|    }
 4699|       |    /*
 4700|       |     * cur == 0 can mean
 4701|       |     *
 4702|       |     * - End of buffer.
 4703|       |     * - An actual 0 character.
 4704|       |     * - An incomplete UTF-8 sequence. This is allowed if partial is set.
 4705|       |     */
 4706|  6.06M|    if (ctxt->input->cur < ctxt->input->end) {
  ------------------
  |  Branch (4706:9): [True: 6.05M, False: 4.15k]
  ------------------
 4707|  6.05M|        if ((cur == 0) && (CUR != 0)) {
  ------------------
  |  | 2225|  5.61M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4707:13): [True: 5.61M, False: 437k]
  |  Branch (4707:27): [True: 647, False: 5.61M]
  ------------------
 4708|    647|            if (partial == 0) {
  ------------------
  |  Branch (4708:17): [True: 368, False: 279]
  ------------------
 4709|    368|                xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4710|    368|                        "Incomplete UTF-8 sequence starting with %02X\n", CUR);
  ------------------
  |  | 2225|    368|#define CUR (*ctxt->input->cur)
  ------------------
 4711|    368|                NEXTL(1);
  ------------------
  |  | 2288|    368|#define NEXTL(l) do {							\
  |  | 2289|    368|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 368]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|    368|    } else ctxt->input->col++;						\
  |  | 2292|    368|    ctxt->input->cur += l;				\
  |  | 2293|    368|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 368]
  |  |  ------------------
  ------------------
 4712|    368|            }
 4713|  6.05M|        } else if ((cur != '<') && (cur != '&') && (cur != ']')) {
  ------------------
  |  Branch (4713:20): [True: 5.99M, False: 59.6k]
  |  Branch (4713:36): [True: 5.99M, False: 6.20k]
  |  Branch (4713:52): [True: 5.98M, False: 3.07k]
  ------------------
 4714|       |            /* Generate the error and skip the offending character */
 4715|  5.98M|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4716|  5.98M|                              "PCDATA invalid Char value %d\n", cur);
 4717|  5.98M|            NEXTL(l);
  ------------------
  |  | 2288|  5.98M|#define NEXTL(l) do {							\
  |  | 2289|  5.98M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 5.98M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  5.98M|    } else ctxt->input->col++;						\
  |  | 2292|  5.98M|    ctxt->input->cur += l;				\
  |  | 2293|  5.98M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 5.98M]
  |  |  ------------------
  ------------------
 4718|  5.98M|        }
 4719|  6.05M|    }
 4720|  6.06M|}
parser.c:xmlFatalErrMsgStr:
  348|   528k|{
  349|   528k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  350|   528k|               val, NULL, NULL, 0, msg, val);
  351|   528k|}
parser.c:xmlParseCommentComplex:
 4819|   151k|                       size_t len, size_t size) {
 4820|   151k|    int q, ql;
 4821|   151k|    int r, rl;
 4822|   151k|    int cur, l;
 4823|   151k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4823:21): [True: 57.4k, False: 94.4k]
  ------------------
 4824|  57.4k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  57.4k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4825|   151k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  94.4k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4826|       |
 4827|   151k|    if (buf == NULL) {
  ------------------
  |  Branch (4827:9): [True: 28.3k, False: 123k]
  ------------------
 4828|  28.3k|        len = 0;
 4829|  28.3k|	size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  28.3k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4830|  28.3k|	buf = xmlMalloc(size);
 4831|  28.3k|	if (buf == NULL) {
  ------------------
  |  Branch (4831:6): [True: 1, False: 28.3k]
  ------------------
 4832|      1|	    xmlErrMemory(ctxt);
 4833|      1|	    return;
 4834|      1|	}
 4835|  28.3k|    }
 4836|   151k|    q = xmlCurrentCharRecover(ctxt, &ql);
 4837|   151k|    if (q == 0)
  ------------------
  |  Branch (4837:9): [True: 1.01k, False: 150k]
  ------------------
 4838|  1.01k|        goto not_terminated;
 4839|   150k|    if (!IS_CHAR(q)) {
  ------------------
  |  |  115|   150k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   150k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 91.6k, False: 59.2k]
  |  |  |  |  ------------------
  |  |  |  |  118|   150k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  91.6k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 91.3k, False: 319]
  |  |  |  |  |  |  |  Branch (108:44): [True: 88.2k, False: 3.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  91.6k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 3.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  91.6k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 2.84k, False: 558]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   150k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 59.2k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.56k, False: 56.6k]
  |  |  |  |  ------------------
  |  |  |  |  120|  59.2k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 56.6k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 56.1k, False: 474]
  |  |  |  |  ------------------
  |  |  |  |  121|  59.2k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 268, False: 206]
  |  |  |  |  |  Branch (121:27): [True: 268, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4839:9): [True: 764, False: 150k]
  ------------------
 4840|    764|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4841|    764|                          "xmlParseComment: invalid xmlChar value %d\n",
 4842|    764|	                  q);
 4843|    764|	xmlFree (buf);
 4844|    764|	return;
 4845|    764|    }
 4846|   150k|    NEXTL(ql);
  ------------------
  |  | 2288|   150k|#define NEXTL(l) do {							\
  |  | 2289|   150k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 266, False: 149k]
  |  |  ------------------
  |  | 2290|    266|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   149k|    } else ctxt->input->col++;						\
  |  | 2292|   150k|    ctxt->input->cur += l;				\
  |  | 2293|   150k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 150k]
  |  |  ------------------
  ------------------
 4847|   150k|    r = xmlCurrentCharRecover(ctxt, &rl);
 4848|   150k|    if (r == 0)
  ------------------
  |  Branch (4848:9): [True: 485, False: 149k]
  ------------------
 4849|    485|        goto not_terminated;
 4850|   149k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|   149k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   149k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 108k, False: 41.0k]
  |  |  |  |  ------------------
  |  |  |  |  118|   149k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   108k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 108k, False: 474]
  |  |  |  |  |  |  |  Branch (108:44): [True: 94.7k, False: 13.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   108k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 13.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   108k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 13.3k, False: 526]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   149k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 41.0k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.59k, False: 39.4k]
  |  |  |  |  ------------------
  |  |  |  |  120|  41.0k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 39.4k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 38.7k, False: 691]
  |  |  |  |  ------------------
  |  |  |  |  121|  41.0k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 396, False: 295]
  |  |  |  |  |  Branch (121:27): [True: 396, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4850:9): [True: 821, False: 148k]
  ------------------
 4851|    821|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4852|    821|                          "xmlParseComment: invalid xmlChar value %d\n",
 4853|    821|	                  r);
 4854|    821|	xmlFree (buf);
 4855|    821|	return;
 4856|    821|    }
 4857|   148k|    NEXTL(rl);
  ------------------
  |  | 2288|   148k|#define NEXTL(l) do {							\
  |  | 2289|   148k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 14.4k, False: 134k]
  |  |  ------------------
  |  | 2290|  14.4k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|   134k|    } else ctxt->input->col++;						\
  |  | 2292|   148k|    ctxt->input->cur += l;				\
  |  | 2293|   148k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 4858|   148k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4859|   148k|    if (cur == 0)
  ------------------
  |  Branch (4859:9): [True: 885, False: 147k]
  ------------------
 4860|    885|        goto not_terminated;
 4861|  13.3M|    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  13.3M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  26.6M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 13.3M, False: 5.78k]
  |  |  |  |  |  Branch (117:25): [True: 10.9M, False: 2.33M]
  |  |  |  |  ------------------
  |  |  |  |  118|  26.6M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  10.9M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 10.9M, False: 5.38k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 1.91M, False: 9.07M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  10.9M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 9.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  10.9M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 9.07M, False: 5.46k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  26.6M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.33M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 74.5k, False: 2.26M]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.33M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2.26M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 2.26M, False: 625]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.33M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 305, False: 320]
  |  |  |  |  |  Branch (121:27): [True: 305, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4862|  13.3M|           ((cur != '>') ||
  ------------------
  |  Branch (4862:13): [True: 12.8M, False: 482k]
  ------------------
 4863|  13.1M|	    (r != '-') || (q != '-'))) {
  ------------------
  |  Branch (4863:6): [True: 331k, False: 151k]
  |  Branch (4863:20): [True: 9.42k, False: 142k]
  ------------------
 4864|  13.1M|	if ((r == '-') && (q == '-')) {
  ------------------
  |  Branch (4864:6): [True: 908k, False: 12.2M]
  |  Branch (4864:20): [True: 493k, False: 415k]
  ------------------
 4865|   493k|	    xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL);
 4866|   493k|	}
 4867|  13.1M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4867:6): [True: 66.9k, False: 13.1M]
  ------------------
 4868|  66.9k|	    xmlChar *tmp;
 4869|  66.9k|            int newSize;
 4870|       |
 4871|  66.9k|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4872|  66.9k|            if (newSize < 0) {
  ------------------
  |  Branch (4872:17): [True: 0, False: 66.9k]
  ------------------
 4873|      0|                xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4874|      0|                             "Comment too big found", NULL);
 4875|      0|                xmlFree (buf);
 4876|      0|                return;
 4877|      0|            }
 4878|  66.9k|	    tmp = xmlRealloc(buf, newSize);
 4879|  66.9k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4879:10): [True: 6, False: 66.9k]
  ------------------
 4880|      6|		xmlErrMemory(ctxt);
 4881|      6|		xmlFree(buf);
 4882|      6|		return;
 4883|      6|	    }
 4884|  66.9k|	    buf = tmp;
 4885|  66.9k|            size = newSize;
 4886|  66.9k|	}
 4887|  13.1M|	COPY_BUF(buf, len, q);
  ------------------
  |  | 2296|  13.1M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2296:9): [True: 10.4M, False: 2.70M]
  |  |  ------------------
  |  | 2297|  13.1M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4888|       |
 4889|  13.1M|	q = r;
 4890|  13.1M|	ql = rl;
 4891|  13.1M|	r = cur;
 4892|  13.1M|	rl = l;
 4893|       |
 4894|  13.1M|	NEXTL(l);
  ------------------
  |  | 2288|  13.1M|#define NEXTL(l) do {							\
  |  | 2289|  13.1M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 1.21M, False: 11.9M]
  |  |  ------------------
  |  | 2290|  1.21M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  11.9M|    } else ctxt->input->col++;						\
  |  | 2292|  13.1M|    ctxt->input->cur += l;				\
  |  | 2293|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 4895|  13.1M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4896|       |
 4897|  13.1M|    }
 4898|   147k|    buf[len] = 0;
 4899|   147k|    if (cur == 0) {
  ------------------
  |  Branch (4899:9): [True: 4.98k, False: 142k]
  ------------------
 4900|  4.98k|	xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4901|  4.98k|	                     "Comment not terminated \n<!--%.50s\n", buf);
 4902|   142k|    } else if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|   142k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   142k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 142k, False: 320]
  |  |  |  |  ------------------
  |  |  |  |  118|   142k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   142k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 142k, False: 398]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 142k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   142k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 142k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   142k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 142k, False: 475]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   142k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 320, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 320]
  |  |  |  |  ------------------
  |  |  |  |  120|    320|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 320, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 320]
  |  |  |  |  ------------------
  |  |  |  |  121|    320|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 320]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4902:16): [True: 795, False: 142k]
  ------------------
 4903|    795|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4904|    795|                          "xmlParseComment: invalid xmlChar value %d\n",
 4905|    795|	                  cur);
 4906|   142k|    } else {
 4907|   142k|        NEXT;
  ------------------
  |  | 2279|   142k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4908|   142k|	if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (4908:6): [True: 142k, False: 0]
  |  Branch (4908:29): [True: 142k, False: 0]
  ------------------
 4909|   142k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (4909:6): [True: 134k, False: 7.97k]
  ------------------
 4910|   134k|	    ctxt->sax->comment(ctxt->userData, buf);
 4911|   142k|    }
 4912|   147k|    xmlFree(buf);
 4913|   147k|    return;
 4914|  2.38k|not_terminated:
 4915|  2.38k|    xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4916|       |			 "Comment not terminated\n", NULL);
 4917|  2.38k|    xmlFree(buf);
 4918|  2.38k|}
parser.c:xmlNsErr:
  384|   157k|{
  385|   157k|    ctxt->nsWellFormed = 0;
  386|       |
  387|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  388|   157k|               info1, info2, info3, 0, msg, info1, info2, info3);
  389|   157k|}
parser.c:xmlSkipBlankCharsPE:
 2400|  1.05M|xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) {
 2401|  1.05M|    int res = 0;
 2402|  1.05M|    int inParam;
 2403|  1.05M|    int expandParam;
 2404|       |
 2405|  1.05M|    inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  1.05M|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 881k, False: 174k]
  |  |  ------------------
  |  |   51|  1.05M|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 155k, False: 726k]
  |  |  ------------------
  |  |   52|   881k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 726k, False: 0]
  |  |  ------------------
  ------------------
 2406|  1.05M|    expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  1.05M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 151k, False: 903k]
  |  |  ------------------
  |  |   56|  1.05M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 756k, False: 147k]
  |  |  ------------------
  |  |   57|   903k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 724k, False: 31.8k]
  |  |  ------------------
  ------------------
 2407|       |
 2408|  1.05M|    if (!inParam && !expandParam)
  ------------------
  |  Branch (2408:9): [True: 174k, False: 881k]
  |  Branch (2408:21): [True: 147k, False: 26.5k]
  ------------------
 2409|   147k|        return(xmlSkipBlankChars(ctxt));
 2410|       |
 2411|       |    /*
 2412|       |     * It's Okay to use CUR/NEXT here since all the blanks are on
 2413|       |     * the ASCII range.
 2414|       |     */
 2415|  2.14M|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  2.14M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2415:12): [True: 2.14M, False: 381]
  ------------------
 2416|  2.14M|        if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */
  ------------------
  |  |  137|  2.14M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.14M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 657k, False: 1.48M]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.14M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.42M, False: 54.7k]
  |  |  |  |  |  Branch (91:23): [True: 524k, False: 902k]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.14M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 29.6k, False: 927k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2417|  1.21M|            NEXT;
  ------------------
  |  | 2279|  1.21M|#define NEXT xmlNextChar(ctxt)
  ------------------
 2418|  1.21M|        } else if (CUR == '%') {
  ------------------
  |  | 2225|   927k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2418:20): [True: 76.3k, False: 851k]
  ------------------
 2419|  76.3k|            if ((expandParam == 0) ||
  ------------------
  |  Branch (2419:17): [True: 78, False: 76.2k]
  ------------------
 2420|  76.2k|                (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  |  137|  76.2k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  76.2k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 58.5k, False: 17.7k]
  |  |  |  |  ------------------
  |  |  |  |   91|  76.2k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 15.4k, False: 2.25k]
  |  |  |  |  |  Branch (91:23): [True: 717, False: 14.7k]
  |  |  |  |  ------------------
  |  |  |  |   92|  76.2k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 206, False: 16.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  | 2226|  16.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2420:42): [True: 2.25k, False: 14.5k]
  ------------------
 2421|  61.8k|                break;
 2422|       |
 2423|       |            /*
 2424|       |             * Expand parameter entity. We continue to consume
 2425|       |             * whitespace at the start of the entity and possible
 2426|       |             * even consume the whole entity and pop it. We might
 2427|       |             * even pop multiple PEs in this loop.
 2428|       |             */
 2429|  14.5k|            xmlParsePERefInternal(ctxt, 0);
 2430|       |
 2431|  14.5k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  14.5k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 13.8k, False: 727]
  |  |  ------------------
  |  |   51|  14.5k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 3.54k, False: 10.2k]
  |  |  ------------------
  |  |   52|  13.8k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 2432|  14.5k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  14.5k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 3.11k, False: 11.4k]
  |  |  ------------------
  |  |   56|  14.5k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |   57|  11.4k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 9.15k, False: 2.26k]
  |  |  ------------------
  ------------------
 2433|   851k|        } else if (CUR == 0) {
  ------------------
  |  | 2225|   851k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2433:20): [True: 54.7k, False: 796k]
  ------------------
 2434|  54.7k|            if (inParam == 0)
  ------------------
  |  Branch (2434:17): [True: 116, False: 54.6k]
  ------------------
 2435|    116|                break;
 2436|       |
 2437|       |            /*
 2438|       |             * Don't pop parameter entities that start a markup
 2439|       |             * declaration to detect Well-formedness constraint:
 2440|       |             * PE Between Declarations.
 2441|       |             */
 2442|  54.6k|            if (ctxt->input->flags & XML_INPUT_MARKUP_DECL)
  ------------------
  |  |   42|  54.6k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
  |  Branch (2442:17): [True: 49.1k, False: 5.49k]
  ------------------
 2443|  49.1k|                break;
 2444|       |
 2445|  5.49k|            xmlPopPE(ctxt);
 2446|       |
 2447|  5.49k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  5.49k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 4.19k, False: 1.30k]
  |  |  ------------------
  |  |   51|  5.49k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 6, False: 4.18k]
  |  |  ------------------
  |  |   52|  4.19k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 4.18k, False: 0]
  |  |  ------------------
  ------------------
 2448|  5.49k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  5.49k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 1.64k, False: 3.85k]
  |  |  ------------------
  |  |   56|  5.49k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 3.85k, False: 1]
  |  |  ------------------
  |  |   57|  3.85k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 3.85k, False: 0]
  |  |  ------------------
  ------------------
 2449|   796k|        } else {
 2450|   796k|            break;
 2451|   796k|        }
 2452|       |
 2453|       |        /*
 2454|       |         * Also increase the counter when entering or exiting a PERef.
 2455|       |         * The spec says: "When a parameter-entity reference is recognized
 2456|       |         * in the DTD and included, its replacement text MUST be enlarged
 2457|       |         * by the attachment of one leading and one following space (#x20)
 2458|       |         * character."
 2459|       |         */
 2460|  1.23M|        if (res < INT_MAX)
  ------------------
  |  Branch (2460:13): [True: 1.23M, False: 0]
  ------------------
 2461|  1.23M|            res++;
 2462|  1.23M|    }
 2463|       |
 2464|   908k|    return(res);
 2465|  1.05M|}
parser.c:xmlValidityError:
  294|   219k|{
  295|   219k|    ctxt->valid = 0;
  296|       |
  297|   219k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
  298|       |               str1, str2, NULL, 0, msg, str1, str2);
  299|   219k|}
parser.c:xmlAttrNormalizeSpace:
  988|  26.4k|{
  989|  26.4k|    if ((src == NULL) || (dst == NULL))
  ------------------
  |  Branch (989:9): [True: 0, False: 26.4k]
  |  Branch (989:26): [True: 0, False: 26.4k]
  ------------------
  990|      0|        return(NULL);
  991|       |
  992|  38.6k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (992:12): [True: 12.1k, False: 26.4k]
  ------------------
  993|  2.85M|    while (*src != 0) {
  ------------------
  |  Branch (993:12): [True: 2.83M, False: 26.4k]
  ------------------
  994|  2.83M|	if (*src == 0x20) {
  ------------------
  |  Branch (994:6): [True: 30.7k, False: 2.80M]
  ------------------
  995|   280k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (995:13): [True: 250k, False: 30.7k]
  ------------------
  996|  30.7k|	    if (*src != 0)
  ------------------
  |  Branch (996:10): [True: 29.7k, False: 984]
  ------------------
  997|  29.7k|		*dst++ = 0x20;
  998|  2.80M|	} else {
  999|  2.80M|	    *dst++ = *src++;
 1000|  2.80M|	}
 1001|  2.83M|    }
 1002|  26.4k|    *dst = 0;
 1003|  26.4k|    if (dst == src)
  ------------------
  |  Branch (1003:9): [True: 20.5k, False: 5.89k]
  ------------------
 1004|  20.5k|       return(NULL);
 1005|  5.89k|    return(dst);
 1006|  26.4k|}
parser.c:xmlAddDefAttrs:
 1020|  21.3k|               const xmlChar *value) {
 1021|  21.3k|    xmlDefAttrsPtr defaults;
 1022|  21.3k|    xmlDefAttr *attr;
 1023|  21.3k|    int len, expandedSize;
 1024|  21.3k|    xmlHashedString name;
 1025|  21.3k|    xmlHashedString prefix;
 1026|  21.3k|    xmlHashedString hvalue;
 1027|  21.3k|    const xmlChar *localname;
 1028|       |
 1029|       |    /*
 1030|       |     * Allows to detect attribute redefinitions
 1031|       |     */
 1032|  21.3k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (1032:9): [True: 19.0k, False: 2.37k]
  ------------------
 1033|  19.0k|        if (xmlHashLookup2(ctxt->attsSpecial, fullname, fullattr) != NULL)
  ------------------
  |  Branch (1033:13): [True: 12.4k, False: 6.53k]
  ------------------
 1034|  12.4k|	    return;
 1035|  19.0k|    }
 1036|       |
 1037|  8.90k|    if (ctxt->attsDefault == NULL) {
  ------------------
  |  Branch (1037:9): [True: 2.47k, False: 6.43k]
  ------------------
 1038|  2.47k|        ctxt->attsDefault = xmlHashCreateDict(10, ctxt->dict);
 1039|  2.47k|	if (ctxt->attsDefault == NULL)
  ------------------
  |  Branch (1039:6): [True: 2, False: 2.46k]
  ------------------
 1040|      2|	    goto mem_error;
 1041|  2.47k|    }
 1042|       |
 1043|       |    /*
 1044|       |     * split the element name into prefix:localname , the string found
 1045|       |     * are within the DTD and then not associated to namespace names.
 1046|       |     */
 1047|  8.90k|    localname = xmlSplitQName3(fullname, &len);
 1048|  8.90k|    if (localname == NULL) {
  ------------------
  |  Branch (1048:9): [True: 8.46k, False: 438]
  ------------------
 1049|  8.46k|        name = xmlDictLookupHashed(ctxt->dict, fullname, -1);
 1050|  8.46k|	prefix.name = NULL;
 1051|  8.46k|    } else {
 1052|    438|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1053|    438|	prefix = xmlDictLookupHashed(ctxt->dict, fullname, len);
 1054|    438|        if (prefix.name == NULL)
  ------------------
  |  Branch (1054:13): [True: 1, False: 437]
  ------------------
 1055|      1|            goto mem_error;
 1056|    438|    }
 1057|  8.90k|    if (name.name == NULL)
  ------------------
  |  Branch (1057:9): [True: 1, False: 8.90k]
  ------------------
 1058|      1|        goto mem_error;
 1059|       |
 1060|       |    /*
 1061|       |     * make sure there is some storage
 1062|       |     */
 1063|  8.90k|    defaults = xmlHashLookup2(ctxt->attsDefault, name.name, prefix.name);
 1064|  8.90k|    if ((defaults == NULL) ||
  ------------------
  |  Branch (1064:9): [True: 2.83k, False: 6.07k]
  ------------------
 1065|  6.07k|        (defaults->nbAttrs >= defaults->maxAttrs)) {
  ------------------
  |  Branch (1065:9): [True: 628, False: 5.44k]
  ------------------
 1066|  3.46k|        xmlDefAttrsPtr temp;
 1067|  3.46k|        int newSize;
 1068|       |
 1069|  3.46k|        if (defaults == NULL) {
  ------------------
  |  Branch (1069:13): [True: 2.83k, False: 628]
  ------------------
 1070|  2.83k|            newSize = 4;
 1071|  2.83k|        } else {
 1072|    628|            if ((defaults->maxAttrs >= XML_MAX_ATTRS) ||
  ------------------
  |  |   93|    628|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1072:17): [True: 0, False: 628]
  ------------------
 1073|    628|                ((size_t) defaults->maxAttrs >
  ------------------
  |  Branch (1073:17): [True: 0, False: 628]
  ------------------
 1074|    628|                     SIZE_MAX / 2 / sizeof(temp[0]) - sizeof(*defaults)))
 1075|      0|                goto mem_error;
 1076|       |
 1077|    628|            if (defaults->maxAttrs > XML_MAX_ATTRS / 2)
  ------------------
  |  |   93|    628|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1077:17): [True: 0, False: 628]
  ------------------
 1078|      0|                newSize = XML_MAX_ATTRS;
  ------------------
  |  |   93|      0|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1079|    628|            else
 1080|    628|                newSize = defaults->maxAttrs * 2;
 1081|    628|        }
 1082|  3.46k|        temp = xmlRealloc(defaults,
 1083|  3.46k|                          sizeof(*defaults) + newSize * sizeof(xmlDefAttr));
 1084|  3.46k|	if (temp == NULL)
  ------------------
  |  Branch (1084:6): [True: 2, False: 3.45k]
  ------------------
 1085|      2|	    goto mem_error;
 1086|  3.45k|        if (defaults == NULL)
  ------------------
  |  Branch (1086:13): [True: 2.83k, False: 627]
  ------------------
 1087|  2.83k|            temp->nbAttrs = 0;
 1088|  3.45k|	temp->maxAttrs = newSize;
 1089|  3.45k|        defaults = temp;
 1090|  3.45k|	if (xmlHashUpdateEntry2(ctxt->attsDefault, name.name, prefix.name,
  ------------------
  |  Branch (1090:6): [True: 0, False: 3.45k]
  ------------------
 1091|  3.45k|	                        defaults, NULL) < 0) {
 1092|      0|	    xmlFree(defaults);
 1093|      0|	    goto mem_error;
 1094|      0|	}
 1095|  3.45k|    }
 1096|       |
 1097|       |    /*
 1098|       |     * Split the attribute name into prefix:localname , the string found
 1099|       |     * are within the DTD and hen not associated to namespace names.
 1100|       |     */
 1101|  8.90k|    localname = xmlSplitQName3(fullattr, &len);
 1102|  8.90k|    if (localname == NULL) {
  ------------------
  |  Branch (1102:9): [True: 6.10k, False: 2.79k]
  ------------------
 1103|  6.10k|        name = xmlDictLookupHashed(ctxt->dict, fullattr, -1);
 1104|  6.10k|	prefix.name = NULL;
 1105|  6.10k|    } else {
 1106|  2.79k|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1107|  2.79k|	prefix = xmlDictLookupHashed(ctxt->dict, fullattr, len);
 1108|  2.79k|        if (prefix.name == NULL)
  ------------------
  |  Branch (1108:13): [True: 1, False: 2.79k]
  ------------------
 1109|      1|            goto mem_error;
 1110|  2.79k|    }
 1111|  8.90k|    if (name.name == NULL)
  ------------------
  |  Branch (1111:9): [True: 1, False: 8.90k]
  ------------------
 1112|      1|        goto mem_error;
 1113|       |
 1114|       |    /* intern the string and precompute the end */
 1115|  8.90k|    len = strlen((const char *) value);
 1116|  8.90k|    hvalue = xmlDictLookupHashed(ctxt->dict, value, len);
 1117|  8.90k|    if (hvalue.name == NULL)
  ------------------
  |  Branch (1117:9): [True: 1, False: 8.89k]
  ------------------
 1118|      1|        goto mem_error;
 1119|       |
 1120|  8.89k|    expandedSize = strlen((const char *) name.name);
 1121|  8.89k|    if (prefix.name != NULL)
  ------------------
  |  Branch (1121:9): [True: 2.79k, False: 6.10k]
  ------------------
 1122|  2.79k|        expandedSize += strlen((const char *) prefix.name);
 1123|  8.89k|    expandedSize += len;
 1124|       |
 1125|  8.89k|    attr = &defaults->attrs[defaults->nbAttrs++];
 1126|  8.89k|    attr->name = name;
 1127|  8.89k|    attr->prefix = prefix;
 1128|  8.89k|    attr->value = hvalue;
 1129|  8.89k|    attr->valueEnd = hvalue.name + len;
 1130|  8.89k|    attr->external = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  8.89k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 421, False: 8.47k]
  |  |  ------------------
  |  |   56|  8.89k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 523, False: 7.95k]
  |  |  ------------------
  |  |   57|  8.47k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 473, False: 50]
  |  |  ------------------
  ------------------
 1131|  8.89k|    attr->expandedSize = expandedSize;
 1132|       |
 1133|  8.89k|    return;
 1134|       |
 1135|      9|mem_error:
 1136|      9|    xmlErrMemory(ctxt);
 1137|      9|}
parser.c:xmlAddSpecialAttr:
 1152|  37.2k|{
 1153|  37.2k|    if (ctxt->attsSpecial == NULL) {
  ------------------
  |  Branch (1153:9): [True: 3.06k, False: 34.1k]
  ------------------
 1154|  3.06k|        ctxt->attsSpecial = xmlHashCreateDict(10, ctxt->dict);
 1155|  3.06k|	if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1155:6): [True: 1, False: 3.06k]
  ------------------
 1156|      1|	    goto mem_error;
 1157|  3.06k|    }
 1158|       |
 1159|  37.1k|    if (PARSER_EXTERNAL(ctxt))
  ------------------
  |  |   55|  37.1k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 11.9k, False: 25.2k]
  |  |  ------------------
  |  |   56|  37.1k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 15.8k, False: 9.34k]
  |  |  ------------------
  |  |   57|  25.2k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 12.3k, False: 3.52k]
  |  |  ------------------
  ------------------
 1160|  24.3k|        type |= XML_SPECIAL_EXTERNAL;
  ------------------
  |  |   95|  24.3k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
 1161|       |
 1162|  37.1k|    if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
  ------------------
  |  Branch (1162:9): [True: 1, False: 37.1k]
  ------------------
 1163|  37.1k|                    XML_INT_TO_PTR(type)) < 0)
  ------------------
  |  |   59|  37.1k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 1164|      1|        goto mem_error;
 1165|  37.1k|    return;
 1166|       |
 1167|  37.1k|mem_error:
 1168|      2|    xmlErrMemory(ctxt);
 1169|      2|}
parser.c:xmlSkipBlankCharsPEBalanced:
 6087|   482k|xmlSkipBlankCharsPEBalanced(xmlParserCtxt *ctxt, int openInputNr) {
 6088|   482k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   482k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6089|   482k|    GROW;
  ------------------
  |  | 2271|   482k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   482k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   482k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 66.7k, False: 415k]
  |  |  ------------------
  |  | 2272|   482k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  66.7k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 46.6k, False: 20.0k]
  |  |  ------------------
  |  | 2273|   482k|	xmlParserGrow(ctxt);
  ------------------
 6090|       |
 6091|   482k|    (void) openInputNr;
 6092|       |
 6093|   482k|    if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   55|   964k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 13.3k, False: 468k]
  |  |  ------------------
  |  |   56|   964k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 52.1k, False: 416k]
  |  |  ------------------
  |  |   57|   468k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 33.7k, False: 18.3k]
  |  |  ------------------
  ------------------
                  if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|   434k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 18.3k, False: 416k]
  |  |  ------------------
  |  |   51|   434k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 18.3k, False: 0]
  |  |  ------------------
  |  |   52|  18.3k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6094|   416k|        return;
 6095|       |
 6096|  71.2k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  71.2k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6096:12): [True: 70.9k, False: 305]
  ------------------
 6097|  70.9k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6097:13): [True: 2.14k, False: 68.7k]
  ------------------
 6098|  2.14k|#ifdef LIBXML_VALID_ENABLED
 6099|  2.14k|            if ((ctxt->validate) && (ctxt->inputNr <= openInputNr)) {
  ------------------
  |  Branch (6099:17): [True: 1.41k, False: 722]
  |  Branch (6099:37): [True: 619, False: 799]
  ------------------
 6100|    619|                xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6101|    619|                                 "Element content declaration doesn't start "
 6102|    619|                                 "and stop in the same entity\n",
 6103|    619|                                 NULL, NULL);
 6104|    619|            }
 6105|  2.14k|#endif
 6106|  2.14k|            if (PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|  2.14k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 2.09k, False: 41]
  |  |  ------------------
  |  |   51|  2.14k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 786, False: 1.31k]
  |  |  ------------------
  |  |   52|  2.09k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 1.31k, False: 0]
  |  |  ------------------
  ------------------
 6107|  2.09k|                xmlPopPE(ctxt);
 6108|     41|            else
 6109|     41|                break;
 6110|  68.7k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  68.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6110:20): [True: 3.67k, False: 65.0k]
  ------------------
 6111|  3.67k|            xmlParsePERefInternal(ctxt, 0);
 6112|  65.0k|        } else {
 6113|  65.0k|            break;
 6114|  65.0k|        }
 6115|       |
 6116|  5.77k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  5.77k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6117|  5.77k|        GROW;
  ------------------
  |  | 2271|  5.77k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  5.77k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.77k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.09k, False: 681]
  |  |  ------------------
  |  | 2272|  5.77k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.09k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.01k, False: 1.08k]
  |  |  ------------------
  |  | 2273|  5.77k|	xmlParserGrow(ctxt);
  ------------------
 6118|  5.77k|    }
 6119|  65.4k|}
parser.c:xmlParseElementChildrenContentDeclPriv:
 6271|  77.6k|                                       int depth) {
 6272|  77.6k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (6272:20): [True: 66.2k, False: 11.4k]
  ------------------
 6273|  77.6k|    xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
 6274|  77.6k|    const xmlChar *elem;
 6275|  77.6k|    xmlChar type = 0;
 6276|       |
 6277|  77.6k|    if (depth > maxDepth) {
  ------------------
  |  Branch (6277:9): [True: 3, False: 77.6k]
  ------------------
 6278|      3|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 6279|      3|                "xmlParseElementChildrenContentDecl : depth %d too deep, "
 6280|      3|                "use XML_PARSE_HUGE\n", depth);
 6281|      3|	return(NULL);
 6282|      3|    }
 6283|  77.6k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6284|  77.6k|    if (RAW == '(') {
  ------------------
  |  | 2224|  77.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6284:9): [True: 35.3k, False: 42.3k]
  ------------------
 6285|  35.3k|        int newInputNr = ctxt->inputNr;
 6286|       |
 6287|       |        /* Recurse on first child */
 6288|  35.3k|	NEXT;
  ------------------
  |  | 2279|  35.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6289|  35.3k|        cur = ret = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6290|  35.3k|                                                           depth + 1);
 6291|  35.3k|        if (cur == NULL)
  ------------------
  |  Branch (6291:13): [True: 32.5k, False: 2.81k]
  ------------------
 6292|  32.5k|            return(NULL);
 6293|  42.3k|    } else {
 6294|  42.3k|	elem = xmlParseName(ctxt);
 6295|  42.3k|	if (elem == NULL) {
  ------------------
  |  Branch (6295:6): [True: 414, False: 41.9k]
  ------------------
 6296|    414|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6297|    414|	    return(NULL);
 6298|    414|	}
 6299|  41.9k|        cur = ret = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6300|  41.9k|	if (cur == NULL) {
  ------------------
  |  Branch (6300:6): [True: 3, False: 41.9k]
  ------------------
 6301|      3|	    xmlErrMemory(ctxt);
 6302|      3|	    return(NULL);
 6303|      3|	}
 6304|  41.9k|	GROW;
  ------------------
  |  | 2271|  41.9k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  41.9k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  41.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.58k, False: 36.3k]
  |  |  ------------------
  |  | 2272|  41.9k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.58k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 3.33k, False: 2.25k]
  |  |  ------------------
  |  | 2273|  41.9k|	xmlParserGrow(ctxt);
  ------------------
 6305|  41.9k|	if (RAW == '?') {
  ------------------
  |  | 2224|  41.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6305:6): [True: 1.28k, False: 40.6k]
  ------------------
 6306|  1.28k|	    cur->ocur = XML_ELEMENT_CONTENT_OPT;
 6307|  1.28k|	    NEXT;
  ------------------
  |  | 2279|  1.28k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6308|  40.6k|	} else if (RAW == '*') {
  ------------------
  |  | 2224|  40.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6308:13): [True: 1.24k, False: 39.4k]
  ------------------
 6309|  1.24k|	    cur->ocur = XML_ELEMENT_CONTENT_MULT;
 6310|  1.24k|	    NEXT;
  ------------------
  |  | 2279|  1.24k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6311|  39.4k|	} else if (RAW == '+') {
  ------------------
  |  | 2224|  39.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6311:13): [True: 392, False: 39.0k]
  ------------------
 6312|    392|	    cur->ocur = XML_ELEMENT_CONTENT_PLUS;
 6313|    392|	    NEXT;
  ------------------
  |  | 2279|    392|#define NEXT xmlNextChar(ctxt)
  ------------------
 6314|  39.0k|	} else {
 6315|  39.0k|	    cur->ocur = XML_ELEMENT_CONTENT_ONCE;
 6316|  39.0k|	}
 6317|  41.9k|	GROW;
  ------------------
  |  | 2271|  41.9k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  41.9k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  41.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.58k, False: 36.3k]
  |  |  ------------------
  |  | 2272|  41.9k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.58k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 3.33k, False: 2.25k]
  |  |  ------------------
  |  | 2273|  41.9k|	xmlParserGrow(ctxt);
  ------------------
 6318|  41.9k|    }
 6319|   200k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   200k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6319:12): [True: 197k, False: 2.63k]
  ------------------
 6320|   197k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6321|   197k|        if (RAW == ')')
  ------------------
  |  | 2224|   197k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6321:13): [True: 39.9k, False: 157k]
  ------------------
 6322|  39.9k|            break;
 6323|       |        /*
 6324|       |	 * Each loop we parse one separator and one element.
 6325|       |	 */
 6326|   157k|        if (RAW == ',') {
  ------------------
  |  | 2224|   157k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6326:13): [True: 80.6k, False: 77.2k]
  ------------------
 6327|  80.6k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2225|  8.37k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6327:10): [True: 8.37k, False: 72.3k]
  ------------------
 6328|       |
 6329|       |	    /*
 6330|       |	     * Detect "Name | Name , Name" error
 6331|       |	     */
 6332|  72.3k|	    else if (type != CUR) {
  ------------------
  |  | 2225|  72.3k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6332:15): [True: 1, False: 72.3k]
  ------------------
 6333|      1|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6334|      1|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6335|      1|		                  type);
 6336|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6336:7): [True: 1, False: 0]
  |  Branch (6336:25): [True: 1, False: 0]
  ------------------
 6337|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6338|      1|		if (ret != NULL)
  ------------------
  |  Branch (6338:7): [True: 1, False: 0]
  ------------------
 6339|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6340|      1|		return(NULL);
 6341|      1|	    }
 6342|  80.6k|	    NEXT;
  ------------------
  |  | 2279|  80.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6343|       |
 6344|  80.6k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_SEQ);
 6345|  80.6k|	    if (op == NULL) {
  ------------------
  |  Branch (6345:10): [True: 2, False: 80.6k]
  ------------------
 6346|      2|                xmlErrMemory(ctxt);
 6347|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6347:7): [True: 1, False: 1]
  |  Branch (6347:25): [True: 1, False: 0]
  ------------------
 6348|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6349|      2|	        xmlFreeDocElementContent(ctxt->myDoc, ret);
 6350|      2|		return(NULL);
 6351|      2|	    }
 6352|  80.6k|	    if (last == NULL) {
  ------------------
  |  Branch (6352:10): [True: 8.37k, False: 72.3k]
  ------------------
 6353|  8.37k|		op->c1 = ret;
 6354|  8.37k|		if (ret != NULL)
  ------------------
  |  Branch (6354:7): [True: 8.37k, False: 0]
  ------------------
 6355|  8.37k|		    ret->parent = op;
 6356|  8.37k|		ret = cur = op;
 6357|  72.3k|	    } else {
 6358|  72.3k|	        cur->c2 = op;
 6359|  72.3k|		if (op != NULL)
  ------------------
  |  Branch (6359:7): [True: 72.3k, False: 0]
  ------------------
 6360|  72.3k|		    op->parent = cur;
 6361|  72.3k|		op->c1 = last;
 6362|  72.3k|		if (last != NULL)
  ------------------
  |  Branch (6362:7): [True: 72.3k, False: 0]
  ------------------
 6363|  72.3k|		    last->parent = op;
 6364|  72.3k|		cur =op;
 6365|  72.3k|		last = NULL;
 6366|  72.3k|	    }
 6367|  80.6k|	} else if (RAW == '|') {
  ------------------
  |  | 2224|  77.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6367:13): [True: 75.5k, False: 1.70k]
  ------------------
 6368|  75.5k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2225|  24.6k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6368:10): [True: 24.6k, False: 50.9k]
  ------------------
 6369|       |
 6370|       |	    /*
 6371|       |	     * Detect "Name , Name | Name" error
 6372|       |	     */
 6373|  50.9k|	    else if (type != CUR) {
  ------------------
  |  | 2225|  50.9k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6373:15): [True: 1, False: 50.9k]
  ------------------
 6374|      1|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6375|      1|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6376|      1|				  type);
 6377|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6377:7): [True: 1, False: 0]
  |  Branch (6377:25): [True: 1, False: 0]
  ------------------
 6378|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6379|      1|		if (ret != NULL)
  ------------------
  |  Branch (6379:7): [True: 1, False: 0]
  ------------------
 6380|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6381|      1|		return(NULL);
 6382|      1|	    }
 6383|  75.5k|	    NEXT;
  ------------------
  |  | 2279|  75.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6384|       |
 6385|  75.5k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6386|  75.5k|	    if (op == NULL) {
  ------------------
  |  Branch (6386:10): [True: 2, False: 75.5k]
  ------------------
 6387|      2|                xmlErrMemory(ctxt);
 6388|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6388:7): [True: 1, False: 1]
  |  Branch (6388:25): [True: 1, False: 0]
  ------------------
 6389|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6390|      2|		if (ret != NULL)
  ------------------
  |  Branch (6390:7): [True: 2, False: 0]
  ------------------
 6391|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6392|      2|		return(NULL);
 6393|      2|	    }
 6394|  75.5k|	    if (last == NULL) {
  ------------------
  |  Branch (6394:10): [True: 24.6k, False: 50.9k]
  ------------------
 6395|  24.6k|		op->c1 = ret;
 6396|  24.6k|		if (ret != NULL)
  ------------------
  |  Branch (6396:7): [True: 24.6k, False: 0]
  ------------------
 6397|  24.6k|		    ret->parent = op;
 6398|  24.6k|		ret = cur = op;
 6399|  50.9k|	    } else {
 6400|  50.9k|	        cur->c2 = op;
 6401|  50.9k|		if (op != NULL)
  ------------------
  |  Branch (6401:7): [True: 50.9k, False: 0]
  ------------------
 6402|  50.9k|		    op->parent = cur;
 6403|  50.9k|		op->c1 = last;
 6404|  50.9k|		if (last != NULL)
  ------------------
  |  Branch (6404:7): [True: 50.9k, False: 0]
  ------------------
 6405|  50.9k|		    last->parent = op;
 6406|  50.9k|		cur =op;
 6407|  50.9k|		last = NULL;
 6408|  50.9k|	    }
 6409|  75.5k|	} else {
 6410|  1.70k|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED, NULL);
 6411|  1.70k|	    if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6411:10): [True: 763, False: 941]
  |  Branch (6411:28): [True: 763, False: 0]
  ------------------
 6412|    763|	        xmlFreeDocElementContent(ctxt->myDoc, last);
 6413|  1.70k|	    if (ret != NULL)
  ------------------
  |  Branch (6413:10): [True: 1.70k, False: 0]
  ------------------
 6414|  1.70k|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6415|  1.70k|	    return(NULL);
 6416|  1.70k|	}
 6417|   156k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6418|   156k|        if (RAW == '(') {
  ------------------
  |  | 2224|   156k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6418:13): [True: 33.9k, False: 122k]
  ------------------
 6419|  33.9k|            int newInputNr = ctxt->inputNr;
 6420|       |
 6421|       |	    /* Recurse on second child */
 6422|  33.9k|	    NEXT;
  ------------------
  |  | 2279|  33.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6423|  33.9k|	    last = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6424|  33.9k|                                                          depth + 1);
 6425|  33.9k|            if (last == NULL) {
  ------------------
  |  Branch (6425:17): [True: 362, False: 33.6k]
  ------------------
 6426|    362|		if (ret != NULL)
  ------------------
  |  Branch (6426:7): [True: 362, False: 0]
  ------------------
 6427|    362|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6428|    362|		return(NULL);
 6429|    362|            }
 6430|   122k|	} else {
 6431|   122k|	    elem = xmlParseName(ctxt);
 6432|   122k|	    if (elem == NULL) {
  ------------------
  |  Branch (6432:10): [True: 147, False: 122k]
  ------------------
 6433|    147|		xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6434|    147|		if (ret != NULL)
  ------------------
  |  Branch (6434:7): [True: 147, False: 0]
  ------------------
 6435|    147|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6436|    147|		return(NULL);
 6437|    147|	    }
 6438|   122k|	    last = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6439|   122k|	    if (last == NULL) {
  ------------------
  |  Branch (6439:10): [True: 1, False: 122k]
  ------------------
 6440|      1|                xmlErrMemory(ctxt);
 6441|      1|		if (ret != NULL)
  ------------------
  |  Branch (6441:7): [True: 1, False: 0]
  ------------------
 6442|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6443|      1|		return(NULL);
 6444|      1|	    }
 6445|   122k|	    if (RAW == '?') {
  ------------------
  |  | 2224|   122k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6445:10): [True: 14.4k, False: 107k]
  ------------------
 6446|  14.4k|		last->ocur = XML_ELEMENT_CONTENT_OPT;
 6447|  14.4k|		NEXT;
  ------------------
  |  | 2279|  14.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6448|   107k|	    } else if (RAW == '*') {
  ------------------
  |  | 2224|   107k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6448:17): [True: 8.63k, False: 98.9k]
  ------------------
 6449|  8.63k|		last->ocur = XML_ELEMENT_CONTENT_MULT;
 6450|  8.63k|		NEXT;
  ------------------
  |  | 2279|  8.63k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6451|  98.9k|	    } else if (RAW == '+') {
  ------------------
  |  | 2224|  98.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6451:17): [True: 8.27k, False: 90.7k]
  ------------------
 6452|  8.27k|		last->ocur = XML_ELEMENT_CONTENT_PLUS;
 6453|  8.27k|		NEXT;
  ------------------
  |  | 2279|  8.27k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6454|  90.7k|	    } else {
 6455|  90.7k|		last->ocur = XML_ELEMENT_CONTENT_ONCE;
 6456|  90.7k|	    }
 6457|   122k|	}
 6458|   156k|    }
 6459|  42.5k|    if ((cur != NULL) && (last != NULL)) {
  ------------------
  |  Branch (6459:9): [True: 42.5k, False: 0]
  |  Branch (6459:26): [True: 31.7k, False: 10.8k]
  ------------------
 6460|  31.7k|        cur->c2 = last;
 6461|  31.7k|	if (last != NULL)
  ------------------
  |  Branch (6461:6): [True: 31.7k, False: 0]
  ------------------
 6462|  31.7k|	    last->parent = cur;
 6463|  31.7k|    }
 6464|  42.5k|#ifdef LIBXML_VALID_ENABLED
 6465|  42.5k|    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6465:9): [True: 38.5k, False: 4.00k]
  |  Branch (6465:29): [True: 104, False: 38.4k]
  ------------------
 6466|    104|        xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6467|    104|                         "Element content declaration doesn't start "
 6468|    104|                         "and stop in the same entity\n",
 6469|    104|                         NULL, NULL);
 6470|    104|    }
 6471|  42.5k|#endif
 6472|  42.5k|    NEXT;
  ------------------
  |  | 2279|  42.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6473|  42.5k|    if (RAW == '?') {
  ------------------
  |  | 2224|  42.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6473:9): [True: 7.49k, False: 35.0k]
  ------------------
 6474|  7.49k|	if (ret != NULL) {
  ------------------
  |  Branch (6474:6): [True: 7.49k, False: 0]
  ------------------
 6475|  7.49k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (6475:10): [True: 93, False: 7.40k]
  ------------------
 6476|  7.40k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6476:10): [True: 73, False: 7.32k]
  ------------------
 6477|    166|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6478|  7.32k|	    else
 6479|  7.32k|	        ret->ocur = XML_ELEMENT_CONTENT_OPT;
 6480|  7.49k|	}
 6481|  7.49k|	NEXT;
  ------------------
  |  | 2279|  7.49k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6482|  35.0k|    } else if (RAW == '*') {
  ------------------
  |  | 2224|  35.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6482:16): [True: 17.3k, False: 17.7k]
  ------------------
 6483|  17.3k|	if (ret != NULL) {
  ------------------
  |  Branch (6483:6): [True: 17.3k, False: 0]
  ------------------
 6484|  17.3k|	    ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6485|  17.3k|	    cur = ret;
 6486|       |	    /*
 6487|       |	     * Some normalization:
 6488|       |	     * (a | b* | c?)* == (a | b | c)*
 6489|       |	     */
 6490|  69.8k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6490:13): [True: 69.8k, False: 0]
  |  Branch (6490:30): [True: 52.5k, False: 17.3k]
  ------------------
 6491|  52.5k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6491:7): [True: 52.5k, False: 0]
  ------------------
 6492|  52.5k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6492:15): [True: 545, False: 51.9k]
  ------------------
 6493|  51.9k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6493:8): [True: 1.82k, False: 50.1k]
  ------------------
 6494|  2.36k|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6495|  52.5k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6495:7): [True: 52.5k, False: 0]
  ------------------
 6496|  52.5k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6496:15): [True: 262, False: 52.2k]
  ------------------
 6497|  52.2k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6497:8): [True: 44, False: 52.2k]
  ------------------
 6498|    306|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6499|  52.5k|		cur = cur->c2;
 6500|  52.5k|	    }
 6501|  17.3k|	}
 6502|  17.3k|	NEXT;
  ------------------
  |  | 2279|  17.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6503|  17.7k|    } else if (RAW == '+') {
  ------------------
  |  | 2224|  17.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6503:16): [True: 5.27k, False: 12.4k]
  ------------------
 6504|  5.27k|	if (ret != NULL) {
  ------------------
  |  Branch (6504:6): [True: 5.27k, False: 0]
  ------------------
 6505|  5.27k|	    int found = 0;
 6506|       |
 6507|  5.27k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6507:10): [True: 289, False: 4.98k]
  ------------------
 6508|  4.98k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6508:10): [True: 39, False: 4.94k]
  ------------------
 6509|    328|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6510|  4.94k|	    else
 6511|  4.94k|	        ret->ocur = XML_ELEMENT_CONTENT_PLUS;
 6512|       |	    /*
 6513|       |	     * Some normalization:
 6514|       |	     * (a | b*)+ == (a | b)*
 6515|       |	     * (a | b?)+ == (a | b)*
 6516|       |	     */
 6517|  10.1k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6517:13): [True: 10.1k, False: 0]
  |  Branch (6517:30): [True: 4.91k, False: 5.27k]
  ------------------
 6518|  4.91k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6518:7): [True: 4.91k, False: 0]
  ------------------
 6519|  4.91k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6519:15): [True: 50, False: 4.86k]
  ------------------
 6520|  4.86k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6520:8): [True: 139, False: 4.72k]
  ------------------
 6521|    189|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6522|    189|		    found = 1;
 6523|    189|		}
 6524|  4.91k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6524:7): [True: 4.91k, False: 0]
  ------------------
 6525|  4.91k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6525:15): [True: 20, False: 4.89k]
  ------------------
 6526|  4.89k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6526:8): [True: 73, False: 4.81k]
  ------------------
 6527|     93|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6528|     93|		    found = 1;
 6529|     93|		}
 6530|  4.91k|		cur = cur->c2;
 6531|  4.91k|	    }
 6532|  5.27k|	    if (found)
  ------------------
  |  Branch (6532:10): [True: 195, False: 5.07k]
  ------------------
 6533|    195|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6534|  5.27k|	}
 6535|  5.27k|	NEXT;
  ------------------
  |  | 2279|  5.27k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6536|  5.27k|    }
 6537|  42.5k|    return(ret);
 6538|  44.7k|}
parser.c:xmlCtxtInitializeLate:
  896|  44.8k|xmlCtxtInitializeLate(xmlParserCtxtPtr ctxt) {
  897|  44.8k|    xmlSAXHandlerPtr sax;
  898|       |
  899|       |    /* Avoid unused variable warning if features are disabled. */
  900|  44.8k|    (void) sax;
  901|       |
  902|       |    /*
  903|       |     * Changing the SAX struct directly is still widespread practice
  904|       |     * in internal and external code.
  905|       |     */
  906|  44.8k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (906:9): [True: 0, False: 44.8k]
  ------------------
  907|  44.8k|    sax = ctxt->sax;
  908|  44.8k|#ifdef LIBXML_SAX1_ENABLED
  909|       |    /*
  910|       |     * Only enable SAX2 if there SAX2 element handlers, except when there
  911|       |     * are no element handlers at all.
  912|       |     */
  913|  44.8k|    if (((ctxt->options & XML_PARSE_SAX1) == 0) &&
  ------------------
  |  Branch (913:9): [True: 25.3k, False: 19.5k]
  ------------------
  914|  25.3k|        (sax) &&
  ------------------
  |  Branch (914:9): [True: 25.3k, False: 0]
  ------------------
  915|  25.3k|        (sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|  25.3k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (915:9): [True: 25.3k, False: 0]
  ------------------
  916|  25.3k|        ((sax->startElementNs != NULL) ||
  ------------------
  |  Branch (916:10): [True: 25.3k, False: 0]
  ------------------
  917|      0|         (sax->endElementNs != NULL) ||
  ------------------
  |  Branch (917:10): [True: 0, False: 0]
  ------------------
  918|      0|         ((sax->startElement == NULL) && (sax->endElement == NULL))))
  ------------------
  |  Branch (918:11): [True: 0, False: 0]
  |  Branch (918:42): [True: 0, False: 0]
  ------------------
  919|  25.3k|        ctxt->sax2 = 1;
  920|       |#else
  921|       |    ctxt->sax2 = 1;
  922|       |#endif /* LIBXML_SAX1_ENABLED */
  923|       |
  924|       |    /*
  925|       |     * Some users replace the dictionary directly in the context struct.
  926|       |     * We really need an API function to do that cleanly.
  927|       |     */
  928|  44.8k|    ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
  ------------------
  |  |   34|  44.8k|#define BAD_CAST (xmlChar *)
  ------------------
  929|  44.8k|    ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
  ------------------
  |  |   34|  44.8k|#define BAD_CAST (xmlChar *)
  ------------------
  930|  44.8k|    ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
  ------------------
  |  |  146|  44.8k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  931|  44.8k|    if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) ||
  ------------------
  |  Branch (931:9): [True: 11, False: 44.8k]
  |  Branch (931:34): [True: 0, False: 44.8k]
  ------------------
  932|  44.8k|		(ctxt->str_xml_ns == NULL)) {
  ------------------
  |  Branch (932:3): [True: 0, False: 44.8k]
  ------------------
  933|     11|        xmlErrMemory(ctxt);
  934|     11|    }
  935|       |
  936|  44.8k|    xmlDictSetLimit(ctxt->dict,
  937|  44.8k|                    (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (937:21): [True: 22.1k, False: 22.7k]
  ------------------
  938|  22.1k|                        0 :
  939|  44.8k|                        XML_MAX_DICTIONARY_LIMIT);
  ------------------
  |  |   73|  67.5k|#define XML_MAX_DICTIONARY_LIMIT 100000000
  ------------------
  940|       |
  941|  44.8k|#ifdef LIBXML_VALID_ENABLED
  942|  44.8k|    if (ctxt->validate)
  ------------------
  |  Branch (942:9): [True: 21.2k, False: 23.5k]
  ------------------
  943|  21.2k|        ctxt->vctxt.flags |= XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  21.2k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  944|  23.5k|    else
  945|  23.5k|        ctxt->vctxt.flags &= ~XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  23.5k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  946|  44.8k|#endif /* LIBXML_VALID_ENABLED */
  947|  44.8k|}
parser.c:xmlPopPE:
 2347|   101k|xmlPopPE(xmlParserCtxtPtr ctxt) {
 2348|   101k|    unsigned long consumed;
 2349|   101k|    xmlEntityPtr ent;
 2350|       |
 2351|   101k|    ent = ctxt->input->entity;
 2352|       |
 2353|   101k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   101k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 2354|       |
 2355|   101k|    if ((ent->flags & XML_ENT_CHECKED) == 0) {
  ------------------
  |  |   20|   101k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (2355:9): [True: 4.45k, False: 96.8k]
  ------------------
 2356|  4.45k|        int result;
 2357|       |
 2358|       |        /*
 2359|       |         * Read the rest of the stream in case of errors. We want
 2360|       |         * to account for the whole entity size.
 2361|       |         */
 2362|  4.68k|        do {
 2363|  4.68k|            ctxt->input->cur = ctxt->input->end;
 2364|  4.68k|            xmlParserShrink(ctxt);
 2365|  4.68k|            result = xmlParserGrow(ctxt);
 2366|  4.68k|        } while (result > 0);
  ------------------
  |  Branch (2366:18): [True: 228, False: 4.45k]
  ------------------
 2367|       |
 2368|  4.45k|        consumed = ctxt->input->consumed;
 2369|  4.45k|        xmlSaturatedAddSizeT(&consumed,
 2370|  4.45k|                             ctxt->input->end - ctxt->input->base);
 2371|       |
 2372|  4.45k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
 2373|       |
 2374|       |        /*
 2375|       |         * Add to sizeentities when parsing an external entity
 2376|       |         * for the first time.
 2377|       |         */
 2378|  4.45k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (2378:13): [True: 3.39k, False: 1.05k]
  ------------------
 2379|  3.39k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
 2380|  3.39k|        }
 2381|       |
 2382|  4.45k|        ent->flags |= XML_ENT_CHECKED;
  ------------------
  |  |   20|  4.45k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
 2383|  4.45k|    }
 2384|       |
 2385|   101k|    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 2386|       |
 2387|   101k|    xmlParserEntityCheck(ctxt, ent->expandedSize);
 2388|       |
 2389|   101k|    GROW;
  ------------------
  |  | 2271|   101k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   101k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   101k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 90.6k, False: 10.6k]
  |  |  ------------------
  |  | 2272|   101k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  90.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 66.5k, False: 24.0k]
  |  |  ------------------
  |  | 2273|   101k|	xmlParserGrow(ctxt);
  ------------------
 2390|   101k|}
parser.c:xmlParseConditionalSections:
 6746|  4.37k|xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
 6747|  4.37k|    size_t depth = 0;
 6748|  4.37k|    int isFreshPE = 0;
 6749|  4.37k|    int oldInputNr = ctxt->inputNr;
 6750|  4.37k|    int declInputNr = ctxt->inputNr;
 6751|       |
 6752|  9.25k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  9.25k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6752:12): [True: 9.25k, False: 7]
  ------------------
 6753|  9.25k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6753:13): [True: 605, False: 8.64k]
  ------------------
 6754|    605|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (6754:17): [True: 193, False: 412]
  ------------------
 6755|    193|                xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6756|    193|                return;
 6757|    193|            }
 6758|       |
 6759|    412|            xmlPopPE(ctxt);
 6760|    412|            declInputNr = ctxt->inputNr;
 6761|  8.64k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|  8.64k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  5.99k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  5.57k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6761:20): [True: 5.99k, False: 2.64k]
  |  Branch (6761:36): [True: 5.57k, False: 422]
  |  Branch (6761:55): [True: 4.54k, False: 1.02k]
  ------------------
 6762|  4.54k|            SKIP(3);
  ------------------
  |  | 2248|  4.54k|#define SKIP(val) do {							\
  |  | 2249|  4.54k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  4.54k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 220, False: 4.32k]
  |  |  ------------------
  |  | 2251|  4.54k|        xmlParserGrow(ctxt);						\
  |  | 2252|  4.54k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 4.54k]
  |  |  ------------------
  ------------------
 6763|  4.54k|            SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  4.54k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6764|       |
 6765|  4.54k|            isFreshPE = 0;
 6766|       |
 6767|  4.54k|            if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
  ------------------
  |  | 2238|  4.54k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2236|  9.09k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2234|  9.09k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2231|  9.09k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 4.24k, False: 308]
  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 1.82k, False: 2.41k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|  4.54k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 1.82k, False: 1]
  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 1.82k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2234:34): [True: 1.82k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2236:38): [True: 1.81k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2238:42): [True: 1.81k, False: 1]
  |  |  ------------------
  ------------------
 6768|  1.81k|                SKIP(7);
  ------------------
  |  | 2248|  1.81k|#define SKIP(val) do {							\
  |  | 2249|  1.81k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.81k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 34, False: 1.78k]
  |  |  ------------------
  |  | 2251|  1.81k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.81k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.81k]
  |  |  ------------------
  ------------------
 6769|  1.81k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  1.81k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6770|  1.81k|                if (RAW != '[') {
  ------------------
  |  | 2224|  1.81k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6770:21): [True: 163, False: 1.65k]
  ------------------
 6771|    163|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6772|    163|                    return;
 6773|    163|                }
 6774|  1.65k|#ifdef LIBXML_VALID_ENABLED
 6775|  1.65k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6775:21): [True: 784, False: 871]
  |  Branch (6775:41): [True: 33, False: 751]
  ------------------
 6776|     33|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6777|     33|                                     "All markup of the conditional section is"
 6778|     33|                                     " not in the same entity\n",
 6779|     33|                                     NULL, NULL);
 6780|     33|                }
 6781|  1.65k|#endif
 6782|  1.65k|                NEXT;
  ------------------
  |  | 2279|  1.65k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6783|       |
 6784|  1.65k|                depth++;
 6785|  2.73k|            } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) {
  ------------------
  |  | 2236|  2.73k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2234|  5.46k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2231|  5.46k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2231:5): [True: 2.42k, False: 308]
  |  |  |  |  |  |  |  Branch (2231:41): [True: 2.41k, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2232|  2.73k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2232:5): [True: 2.41k, False: 2]
  |  |  |  |  |  |  |  Branch (2232:41): [True: 2.41k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2234:34): [True: 2.40k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2236:38): [True: 2.40k, False: 1]
  |  |  ------------------
  ------------------
 6786|  2.40k|                size_t ignoreDepth = 0;
 6787|       |
 6788|  2.40k|                SKIP(6);
  ------------------
  |  | 2248|  2.40k|#define SKIP(val) do {							\
  |  | 2249|  2.40k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  2.40k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 234, False: 2.17k]
  |  |  ------------------
  |  | 2251|  2.40k|        xmlParserGrow(ctxt);						\
  |  | 2252|  2.40k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2.40k]
  |  |  ------------------
  ------------------
 6789|  2.40k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2277|  2.40k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6790|  2.40k|                if (RAW != '[') {
  ------------------
  |  | 2224|  2.40k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6790:21): [True: 478, False: 1.92k]
  ------------------
 6791|    478|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6792|    478|                    return;
 6793|    478|                }
 6794|  1.92k|#ifdef LIBXML_VALID_ENABLED
 6795|  1.92k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6795:21): [True: 1.34k, False: 587]
  |  Branch (6795:41): [True: 6, False: 1.33k]
  ------------------
 6796|      6|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6797|      6|                                     "All markup of the conditional section is"
 6798|      6|                                     " not in the same entity\n",
 6799|      6|                                     NULL, NULL);
 6800|      6|                }
 6801|  1.92k|#endif
 6802|  1.92k|                NEXT;
  ------------------
  |  | 2279|  1.92k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6803|       |
 6804|  50.9k|                while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  50.9k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6804:24): [True: 50.9k, False: 2]
  ------------------
 6805|  50.9k|                    if (RAW == 0) {
  ------------------
  |  | 2224|  50.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6805:25): [True: 1.14k, False: 49.7k]
  ------------------
 6806|  1.14k|                        xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL);
 6807|  1.14k|                        return;
 6808|  1.14k|                    }
 6809|  49.7k|                    if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|  49.7k|#define RAW (*ctxt->input->cur)
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  2.42k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|  1.42k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6809:25): [True: 2.42k, False: 47.3k]
  |  Branch (6809:41): [True: 1.42k, False: 996]
  |  Branch (6809:60): [True: 883, False: 545]
  ------------------
 6810|    883|                        SKIP(3);
  ------------------
  |  | 2248|    883|#define SKIP(val) do {							\
  |  | 2249|    883|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|    883|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 87, False: 796]
  |  |  ------------------
  |  | 2251|    883|        xmlParserGrow(ctxt);						\
  |  | 2252|    883|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 883]
  |  |  ------------------
  ------------------
 6811|    883|                        ignoreDepth++;
 6812|       |                        /* Check for integer overflow */
 6813|    883|                        if (ignoreDepth == 0) {
  ------------------
  |  Branch (6813:29): [True: 0, False: 883]
  ------------------
 6814|      0|                            xmlErrMemory(ctxt);
 6815|      0|                            return;
 6816|      0|                        }
 6817|  48.9k|                    } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2224|  48.9k|#define RAW (*ctxt->input->cur)
  ------------------
                                  } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2226|  3.11k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6817:32): [True: 3.11k, False: 45.7k]
  |  Branch (6817:48): [True: 1.77k, False: 1.34k]
  ------------------
 6818|  1.77k|                               (NXT(2) == '>')) {
  ------------------
  |  | 2226|  1.77k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6818:32): [True: 1.23k, False: 539]
  ------------------
 6819|  1.23k|                        SKIP(3);
  ------------------
  |  | 2248|  1.23k|#define SKIP(val) do {							\
  |  | 2249|  1.23k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.23k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 292, False: 939]
  |  |  ------------------
  |  | 2251|  1.23k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.23k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
 6820|  1.23k|                        if (ignoreDepth == 0)
  ------------------
  |  Branch (6820:29): [True: 781, False: 450]
  ------------------
 6821|    781|                            break;
 6822|    450|                        ignoreDepth--;
 6823|  47.6k|                    } else {
 6824|  47.6k|                        NEXT;
  ------------------
  |  | 2279|  47.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6825|  47.6k|                    }
 6826|  49.7k|                }
 6827|       |
 6828|    783|#ifdef LIBXML_VALID_ENABLED
 6829|    783|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6829:21): [True: 525, False: 258]
  |  Branch (6829:41): [True: 6, False: 519]
  ------------------
 6830|      6|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6831|      6|                                     "All markup of the conditional section is"
 6832|      6|                                     " not in the same entity\n",
 6833|      6|                                     NULL, NULL);
 6834|      6|                }
 6835|    783|#endif
 6836|    783|            } else {
 6837|    324|                xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
 6838|    324|                return;
 6839|    324|            }
 6840|  4.54k|        } else if ((depth > 0) &&
  ------------------
  |  Branch (6840:20): [True: 4.09k, False: 0]
  ------------------
 6841|  4.09k|                   (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2224|  4.09k|#define RAW (*ctxt->input->cur)
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2226|  1.26k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2226|  1.25k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6841:20): [True: 1.26k, False: 2.83k]
  |  Branch (6841:36): [True: 1.25k, False: 3]
  |  Branch (6841:55): [True: 1.25k, False: 1]
  ------------------
 6842|  1.25k|            if (isFreshPE) {
  ------------------
  |  Branch (6842:17): [True: 1, False: 1.25k]
  ------------------
 6843|      1|                xmlFatalErrMsg(ctxt, XML_ERR_CONDSEC_INVALID,
 6844|      1|                               "Parameter entity must match "
 6845|      1|                               "extSubsetDecl\n");
 6846|      1|                return;
 6847|      1|            }
 6848|       |
 6849|  1.25k|            depth--;
 6850|  1.25k|#ifdef LIBXML_VALID_ENABLED
 6851|  1.25k|            if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6851:17): [True: 501, False: 754]
  |  Branch (6851:37): [True: 19, False: 482]
  ------------------
 6852|     19|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6853|     19|                                 "All markup of the conditional section is not"
 6854|     19|                                 " in the same entity\n",
 6855|     19|                                 NULL, NULL);
 6856|     19|            }
 6857|  1.25k|#endif
 6858|  1.25k|            SKIP(3);
  ------------------
  |  | 2248|  1.25k|#define SKIP(val) do {							\
  |  | 2249|  1.25k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  1.25k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 465, False: 790]
  |  |  ------------------
  |  | 2251|  1.25k|        xmlParserGrow(ctxt);						\
  |  | 2252|  1.25k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 1.25k]
  |  |  ------------------
  ------------------
 6859|  2.84k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|  2.84k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  1.44k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|    422|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6859:20): [True: 1.44k, False: 1.39k]
  |  Branch (6859:37): [True: 1.02k, False: 422]
  |  Branch (6859:56): [True: 418, False: 4]
  ------------------
 6860|  1.44k|            isFreshPE = 0;
 6861|  1.44k|            xmlParseMarkupDecl(ctxt);
 6862|  1.44k|        } else if (RAW == '%') {
  ------------------
  |  | 2224|  1.39k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6862:20): [True: 1.34k, False: 48]
  ------------------
 6863|  1.34k|            xmlParsePERefInternal(ctxt, 1);
 6864|  1.34k|            if (ctxt->inputNr > declInputNr) {
  ------------------
  |  Branch (6864:17): [True: 417, False: 931]
  ------------------
 6865|    417|                isFreshPE = 1;
 6866|    417|                declInputNr = ctxt->inputNr;
 6867|    417|            }
 6868|  1.34k|        } else {
 6869|     48|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6870|     48|            return;
 6871|     48|        }
 6872|       |
 6873|  6.89k|        if (depth == 0)
  ------------------
  |  Branch (6873:13): [True: 2.01k, False: 4.88k]
  ------------------
 6874|  2.01k|            break;
 6875|       |
 6876|  4.88k|        SKIP_BLANKS;
  ------------------
  |  | 2275|  4.88k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6877|  4.88k|        SHRINK;
  ------------------
  |  | 2267|  4.88k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  4.88k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  4.88k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 4.65k, False: 235]
  |  |  ------------------
  |  | 2268|  4.88k|	xmlParserShrink(ctxt);
  ------------------
 6878|  4.88k|        GROW;
  ------------------
  |  | 2271|  4.88k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  4.88k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  4.88k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 4.65k, False: 235]
  |  |  ------------------
  |  | 2272|  4.88k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.65k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 3.74k, False: 910]
  |  |  ------------------
  |  | 2273|  4.88k|	xmlParserGrow(ctxt);
  ------------------
 6879|  4.88k|    }
 6880|  4.37k|}
parser.c:xmlParserEntityCheck:
  435|  2.43M|{
  436|  2.43M|    unsigned long consumed;
  437|  2.43M|    unsigned long *expandedSize;
  438|  2.43M|    xmlParserInputPtr input = ctxt->input;
  439|  2.43M|    xmlEntityPtr entity = input->entity;
  440|       |
  441|  2.43M|    if ((entity) && (entity->flags & XML_ENT_CHECKED))
  ------------------
  |  |   20|   423k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (441:9): [True: 423k, False: 2.01M]
  |  Branch (441:21): [True: 330k, False: 92.7k]
  ------------------
  442|   330k|        return(0);
  443|       |
  444|       |    /*
  445|       |     * Compute total consumed bytes so far, including input streams of
  446|       |     * external entities.
  447|       |     */
  448|  2.10M|    consumed = input->consumed;
  449|  2.10M|    xmlSaturatedAddSizeT(&consumed, input->cur - input->base);
  450|  2.10M|    xmlSaturatedAdd(&consumed, ctxt->sizeentities);
  451|       |
  452|  2.10M|    if (entity)
  ------------------
  |  Branch (452:9): [True: 92.7k, False: 2.01M]
  ------------------
  453|  92.7k|        expandedSize = &entity->expandedSize;
  454|  2.01M|    else
  455|  2.01M|        expandedSize = &ctxt->sizeentcopy;
  456|       |
  457|       |    /*
  458|       |     * Add extra cost and some fixed cost.
  459|       |     */
  460|  2.10M|    xmlSaturatedAdd(expandedSize, extra);
  461|  2.10M|    xmlSaturatedAdd(expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  2.10M|#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.10M|    if ((*expandedSize > XML_PARSER_ALLOWED_EXPANSION) &&
  ------------------
  |  |  162|  2.10M|#define XML_PARSER_ALLOWED_EXPANSION 1000000
  ------------------
  |  Branch (468:9): [True: 591k, False: 1.51M]
  ------------------
  469|   591k|        ((*expandedSize >= ULONG_MAX) ||
  ------------------
  |  Branch (469:10): [True: 0, False: 591k]
  ------------------
  470|   591k|         (*expandedSize / ctxt->maxAmpl > consumed))) {
  ------------------
  |  Branch (470:10): [True: 240, False: 591k]
  ------------------
  471|    240|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
  472|    240|                       "Maximum entity amplification factor exceeded, see "
  473|    240|                       "xmlCtxtSetMaxAmplification.\n");
  474|    240|        return(1);
  475|    240|    }
  476|       |
  477|  2.10M|    return(0);
  478|  2.10M|}
parser.c:xmlLookupGeneralEntity:
 7395|  3.61M|xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) {
 7396|  3.61M|    xmlEntityPtr ent = NULL;
 7397|       |
 7398|       |    /*
 7399|       |     * Predefined entities override any extra definition
 7400|       |     */
 7401|  3.61M|    if ((ctxt->options & XML_PARSE_OLDSAX) == 0) {
  ------------------
  |  Branch (7401:9): [True: 1.84M, False: 1.76M]
  ------------------
 7402|  1.84M|        ent = xmlGetPredefinedEntity(name);
 7403|  1.84M|        if (ent != NULL)
  ------------------
  |  Branch (7403:13): [True: 759k, False: 1.08M]
  ------------------
 7404|   759k|            return(ent);
 7405|  1.84M|    }
 7406|       |
 7407|       |    /*
 7408|       |     * Ask first SAX for entity resolution, otherwise try the
 7409|       |     * entities which may have stored in the parser context.
 7410|       |     */
 7411|  2.85M|    if (ctxt->sax != NULL) {
  ------------------
  |  Branch (7411:9): [True: 2.85M, False: 0]
  ------------------
 7412|  2.85M|	if (ctxt->sax->getEntity != NULL)
  ------------------
  |  Branch (7412:6): [True: 2.85M, False: 0]
  ------------------
 7413|  2.85M|	    ent = ctxt->sax->getEntity(ctxt->userData, name);
 7414|  2.85M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7414:6): [True: 30.5k, False: 2.82M]
  |  Branch (7414:34): [True: 2.88k, False: 27.7k]
  ------------------
 7415|  2.88k|	    (ctxt->options & XML_PARSE_OLDSAX))
  ------------------
  |  Branch (7415:6): [True: 776, False: 2.11k]
  ------------------
 7416|    776|	    ent = xmlGetPredefinedEntity(name);
 7417|  2.85M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7417:6): [True: 30.5k, False: 2.82M]
  |  Branch (7417:34): [True: 2.88k, False: 27.7k]
  ------------------
 7418|  2.88k|	    (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (7418:6): [True: 2.88k, False: 0]
  ------------------
 7419|  2.88k|	    ent = xmlSAX2GetEntity(ctxt, name);
 7420|  2.88k|	}
 7421|  2.85M|    }
 7422|       |
 7423|  2.85M|    if (ent == NULL) {
  ------------------
  |  Branch (7423:9): [True: 300k, False: 2.55M]
  ------------------
 7424|   300k|        xmlHandleUndeclaredEntity(ctxt, name);
 7425|   300k|    }
 7426|       |
 7427|       |    /*
 7428|       |     * [ WFC: Parsed Entity ]
 7429|       |     * An entity reference must not contain the name of an
 7430|       |     * unparsed entity
 7431|       |     */
 7432|  2.55M|    else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (7432:14): [True: 468, False: 2.55M]
  ------------------
 7433|    468|	xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
 7434|    468|		 "Entity reference to unparsed entity %s\n", name);
 7435|    468|        ent = NULL;
 7436|    468|    }
 7437|       |
 7438|       |    /*
 7439|       |     * [ WFC: No External Entity References ]
 7440|       |     * Attribute values cannot contain direct or indirect
 7441|       |     * entity references to external entities.
 7442|       |     */
 7443|  2.55M|    else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
  ------------------
  |  Branch (7443:14): [True: 12.3k, False: 2.54M]
  ------------------
 7444|  12.3k|        if (inAttr) {
  ------------------
  |  Branch (7444:13): [True: 849, False: 11.5k]
  ------------------
 7445|    849|            xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
 7446|    849|                 "Attribute references external entity '%s'\n", name);
 7447|    849|            ent = NULL;
 7448|    849|        }
 7449|  12.3k|    }
 7450|       |
 7451|  2.85M|    return(ent);
 7452|  3.61M|}
parser.c:xmlParseEntityRefInternal:
 7463|   993k|xmlParseEntityRefInternal(xmlParserCtxtPtr ctxt) {
 7464|   993k|    const xmlChar *name;
 7465|       |
 7466|   993k|    GROW;
  ------------------
  |  | 2271|   993k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   993k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   993k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 414k, False: 579k]
  |  |  ------------------
  |  | 2272|   993k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   414k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 207k, False: 206k]
  |  |  ------------------
  |  | 2273|   993k|	xmlParserGrow(ctxt);
  ------------------
 7467|       |
 7468|   993k|    if (RAW != '&')
  ------------------
  |  | 2224|   993k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7468:9): [True: 0, False: 993k]
  ------------------
 7469|      0|        return(NULL);
 7470|   993k|    NEXT;
  ------------------
  |  | 2279|   993k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7471|   993k|    name = xmlParseName(ctxt);
 7472|   993k|    if (name == NULL) {
  ------------------
  |  Branch (7472:9): [True: 46.9k, False: 947k]
  ------------------
 7473|  46.9k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7474|  46.9k|		       "xmlParseEntityRef: no name\n");
 7475|  46.9k|        return(NULL);
 7476|  46.9k|    }
 7477|   947k|    if (RAW != ';') {
  ------------------
  |  | 2224|   947k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7477:9): [True: 79.6k, False: 867k]
  ------------------
 7478|  79.6k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7479|  79.6k|	return(NULL);
 7480|  79.6k|    }
 7481|   867k|    NEXT;
  ------------------
  |  | 2279|   867k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7482|       |
 7483|   867k|    return(name);
 7484|   947k|}
parser.c:xmlParsePERefInternal:
 7599|   175k|xmlParsePERefInternal(xmlParserCtxt *ctxt, int markupDecl) {
 7600|   175k|    const xmlChar *name;
 7601|   175k|    xmlEntityPtr entity = NULL;
 7602|   175k|    xmlParserInputPtr input;
 7603|       |
 7604|   175k|    if (RAW != '%')
  ------------------
  |  | 2224|   175k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7604:9): [True: 0, False: 175k]
  ------------------
 7605|      0|        return;
 7606|   175k|    NEXT;
  ------------------
  |  | 2279|   175k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7607|   175k|    name = xmlParseName(ctxt);
 7608|   175k|    if (name == NULL) {
  ------------------
  |  Branch (7608:9): [True: 12.5k, False: 162k]
  ------------------
 7609|  12.5k|	xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n");
 7610|  12.5k|	return;
 7611|  12.5k|    }
 7612|   162k|    if (RAW != ';') {
  ------------------
  |  | 2224|   162k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7612:9): [True: 12.3k, False: 150k]
  ------------------
 7613|  12.3k|	xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL);
 7614|  12.3k|        return;
 7615|  12.3k|    }
 7616|       |
 7617|   150k|    NEXT;
  ------------------
  |  | 2279|   150k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7618|       |
 7619|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7620|   150k|    ctxt->hasPErefs = 1;
 7621|       |
 7622|       |    /*
 7623|       |     * Request the entity from SAX
 7624|       |     */
 7625|   150k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7625:9): [True: 150k, False: 0]
  ------------------
 7626|   150k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7626:2): [True: 150k, False: 0]
  ------------------
 7627|   150k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7628|       |
 7629|   150k|    if (entity == NULL) {
  ------------------
  |  Branch (7629:9): [True: 45.8k, False: 104k]
  ------------------
 7630|  45.8k|        xmlHandleUndeclaredEntity(ctxt, name);
 7631|   104k|    } else {
 7632|       |	/*
 7633|       |	 * Internal checking in case the entity quest barfed
 7634|       |	 */
 7635|   104k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7635:6): [True: 97.7k, False: 6.72k]
  ------------------
 7636|  97.7k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7636:6): [True: 0, False: 97.7k]
  ------------------
 7637|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7638|      0|		  "Internal: %%%s; is not a parameter entity\n",
 7639|      0|			  name, NULL);
 7640|   104k|	} else {
 7641|   104k|	    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7641:10): [True: 97.7k, False: 6.72k]
  ------------------
 7642|  97.7k|                ((ctxt->options & XML_PARSE_NO_XXE) ||
  ------------------
  |  Branch (7642:18): [True: 196, False: 97.5k]
  ------------------
 7643|  97.5k|		 (((ctxt->loadsubset & ~XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|  97.5k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7643:5): [True: 27.5k, False: 70.0k]
  ------------------
 7644|  27.5k|		  (ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7644:5): [True: 10.8k, False: 16.6k]
  ------------------
 7645|  10.8k|		  (ctxt->validate == 0))))
  ------------------
  |  Branch (7645:5): [True: 201, False: 10.6k]
  ------------------
 7646|    397|		return;
 7647|       |
 7648|   104k|            if (entity->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   104k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (7648:17): [True: 12, False: 104k]
  ------------------
 7649|     12|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 7650|     12|                return;
 7651|     12|            }
 7652|       |
 7653|   104k|	    input = xmlNewEntityInputStream(ctxt, entity);
 7654|   104k|	    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7654:10): [True: 1.95k, False: 102k]
  ------------------
 7655|  1.95k|                xmlFreeInputStream(input);
 7656|  1.95k|		return;
 7657|  1.95k|            }
 7658|       |
 7659|   102k|            entity->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   102k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 7660|       |
 7661|   102k|            if (markupDecl)
  ------------------
  |  Branch (7661:17): [True: 94.4k, False: 7.67k]
  ------------------
 7662|  94.4k|                input->flags |= XML_INPUT_MARKUP_DECL;
  ------------------
  |  |   42|  94.4k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
 7663|       |
 7664|   102k|            GROW;
  ------------------
  |  | 2271|   102k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   102k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   102k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 102k, False: 0]
  |  |  ------------------
  |  | 2272|   102k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   102k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 64.4k, False: 37.6k]
  |  |  ------------------
  |  | 2273|   102k|	xmlParserGrow(ctxt);
  ------------------
 7665|       |
 7666|   102k|	    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (7666:10): [True: 95.3k, False: 6.71k]
  ------------------
 7667|  95.3k|                xmlDetectEncoding(ctxt);
 7668|       |
 7669|  95.3k|                if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2234|  95.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|   190k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 76.8k, False: 18.5k]
  |  |  |  |  |  Branch (2231:41): [True: 48.1k, False: 28.6k]
  |  |  |  |  ------------------
  |  |  |  | 2232|  95.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 44.1k, False: 4.04k]
  |  |  |  |  |  Branch (2232:41): [True: 43.3k, False: 767]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 41.9k, False: 1.44k]
  |  |  ------------------
  ------------------
 7670|  41.9k|                    (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|  41.9k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  41.9k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 39.3k, False: 2.62k]
  |  |  |  |  ------------------
  |  |  |  |   91|  41.9k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.55k, False: 72]
  |  |  |  |  |  Branch (91:23): [True: 849, False: 1.70k]
  |  |  |  |  ------------------
  |  |  |  |   92|  41.9k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 546, False: 1.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7671|  40.7k|                    xmlParseTextDecl(ctxt);
 7672|  40.7k|                }
 7673|  95.3k|            }
 7674|   102k|	}
 7675|   104k|    }
 7676|   150k|}
parser.c:xmlErrAttributeDup:
  238|  54.9k|{
  239|  54.9k|    if (prefix == NULL)
  ------------------
  |  Branch (239:9): [True: 12.8k, False: 42.1k]
  ------------------
  240|  12.8k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  241|  12.8k|                   XML_ERR_FATAL, localname, NULL, NULL, 0,
  242|  12.8k|                   "Attribute %s redefined\n", localname);
  243|  42.1k|    else
  244|  42.1k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  245|       |                   XML_ERR_FATAL, prefix, localname, NULL, 0,
  246|  42.1k|                   "Attribute %s:%s redefined\n", prefix, localname);
  247|  54.9k|}
parser.c:xmlParseEndTag1:
 8307|  66.6k|xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
 8308|  66.6k|    const xmlChar *name;
 8309|       |
 8310|  66.6k|    GROW;
  ------------------
  |  | 2271|  66.6k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  66.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  66.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 53.9k, False: 12.7k]
  |  |  ------------------
  |  | 2272|  66.6k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  53.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.76k, False: 44.1k]
  |  |  ------------------
  |  | 2273|  66.6k|	xmlParserGrow(ctxt);
  ------------------
 8311|  66.6k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2224|  66.6k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2226|  66.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8311:9): [True: 18, False: 66.6k]
  |  Branch (8311:25): [True: 16, False: 66.6k]
  ------------------
 8312|     34|	xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED,
 8313|     34|		       "xmlParseEndTag: '</' not found\n");
 8314|     34|	return;
 8315|     34|    }
 8316|  66.6k|    SKIP(2);
  ------------------
  |  | 2248|  66.6k|#define SKIP(val) do {							\
  |  | 2249|  66.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  66.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 344, False: 66.3k]
  |  |  ------------------
  |  | 2251|  66.6k|        xmlParserGrow(ctxt);						\
  |  | 2252|  66.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 66.6k]
  |  |  ------------------
  ------------------
 8317|       |
 8318|  66.6k|    name = xmlParseNameAndCompare(ctxt,ctxt->name);
 8319|       |
 8320|       |    /*
 8321|       |     * We should definitely be at the ending "S? '>'" part
 8322|       |     */
 8323|  66.6k|    GROW;
  ------------------
  |  | 2271|  66.6k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  66.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  66.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 53.8k, False: 12.7k]
  |  |  ------------------
  |  | 2272|  66.6k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  53.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.80k, False: 44.0k]
  |  |  ------------------
  |  | 2273|  66.6k|	xmlParserGrow(ctxt);
  ------------------
 8324|  66.6k|    SKIP_BLANKS;
  ------------------
  |  | 2275|  66.6k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8325|  66.6k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|  66.6k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  66.6k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 62.9k, False: 3.73k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 62.9k]
  |  |  |  |  ------------------
  |  |  |  |  109|  66.6k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 66.6k]
  |  |  |  |  ------------------
  |  |  |  |  110|  66.6k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 62.7k, False: 3.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2224|  62.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8325:33): [True: 4.53k, False: 58.1k]
  ------------------
 8326|  8.45k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 8327|  8.45k|    } else
 8328|  58.1k|	NEXT1;
  ------------------
  |  | 2281|  58.1k|#define NEXT1 {								\
  |  | 2282|  58.1k|	ctxt->input->col++;						\
  |  | 2283|  58.1k|	ctxt->input->cur++;						\
  |  | 2284|  58.1k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 1.38k, False: 56.8k]
  |  |  ------------------
  |  | 2285|  58.1k|	    xmlParserGrow(ctxt);						\
  |  | 2286|  58.1k|    }
  ------------------
 8329|       |
 8330|       |    /*
 8331|       |     * [ WFC: Element Type Match ]
 8332|       |     * The Name in an element's end-tag must match the element type in the
 8333|       |     * start-tag.
 8334|       |     *
 8335|       |     */
 8336|  66.6k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (8336:9): [True: 7.46k, False: 59.1k]
  ------------------
 8337|  7.46k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  1.50k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8337:13): [True: 1.50k, False: 5.95k]
  ------------------
 8338|  7.46k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 8339|  7.46k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 8340|  7.46k|		                ctxt->name, line, name);
 8341|  7.46k|    }
 8342|       |
 8343|       |    /*
 8344|       |     * SAX: End of Tag
 8345|       |     */
 8346|  66.6k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (8346:9): [True: 66.6k, False: 0]
  |  Branch (8346:32): [True: 66.6k, False: 0]
  ------------------
 8347|  66.6k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8347:2): [True: 59.4k, False: 7.24k]
  ------------------
 8348|  59.4k|        ctxt->sax->endElement(ctxt->userData, ctxt->name);
 8349|       |
 8350|  66.6k|    namePop(ctxt);
 8351|  66.6k|    spacePop(ctxt);
 8352|  66.6k|}
parser.c:xmlParseNameAndCompare:
 3303|   268k|xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
 3304|   268k|    register const xmlChar *cmp = other;
 3305|   268k|    register const xmlChar *in;
 3306|   268k|    const xmlChar *ret;
 3307|       |
 3308|   268k|    GROW;
  ------------------
  |  | 2271|   268k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   268k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   268k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 233k, False: 35.3k]
  |  |  ------------------
  |  | 2272|   268k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   233k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 18.3k, False: 215k]
  |  |  ------------------
  |  | 2273|   268k|	xmlParserGrow(ctxt);
  ------------------
 3309|       |
 3310|   268k|    in = ctxt->input->cur;
 3311|   606k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (3311:12): [True: 602k, False: 4.07k]
  |  Branch (3311:24): [True: 337k, False: 264k]
  ------------------
 3312|   337k|	++in;
 3313|   337k|	++cmp;
 3314|   337k|    }
 3315|   268k|    if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  11.4k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  11.4k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 560, False: 10.9k]
  |  |  |  |  ------------------
  |  |  |  |   91|  11.4k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 8.33k, False: 2.60k]
  |  |  |  |  |  Branch (91:23): [True: 2.01k, False: 6.31k]
  |  |  |  |  ------------------
  |  |  |  |   92|  11.4k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.83k, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3315:9): [True: 255k, False: 13.8k]
  |  Branch (3315:23): [True: 243k, False: 11.4k]
  ------------------
 3316|       |	/* success */
 3317|   247k|	ctxt->input->col += in - ctxt->input->cur;
 3318|   247k|	ctxt->input->cur = in;
 3319|   247k|	return (const xmlChar*) 1;
 3320|   247k|    }
 3321|       |    /* failure (or end of input buffer), check with full function */
 3322|  20.8k|    ret = xmlParseName (ctxt);
 3323|       |    /* strings coming from the dictionary direct compare possible */
 3324|  20.8k|    if (ret == other) {
  ------------------
  |  Branch (3324:9): [True: 4.98k, False: 15.9k]
  ------------------
 3325|  4.98k|	return (const xmlChar*) 1;
 3326|  4.98k|    }
 3327|  15.9k|    return ret;
 3328|  20.8k|}
parser.c:namePop:
 2138|   548k|{
 2139|   548k|    const xmlChar *ret;
 2140|       |
 2141|   548k|    if ((ctxt == NULL) || (ctxt->nameNr <= 0))
  ------------------
  |  Branch (2141:9): [True: 0, False: 548k]
  |  Branch (2141:27): [True: 2, False: 548k]
  ------------------
 2142|      2|        return (NULL);
 2143|   548k|    ctxt->nameNr--;
 2144|   548k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2144:9): [True: 540k, False: 8.18k]
  ------------------
 2145|   540k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2146|  8.18k|    else
 2147|  8.18k|        ctxt->name = NULL;
 2148|   548k|    ret = ctxt->nameTab[ctxt->nameNr];
 2149|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2150|   548k|    return (ret);
 2151|   548k|}
parser.c:spacePop:
 2179|   763k|static int spacePop(xmlParserCtxtPtr ctxt) {
 2180|   763k|    int ret;
 2181|   763k|    if (ctxt->spaceNr <= 0) return(0);
  ------------------
  |  Branch (2181:9): [True: 0, False: 763k]
  ------------------
 2182|   763k|    ctxt->spaceNr--;
 2183|   763k|    if (ctxt->spaceNr > 0)
  ------------------
  |  Branch (2183:9): [True: 763k, False: 14]
  ------------------
 2184|   763k|	ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1];
 2185|     14|    else
 2186|     14|        ctxt->space = &ctxt->spaceTab[0];
 2187|   763k|    ret = ctxt->spaceTab[ctxt->spaceNr];
 2188|   763k|    ctxt->spaceTab[ctxt->spaceNr] = -1;
 2189|   763k|    return(ret);
 2190|   763k|}
parser.c:xmlParseContentInternal:
 9540|  9.67k|xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
 9541|  9.67k|    int oldNameNr = ctxt->nameNr;
 9542|  9.67k|    int oldSpaceNr = ctxt->spaceNr;
 9543|  9.67k|    int oldNodeNr = ctxt->nodeNr;
 9544|       |
 9545|  9.67k|    GROW;
  ------------------
  |  | 2271|  9.67k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.67k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.67k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 9.67k, False: 0]
  |  |  ------------------
  |  | 2272|  9.67k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.67k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 7.60k, False: 2.06k]
  |  |  ------------------
  |  | 2273|  9.67k|	xmlParserGrow(ctxt);
  ------------------
 9546|  5.04M|    while ((ctxt->input->cur < ctxt->input->end) &&
  ------------------
  |  Branch (9546:12): [True: 5.03M, False: 5.27k]
  ------------------
 9547|  5.03M|	   (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  5.03M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (9547:5): [True: 5.03M, False: 411]
  ------------------
 9548|  5.03M|	const xmlChar *cur = ctxt->input->cur;
 9549|       |
 9550|       |	/*
 9551|       |	 * First case : a Processing Instruction.
 9552|       |	 */
 9553|  5.03M|	if ((*cur == '<') && (cur[1] == '?')) {
  ------------------
  |  Branch (9553:6): [True: 890k, False: 4.14M]
  |  Branch (9553:23): [True: 29.3k, False: 861k]
  ------------------
 9554|  29.3k|	    xmlParsePI(ctxt);
 9555|  29.3k|	}
 9556|       |
 9557|       |	/*
 9558|       |	 * Second case : a CDSection
 9559|       |	 */
 9560|       |	/* 2.6.0 test was *cur not RAW */
 9561|  5.00M|	else if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
  ------------------
  |  | 2242|  5.00M|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2240|  10.0M|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2238|  10.0M|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2236|  10.0M|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2234|  10.0M|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2231|  10.0M|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:5): [True: 861k, False: 4.14M]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2231:41): [True: 79.2k, False: 782k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2232|  5.00M|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:5): [True: 31.1k, False: 48.1k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2232:41): [True: 30.2k, False: 897]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2234:34): [True: 29.6k, False: 573]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2236:38): [True: 27.1k, False: 2.51k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2238:42): [True: 26.7k, False: 338]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2240:46): [True: 26.5k, False: 247]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2243|  5.00M|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2243:5): [True: 26.0k, False: 506]
  |  |  ------------------
  ------------------
 9562|  26.0k|	    xmlParseCDSect(ctxt);
 9563|  26.0k|	}
 9564|       |
 9565|       |	/*
 9566|       |	 * Third case :  a comment
 9567|       |	 */
 9568|  4.98M|	else if ((*cur == '<') && (NXT(1) == '!') &&
  ------------------
  |  | 2226|   835k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9568:11): [True: 835k, False: 4.14M]
  |  Branch (9568:28): [True: 53.2k, False: 782k]
  ------------------
 9569|  53.2k|		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2226|  53.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
              		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2226|  33.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9569:4): [True: 33.5k, False: 19.6k]
  |  Branch (9569:23): [True: 33.3k, False: 278]
  ------------------
 9570|  33.3k|	    xmlParseComment(ctxt);
 9571|  33.3k|	}
 9572|       |
 9573|       |	/*
 9574|       |	 * Fourth case :  a sub-element.
 9575|       |	 */
 9576|  4.95M|	else if (*cur == '<') {
  ------------------
  |  Branch (9576:11): [True: 802k, False: 4.14M]
  ------------------
 9577|   802k|            if (NXT(1) == '/') {
  ------------------
  |  | 2226|   802k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9577:17): [True: 248k, False: 553k]
  ------------------
 9578|   248k|                if (ctxt->nameNr <= oldNameNr)
  ------------------
  |  Branch (9578:21): [True: 3.98k, False: 244k]
  ------------------
 9579|  3.98k|                    break;
 9580|   244k|	        xmlParseElementEnd(ctxt);
 9581|   553k|            } else {
 9582|   553k|	        xmlParseElementStart(ctxt);
 9583|   553k|            }
 9584|   802k|	}
 9585|       |
 9586|       |	/*
 9587|       |	 * Fifth case : a reference. If if has not been resolved,
 9588|       |	 *    parsing returns it's Name, create the node
 9589|       |	 */
 9590|       |
 9591|  4.14M|	else if (*cur == '&') {
  ------------------
  |  Branch (9591:11): [True: 74.0k, False: 4.07M]
  ------------------
 9592|  74.0k|	    xmlParseReference(ctxt);
 9593|  74.0k|	}
 9594|       |
 9595|       |	/*
 9596|       |	 * Last case, text. Note that References are handled directly.
 9597|       |	 */
 9598|  4.07M|	else {
 9599|  4.07M|	    xmlParseCharDataInternal(ctxt, 0);
 9600|  4.07M|	}
 9601|       |
 9602|  5.03M|	SHRINK;
  ------------------
  |  | 2267|  5.03M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  5.03M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.03M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 5.03M, False: 0]
  |  |  ------------------
  |  | 2268|  5.03M|	xmlParserShrink(ctxt);
  ------------------
 9603|  5.03M|	GROW;
  ------------------
  |  | 2271|  5.03M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  5.03M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.03M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 5.03M, False: 0]
  |  |  ------------------
  |  | 2272|  5.03M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.03M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 119k, False: 4.91M]
  |  |  ------------------
  |  | 2273|  5.03M|	xmlParserGrow(ctxt);
  ------------------
 9604|  5.03M|    }
 9605|       |
 9606|  9.67k|    if ((ctxt->nameNr > oldNameNr) &&
  ------------------
  |  Branch (9606:9): [True: 1.40k, False: 8.27k]
  ------------------
 9607|  1.40k|        (ctxt->input->cur >= ctxt->input->end) &&
  ------------------
  |  Branch (9607:9): [True: 1.24k, False: 160]
  ------------------
 9608|  1.24k|        (ctxt->wellFormed)) {
  ------------------
  |  Branch (9608:9): [True: 41, False: 1.20k]
  ------------------
 9609|     41|        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9610|     41|        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9611|     41|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9612|     41|                "Premature end of data in tag %s line %d\n",
 9613|     41|                name, line, NULL);
 9614|     41|    }
 9615|       |
 9616|       |    /*
 9617|       |     * Clean up in error case
 9618|       |     */
 9619|       |
 9620|  67.2k|    while (ctxt->nodeNr > oldNodeNr)
  ------------------
  |  Branch (9620:12): [True: 57.5k, False: 9.67k]
  ------------------
 9621|  57.5k|        nodePop(ctxt);
 9622|       |
 9623|  87.9k|    while (ctxt->nameNr > oldNameNr) {
  ------------------
  |  Branch (9623:12): [True: 78.2k, False: 9.67k]
  ------------------
 9624|  78.2k|        xmlStartTag *tag = &ctxt->pushTab[ctxt->nameNr - 1];
 9625|       |
 9626|  78.2k|        if (tag->nsNr != 0)
  ------------------
  |  Branch (9626:13): [True: 21.3k, False: 56.9k]
  ------------------
 9627|  21.3k|            xmlParserNsPop(ctxt, tag->nsNr);
 9628|       |
 9629|  78.2k|        namePop(ctxt);
 9630|  78.2k|    }
 9631|       |
 9632|  87.9k|    while (ctxt->spaceNr > oldSpaceNr)
  ------------------
  |  Branch (9632:12): [True: 78.2k, False: 9.67k]
  ------------------
 9633|  78.2k|        spacePop(ctxt);
 9634|  9.67k|}
parser.c:xmlFatalErrMsgStrIntStr:
  332|   138k|{
  333|   138k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  334|       |               str1, str2, NULL, val, msg, str1, val, str2);
  335|   138k|}
parser.c:xmlParseElementStart:
 9699|   561k|xmlParseElementStart(xmlParserCtxtPtr ctxt) {
 9700|   561k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (9700:20): [True: 355k, False: 206k]
  ------------------
 9701|   561k|    const xmlChar *name;
 9702|   561k|    const xmlChar *prefix = NULL;
 9703|   561k|    const xmlChar *URI = NULL;
 9704|   561k|    xmlParserNodeInfo node_info;
 9705|   561k|    int line;
 9706|   561k|    xmlNodePtr cur;
 9707|   561k|    int nbNs = 0;
 9708|       |
 9709|   561k|    if (ctxt->nameNr > maxDepth) {
  ------------------
  |  Branch (9709:9): [True: 13, False: 561k]
  ------------------
 9710|     13|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 9711|     13|                "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
 9712|     13|                ctxt->nameNr);
 9713|     13|	return(-1);
 9714|     13|    }
 9715|       |
 9716|       |    /* Capture start position */
 9717|   561k|    if (ctxt->record_info) {
  ------------------
  |  Branch (9717:9): [True: 0, False: 561k]
  ------------------
 9718|      0|        node_info.begin_pos = ctxt->input->consumed +
 9719|      0|                          (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2227|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9720|      0|	node_info.begin_line = ctxt->input->line;
 9721|      0|    }
 9722|       |
 9723|   561k|    if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (9723:9): [True: 0, False: 561k]
  ------------------
 9724|      0|	spacePush(ctxt, -1);
 9725|   561k|    else if (*ctxt->space == -2)
  ------------------
  |  Branch (9725:14): [True: 91.5k, False: 469k]
  ------------------
 9726|  91.5k|	spacePush(ctxt, -1);
 9727|   469k|    else
 9728|   469k|	spacePush(ctxt, *ctxt->space);
 9729|       |
 9730|   561k|    line = ctxt->input->line;
 9731|   561k|#ifdef LIBXML_SAX1_ENABLED
 9732|   561k|    if (ctxt->sax2)
  ------------------
  |  Branch (9732:9): [True: 377k, False: 183k]
  ------------------
 9733|   377k|#endif /* LIBXML_SAX1_ENABLED */
 9734|   377k|        name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
 9735|   183k|#ifdef LIBXML_SAX1_ENABLED
 9736|   183k|    else
 9737|   183k|	name = xmlParseStartTag(ctxt);
 9738|   561k|#endif /* LIBXML_SAX1_ENABLED */
 9739|   561k|    if (name == NULL) {
  ------------------
  |  Branch (9739:9): [True: 30.3k, False: 531k]
  ------------------
 9740|  30.3k|	spacePop(ctxt);
 9741|  30.3k|        return(-1);
 9742|  30.3k|    }
 9743|   531k|    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
 9744|   531k|    cur = ctxt->node;
 9745|       |
 9746|   531k|#ifdef LIBXML_VALID_ENABLED
 9747|       |    /*
 9748|       |     * [ VC: Root Element Type ]
 9749|       |     * The Name in the document type declaration must match the element
 9750|       |     * type of the root element.
 9751|       |     */
 9752|   531k|    if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (9752:9): [True: 74.7k, False: 456k]
  |  Branch (9752:27): [True: 7.21k, False: 67.5k]
  |  Branch (9752:47): [True: 7.21k, False: 0]
  ------------------
 9753|  7.21k|        ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (9753:9): [True: 7.21k, False: 0]
  |  Branch (9753:23): [True: 0, False: 7.21k]
  ------------------
 9754|      0|        ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 9755|   531k|#endif /* LIBXML_VALID_ENABLED */
 9756|       |
 9757|       |    /*
 9758|       |     * Check for an Empty Element.
 9759|       |     */
 9760|   531k|    if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   531k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|   100k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9760:9): [True: 100k, False: 430k]
  |  Branch (9760:25): [True: 93.7k, False: 6.39k]
  ------------------
 9761|  93.7k|        SKIP(2);
  ------------------
  |  | 2248|  93.7k|#define SKIP(val) do {							\
  |  | 2249|  93.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|  93.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 926, False: 92.8k]
  |  |  ------------------
  |  | 2251|  93.7k|        xmlParserGrow(ctxt);						\
  |  | 2252|  93.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 93.7k]
  |  |  ------------------
  ------------------
 9762|  93.7k|	if (ctxt->sax2) {
  ------------------
  |  Branch (9762:6): [True: 45.0k, False: 48.6k]
  ------------------
 9763|  45.0k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9763:10): [True: 45.0k, False: 0]
  |  Branch (9763:33): [True: 45.0k, False: 0]
  ------------------
 9764|  45.0k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9764:3): [True: 33.0k, False: 11.9k]
  ------------------
 9765|  33.0k|		ctxt->sax->endElementNs(ctxt->userData, name, prefix, URI);
 9766|  45.0k|#ifdef LIBXML_SAX1_ENABLED
 9767|  48.6k|	} else {
 9768|  48.6k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (9768:10): [True: 48.6k, False: 0]
  |  Branch (9768:33): [True: 48.6k, False: 0]
  ------------------
 9769|  48.6k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9769:3): [True: 37.0k, False: 11.6k]
  ------------------
 9770|  37.0k|		ctxt->sax->endElement(ctxt->userData, name);
 9771|  48.6k|#endif /* LIBXML_SAX1_ENABLED */
 9772|  48.6k|	}
 9773|  93.7k|	namePop(ctxt);
 9774|  93.7k|	spacePop(ctxt);
 9775|  93.7k|	if (nbNs > 0)
  ------------------
  |  Branch (9775:6): [True: 7.28k, False: 86.4k]
  ------------------
 9776|  7.28k|	    xmlParserNsPop(ctxt, nbNs);
 9777|  93.7k|	if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9777:6): [True: 70.8k, False: 22.8k]
  |  Branch (9777:21): [True: 0, False: 70.8k]
  ------------------
 9778|      0|            node_info.node = cur;
 9779|      0|            node_info.end_pos = ctxt->input->consumed +
 9780|      0|                                (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2227|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9781|      0|            node_info.end_line = ctxt->input->line;
 9782|      0|            xmlParserAddNodeInfo(ctxt, &node_info);
 9783|      0|	}
 9784|  93.7k|	return(1);
 9785|  93.7k|    }
 9786|   437k|    if (RAW == '>') {
  ------------------
  |  | 2224|   437k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9786:9): [True: 326k, False: 110k]
  ------------------
 9787|   326k|        NEXT1;
  ------------------
  |  | 2281|   326k|#define NEXT1 {								\
  |  | 2282|   326k|	ctxt->input->col++;						\
  |  | 2283|   326k|	ctxt->input->cur++;						\
  |  | 2284|   326k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 751, False: 326k]
  |  |  ------------------
  |  | 2285|   326k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   326k|    }
  ------------------
 9788|   326k|        if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9788:13): [True: 282k, False: 44.5k]
  |  Branch (9788:28): [True: 0, False: 282k]
  ------------------
 9789|      0|            node_info.node = cur;
 9790|      0|            node_info.end_pos = 0;
 9791|      0|            node_info.end_line = 0;
 9792|      0|            xmlParserAddNodeInfo(ctxt, &node_info);
 9793|      0|        }
 9794|   326k|    } else {
 9795|   110k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_GT_REQUIRED,
 9796|   110k|		     "Couldn't find end of Start Tag %s line %d\n",
 9797|   110k|		                name, line, NULL);
 9798|       |
 9799|       |	/*
 9800|       |	 * end of parsing of this node.
 9801|       |	 */
 9802|   110k|	nodePop(ctxt);
 9803|   110k|	namePop(ctxt);
 9804|   110k|	spacePop(ctxt);
 9805|   110k|	if (nbNs > 0)
  ------------------
  |  Branch (9805:6): [True: 36.3k, False: 73.9k]
  ------------------
 9806|  36.3k|	    xmlParserNsPop(ctxt, nbNs);
 9807|   110k|	return(-1);
 9808|   110k|    }
 9809|       |
 9810|   326k|    return(0);
 9811|   437k|}
parser.c:spacePush:
 2153|   888k|static int spacePush(xmlParserCtxtPtr ctxt, int val) {
 2154|   888k|    if (ctxt->spaceNr >= ctxt->spaceMax) {
  ------------------
  |  Branch (2154:9): [True: 79.2k, False: 809k]
  ------------------
 2155|  79.2k|        int *tmp;
 2156|  79.2k|        int newSize;
 2157|       |
 2158|  79.2k|        newSize = xmlGrowCapacity(ctxt->spaceMax, sizeof(tmp[0]),
 2159|  79.2k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  79.2k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2160|  79.2k|        if (newSize < 0) {
  ------------------
  |  Branch (2160:13): [True: 0, False: 79.2k]
  ------------------
 2161|      0|	    xmlErrMemory(ctxt);
 2162|      0|	    return(-1);
 2163|      0|        }
 2164|       |
 2165|  79.2k|        tmp = xmlRealloc(ctxt->spaceTab, newSize * sizeof(tmp[0]));
 2166|  79.2k|        if (tmp == NULL) {
  ------------------
  |  Branch (2166:13): [True: 41, False: 79.1k]
  ------------------
 2167|     41|	    xmlErrMemory(ctxt);
 2168|     41|	    return(-1);
 2169|     41|	}
 2170|  79.1k|	ctxt->spaceTab = tmp;
 2171|       |
 2172|  79.1k|        ctxt->spaceMax = newSize;
 2173|  79.1k|    }
 2174|   888k|    ctxt->spaceTab[ctxt->spaceNr] = val;
 2175|   888k|    ctxt->space = &ctxt->spaceTab[ctxt->spaceNr];
 2176|   888k|    return(ctxt->spaceNr++);
 2177|   888k|}
parser.c:xmlParseStartTag2:
 8751|   595k|                  const xmlChar **URI, int *nbNsPtr) {
 8752|   595k|    xmlHashedString hlocalname;
 8753|   595k|    xmlHashedString hprefix;
 8754|   595k|    xmlHashedString hattname;
 8755|   595k|    xmlHashedString haprefix;
 8756|   595k|    const xmlChar *localname;
 8757|   595k|    const xmlChar *prefix;
 8758|   595k|    const xmlChar *attname;
 8759|   595k|    const xmlChar *aprefix;
 8760|   595k|    const xmlChar *uri;
 8761|   595k|    xmlChar *attvalue = NULL;
 8762|   595k|    const xmlChar **atts = ctxt->atts;
 8763|   595k|    unsigned attrHashSize = 0;
 8764|   595k|    int maxatts = ctxt->maxatts;
 8765|   595k|    int nratts, nbatts, nbdef;
 8766|   595k|    int i, j, nbNs, nbTotalDef, attval, nsIndex, maxAtts;
 8767|   595k|    int alloc = 0;
 8768|   595k|    int numNsErr = 0;
 8769|   595k|    int numDupErr = 0;
 8770|       |
 8771|   595k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2224|   595k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8771:9): [True: 0, False: 595k]
  ------------------
 8772|   595k|    NEXT1;
  ------------------
  |  | 2281|   595k|#define NEXT1 {								\
  |  | 2282|   595k|	ctxt->input->col++;						\
  |  | 2283|   595k|	ctxt->input->cur++;						\
  |  | 2284|   595k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 1.00k, False: 594k]
  |  |  ------------------
  |  | 2285|   595k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   595k|    }
  ------------------
 8773|       |
 8774|   595k|    nbatts = 0;
 8775|   595k|    nratts = 0;
 8776|   595k|    nbdef = 0;
 8777|   595k|    nbNs = 0;
 8778|   595k|    nbTotalDef = 0;
 8779|   595k|    attval = 0;
 8780|       |
 8781|   595k|    if (xmlParserNsStartElement(ctxt->nsdb) < 0) {
  ------------------
  |  Branch (8781:9): [True: 0, False: 595k]
  ------------------
 8782|      0|        xmlErrMemory(ctxt);
 8783|      0|        return(NULL);
 8784|      0|    }
 8785|       |
 8786|   595k|    hlocalname = xmlParseQNameHashed(ctxt, &hprefix);
 8787|   595k|    if (hlocalname.name == NULL) {
  ------------------
  |  Branch (8787:9): [True: 16.6k, False: 578k]
  ------------------
 8788|  16.6k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8789|  16.6k|		       "StartTag: invalid element name\n");
 8790|  16.6k|        return(NULL);
 8791|  16.6k|    }
 8792|   578k|    localname = hlocalname.name;
 8793|   578k|    prefix = hprefix.name;
 8794|       |
 8795|       |    /*
 8796|       |     * Now parse the attributes, it ends up with the ending
 8797|       |     *
 8798|       |     * (S Attribute)* S?
 8799|       |     */
 8800|   578k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   578k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8801|   578k|    GROW;
  ------------------
  |  | 2271|   578k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   578k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   578k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 362k, False: 216k]
  |  |  ------------------
  |  | 2272|   578k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   362k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 26.6k, False: 335k]
  |  |  ------------------
  |  | 2273|   578k|	xmlParserGrow(ctxt);
  ------------------
 8802|       |
 8803|       |    /*
 8804|       |     * The ctxt->atts array will be ultimately passed to the SAX callback
 8805|       |     * containing five xmlChar pointers for each attribute:
 8806|       |     *
 8807|       |     * [0] attribute name
 8808|       |     * [1] attribute prefix
 8809|       |     * [2] namespace URI
 8810|       |     * [3] attribute value
 8811|       |     * [4] end of attribute value
 8812|       |     *
 8813|       |     * To save memory, we reuse this array temporarily and store integers
 8814|       |     * in these pointer variables.
 8815|       |     *
 8816|       |     * [0] attribute name
 8817|       |     * [1] attribute prefix
 8818|       |     * [2] hash value of attribute prefix, and later namespace index
 8819|       |     * [3] for non-allocated values: ptrdiff_t offset into input buffer
 8820|       |     * [4] for non-allocated values: ptrdiff_t offset into input buffer
 8821|       |     *
 8822|       |     * The ctxt->attallocs array contains an additional unsigned int for
 8823|       |     * each attribute, containing the hash value of the attribute name
 8824|       |     * and the alloc flag in bit 31.
 8825|       |     */
 8826|       |
 8827|   671k|    while (((RAW != '>') &&
  ------------------
  |  | 2224|   671k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8827:13): [True: 379k, False: 292k]
  ------------------
 8828|   379k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2224|   379k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2226|   120k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8828:6): [True: 258k, False: 120k]
  |  Branch (8828:22): [True: 4.82k, False: 115k]
  ------------------
 8829|   263k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   263k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   263k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 252k, False: 11.7k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 252k]
  |  |  |  |  ------------------
  |  |  |  |  109|   263k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  110|   263k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 251k, False: 12.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   251k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8829:29): [True: 251k, False: 35]
  ------------------
 8830|   251k|	int len = -1;
 8831|       |
 8832|   251k|	hattname = xmlParseAttribute2(ctxt, prefix, localname,
 8833|   251k|                                          &haprefix, &attvalue, &len,
 8834|   251k|                                          &alloc);
 8835|   251k|        if (hattname.name == NULL)
  ------------------
  |  Branch (8835:13): [True: 60.1k, False: 191k]
  ------------------
 8836|  60.1k|	    break;
 8837|   191k|        if (attvalue == NULL)
  ------------------
  |  Branch (8837:13): [True: 23.2k, False: 167k]
  ------------------
 8838|  23.2k|            goto next_attr;
 8839|   167k|        attname = hattname.name;
 8840|   167k|        aprefix = haprefix.name;
 8841|   167k|	if (len < 0) len = xmlStrlen(attvalue);
  ------------------
  |  Branch (8841:6): [True: 0, False: 167k]
  ------------------
 8842|       |
 8843|   167k|        if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (8843:13): [True: 26.3k, False: 141k]
  |  Branch (8843:45): [True: 25.9k, False: 431]
  ------------------
 8844|  25.9k|            xmlHashedString huri;
 8845|  25.9k|            xmlURIPtr parsedUri;
 8846|       |
 8847|  25.9k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8848|  25.9k|            uri = huri.name;
 8849|  25.9k|            if (uri == NULL) {
  ------------------
  |  Branch (8849:17): [True: 1, False: 25.9k]
  ------------------
 8850|      1|                xmlErrMemory(ctxt);
 8851|      1|                goto next_attr;
 8852|      1|            }
 8853|  25.9k|            if (*uri != 0) {
  ------------------
  |  Branch (8853:17): [True: 8.67k, False: 17.2k]
  ------------------
 8854|  8.67k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8854:21): [True: 19, False: 8.65k]
  ------------------
 8855|     19|                    xmlErrMemory(ctxt);
 8856|     19|                    goto next_attr;
 8857|     19|                }
 8858|  8.65k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8858:21): [True: 2.62k, False: 6.03k]
  ------------------
 8859|  2.62k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8860|  2.62k|                             "xmlns: '%s' is not a valid URI\n",
 8861|  2.62k|                                       uri, NULL, NULL);
 8862|  6.03k|                } else {
 8863|  6.03k|                    if (parsedUri->scheme == NULL) {
  ------------------
  |  Branch (8863:25): [True: 2.36k, False: 3.66k]
  ------------------
 8864|  2.36k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8865|  2.36k|                                  "xmlns: URI %s is not absolute\n",
 8866|  2.36k|                                  uri, NULL, NULL);
 8867|  2.36k|                    }
 8868|  6.03k|                    xmlFreeURI(parsedUri);
 8869|  6.03k|                }
 8870|  8.65k|                if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8870:21): [True: 196, False: 8.45k]
  ------------------
 8871|    196|                    if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8871:25): [True: 196, False: 0]
  ------------------
 8872|    196|                        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8873|    196|                     "xml namespace URI cannot be the default namespace\n",
 8874|    196|                                 NULL, NULL, NULL);
 8875|    196|                    }
 8876|    196|                    goto next_attr;
 8877|    196|                }
 8878|  8.45k|                if ((len == 29) &&
  ------------------
  |  Branch (8878:21): [True: 2.15k, False: 6.29k]
  ------------------
 8879|  2.15k|                    (xmlStrEqual(uri,
  ------------------
  |  Branch (8879:21): [True: 805, False: 1.35k]
  ------------------
 8880|  2.15k|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|  2.15k|#define BAD_CAST (xmlChar *)
  ------------------
 8881|    805|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8882|    805|                         "reuse of the xmlns namespace name is forbidden\n",
 8883|    805|                             NULL, NULL, NULL);
 8884|    805|                    goto next_attr;
 8885|    805|                }
 8886|  8.45k|            }
 8887|       |
 8888|  24.9k|            if (xmlParserNsPush(ctxt, NULL, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8888:17): [True: 19.6k, False: 5.30k]
  ------------------
 8889|  19.6k|                nbNs++;
 8890|   142k|        } else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (8890:20): [True: 26.2k, False: 115k]
  ------------------
 8891|  26.2k|            xmlHashedString huri;
 8892|  26.2k|            xmlURIPtr parsedUri;
 8893|       |
 8894|  26.2k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8895|  26.2k|            uri = huri.name;
 8896|  26.2k|            if (uri == NULL) {
  ------------------
  |  Branch (8896:17): [True: 1, False: 26.2k]
  ------------------
 8897|      1|                xmlErrMemory(ctxt);
 8898|      1|                goto next_attr;
 8899|      1|            }
 8900|       |
 8901|  26.2k|            if (attname == ctxt->str_xml) {
  ------------------
  |  Branch (8901:17): [True: 508, False: 25.7k]
  ------------------
 8902|    508|                if (uri != ctxt->str_xml_ns) {
  ------------------
  |  Branch (8902:21): [True: 308, False: 200]
  ------------------
 8903|    308|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8904|    308|                             "xml namespace prefix mapped to wrong URI\n",
 8905|    308|                             NULL, NULL, NULL);
 8906|    308|                }
 8907|       |                /*
 8908|       |                 * Do not keep a namespace definition node
 8909|       |                 */
 8910|    508|                goto next_attr;
 8911|    508|            }
 8912|  25.7k|            if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8912:17): [True: 736, False: 25.0k]
  ------------------
 8913|    736|                if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8913:21): [True: 736, False: 0]
  ------------------
 8914|    736|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8915|    736|                             "xml namespace URI mapped to wrong prefix\n",
 8916|    736|                             NULL, NULL, NULL);
 8917|    736|                }
 8918|    736|                goto next_attr;
 8919|    736|            }
 8920|  25.0k|            if (attname == ctxt->str_xmlns) {
  ------------------
  |  Branch (8920:17): [True: 362, False: 24.6k]
  ------------------
 8921|    362|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8922|    362|                         "redefinition of the xmlns prefix is forbidden\n",
 8923|    362|                         NULL, NULL, NULL);
 8924|    362|                goto next_attr;
 8925|    362|            }
 8926|  24.6k|            if ((len == 29) &&
  ------------------
  |  Branch (8926:17): [True: 374, False: 24.2k]
  ------------------
 8927|    374|                (xmlStrEqual(uri,
  ------------------
  |  Branch (8927:17): [True: 211, False: 163]
  ------------------
 8928|    374|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    374|#define BAD_CAST (xmlChar *)
  ------------------
 8929|    211|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8930|    211|                         "reuse of the xmlns namespace name is forbidden\n",
 8931|    211|                         NULL, NULL, NULL);
 8932|    211|                goto next_attr;
 8933|    211|            }
 8934|  24.4k|            if ((uri == NULL) || (uri[0] == 0)) {
  ------------------
  |  Branch (8934:17): [True: 0, False: 24.4k]
  |  Branch (8934:34): [True: 104, False: 24.3k]
  ------------------
 8935|    104|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8936|    104|                         "xmlns:%s: Empty XML namespace is not allowed\n",
 8937|    104|                              attname, NULL, NULL);
 8938|    104|                goto next_attr;
 8939|  24.3k|            } else {
 8940|  24.3k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8940:21): [True: 4, False: 24.3k]
  ------------------
 8941|      4|                    xmlErrMemory(ctxt);
 8942|      4|                    goto next_attr;
 8943|      4|                }
 8944|  24.3k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8944:21): [True: 5.54k, False: 18.7k]
  ------------------
 8945|  5.54k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8946|  5.54k|                         "xmlns:%s: '%s' is not a valid URI\n",
 8947|  5.54k|                                       attname, uri, NULL);
 8948|  18.7k|                } else {
 8949|  18.7k|                    if ((ctxt->pedantic) && (parsedUri->scheme == NULL)) {
  ------------------
  |  Branch (8949:25): [True: 8.33k, False: 10.4k]
  |  Branch (8949:45): [True: 6.72k, False: 1.61k]
  ------------------
 8950|  6.72k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8951|  6.72k|                                  "xmlns:%s: URI %s is not absolute\n",
 8952|  6.72k|                                  attname, uri, NULL);
 8953|  6.72k|                    }
 8954|  18.7k|                    xmlFreeURI(parsedUri);
 8955|  18.7k|                }
 8956|  24.3k|            }
 8957|       |
 8958|  24.3k|            if (xmlParserNsPush(ctxt, &hattname, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8958:17): [True: 22.9k, False: 1.41k]
  ------------------
 8959|  22.9k|                nbNs++;
 8960|   115k|        } else {
 8961|       |            /*
 8962|       |             * Populate attributes array, see above for repurposing
 8963|       |             * of xmlChar pointers.
 8964|       |             */
 8965|   115k|            if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (8965:17): [True: 10.7k, False: 104k]
  |  Branch (8965:35): [True: 9.17k, False: 95.8k]
  ------------------
 8966|  19.9k|                int res = xmlCtxtGrowAttrs(ctxt);
 8967|       |
 8968|  19.9k|                maxatts = ctxt->maxatts;
 8969|  19.9k|                atts = ctxt->atts;
 8970|       |
 8971|  19.9k|                if (res < 0)
  ------------------
  |  Branch (8971:21): [True: 5, False: 19.9k]
  ------------------
 8972|      5|                    goto next_attr;
 8973|  19.9k|            }
 8974|   115k|            ctxt->attallocs[nratts++] = (hattname.hashValue & 0x7FFFFFFF) |
 8975|   115k|                                        ((unsigned) alloc << 31);
 8976|   115k|            atts[nbatts++] = attname;
 8977|   115k|            atts[nbatts++] = aprefix;
 8978|   115k|            atts[nbatts++] = XML_INT_TO_PTR(haprefix.hashValue);
  ------------------
  |  |   59|   115k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8979|   115k|            if (alloc) {
  ------------------
  |  Branch (8979:17): [True: 21.0k, False: 94.6k]
  ------------------
 8980|  21.0k|                atts[nbatts++] = attvalue;
 8981|  21.0k|                attvalue += len;
 8982|  21.0k|                atts[nbatts++] = attvalue;
 8983|  94.6k|            } else {
 8984|       |                /*
 8985|       |                 * attvalue points into the input buffer which can be
 8986|       |                 * reallocated. Store differences to input->base instead.
 8987|       |                 * The pointers will be reconstructed later.
 8988|       |                 */
 8989|  94.6k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|  94.6k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8990|  94.6k|                attvalue += len;
 8991|  94.6k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|  94.6k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 8992|  94.6k|            }
 8993|       |            /*
 8994|       |             * tag if some deallocation is needed
 8995|       |             */
 8996|   115k|            if (alloc != 0) attval = 1;
  ------------------
  |  Branch (8996:17): [True: 21.0k, False: 94.6k]
  ------------------
 8997|   115k|            attvalue = NULL; /* moved into atts */
 8998|   115k|        }
 8999|       |
 9000|   191k|next_attr:
 9001|   191k|        if ((attvalue != NULL) && (alloc != 0)) {
  ------------------
  |  Branch (9001:13): [True: 52.2k, False: 138k]
  |  Branch (9001:35): [True: 5.72k, False: 46.5k]
  ------------------
 9002|  5.72k|            xmlFree(attvalue);
 9003|  5.72k|            attvalue = NULL;
 9004|  5.72k|        }
 9005|       |
 9006|   191k|	GROW
  ------------------
  |  | 2271|   191k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   191k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   191k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 70.4k, False: 120k]
  |  |  ------------------
  |  | 2272|   191k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  70.4k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 9.79k, False: 60.6k]
  |  |  ------------------
  |  | 2273|   191k|	xmlParserGrow(ctxt);
  ------------------
 9007|   191k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   191k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2224|   136k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2226|  15.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9007:6): [True: 54.3k, False: 136k]
  |  Branch (9007:24): [True: 15.9k, False: 120k]
  |  Branch (9007:40): [True: 15.1k, False: 754]
  ------------------
 9008|  69.4k|	    break;
 9009|   121k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2275|   121k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (9009:6): [True: 28.6k, False: 93.0k]
  ------------------
 9010|  28.6k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 9011|  28.6k|			   "attributes construct error\n");
 9012|  28.6k|	    break;
 9013|  28.6k|	}
 9014|  93.0k|        GROW;
  ------------------
  |  | 2271|  93.0k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  93.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  93.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 17.6k, False: 75.4k]
  |  |  ------------------
  |  | 2272|  93.0k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  17.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 4.65k, False: 12.9k]
  |  |  ------------------
  |  | 2273|  93.0k|	xmlParserGrow(ctxt);
  ------------------
 9015|  93.0k|    }
 9016|       |
 9017|       |    /*
 9018|       |     * Namespaces from default attributes
 9019|       |     */
 9020|   578k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9020:9): [True: 173k, False: 405k]
  ------------------
 9021|   173k|        xmlDefAttrsPtr defaults;
 9022|       |
 9023|   173k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9024|   173k|	if (defaults != NULL) {
  ------------------
  |  Branch (9024:6): [True: 120k, False: 52.4k]
  ------------------
 9025|   547k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9025:18): [True: 427k, False: 120k]
  ------------------
 9026|   427k|                xmlDefAttr *attr = &defaults->attrs[i];
 9027|       |
 9028|   427k|	        attname = attr->name.name;
 9029|   427k|		aprefix = attr->prefix.name;
 9030|       |
 9031|   427k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (9031:7): [True: 20.2k, False: 406k]
  |  Branch (9031:39): [True: 19.0k, False: 1.15k]
  ------------------
 9032|  19.0k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9033|       |
 9034|  19.0k|                    if (xmlParserNsPush(ctxt, NULL, &attr->value, NULL, 1) > 0)
  ------------------
  |  Branch (9034:25): [True: 18.0k, False: 984]
  ------------------
 9035|  18.0k|                        nbNs++;
 9036|   408k|		} else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (9036:14): [True: 176k, False: 231k]
  ------------------
 9037|   176k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9038|       |
 9039|   176k|                    if (xmlParserNsPush(ctxt, &attr->name, &attr->value,
  ------------------
  |  Branch (9039:25): [True: 174k, False: 2.62k]
  ------------------
 9040|   176k|                                      NULL, 1) > 0)
 9041|   174k|                        nbNs++;
 9042|   231k|		} else {
 9043|   231k|                    if (nratts + nbTotalDef >= XML_MAX_ATTRS) {
  ------------------
  |  |   93|   231k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (9043:25): [True: 0, False: 231k]
  ------------------
 9044|      0|                        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 9045|      0|                                    "Maximum number of attributes exceeded");
 9046|      0|                        break;
 9047|      0|                    }
 9048|   231k|                    nbTotalDef += 1;
 9049|   231k|                }
 9050|   427k|	    }
 9051|   120k|	}
 9052|   173k|    }
 9053|       |
 9054|       |    /*
 9055|       |     * Resolve attribute namespaces
 9056|       |     */
 9057|   694k|    for (i = 0; i < nbatts; i += 5) {
  ------------------
  |  Branch (9057:17): [True: 115k, False: 578k]
  ------------------
 9058|   115k|        attname = atts[i];
 9059|   115k|        aprefix = atts[i+1];
 9060|       |
 9061|       |        /*
 9062|       |	* The default namespace does not apply to attribute names.
 9063|       |	*/
 9064|   115k|	if (aprefix == NULL) {
  ------------------
  |  Branch (9064:6): [True: 46.9k, False: 68.7k]
  ------------------
 9065|  46.9k|            nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  46.9k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9066|  68.7k|        } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9066:20): [True: 44.6k, False: 24.1k]
  ------------------
 9067|  44.6k|            nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  44.6k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9068|  44.6k|        } else {
 9069|  24.1k|            haprefix.name = aprefix;
 9070|  24.1k|            haprefix.hashValue = (size_t) atts[i+2];
 9071|  24.1k|            nsIndex = xmlParserNsLookup(ctxt, &haprefix, NULL);
 9072|       |
 9073|  24.1k|	    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9073:10): [True: 14.4k, False: 9.72k]
  |  Branch (9073:34): [True: 195, False: 9.52k]
  ------------------
 9074|  14.6k|                xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9075|  14.6k|		    "Namespace prefix %s for %s on %s is not defined\n",
 9076|  14.6k|		    aprefix, attname, localname);
 9077|  14.6k|                nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  14.6k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9078|  14.6k|            }
 9079|  24.1k|        }
 9080|       |
 9081|   115k|        atts[i+2] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   115k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9082|   115k|    }
 9083|       |
 9084|       |    /*
 9085|       |     * Maximum number of attributes including default attributes.
 9086|       |     */
 9087|   578k|    maxAtts = nratts + nbTotalDef;
 9088|       |
 9089|       |    /*
 9090|       |     * Verify that attribute names are unique.
 9091|       |     */
 9092|   578k|    if (maxAtts > 1) {
  ------------------
  |  Branch (9092:9): [True: 40.4k, False: 538k]
  ------------------
 9093|  40.4k|        attrHashSize = 4;
 9094|  94.7k|        while (attrHashSize / 2 < (unsigned) maxAtts)
  ------------------
  |  Branch (9094:16): [True: 54.3k, False: 40.4k]
  ------------------
 9095|  54.3k|            attrHashSize *= 2;
 9096|       |
 9097|  40.4k|        if (attrHashSize > ctxt->attrHashMax) {
  ------------------
  |  Branch (9097:13): [True: 6.26k, False: 34.1k]
  ------------------
 9098|  6.26k|            xmlAttrHashBucket *tmp;
 9099|       |
 9100|  6.26k|            tmp = xmlRealloc(ctxt->attrHash, attrHashSize * sizeof(tmp[0]));
 9101|  6.26k|            if (tmp == NULL) {
  ------------------
  |  Branch (9101:17): [True: 3, False: 6.25k]
  ------------------
 9102|      3|                xmlErrMemory(ctxt);
 9103|      3|                goto done;
 9104|      3|            }
 9105|       |
 9106|  6.25k|            ctxt->attrHash = tmp;
 9107|  6.25k|            ctxt->attrHashMax = attrHashSize;
 9108|  6.25k|        }
 9109|       |
 9110|  40.4k|        memset(ctxt->attrHash, -1, attrHashSize * sizeof(ctxt->attrHash[0]));
 9111|       |
 9112|   125k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9112:28): [True: 84.7k, False: 40.4k]
  ------------------
 9113|  84.7k|            const xmlChar *nsuri;
 9114|  84.7k|            unsigned hashValue, nameHashValue, uriHashValue;
 9115|  84.7k|            int res;
 9116|       |
 9117|  84.7k|            attname = atts[i];
 9118|  84.7k|            aprefix = atts[i+1];
 9119|  84.7k|            nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|  84.7k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9120|       |            /* Hash values always have bit 31 set, see dict.c */
 9121|  84.7k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9122|       |
 9123|  84.7k|            if (nsIndex == NS_INDEX_EMPTY) {
  ------------------
  |  |   80|  84.7k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (9123:17): [True: 37.3k, False: 47.3k]
  ------------------
 9124|       |                /*
 9125|       |                 * Prefix with empty namespace means an undeclared
 9126|       |                 * prefix which was already reported above.
 9127|       |                 */
 9128|  37.3k|                if (aprefix != NULL)
  ------------------
  |  Branch (9128:21): [True: 12.0k, False: 25.3k]
  ------------------
 9129|  12.0k|                    continue;
 9130|  25.3k|                nsuri = NULL;
 9131|  25.3k|                uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  25.3k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9132|  47.3k|            } else if (nsIndex == NS_INDEX_XML) {
  ------------------
  |  |   81|  47.3k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (9132:24): [True: 38.0k, False: 9.28k]
  ------------------
 9133|  38.0k|                nsuri = ctxt->str_xml_ns;
 9134|  38.0k|                uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  38.0k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9135|  38.0k|            } else {
 9136|  9.28k|                nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9137|  9.28k|                uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9138|  9.28k|            }
 9139|       |
 9140|  72.6k|            hashValue = xmlDictCombineHash(nameHashValue, uriHashValue);
 9141|  72.6k|            res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9142|  72.6k|                                    hashValue, i);
 9143|  72.6k|            if (res < 0)
  ------------------
  |  Branch (9143:17): [True: 0, False: 72.6k]
  ------------------
 9144|      0|                continue;
 9145|       |
 9146|       |            /*
 9147|       |             * [ WFC: Unique Att Spec ]
 9148|       |             * No attribute name may appear more than once in the same
 9149|       |             * start-tag or empty-element tag.
 9150|       |             * As extended by the Namespace in XML REC.
 9151|       |             */
 9152|  72.6k|            if (res < INT_MAX) {
  ------------------
  |  Branch (9152:17): [True: 45.6k, False: 26.9k]
  ------------------
 9153|  45.6k|                if (aprefix == atts[res+1]) {
  ------------------
  |  Branch (9153:21): [True: 40.6k, False: 5.00k]
  ------------------
 9154|  40.6k|                    xmlErrAttributeDup(ctxt, aprefix, attname);
 9155|  40.6k|                    numDupErr += 1;
 9156|  40.6k|                } else {
 9157|  5.00k|                    xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9158|  5.00k|                             "Namespaced Attribute %s in '%s' redefined\n",
 9159|  5.00k|                             attname, nsuri, NULL);
 9160|  5.00k|                    numNsErr += 1;
 9161|  5.00k|                }
 9162|  45.6k|            }
 9163|  72.6k|        }
 9164|  40.4k|    }
 9165|       |
 9166|       |    /*
 9167|       |     * Default attributes
 9168|       |     */
 9169|   578k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9169:9): [True: 173k, False: 405k]
  ------------------
 9170|   173k|        xmlDefAttrsPtr defaults;
 9171|       |
 9172|   173k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9173|   173k|	if (defaults != NULL) {
  ------------------
  |  Branch (9173:6): [True: 120k, False: 52.4k]
  ------------------
 9174|   547k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9174:18): [True: 427k, False: 120k]
  ------------------
 9175|   427k|                xmlDefAttr *attr = &defaults->attrs[i];
 9176|   427k|                const xmlChar *nsuri = NULL;
 9177|   427k|                unsigned hashValue, uriHashValue = 0;
 9178|   427k|                int res;
 9179|       |
 9180|   427k|	        attname = attr->name.name;
 9181|   427k|		aprefix = attr->prefix.name;
 9182|       |
 9183|   427k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL))
  ------------------
  |  Branch (9183:7): [True: 20.2k, False: 406k]
  |  Branch (9183:39): [True: 19.0k, False: 1.15k]
  ------------------
 9184|  19.0k|                    continue;
 9185|   408k|		if (aprefix == ctxt->str_xmlns)
  ------------------
  |  Branch (9185:7): [True: 176k, False: 231k]
  ------------------
 9186|   176k|                    continue;
 9187|       |
 9188|   231k|                if (aprefix == NULL) {
  ------------------
  |  Branch (9188:21): [True: 121k, False: 110k]
  ------------------
 9189|   121k|                    nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   121k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9190|   121k|                    nsuri = NULL;
 9191|   121k|                    uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   121k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9192|   121k|                } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9192:28): [True: 31.7k, False: 78.2k]
  ------------------
 9193|  31.7k|                    nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  31.7k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9194|  31.7k|                    nsuri = ctxt->str_xml_ns;
 9195|  31.7k|                    uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  31.7k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9196|  78.2k|                } else {
 9197|  78.2k|                    nsIndex = xmlParserNsLookup(ctxt, &attr->prefix, NULL);
 9198|  78.2k|                    if ((nsIndex == INT_MAX) ||
  ------------------
  |  Branch (9198:25): [True: 66.1k, False: 12.1k]
  ------------------
 9199|  66.3k|                        (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9199:25): [True: 201, False: 11.9k]
  ------------------
 9200|  66.3k|                        xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9201|  66.3k|                                 "Namespace prefix %s for %s on %s is not "
 9202|  66.3k|                                 "defined\n",
 9203|  66.3k|                                 aprefix, attname, localname);
 9204|  66.3k|                        nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  66.3k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9205|  66.3k|                        nsuri = NULL;
 9206|  66.3k|                        uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  66.3k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9207|  66.3k|                    } else {
 9208|  11.9k|                        nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9209|  11.9k|                        uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9210|  11.9k|                    }
 9211|  78.2k|                }
 9212|       |
 9213|       |                /*
 9214|       |                 * Check whether the attribute exists
 9215|       |                 */
 9216|   231k|                if (maxAtts > 1) {
  ------------------
  |  Branch (9216:21): [True: 201k, False: 30.0k]
  ------------------
 9217|   201k|                    hashValue = xmlDictCombineHash(attr->name.hashValue,
 9218|   201k|                                                   uriHashValue);
 9219|   201k|                    res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9220|   201k|                                            hashValue, nbatts);
 9221|   201k|                    if (res < 0)
  ------------------
  |  Branch (9221:25): [True: 0, False: 201k]
  ------------------
 9222|      0|                        continue;
 9223|   201k|                    if (res < INT_MAX) {
  ------------------
  |  Branch (9223:25): [True: 7.05k, False: 194k]
  ------------------
 9224|  7.05k|                        if (aprefix == atts[res+1])
  ------------------
  |  Branch (9224:29): [True: 910, False: 6.14k]
  ------------------
 9225|    910|                            continue;
 9226|  6.14k|                        xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9227|  6.14k|                                 "Namespaced Attribute %s in '%s' redefined\n",
 9228|  6.14k|                                 attname, nsuri, NULL);
 9229|  6.14k|                    }
 9230|   201k|                }
 9231|       |
 9232|   230k|                xmlParserEntityCheck(ctxt, attr->expandedSize);
 9233|       |
 9234|   230k|                if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9234:21): [True: 1.17k, False: 229k]
  |  Branch (9234:39): [True: 881, False: 228k]
  ------------------
 9235|  2.05k|                    res = xmlCtxtGrowAttrs(ctxt);
 9236|       |
 9237|  2.05k|                    maxatts = ctxt->maxatts;
 9238|  2.05k|                    atts = ctxt->atts;
 9239|       |
 9240|  2.05k|                    if (res < 0) {
  ------------------
  |  Branch (9240:25): [True: 4, False: 2.04k]
  ------------------
 9241|      4|                        localname = NULL;
 9242|      4|                        goto done;
 9243|      4|                    }
 9244|  2.05k|                }
 9245|       |
 9246|   230k|                atts[nbatts++] = attname;
 9247|   230k|                atts[nbatts++] = aprefix;
 9248|   230k|                atts[nbatts++] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   230k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9249|   230k|                atts[nbatts++] = attr->value.name;
 9250|   230k|                atts[nbatts++] = attr->valueEnd;
 9251|       |
 9252|   230k|#ifdef LIBXML_VALID_ENABLED
 9253|       |                /*
 9254|       |                 * This should be moved to valid.c, but we don't keep track
 9255|       |                 * whether an attribute was defaulted.
 9256|       |                 */
 9257|   230k|                if ((ctxt->validate) &&
  ------------------
  |  Branch (9257:21): [True: 100k, False: 130k]
  ------------------
 9258|   100k|                    (ctxt->standalone == 1) &&
  ------------------
  |  Branch (9258:21): [True: 883, False: 99.5k]
  ------------------
 9259|    883|                    (attr->external != 0)) {
  ------------------
  |  Branch (9259:21): [True: 811, False: 72]
  ------------------
 9260|    811|                    xmlValidityError(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 9261|    811|                            "standalone: attribute %s on %s defaulted "
 9262|    811|                            "from external subset\n",
 9263|    811|                            attname, localname);
 9264|    811|                }
 9265|   230k|#endif
 9266|   230k|                nbdef++;
 9267|   230k|	    }
 9268|   120k|	}
 9269|   173k|    }
 9270|       |
 9271|       |    /*
 9272|       |     * Using a single hash table for nsUri/localName pairs cannot
 9273|       |     * detect duplicate QNames reliably. The following example will
 9274|       |     * only result in two namespace errors.
 9275|       |     *
 9276|       |     * <doc xmlns:a="a" xmlns:b="a">
 9277|       |     *   <elem a:a="" b:a="" b:a=""/>
 9278|       |     * </doc>
 9279|       |     *
 9280|       |     * If we saw more than one namespace error but no duplicate QNames
 9281|       |     * were found, we have to scan for duplicate QNames.
 9282|       |     */
 9283|   578k|    if ((numDupErr == 0) && (numNsErr > 1)) {
  ------------------
  |  Branch (9283:9): [True: 577k, False: 782]
  |  Branch (9283:29): [True: 1.18k, False: 576k]
  ------------------
 9284|  1.18k|        memset(ctxt->attrHash, -1,
 9285|  1.18k|               attrHashSize * sizeof(ctxt->attrHash[0]));
 9286|       |
 9287|  9.15k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9287:28): [True: 7.97k, False: 1.18k]
  ------------------
 9288|  7.97k|            unsigned hashValue, nameHashValue, prefixHashValue;
 9289|  7.97k|            int res;
 9290|       |
 9291|  7.97k|            aprefix = atts[i+1];
 9292|  7.97k|            if (aprefix == NULL)
  ------------------
  |  Branch (9292:17): [True: 296, False: 7.67k]
  ------------------
 9293|    296|                continue;
 9294|       |
 9295|  7.67k|            attname = atts[i];
 9296|       |            /* Hash values always have bit 31 set, see dict.c */
 9297|  7.67k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9298|  7.67k|            prefixHashValue = xmlDictComputeHash(ctxt->dict, aprefix);
 9299|       |
 9300|  7.67k|            hashValue = xmlDictCombineHash(nameHashValue, prefixHashValue);
 9301|  7.67k|            res = xmlAttrHashInsertQName(ctxt, attrHashSize, attname,
 9302|  7.67k|                                         aprefix, hashValue, i);
 9303|  7.67k|            if (res < INT_MAX)
  ------------------
  |  Branch (9303:17): [True: 3.75k, False: 3.92k]
  ------------------
 9304|  3.75k|                xmlErrAttributeDup(ctxt, aprefix, attname);
 9305|  7.67k|        }
 9306|  1.18k|    }
 9307|       |
 9308|       |    /*
 9309|       |     * Reconstruct attribute pointers
 9310|       |     */
 9311|   924k|    for (i = 0, j = 0; i < nbatts; i += 5, j++) {
  ------------------
  |  Branch (9311:24): [True: 346k, False: 578k]
  ------------------
 9312|       |        /* namespace URI */
 9313|   346k|        nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   346k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9314|   346k|        if (nsIndex == INT_MAX)
  ------------------
  |  Branch (9314:13): [True: 248k, False: 97.5k]
  ------------------
 9315|   248k|            atts[i+2] = NULL;
 9316|  97.5k|        else if (nsIndex == INT_MAX - 1)
  ------------------
  |  Branch (9316:18): [True: 76.1k, False: 21.4k]
  ------------------
 9317|  76.1k|            atts[i+2] = ctxt->str_xml_ns;
 9318|  21.4k|        else
 9319|  21.4k|            atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
 9320|       |
 9321|   346k|        if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
  ------------------
  |  Branch (9321:13): [True: 115k, False: 230k]
  |  Branch (9321:29): [True: 94.6k, False: 21.0k]
  ------------------
 9322|  94.6k|            atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  | 2228|  94.6k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  |   58|  94.6k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9323|  94.6k|            atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  | 2228|  94.6k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  |   58|  94.6k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9324|  94.6k|        }
 9325|   346k|    }
 9326|       |
 9327|   578k|    uri = xmlParserNsLookupUri(ctxt, &hprefix);
 9328|   578k|    if ((prefix != NULL) && (uri == NULL)) {
  ------------------
  |  Branch (9328:9): [True: 63.3k, False: 515k]
  |  Branch (9328:29): [True: 35.9k, False: 27.3k]
  ------------------
 9329|  35.9k|	xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9330|  35.9k|	         "Namespace prefix %s on %s is not defined\n",
 9331|  35.9k|		 prefix, localname, NULL);
 9332|  35.9k|    }
 9333|   578k|    *pref = prefix;
 9334|   578k|    *URI = uri;
 9335|       |
 9336|       |    /*
 9337|       |     * SAX callback
 9338|       |     */
 9339|   578k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElementNs != NULL) &&
  ------------------
  |  Branch (9339:9): [True: 578k, False: 0]
  |  Branch (9339:32): [True: 578k, False: 0]
  ------------------
 9340|   578k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (9340:2): [True: 459k, False: 119k]
  ------------------
 9341|   459k|	if (nbNs > 0)
  ------------------
  |  Branch (9341:6): [True: 62.4k, False: 397k]
  ------------------
 9342|  62.4k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9343|  62.4k|                          nbNs, ctxt->nsTab + 2 * (ctxt->nsNr - nbNs),
 9344|  62.4k|			  nbatts / 5, nbdef, atts);
 9345|   397k|	else
 9346|   397k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9347|   397k|                          0, NULL, nbatts / 5, nbdef, atts);
 9348|   459k|    }
 9349|       |
 9350|   578k|done:
 9351|       |    /*
 9352|       |     * Free allocated attribute values
 9353|       |     */
 9354|   578k|    if (attval != 0) {
  ------------------
  |  Branch (9354:9): [True: 11.7k, False: 566k]
  ------------------
 9355|  70.7k|	for (i = 0, j = 0; j < nratts; i += 5, j++)
  ------------------
  |  Branch (9355:21): [True: 58.9k, False: 11.7k]
  ------------------
 9356|  58.9k|	    if (ctxt->attallocs[j] & 0x80000000)
  ------------------
  |  Branch (9356:10): [True: 21.0k, False: 37.8k]
  ------------------
 9357|  21.0k|	        xmlFree((xmlChar *) atts[i+3]);
 9358|  11.7k|    }
 9359|       |
 9360|   578k|    *nbNsPtr = nbNs;
 9361|   578k|    return(localname);
 9362|   578k|}
parser.c:xmlParserNsStartElement:
 1467|   595k|xmlParserNsStartElement(xmlParserNsData *nsdb) {
 1468|   595k|    if (nsdb->elementId == UINT_MAX)
  ------------------
  |  Branch (1468:9): [True: 0, False: 595k]
  ------------------
 1469|      0|        return(-1);
 1470|   595k|    nsdb->elementId++;
 1471|       |
 1472|   595k|    return(0);
 1473|   595k|}
parser.c:xmlParseQNameHashed:
 8392|   863k|xmlParseQNameHashed(xmlParserCtxtPtr ctxt, xmlHashedString *prefix) {
 8393|   863k|    xmlHashedString l, p;
 8394|   863k|    int start, isNCName = 0;
 8395|       |
 8396|   863k|    l.name = NULL;
 8397|   863k|    p.name = NULL;
 8398|       |
 8399|   863k|    GROW;
  ------------------
  |  | 2271|   863k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   863k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   863k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 508k, False: 354k]
  |  |  ------------------
  |  | 2272|   863k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   508k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 40.4k, False: 467k]
  |  |  ------------------
  |  | 2273|   863k|	xmlParserGrow(ctxt);
  ------------------
 8400|   863k|    start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2227|   863k|#define CUR_PTR ctxt->input->cur
  ------------------
                  start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2228|   863k|#define BASE_PTR ctxt->input->base
  ------------------
 8401|       |
 8402|   863k|    l = xmlParseNCName(ctxt);
 8403|   863k|    if (l.name != NULL) {
  ------------------
  |  Branch (8403:9): [True: 780k, False: 82.5k]
  ------------------
 8404|   780k|        isNCName = 1;
 8405|   780k|        if (CUR == ':') {
  ------------------
  |  | 2225|   780k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8405:13): [True: 180k, False: 599k]
  ------------------
 8406|   180k|            NEXT;
  ------------------
  |  | 2279|   180k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8407|   180k|            p = l;
 8408|   180k|            l = xmlParseNCName(ctxt);
 8409|   180k|        }
 8410|   780k|    }
 8411|   863k|    if ((l.name == NULL) || (CUR == ':')) {
  ------------------
  |  | 2225|   771k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8411:9): [True: 91.8k, False: 771k]
  |  Branch (8411:29): [True: 1.76k, False: 769k]
  ------------------
 8412|  93.5k|        xmlChar *tmp;
 8413|       |
 8414|  93.5k|        l.name = NULL;
 8415|  93.5k|        p.name = NULL;
 8416|  93.5k|        if ((isNCName == 0) && (CUR != ':'))
  ------------------
  |  | 2225|  82.5k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8416:13): [True: 82.5k, False: 11.0k]
  |  Branch (8416:32): [True: 77.8k, False: 4.69k]
  ------------------
 8417|  77.8k|            return(l);
 8418|  15.7k|        tmp = xmlParseNmtoken(ctxt);
 8419|  15.7k|        if (tmp != NULL)
  ------------------
  |  Branch (8419:13): [True: 7.68k, False: 8.10k]
  ------------------
 8420|  7.68k|            xmlFree(tmp);
 8421|  15.7k|        l = xmlDictLookupHashed(ctxt->dict, BASE_PTR + start,
  ------------------
  |  | 2228|  15.7k|#define BASE_PTR ctxt->input->base
  ------------------
 8422|  15.7k|                                CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2227|  15.7k|#define CUR_PTR ctxt->input->cur
  ------------------
                                              CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2228|  15.7k|#define BASE_PTR ctxt->input->base
  ------------------
 8423|  15.7k|        if (l.name == NULL) {
  ------------------
  |  Branch (8423:13): [True: 1, False: 15.7k]
  ------------------
 8424|      1|            xmlErrMemory(ctxt);
 8425|      1|            return(l);
 8426|      1|        }
 8427|  15.7k|        xmlNsErr(ctxt, XML_NS_ERR_QNAME,
 8428|  15.7k|                 "Failed to parse QName '%s'\n", l.name, NULL, NULL);
 8429|  15.7k|    }
 8430|       |
 8431|   785k|    *prefix = p;
 8432|   785k|    return(l);
 8433|   863k|}
parser.c:xmlParseNCName:
 3246|  1.04M|xmlParseNCName(xmlParserCtxtPtr ctxt) {
 3247|  1.04M|    const xmlChar *in, *e;
 3248|  1.04M|    xmlHashedString ret;
 3249|  1.04M|    size_t count = 0;
 3250|  1.04M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3250:24): [True: 603k, False: 440k]
  ------------------
 3251|   603k|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   603k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3252|  1.04M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  1.48M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3253|       |
 3254|  1.04M|    ret.name = NULL;
 3255|       |
 3256|       |    /*
 3257|       |     * Accelerator for simple ASCII names
 3258|       |     */
 3259|  1.04M|    in = ctxt->input->cur;
 3260|  1.04M|    e = ctxt->input->end;
 3261|  1.04M|    if ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3261:11): [True: 949k, False: 94.6k]
  |  Branch (3261:28): [True: 938k, False: 11.2k]
  ------------------
 3262|   105k|	 ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3262:4): [True: 24.6k, False: 81.3k]
  |  Branch (3262:21): [True: 10.2k, False: 14.3k]
  ------------------
 3263|   949k|	 (*in == '_')) && (in < e)) {
  ------------------
  |  Branch (3263:3): [True: 1.47k, False: 94.2k]
  |  Branch (3263:20): [True: 949k, False: 0]
  ------------------
 3264|   949k|	in++;
 3265|  6.02M|	while ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3265:11): [True: 3.41M, False: 2.61M]
  |  Branch (3265:28): [True: 3.40M, False: 8.00k]
  ------------------
 3266|  2.61M|	        ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3266:11): [True: 267k, False: 2.35M]
  |  Branch (3266:28): [True: 254k, False: 12.5k]
  ------------------
 3267|  2.36M|	        ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3267:11): [True: 2.10M, False: 257k]
  |  Branch (3267:28): [True: 1.40M, False: 701k]
  ------------------
 3268|   958k|	        (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3268:10): [True: 3.20k, False: 955k]
  |  Branch (3268:26): [True: 3.70k, False: 951k]
  ------------------
 3269|  5.07M|	        (*in == '.')) && (in < e))
  ------------------
  |  Branch (3269:10): [True: 1.68k, False: 949k]
  |  Branch (3269:27): [True: 5.07M, False: 0]
  ------------------
 3270|  5.07M|	    in++;
 3271|   949k|	if (in >= e)
  ------------------
  |  Branch (3271:6): [True: 474, False: 949k]
  ------------------
 3272|    474|	    goto complex;
 3273|   949k|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3273:6): [True: 941k, False: 7.64k]
  |  Branch (3273:19): [True: 934k, False: 7.49k]
  ------------------
 3274|   934k|	    count = in - ctxt->input->cur;
 3275|   934k|            if (count > maxLength) {
  ------------------
  |  Branch (3275:17): [True: 27, False: 934k]
  ------------------
 3276|     27|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3277|     27|                return(ret);
 3278|     27|            }
 3279|   934k|	    ret = xmlDictLookupHashed(ctxt->dict, ctxt->input->cur, count);
 3280|   934k|	    ctxt->input->cur = in;
 3281|   934k|	    ctxt->input->col += count;
 3282|   934k|	    if (ret.name == NULL) {
  ------------------
  |  Branch (3282:10): [True: 3, False: 934k]
  ------------------
 3283|      3|	        xmlErrMemory(ctxt);
 3284|      3|	    }
 3285|   934k|	    return(ret);
 3286|   934k|	}
 3287|   949k|    }
 3288|   109k|complex:
 3289|   109k|    return(xmlParseNCNameComplex(ctxt));
 3290|  1.04M|}
parser.c:xmlParseNCNameComplex:
 3193|   109k|xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
 3194|   109k|    xmlHashedString ret;
 3195|   109k|    int len = 0, l;
 3196|   109k|    int c;
 3197|   109k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3197:21): [True: 75.8k, False: 33.9k]
  ------------------
 3198|  75.8k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  75.8k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3199|   109k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  33.9k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3200|   109k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3200:17): [True: 65.6k, False: 44.1k]
  ------------------
 3201|   109k|    size_t startPosition = 0;
 3202|       |
 3203|   109k|    ret.name = NULL;
 3204|   109k|    ret.hashValue = 0;
 3205|       |
 3206|       |    /*
 3207|       |     * Handler for more complex cases
 3208|       |     */
 3209|   109k|    startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2227|   109k|#define CUR_PTR ctxt->input->cur
  ------------------
                  startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2228|   109k|#define BASE_PTR ctxt->input->base
  ------------------
 3210|   109k|    c = xmlCurrentChar(ctxt, &l);
 3211|   109k|    if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
  ------------------
  |  Branch (3211:9): [True: 699, False: 109k]
  |  Branch (3211:23): [True: 1.37k, False: 107k]
  |  Branch (3211:37): [True: 5.31k, False: 102k]
  ------------------
 3212|   102k|	(!xmlIsNameStartChar(c, old10) || (c == ':'))) {
  ------------------
  |  Branch (3212:3): [True: 79.3k, False: 23.0k]
  |  Branch (3212:36): [True: 5.00k, False: 18.0k]
  ------------------
 3213|  91.7k|	return(ret);
 3214|  91.7k|    }
 3215|       |
 3216|  4.03M|    while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
  ------------------
  |  Branch (3216:12): [True: 4.03M, False: 438]
  |  Branch (3216:26): [True: 4.03M, False: 853]
  |  Branch (3216:40): [True: 4.03M, False: 230]
  ------------------
 3217|  4.03M|	   (xmlIsNameChar(c, old10) && (c != ':'))) {
  ------------------
  |  Branch (3217:6): [True: 4.02M, False: 15.7k]
  |  Branch (3217:33): [True: 4.02M, False: 842]
  ------------------
 3218|  4.02M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3218:13): [True: 4.02M, False: 0]
  ------------------
 3219|  4.02M|	    len += l;
 3220|  4.02M|	NEXTL(l);
  ------------------
  |  | 2288|  4.02M|#define NEXTL(l) do {							\
  |  | 2289|  4.02M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2289:9): [True: 0, False: 4.02M]
  |  |  ------------------
  |  | 2290|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2291|  4.02M|    } else ctxt->input->col++;						\
  |  | 2292|  4.02M|    ctxt->input->cur += l;				\
  |  | 2293|  4.02M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2293:12): [Folded, False: 4.02M]
  |  |  ------------------
  ------------------
 3221|  4.02M|	c = xmlCurrentChar(ctxt, &l);
 3222|  4.02M|    }
 3223|  18.0k|    if (len > maxLength) {
  ------------------
  |  Branch (3223:9): [True: 31, False: 18.0k]
  ------------------
 3224|     31|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3225|     31|        return(ret);
 3226|     31|    }
 3227|  18.0k|    ret = xmlDictLookupHashed(ctxt->dict, (BASE_PTR + startPosition), len);
  ------------------
  |  | 2228|  18.0k|#define BASE_PTR ctxt->input->base
  ------------------
 3228|  18.0k|    if (ret.name == NULL)
  ------------------
  |  Branch (3228:9): [True: 3, False: 18.0k]
  ------------------
 3229|      3|        xmlErrMemory(ctxt);
 3230|  18.0k|    return(ret);
 3231|  18.0k|}
parser.c:xmlParseAttribute2:
 8530|   251k|{
 8531|   251k|    xmlHashedString hname;
 8532|   251k|    const xmlChar *prefix, *name;
 8533|   251k|    xmlChar *val = NULL, *internal_val = NULL;
 8534|   251k|    int special = 0;
 8535|   251k|    int isNamespace;
 8536|   251k|    int flags;
 8537|       |
 8538|   251k|    *value = NULL;
 8539|   251k|    GROW;
  ------------------
  |  | 2271|   251k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   251k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   251k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 118k, False: 133k]
  |  |  ------------------
  |  | 2272|   251k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   118k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 11.6k, False: 106k]
  |  |  ------------------
  |  | 2273|   251k|	xmlParserGrow(ctxt);
  ------------------
 8540|   251k|    hname = xmlParseQNameHashed(ctxt, hprefix);
 8541|   251k|    if (hname.name == NULL) {
  ------------------
  |  Branch (8541:9): [True: 60.1k, False: 191k]
  ------------------
 8542|  60.1k|        xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8543|  60.1k|                       "error parsing attribute name\n");
 8544|  60.1k|        return(hname);
 8545|  60.1k|    }
 8546|   191k|    name = hname.name;
 8547|   191k|    prefix = hprefix->name;
 8548|       |
 8549|       |    /*
 8550|       |     * get the type if needed
 8551|       |     */
 8552|   191k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (8552:9): [True: 32.5k, False: 158k]
  ------------------
 8553|  32.5k|        special = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem,
  ------------------
  |  |   58|  32.5k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8554|  32.5k|                                              prefix, name));
 8555|  32.5k|    }
 8556|       |
 8557|       |    /*
 8558|       |     * read the value
 8559|       |     */
 8560|   191k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   191k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8561|   191k|    if (RAW != '=') {
  ------------------
  |  | 2224|   191k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8561:9): [True: 18.1k, False: 173k]
  ------------------
 8562|  18.1k|        xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8563|  18.1k|                          "Specification mandates value for attribute %s\n",
 8564|  18.1k|                          name);
 8565|  18.1k|        goto error;
 8566|  18.1k|    }
 8567|       |
 8568|       |
 8569|   173k|    NEXT;
  ------------------
  |  | 2279|   173k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8570|   173k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   173k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8571|   173k|    flags = 0;
 8572|   173k|    isNamespace = (((prefix == NULL) && (name == ctxt->str_xmlns)) ||
  ------------------
  |  Branch (8572:21): [True: 76.3k, False: 96.6k]
  |  Branch (8572:41): [True: 26.4k, False: 49.8k]
  ------------------
 8573|   146k|                   (prefix == ctxt->str_xmlns));
  ------------------
  |  Branch (8573:20): [True: 26.8k, False: 119k]
  ------------------
 8574|   173k|    val = xmlParseAttValueInternal(ctxt, len, &flags, special,
 8575|   173k|                                   isNamespace);
 8576|   173k|    if (val == NULL)
  ------------------
  |  Branch (8576:9): [True: 5.03k, False: 167k]
  ------------------
 8577|  5.03k|        goto error;
 8578|       |
 8579|   167k|    *alloc = (flags & XML_ATTVAL_ALLOC) != 0;
  ------------------
  |  |   98|   167k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 8580|       |
 8581|   167k|#ifdef LIBXML_VALID_ENABLED
 8582|   167k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (8582:9): [True: 59.7k, False: 108k]
  ------------------
 8583|  59.7k|        (ctxt->standalone == 1) &&
  ------------------
  |  Branch (8583:9): [True: 475, False: 59.3k]
  ------------------
 8584|    475|        (special & XML_SPECIAL_EXTERNAL) &&
  ------------------
  |  |   95|    475|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
  |  Branch (8584:9): [True: 103, False: 372]
  ------------------
 8585|    103|        (flags & XML_ATTVAL_NORM_CHANGE)) {
  ------------------
  |  |   99|    103|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
  |  Branch (8585:9): [True: 34, False: 69]
  ------------------
 8586|     34|        xmlValidityError(ctxt, XML_DTD_NOT_STANDALONE,
 8587|     34|                         "standalone: normalization of attribute %s on %s "
 8588|     34|                         "by external subset declaration\n",
 8589|     34|                         name, elem);
 8590|     34|    }
 8591|   167k|#endif
 8592|       |
 8593|   167k|    if (prefix == ctxt->str_xml) {
  ------------------
  |  Branch (8593:9): [True: 44.6k, False: 123k]
  ------------------
 8594|       |        /*
 8595|       |         * Check that xml:lang conforms to the specification
 8596|       |         * No more registered as an error, just generate a warning now
 8597|       |         * since this was deprecated in XML second edition
 8598|       |         */
 8599|  44.6k|        if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "lang"))) {
  ------------------
  |  |   34|  39.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8599:13): [True: 39.4k, False: 5.19k]
  |  Branch (8599:33): [True: 35.7k, False: 3.70k]
  ------------------
 8600|  35.7k|            internal_val = xmlStrndup(val, *len);
 8601|  35.7k|            if (internal_val == NULL)
  ------------------
  |  Branch (8601:17): [True: 2, False: 35.7k]
  ------------------
 8602|      2|                goto mem_error;
 8603|  35.7k|            if (!xmlCheckLanguageID(internal_val)) {
  ------------------
  |  Branch (8603:17): [True: 32.0k, False: 3.64k]
  ------------------
 8604|  32.0k|                xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8605|  32.0k|                              "Malformed value for xml:lang : %s\n",
 8606|  32.0k|                              internal_val, NULL);
 8607|  32.0k|            }
 8608|  35.7k|        }
 8609|       |
 8610|       |        /*
 8611|       |         * Check that xml:space conforms to the specification
 8612|       |         */
 8613|  44.6k|        if (xmlStrEqual(name, BAD_CAST "space")) {
  ------------------
  |  |   34|  44.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8613:13): [True: 1.04k, False: 43.5k]
  ------------------
 8614|  1.04k|            internal_val = xmlStrndup(val, *len);
 8615|  1.04k|            if (internal_val == NULL)
  ------------------
  |  Branch (8615:17): [True: 2, False: 1.04k]
  ------------------
 8616|      2|                goto mem_error;
 8617|  1.04k|            if (xmlStrEqual(internal_val, BAD_CAST "default"))
  ------------------
  |  |   34|  1.04k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8617:17): [True: 300, False: 742]
  ------------------
 8618|    300|                *(ctxt->space) = 0;
 8619|    742|            else if (xmlStrEqual(internal_val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    742|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8619:22): [True: 410, False: 332]
  ------------------
 8620|    410|                *(ctxt->space) = 1;
 8621|    332|            else {
 8622|    332|                xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8623|    332|                              "Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8624|    332|                              internal_val, NULL);
 8625|    332|            }
 8626|  1.04k|        }
 8627|  44.6k|        if (internal_val) {
  ------------------
  |  Branch (8627:13): [True: 36.7k, False: 7.85k]
  ------------------
 8628|  36.7k|            xmlFree(internal_val);
 8629|  36.7k|        }
 8630|  44.6k|    }
 8631|       |
 8632|   167k|    *value = val;
 8633|   167k|    return (hname);
 8634|       |
 8635|      4|mem_error:
 8636|      4|    xmlErrMemory(ctxt);
 8637|  23.2k|error:
 8638|  23.2k|    if ((val != NULL) && (*alloc != 0))
  ------------------
  |  Branch (8638:9): [True: 4, False: 23.2k]
  |  Branch (8638:26): [True: 1, False: 3]
  ------------------
 8639|      1|        xmlFree(val);
 8640|  23.2k|    return(hname);
 8641|      4|}
parser.c:xmlNsWarn:
  406|  9.08k|{
  407|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  408|  9.08k|               info1, info2, info3, 0, msg, info1, info2, info3);
  409|  9.08k|}
parser.c:xmlCtxtGrowAttrs:
 1849|  21.9k|xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt) {
 1850|  21.9k|    const xmlChar **atts;
 1851|  21.9k|    unsigned *attallocs;
 1852|  21.9k|    int newSize;
 1853|       |
 1854|  21.9k|    newSize = xmlGrowCapacity(ctxt->maxatts / 5,
 1855|  21.9k|                              sizeof(atts[0]) * 5 + sizeof(attallocs[0]),
 1856|  21.9k|                              10, XML_MAX_ATTRS);
  ------------------
  |  |   93|  21.9k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1857|  21.9k|    if (newSize < 0) {
  ------------------
  |  Branch (1857:9): [True: 0, False: 21.9k]
  ------------------
 1858|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 1859|      0|                    "Maximum number of attributes exceeded");
 1860|      0|        return(-1);
 1861|      0|    }
 1862|       |
 1863|  21.9k|    atts = xmlRealloc(ctxt->atts, newSize * sizeof(atts[0]) * 5);
 1864|  21.9k|    if (atts == NULL)
  ------------------
  |  Branch (1864:9): [True: 4, False: 21.9k]
  ------------------
 1865|      4|        goto mem_error;
 1866|  21.9k|    ctxt->atts = atts;
 1867|       |
 1868|  21.9k|    attallocs = xmlRealloc(ctxt->attallocs,
 1869|  21.9k|                           newSize * sizeof(attallocs[0]));
 1870|  21.9k|    if (attallocs == NULL)
  ------------------
  |  Branch (1870:9): [True: 5, False: 21.9k]
  ------------------
 1871|      5|        goto mem_error;
 1872|  21.9k|    ctxt->attallocs = attallocs;
 1873|       |
 1874|  21.9k|    ctxt->maxatts = newSize * 5;
 1875|       |
 1876|  21.9k|    return(0);
 1877|       |
 1878|      9|mem_error:
 1879|      9|    xmlErrMemory(ctxt);
 1880|      9|    return(-1);
 1881|  21.9k|}
parser.c:xmlAttrHashInsert:
 8657|   274k|                  const xmlChar *uri, unsigned hashValue, int aindex) {
 8658|   274k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8659|   274k|    xmlAttrHashBucket *bucket;
 8660|   274k|    unsigned hindex;
 8661|       |
 8662|   274k|    hindex = hashValue & (size - 1);
 8663|   274k|    bucket = &table[hindex];
 8664|       |
 8665|   323k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8665:12): [True: 101k, False: 221k]
  ------------------
 8666|   101k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8667|       |
 8668|   101k|        if (name == atts[0]) {
  ------------------
  |  Branch (8668:13): [True: 54.0k, False: 47.8k]
  ------------------
 8669|  54.0k|            int nsIndex = XML_PTR_TO_INT(atts[2]);
  ------------------
  |  |   58|  54.0k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8670|       |
 8671|  54.0k|            if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
  ------------------
  |  |   80|  54.0k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (8671:17): [True: 9.60k, False: 44.4k]
  |  Branch (8671:17): [True: 52.7k, False: 1.31k]
  ------------------
 8672|  54.0k|                (nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
  ------------------
  |  |   81|  44.4k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (8672:17): [True: 37.0k, False: 7.43k]
  ------------------
 8673|  44.4k|                (uri == ctxt->nsTab[nsIndex * 2 + 1]))
 8674|  52.7k|                return(bucket->index);
 8675|  54.0k|        }
 8676|       |
 8677|  49.1k|        hindex++;
 8678|  49.1k|        bucket++;
 8679|  49.1k|        if (hindex >= size) {
  ------------------
  |  Branch (8679:13): [True: 2.46k, False: 46.6k]
  ------------------
 8680|  2.46k|            hindex = 0;
 8681|  2.46k|            bucket = table;
 8682|  2.46k|        }
 8683|  49.1k|    }
 8684|       |
 8685|   221k|    bucket->index = aindex;
 8686|       |
 8687|       |    return(INT_MAX);
 8688|   274k|}
parser.c:xmlAttrHashInsertQName:
 8693|  7.67k|                       unsigned hashValue, int aindex) {
 8694|  7.67k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8695|  7.67k|    xmlAttrHashBucket *bucket;
 8696|  7.67k|    unsigned hindex;
 8697|       |
 8698|  7.67k|    hindex = hashValue & (size - 1);
 8699|  7.67k|    bucket = &table[hindex];
 8700|       |
 8701|  11.0k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8701:12): [True: 7.14k, False: 3.92k]
  ------------------
 8702|  7.14k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8703|       |
 8704|  7.14k|        if ((name == atts[0]) && (prefix == atts[1]))
  ------------------
  |  Branch (8704:13): [True: 4.72k, False: 2.42k]
  |  Branch (8704:34): [True: 3.75k, False: 966]
  ------------------
 8705|  3.75k|            return(bucket->index);
 8706|       |
 8707|  3.38k|        hindex++;
 8708|  3.38k|        bucket++;
 8709|  3.38k|        if (hindex >= size) {
  ------------------
  |  Branch (8709:13): [True: 200, False: 3.18k]
  ------------------
 8710|    200|            hindex = 0;
 8711|    200|            bucket = table;
 8712|    200|        }
 8713|  3.38k|    }
 8714|       |
 8715|  3.92k|    bucket->index = aindex;
 8716|       |
 8717|       |    return(INT_MAX);
 8718|  7.67k|}
parser.c:xmlParserNsLookupUri:
 1536|   578k|xmlParserNsLookupUri(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix) {
 1537|   578k|    const xmlChar *ret;
 1538|   578k|    int nsIndex;
 1539|       |
 1540|   578k|    if (prefix->name == ctxt->str_xml)
  ------------------
  |  Branch (1540:9): [True: 390, False: 578k]
  ------------------
 1541|    390|        return(ctxt->str_xml_ns);
 1542|       |
 1543|       |    /*
 1544|       |     * minNsIndex is used when building an entity tree. We must
 1545|       |     * ignore namespaces declared outside the entity.
 1546|       |     */
 1547|   578k|    nsIndex = xmlParserNsLookup(ctxt, prefix, NULL);
 1548|   578k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1548:9): [True: 485k, False: 92.7k]
  |  Branch (1548:33): [True: 4.46k, False: 88.2k]
  ------------------
 1549|   490k|        return(NULL);
 1550|       |
 1551|  88.2k|    ret = ctxt->nsTab[nsIndex * 2 + 1];
 1552|  88.2k|    if (ret[0] == 0)
  ------------------
  |  Branch (1552:9): [True: 24.2k, False: 64.0k]
  ------------------
 1553|  24.2k|        ret = NULL;
 1554|  88.2k|    return(ret);
 1555|   578k|}
parser.c:nameNsPush:
 2061|   702k|{
 2062|   702k|    xmlStartTag *tag;
 2063|       |
 2064|   702k|    if (ctxt->nameNr >= ctxt->nameMax) {
  ------------------
  |  Branch (2064:9): [True: 42.1k, False: 660k]
  ------------------
 2065|  42.1k|        const xmlChar **tmp;
 2066|  42.1k|        xmlStartTag *tmp2;
 2067|  42.1k|        int newSize;
 2068|       |
 2069|  42.1k|        newSize = xmlGrowCapacity(ctxt->nameMax,
 2070|  42.1k|                                  sizeof(tmp[0]) + sizeof(tmp2[0]),
 2071|  42.1k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  42.1k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2072|  42.1k|        if (newSize < 0)
  ------------------
  |  Branch (2072:13): [True: 0, False: 42.1k]
  ------------------
 2073|      0|            goto mem_error;
 2074|       |
 2075|  42.1k|        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
 2076|  42.1k|        if (tmp == NULL)
  ------------------
  |  Branch (2076:13): [True: 17, False: 42.1k]
  ------------------
 2077|     17|	    goto mem_error;
 2078|  42.1k|	ctxt->nameTab = tmp;
 2079|       |
 2080|  42.1k|        tmp2 = xmlRealloc(ctxt->pushTab, newSize * sizeof(tmp2[0]));
 2081|  42.1k|        if (tmp2 == NULL)
  ------------------
  |  Branch (2081:13): [True: 17, False: 42.0k]
  ------------------
 2082|     17|	    goto mem_error;
 2083|  42.0k|	ctxt->pushTab = tmp2;
 2084|       |
 2085|  42.0k|        ctxt->nameMax = newSize;
 2086|   660k|    } else if (ctxt->pushTab == NULL) {
  ------------------
  |  Branch (2086:16): [True: 27.1k, False: 633k]
  ------------------
 2087|  27.1k|        ctxt->pushTab = xmlMalloc(ctxt->nameMax * sizeof(ctxt->pushTab[0]));
 2088|  27.1k|        if (ctxt->pushTab == NULL)
  ------------------
  |  Branch (2088:13): [True: 9, False: 27.1k]
  ------------------
 2089|      9|            goto mem_error;
 2090|  27.1k|    }
 2091|   702k|    ctxt->nameTab[ctxt->nameNr] = value;
 2092|   702k|    ctxt->name = value;
 2093|   702k|    tag = &ctxt->pushTab[ctxt->nameNr];
 2094|   702k|    tag->prefix = prefix;
 2095|   702k|    tag->URI = URI;
 2096|   702k|    tag->line = line;
 2097|   702k|    tag->nsNr = nsNr;
 2098|   702k|    return (ctxt->nameNr++);
 2099|     43|mem_error:
 2100|     43|    xmlErrMemory(ctxt);
 2101|     43|    return (-1);
 2102|   702k|}
parser.c:xmlParseElementEnd:
 9819|   248k|xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
 9820|   248k|    xmlNodePtr cur = ctxt->node;
 9821|       |
 9822|   248k|    if (ctxt->nameNr <= 0) {
  ------------------
  |  Branch (9822:9): [True: 5, False: 248k]
  ------------------
 9823|      5|        if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2224|      5|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2226|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9823:13): [True: 3, False: 2]
  |  Branch (9823:29): [True: 2, False: 1]
  ------------------
 9824|      2|            SKIP(2);
  ------------------
  |  | 2248|      2|#define SKIP(val) do {							\
  |  | 2249|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2251|      2|        xmlParserGrow(ctxt);						\
  |  | 2252|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
 9825|      5|        return;
 9826|      5|    }
 9827|       |
 9828|       |    /*
 9829|       |     * parse the end of tag: '</' should be here.
 9830|       |     */
 9831|   248k|    if (ctxt->sax2) {
  ------------------
  |  Branch (9831:9): [True: 194k, False: 53.9k]
  ------------------
 9832|   194k|	xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
 9833|   194k|	namePop(ctxt);
 9834|   194k|    }
 9835|  53.9k|#ifdef LIBXML_SAX1_ENABLED
 9836|  53.9k|    else
 9837|  53.9k|	xmlParseEndTag1(ctxt, 0);
 9838|   248k|#endif /* LIBXML_SAX1_ENABLED */
 9839|       |
 9840|       |    /*
 9841|       |     * Capture end position
 9842|       |     */
 9843|   248k|    if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9843:9): [True: 218k, False: 29.9k]
  |  Branch (9843:24): [True: 0, False: 218k]
  ------------------
 9844|      0|        xmlParserNodeInfoPtr node_info;
 9845|       |
 9846|      0|        node_info = (xmlParserNodeInfoPtr) xmlParserFindNodeInfo(ctxt, cur);
 9847|      0|        if (node_info != NULL) {
  ------------------
  |  Branch (9847:13): [True: 0, False: 0]
  ------------------
 9848|      0|            node_info->end_pos = ctxt->input->consumed +
 9849|      0|                                 (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2227|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9850|      0|            node_info->end_line = ctxt->input->line;
 9851|      0|        }
 9852|      0|    }
 9853|   248k|}
parser.c:xmlParseEndTag2:
 9377|   223k|xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
 9378|   223k|    const xmlChar *name;
 9379|       |
 9380|   223k|    GROW;
  ------------------
  |  | 2271|   223k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   223k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   223k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 194k, False: 28.7k]
  |  |  ------------------
  |  | 2272|   223k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   194k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 10.4k, False: 183k]
  |  |  ------------------
  |  | 2273|   223k|	xmlParserGrow(ctxt);
  ------------------
 9381|   223k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2224|   223k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2226|   223k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9381:9): [True: 25, False: 223k]
  |  Branch (9381:25): [True: 23, False: 223k]
  ------------------
 9382|     48|	xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL);
 9383|     48|	return;
 9384|     48|    }
 9385|   223k|    SKIP(2);
  ------------------
  |  | 2248|   223k|#define SKIP(val) do {							\
  |  | 2249|   223k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   223k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 943, False: 222k]
  |  |  ------------------
  |  | 2251|   223k|        xmlParserGrow(ctxt);						\
  |  | 2252|   223k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 223k]
  |  |  ------------------
  ------------------
 9386|       |
 9387|   223k|    if (tag->prefix == NULL)
  ------------------
  |  Branch (9387:9): [True: 202k, False: 20.8k]
  ------------------
 9388|   202k|        name = xmlParseNameAndCompare(ctxt, ctxt->name);
 9389|  20.8k|    else
 9390|  20.8k|        name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
 9391|       |
 9392|       |    /*
 9393|       |     * We should definitely be at the ending "S? '>'" part
 9394|       |     */
 9395|   223k|    GROW;
  ------------------
  |  | 2271|   223k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   223k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   223k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 194k, False: 28.7k]
  |  |  ------------------
  |  | 2272|   223k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   194k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 10.5k, False: 183k]
  |  |  ------------------
  |  | 2273|   223k|	xmlParserGrow(ctxt);
  ------------------
 9396|   223k|    SKIP_BLANKS;
  ------------------
  |  | 2275|   223k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9397|   223k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   223k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   223k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 206k, False: 16.4k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 206k]
  |  |  |  |  ------------------
  |  |  |  |  109|   223k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 223k]
  |  |  |  |  ------------------
  |  |  |  |  110|   223k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 206k, False: 16.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2224|   206k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9397:33): [True: 9.97k, False: 196k]
  ------------------
 9398|  26.6k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 9399|  26.6k|    } else
 9400|   196k|	NEXT1;
  ------------------
  |  | 2281|   196k|#define NEXT1 {								\
  |  | 2282|   196k|	ctxt->input->col++;						\
  |  | 2283|   196k|	ctxt->input->cur++;						\
  |  | 2284|   196k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2284:6): [True: 1.43k, False: 194k]
  |  |  ------------------
  |  | 2285|   196k|	    xmlParserGrow(ctxt);						\
  |  | 2286|   196k|    }
  ------------------
 9401|       |
 9402|       |    /*
 9403|       |     * [ WFC: Element Type Match ]
 9404|       |     * The Name in an element's end-tag must match the element type in the
 9405|       |     * start-tag.
 9406|       |     *
 9407|       |     */
 9408|   223k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (9408:9): [True: 16.7k, False: 206k]
  ------------------
 9409|  16.7k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  3.75k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9409:13): [True: 3.75k, False: 12.9k]
  ------------------
 9410|  16.7k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 9411|  16.7k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 9412|  16.7k|		                ctxt->name, tag->line, name);
 9413|  16.7k|    }
 9414|       |
 9415|       |    /*
 9416|       |     * SAX: End of Tag
 9417|       |     */
 9418|   223k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9418:9): [True: 223k, False: 0]
  |  Branch (9418:32): [True: 223k, False: 0]
  ------------------
 9419|   223k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (9419:2): [True: 173k, False: 49.5k]
  ------------------
 9420|   173k|	ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
 9421|   173k|                                tag->URI);
 9422|       |
 9423|   223k|    spacePop(ctxt);
 9424|   223k|    if (tag->nsNr != 0)
  ------------------
  |  Branch (9424:9): [True: 22.0k, False: 200k]
  ------------------
 9425|  22.0k|	xmlParserNsPop(ctxt, tag->nsNr);
 9426|   223k|}
parser.c:xmlParseQNameAndCompare:
 8471|  20.8k|                        xmlChar const *prefix) {
 8472|  20.8k|    const xmlChar *cmp;
 8473|  20.8k|    const xmlChar *in;
 8474|  20.8k|    const xmlChar *ret;
 8475|  20.8k|    const xmlChar *prefix2;
 8476|       |
 8477|  20.8k|    if (prefix == NULL) return(xmlParseNameAndCompare(ctxt, name));
  ------------------
  |  Branch (8477:9): [True: 0, False: 20.8k]
  ------------------
 8478|       |
 8479|  20.8k|    GROW;
  ------------------
  |  | 2271|  20.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  20.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  20.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 14.7k, False: 6.09k]
  |  |  ------------------
  |  | 2272|  20.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  14.7k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 1.91k, False: 12.8k]
  |  |  ------------------
  |  | 2273|  20.8k|	xmlParserGrow(ctxt);
  ------------------
 8480|  20.8k|    in = ctxt->input->cur;
 8481|       |
 8482|  20.8k|    cmp = prefix;
 8483|  41.5k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8483:12): [True: 40.6k, False: 897]
  |  Branch (8483:24): [True: 20.7k, False: 19.9k]
  ------------------
 8484|  20.7k|	++in;
 8485|  20.7k|	++cmp;
 8486|  20.7k|    }
 8487|  20.8k|    if ((*cmp == 0) && (*in == ':')) {
  ------------------
  |  Branch (8487:9): [True: 19.3k, False: 1.51k]
  |  Branch (8487:24): [True: 17.9k, False: 1.31k]
  ------------------
 8488|  17.9k|        in++;
 8489|  17.9k|	cmp = name;
 8490|  39.7k|	while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8490:9): [True: 30.4k, False: 9.25k]
  |  Branch (8490:21): [True: 21.7k, False: 8.73k]
  ------------------
 8491|  21.7k|	    ++in;
 8492|  21.7k|	    ++cmp;
 8493|  21.7k|	}
 8494|  17.9k|	if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  8.83k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  8.83k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 83, False: 8.75k]
  |  |  |  |  ------------------
  |  |  |  |   91|  8.83k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.49k, False: 7.25k]
  |  |  |  |  |  Branch (91:23): [True: 211, False: 1.28k]
  |  |  |  |  ------------------
  |  |  |  |   92|  8.83k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 412, False: 8.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8494:6): [True: 12.5k, False: 5.41k]
  |  Branch (8494:20): [True: 3.74k, False: 8.83k]
  ------------------
 8495|       |	    /* success */
 8496|  4.45k|            ctxt->input->col += in - ctxt->input->cur;
 8497|  4.45k|	    ctxt->input->cur = in;
 8498|  4.45k|	    return((const xmlChar*) 1);
 8499|  4.45k|	}
 8500|  17.9k|    }
 8501|       |    /*
 8502|       |     * all strings coms from the dictionary, equality can be done directly
 8503|       |     */
 8504|  16.3k|    ret = xmlParseQName (ctxt, &prefix2);
 8505|  16.3k|    if (ret == NULL)
  ------------------
  |  Branch (8505:9): [True: 938, False: 15.4k]
  ------------------
 8506|    938|        return(NULL);
 8507|  15.4k|    if ((ret == name) && (prefix == prefix2))
  ------------------
  |  Branch (8507:9): [True: 9.32k, False: 6.10k]
  |  Branch (8507:26): [True: 8.06k, False: 1.26k]
  ------------------
 8508|  8.06k|	return((const xmlChar*) 1);
 8509|  7.36k|    return ret;
 8510|  15.4k|}
parser.c:xmlParseQName:
 8448|  16.3k|xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
 8449|  16.3k|    xmlHashedString n, p;
 8450|       |
 8451|  16.3k|    n = xmlParseQNameHashed(ctxt, &p);
 8452|  16.3k|    if (n.name == NULL)
  ------------------
  |  Branch (8452:9): [True: 938, False: 15.4k]
  ------------------
 8453|    938|        return(NULL);
 8454|  15.4k|    *prefix = p.name;
 8455|  15.4k|    return(n.name);
 8456|  16.3k|}
parser.c:xmlParseInternalSubset:
 7994|  12.7k|xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
 7995|       |    /*
 7996|       |     * Is there any DTD definition ?
 7997|       |     */
 7998|  12.7k|    if (RAW == '[') {
  ------------------
  |  | 2224|  12.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7998:9): [True: 12.7k, False: 0]
  ------------------
 7999|  12.7k|        int oldInputNr = ctxt->inputNr;
 8000|       |
 8001|  12.7k|        NEXT;
  ------------------
  |  | 2279|  12.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8002|       |	/*
 8003|       |	 * Parse the succession of Markup declarations and
 8004|       |	 * PEReferences.
 8005|       |	 * Subsequence (markupdecl | PEReference | S)*
 8006|       |	 */
 8007|  12.7k|	SKIP_BLANKS;
  ------------------
  |  | 2275|  12.7k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8008|   657k|        while (1) {
  ------------------
  |  Branch (8008:16): [True: 657k, Folded]
  ------------------
 8009|   657k|            if (PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   657k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 685, False: 657k]
  |  |  ------------------
  ------------------
 8010|    685|                return;
 8011|   657k|            } else if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (8011:24): [True: 93.0k, False: 563k]
  ------------------
 8012|  93.0k|                if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (8012:21): [True: 1.40k, False: 91.6k]
  ------------------
 8013|  1.40k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8014|  1.40k|                    return;
 8015|  1.40k|                }
 8016|  91.6k|                xmlPopPE(ctxt);
 8017|   563k|            } else if ((RAW == ']') && (ctxt->inputNr <= oldInputNr)) {
  ------------------
  |  | 2224|   563k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8017:24): [True: 7.92k, False: 556k]
  |  Branch (8017:40): [True: 7.92k, False: 3]
  ------------------
 8018|  7.92k|                NEXT;
  ------------------
  |  | 2279|  7.92k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8019|  7.92k|                SKIP_BLANKS;
  ------------------
  |  | 2275|  7.92k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8020|  7.92k|                break;
 8021|   556k|            } else if ((PARSER_EXTERNAL(ctxt)) &&
  ------------------
  |  |   55|   556k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 0, False: 556k]
  |  |  ------------------
  |  |   56|   556k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 505k, False: 50.7k]
  |  |  ------------------
  |  |   57|   556k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 500k, False: 4.79k]
  |  |  ------------------
  ------------------
 8022|   500k|                       (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2224|   500k|#define RAW (*ctxt->input->cur)
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   364k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2226|   356k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8022:24): [True: 364k, False: 135k]
  |  Branch (8022:40): [True: 356k, False: 8.29k]
  |  Branch (8022:59): [True: 3.39k, False: 353k]
  ------------------
 8023|       |                /*
 8024|       |                 * Conditional sections are allowed in external entities
 8025|       |                 * included by PE References in the internal subset.
 8026|       |                 */
 8027|  3.39k|                xmlParseConditionalSections(ctxt);
 8028|   552k|            } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2224|   552k|#define RAW (*ctxt->input->cur)
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|   396k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2226|  9.35k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8028:24): [True: 396k, False: 155k]
  |  Branch (8028:41): [True: 387k, False: 9.35k]
  |  Branch (8028:60): [True: 8.75k, False: 599]
  ------------------
 8029|   396k|                xmlParseMarkupDecl(ctxt);
 8030|   396k|            } else if (RAW == '%') {
  ------------------
  |  | 2224|   156k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8030:24): [True: 153k, False: 2.77k]
  ------------------
 8031|   153k|                xmlParsePERefInternal(ctxt, 1);
 8032|   153k|            } else {
 8033|  2.77k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8034|       |
 8035|  3.36k|                while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (8035:24): [True: 593, False: 2.77k]
  ------------------
 8036|    593|                    xmlPopPE(ctxt);
 8037|  2.77k|                return;
 8038|  2.77k|            }
 8039|   644k|            SKIP_BLANKS;
  ------------------
  |  | 2275|   644k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8040|   644k|            SHRINK;
  ------------------
  |  | 2267|   644k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   644k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   644k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2267:9): [True: 599k, False: 45.1k]
  |  |  ------------------
  |  | 2268|   644k|	xmlParserShrink(ctxt);
  ------------------
 8041|   644k|            GROW;
  ------------------
  |  | 2271|   644k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   644k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   644k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:9): [True: 599k, False: 45.1k]
  |  |  ------------------
  |  | 2272|   644k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   599k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2272:9): [True: 417k, False: 182k]
  |  |  ------------------
  |  | 2273|   644k|	xmlParserGrow(ctxt);
  ------------------
 8042|   644k|        }
 8043|  12.7k|    }
 8044|       |
 8045|       |    /*
 8046|       |     * We should be at the end of the DOCTYPE declaration.
 8047|       |     */
 8048|  7.92k|    if (RAW != '>') {
  ------------------
  |  | 2224|  7.92k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8048:9): [True: 119, False: 7.80k]
  ------------------
 8049|    119|        xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8050|    119|        return;
 8051|    119|    }
 8052|  7.80k|    NEXT;
  ------------------
  |  | 2279|  7.80k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8053|  7.80k|}
parser.c:xmlCleanSpecialAttr:
 1194|  18.0k|{
 1195|  18.0k|    if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1195:9): [True: 14.9k, False: 3.06k]
  ------------------
 1196|  14.9k|        return;
 1197|       |
 1198|  3.06k|    xmlHashScanFull(ctxt->attsSpecial, xmlCleanSpecialAttrCallback, ctxt);
 1199|       |
 1200|  3.06k|    if (xmlHashSize(ctxt->attsSpecial) == 0) {
  ------------------
  |  Branch (1200:9): [True: 183, False: 2.88k]
  ------------------
 1201|    183|        xmlHashFree(ctxt->attsSpecial, NULL);
 1202|       |        ctxt->attsSpecial = NULL;
 1203|    183|    }
 1204|  3.06k|}
parser.c:xmlCleanSpecialAttrCallback:
 1177|  17.9k|                            const xmlChar *unused ATTRIBUTE_UNUSED) {
 1178|  17.9k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
 1179|       |
 1180|  17.9k|    if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) {
  ------------------
  |  |   58|  17.9k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
  |  Branch (1180:9): [True: 1.67k, False: 16.2k]
  ------------------
 1181|       |        xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
 1182|  1.67k|    }
 1183|  17.9k|}
parser.c:xmlFinishDocument:
10351|  23.1k|xmlFinishDocument(xmlParserCtxtPtr ctxt) {
10352|  23.1k|    xmlDocPtr doc;
10353|       |
10354|       |    /*
10355|       |     * SAX: end of the document processing.
10356|       |     */
10357|  23.1k|    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
  ------------------
  |  Branch (10357:9): [True: 23.1k, False: 0]
  |  Branch (10357:24): [True: 23.1k, False: 0]
  ------------------
10358|  23.1k|        ctxt->sax->endDocument(ctxt->userData);
10359|       |
10360|       |    /*
10361|       |     * Remove locally kept entity definitions if the tree was not built
10362|       |     */
10363|  23.1k|    doc = ctxt->myDoc;
10364|  23.1k|    if ((doc != NULL) &&
  ------------------
  |  Branch (10364:9): [True: 23.0k, False: 59]
  ------------------
10365|  23.0k|        (xmlStrEqual(doc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  23.0k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  23.0k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (10365:9): [True: 19, False: 23.0k]
  ------------------
10366|     19|        xmlFreeDoc(doc);
10367|       |        ctxt->myDoc = NULL;
10368|     19|    }
10369|  23.1k|}
parser.c:xmlParseTryOrFinish:
10830|   431k|xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
10831|   431k|    int ret = 0;
10832|   431k|    size_t avail;
10833|   431k|    xmlChar cur, next;
10834|       |
10835|   431k|    if (ctxt->input == NULL)
  ------------------
  |  Branch (10835:9): [True: 0, False: 431k]
  ------------------
10836|      0|        return(0);
10837|       |
10838|   431k|    if ((ctxt->input != NULL) &&
  ------------------
  |  Branch (10838:9): [True: 431k, False: 0]
  ------------------
10839|   431k|        (ctxt->input->cur - ctxt->input->base > 4096)) {
  ------------------
  |  Branch (10839:9): [True: 2.88k, False: 428k]
  ------------------
10840|  2.88k|        xmlParserShrink(ctxt);
10841|  2.88k|    }
10842|       |
10843|  3.94M|    while (ctxt->disableSAX == 0) {
  ------------------
  |  Branch (10843:12): [True: 3.93M, False: 10.1k]
  ------------------
10844|  3.93M|        avail = ctxt->input->end - ctxt->input->cur;
10845|  3.93M|        if (avail < 1)
  ------------------
  |  Branch (10845:13): [True: 21.1k, False: 3.91M]
  ------------------
10846|  21.1k|	    goto done;
10847|  3.91M|        switch (ctxt->instate) {
10848|  4.09k|            case XML_PARSER_EOF:
  ------------------
  |  Branch (10848:13): [True: 4.09k, False: 3.91M]
  ------------------
10849|       |	        /*
10850|       |		 * Document parsing is done !
10851|       |		 */
10852|  4.09k|	        goto done;
10853|  35.8k|            case XML_PARSER_START:
  ------------------
  |  Branch (10853:13): [True: 35.8k, False: 3.88M]
  ------------------
10854|       |                /*
10855|       |                 * Very first chars read from the document flow.
10856|       |                 */
10857|  35.8k|                if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (10857:21): [True: 34.7k, False: 1.09k]
  |  Branch (10857:37): [True: 453, False: 34.2k]
  ------------------
10858|    453|                    goto done;
10859|       |
10860|       |                /*
10861|       |                 * We need more bytes to detect EBCDIC code pages.
10862|       |                 * See xmlDetectEBCDIC.
10863|       |                 */
10864|  35.3k|                if ((CMP4(CUR_PTR, 0x4C, 0x6F, 0xA7, 0x94)) &&
  ------------------
  |  | 2231|  35.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2231:5): [True: 753, False: 34.6k]
  |  |  |  Branch (2231:41): [True: 738, False: 15]
  |  |  ------------------
  |  | 2232|  35.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2232:5): [True: 726, False: 12]
  |  |  |  Branch (2232:41): [True: 716, False: 10]
  |  |  ------------------
  ------------------
10865|    716|                    (!terminate) && (avail < 200))
  ------------------
  |  Branch (10865:21): [True: 371, False: 345]
  |  Branch (10865:37): [True: 342, False: 29]
  ------------------
10866|    342|                    goto done;
10867|       |
10868|  35.0k|                xmlDetectEncoding(ctxt);
10869|  35.0k|                ctxt->instate = XML_PARSER_XML_DECL;
10870|  35.0k|		break;
10871|       |
10872|  50.7k|            case XML_PARSER_XML_DECL:
  ------------------
  |  Branch (10872:13): [True: 50.7k, False: 3.86M]
  ------------------
10873|  50.7k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10873:7): [True: 48.7k, False: 2.01k]
  |  Branch (10873:23): [True: 3, False: 48.7k]
  ------------------
10874|      3|		    goto done;
10875|  50.7k|		cur = ctxt->input->cur[0];
10876|  50.7k|		next = ctxt->input->cur[1];
10877|  50.7k|	        if ((cur == '<') && (next == '?')) {
  ------------------
  |  Branch (10877:14): [True: 49.9k, False: 812]
  |  Branch (10877:30): [True: 24.4k, False: 25.5k]
  ------------------
10878|       |		    /* PI or XML decl */
10879|  24.4k|		    if ((!terminate) &&
  ------------------
  |  Branch (10879:11): [True: 23.1k, False: 1.29k]
  ------------------
10880|  23.1k|                        (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (10880:25): [True: 15.7k, False: 7.34k]
  ------------------
10881|  15.7k|			goto done;
10882|  8.64k|		    if ((ctxt->input->cur[2] == 'x') &&
  ------------------
  |  Branch (10882:11): [True: 7.01k, False: 1.62k]
  ------------------
10883|  7.01k|			(ctxt->input->cur[3] == 'm') &&
  ------------------
  |  Branch (10883:4): [True: 6.17k, False: 845]
  ------------------
10884|  6.17k|			(ctxt->input->cur[4] == 'l') &&
  ------------------
  |  Branch (10884:4): [True: 3.17k, False: 2.99k]
  ------------------
10885|  3.17k|			(IS_BLANK_CH(ctxt->input->cur[5]))) {
  ------------------
  |  |  137|  3.17k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.17k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.03k, False: 145]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.17k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 141, False: 4]
  |  |  |  |  |  Branch (91:23): [True: 24, False: 117]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.17k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 9, False: 112]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10886|  3.06k|			ret += 5;
10887|  3.06k|			xmlParseXMLDecl(ctxt);
10888|  5.58k|		    } else {
10889|  5.58k|			ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  5.58k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10890|  5.58k|                        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10890:29): [True: 3, False: 5.57k]
  ------------------
10891|      3|                            xmlErrMemory(ctxt);
10892|      3|                            break;
10893|      3|                        }
10894|  5.58k|		    }
10895|  26.3k|		} else {
10896|  26.3k|		    ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  26.3k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10897|  26.3k|		    if (ctxt->version == NULL) {
  ------------------
  |  Branch (10897:11): [True: 2, False: 26.3k]
  ------------------
10898|      2|		        xmlErrMemory(ctxt);
10899|      2|			break;
10900|      2|		    }
10901|  26.3k|		}
10902|  34.9k|                if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10902:21): [True: 34.9k, False: 0]
  |  Branch (10902:36): [True: 34.9k, False: 0]
  ------------------
10903|  34.9k|                    ctxt->sax->setDocumentLocator(ctxt->userData,
10904|  34.9k|                            (xmlSAXLocator *) &xmlDefaultSAXLocator);
10905|  34.9k|                }
10906|  34.9k|                if ((ctxt->sax) && (ctxt->sax->startDocument) &&
  ------------------
  |  Branch (10906:21): [True: 34.9k, False: 0]
  |  Branch (10906:36): [True: 34.9k, False: 0]
  ------------------
10907|  34.9k|                    (!ctxt->disableSAX))
  ------------------
  |  Branch (10907:21): [True: 34.7k, False: 290]
  ------------------
10908|  34.7k|                    ctxt->sax->startDocument(ctxt->userData);
10909|  34.9k|                ctxt->instate = XML_PARSER_MISC;
10910|  34.9k|		break;
10911|   578k|            case XML_PARSER_START_TAG: {
  ------------------
  |  Branch (10911:13): [True: 578k, False: 3.33M]
  ------------------
10912|   578k|	        const xmlChar *name;
10913|   578k|		const xmlChar *prefix = NULL;
10914|   578k|		const xmlChar *URI = NULL;
10915|   578k|                int line = ctxt->input->line;
10916|   578k|		int nbNs = 0;
10917|       |
10918|   578k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10918:7): [True: 503k, False: 74.0k]
  |  Branch (10918:23): [True: 90, False: 503k]
  ------------------
10919|     90|		    goto done;
10920|   577k|		cur = ctxt->input->cur[0];
10921|   577k|	        if (cur != '<') {
  ------------------
  |  Branch (10921:14): [True: 1.97k, False: 575k]
  ------------------
10922|  1.97k|		    xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10923|  1.97k|                                   "Start tag expected, '<' not found");
10924|  1.97k|                    ctxt->instate = XML_PARSER_EOF;
10925|  1.97k|                    xmlFinishDocument(ctxt);
10926|  1.97k|		    goto done;
10927|  1.97k|		}
10928|   575k|		if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (10928:7): [True: 503k, False: 72.5k]
  |  Branch (10928:23): [True: 253k, False: 249k]
  ------------------
10929|   253k|                    goto done;
10930|   322k|		if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (10930:7): [True: 0, False: 322k]
  ------------------
10931|      0|		    spacePush(ctxt, -1);
10932|   322k|		else if (*ctxt->space == -2)
  ------------------
  |  Branch (10932:12): [True: 52.0k, False: 270k]
  ------------------
10933|  52.0k|		    spacePush(ctxt, -1);
10934|   270k|		else
10935|   270k|		    spacePush(ctxt, *ctxt->space);
10936|   322k|#ifdef LIBXML_SAX1_ENABLED
10937|   322k|		if (ctxt->sax2)
  ------------------
  |  Branch (10937:7): [True: 217k, False: 104k]
  ------------------
10938|   217k|#endif /* LIBXML_SAX1_ENABLED */
10939|   217k|		    name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
10940|   104k|#ifdef LIBXML_SAX1_ENABLED
10941|   104k|		else
10942|   104k|		    name = xmlParseStartTag(ctxt);
10943|   322k|#endif /* LIBXML_SAX1_ENABLED */
10944|   322k|		if (name == NULL) {
  ------------------
  |  Branch (10944:7): [True: 1.70k, False: 320k]
  ------------------
10945|  1.70k|		    spacePop(ctxt);
10946|  1.70k|                    ctxt->instate = XML_PARSER_EOF;
10947|  1.70k|                    xmlFinishDocument(ctxt);
10948|  1.70k|		    goto done;
10949|  1.70k|		}
10950|   320k|#ifdef LIBXML_VALID_ENABLED
10951|       |		/*
10952|       |		 * [ VC: Root Element Type ]
10953|       |		 * The Name in the document type declaration must match
10954|       |		 * the element type of the root element.
10955|       |		 */
10956|   320k|		if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (10956:7): [True: 145k, False: 174k]
  |  Branch (10956:25): [True: 118k, False: 26.6k]
  |  Branch (10956:45): [True: 118k, False: 0]
  ------------------
10957|   118k|		    ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (10957:7): [True: 118k, False: 0]
  |  Branch (10957:21): [True: 0, False: 118k]
  ------------------
10958|      0|		    ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
10959|   320k|#endif /* LIBXML_VALID_ENABLED */
10960|       |
10961|       |		/*
10962|       |		 * Check for an Empty Element.
10963|       |		 */
10964|   320k|		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2224|   320k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2226|   109k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10964:7): [True: 109k, False: 210k]
  |  Branch (10964:23): [True: 106k, False: 3.25k]
  ------------------
10965|   106k|		    SKIP(2);
  ------------------
  |  | 2248|   106k|#define SKIP(val) do {							\
  |  | 2249|   106k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2250|   106k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 920, False: 105k]
  |  |  ------------------
  |  | 2251|   106k|        xmlParserGrow(ctxt);						\
  |  | 2252|   106k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2252:12): [Folded, False: 106k]
  |  |  ------------------
  ------------------
10966|       |
10967|   106k|		    if (ctxt->sax2) {
  ------------------
  |  Branch (10967:11): [True: 85.4k, False: 20.9k]
  ------------------
10968|  85.4k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (10968:8): [True: 85.4k, False: 0]
  ------------------
10969|  85.4k|			    (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (10969:8): [True: 85.4k, False: 0]
  ------------------
10970|  85.4k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (10970:8): [True: 85.3k, False: 44]
  ------------------
10971|  85.3k|			    ctxt->sax->endElementNs(ctxt->userData, name,
10972|  85.3k|			                            prefix, URI);
10973|  85.4k|			if (nbNs > 0)
  ------------------
  |  Branch (10973:8): [True: 4.59k, False: 80.8k]
  ------------------
10974|  4.59k|			    xmlParserNsPop(ctxt, nbNs);
10975|  85.4k|#ifdef LIBXML_SAX1_ENABLED
10976|  85.4k|		    } else {
10977|  20.9k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (10977:8): [True: 20.9k, False: 0]
  ------------------
10978|  20.9k|			    (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (10978:8): [True: 20.9k, False: 0]
  ------------------
10979|  20.9k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (10979:8): [True: 20.9k, False: 13]
  ------------------
10980|  20.9k|			    ctxt->sax->endElement(ctxt->userData, name);
10981|  20.9k|#endif /* LIBXML_SAX1_ENABLED */
10982|  20.9k|		    }
10983|   106k|		    spacePop(ctxt);
10984|   214k|		} else if (RAW == '>') {
  ------------------
  |  | 2224|   214k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10984:14): [True: 166k, False: 47.7k]
  ------------------
10985|   166k|		    NEXT;
  ------------------
  |  | 2279|   166k|#define NEXT xmlNextChar(ctxt)
  ------------------
10986|   166k|                    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
10987|   166k|		} else {
10988|  47.7k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_GT_REQUIRED,
10989|  47.7k|					 "Couldn't find end of Start Tag %s\n",
10990|  47.7k|					 name);
10991|  47.7k|		    nodePop(ctxt);
10992|  47.7k|		    spacePop(ctxt);
10993|  47.7k|                    if (nbNs > 0)
  ------------------
  |  Branch (10993:25): [True: 5.55k, False: 42.1k]
  ------------------
10994|  5.55k|                        xmlParserNsPop(ctxt, nbNs);
10995|  47.7k|		}
10996|       |
10997|   320k|                if (ctxt->nameNr == 0)
  ------------------
  |  Branch (10997:21): [True: 7.75k, False: 312k]
  ------------------
10998|  7.75k|                    ctxt->instate = XML_PARSER_EPILOG;
10999|   312k|                else
11000|   312k|                    ctxt->instate = XML_PARSER_CONTENT;
11001|   320k|                break;
11002|   322k|	    }
11003|  2.97M|            case XML_PARSER_CONTENT: {
  ------------------
  |  Branch (11003:13): [True: 2.97M, False: 938k]
  ------------------
11004|  2.97M|		cur = ctxt->input->cur[0];
11005|       |
11006|  2.97M|		if (cur == '<') {
  ------------------
  |  Branch (11006:7): [True: 456k, False: 2.52M]
  ------------------
11007|   456k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11007:25): [True: 372k, False: 84.3k]
  |  Branch (11007:41): [True: 1.19k, False: 371k]
  ------------------
11008|  1.19k|                        goto done;
11009|   455k|		    next = ctxt->input->cur[1];
11010|       |
11011|   455k|                    if (next == '/') {
  ------------------
  |  Branch (11011:25): [True: 42.5k, False: 413k]
  ------------------
11012|  42.5k|                        ctxt->instate = XML_PARSER_END_TAG;
11013|  42.5k|                        break;
11014|   413k|                    } else if (next == '?') {
  ------------------
  |  Branch (11014:32): [True: 19.1k, False: 393k]
  ------------------
11015|  19.1k|                        if ((!terminate) &&
  ------------------
  |  Branch (11015:29): [True: 16.9k, False: 2.19k]
  ------------------
11016|  16.9k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11016:29): [True: 5.32k, False: 11.6k]
  ------------------
11017|  5.32k|                            goto done;
11018|  13.8k|                        xmlParsePI(ctxt);
11019|  13.8k|                        ctxt->instate = XML_PARSER_CONTENT;
11020|  13.8k|                        break;
11021|   393k|                    } else if (next == '!') {
  ------------------
  |  Branch (11021:32): [True: 98.2k, False: 295k]
  ------------------
11022|  98.2k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11022:29): [True: 90.6k, False: 7.59k]
  |  Branch (11022:45): [True: 213, False: 90.3k]
  ------------------
11023|    213|                            goto done;
11024|  97.9k|                        next = ctxt->input->cur[2];
11025|       |
11026|  97.9k|                        if (next == '-') {
  ------------------
  |  Branch (11026:29): [True: 81.8k, False: 16.1k]
  ------------------
11027|  81.8k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11027:33): [True: 77.9k, False: 3.90k]
  |  Branch (11027:49): [True: 158, False: 77.8k]
  ------------------
11028|    158|                                goto done;
11029|  81.7k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11029:33): [True: 81.6k, False: 16]
  ------------------
11030|  81.6k|                                if ((!terminate) &&
  ------------------
  |  Branch (11030:37): [True: 77.7k, False: 3.89k]
  ------------------
11031|  77.7k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11031:37): [True: 5.19k, False: 72.6k]
  ------------------
11032|  5.19k|                                    goto done;
11033|  76.5k|                                xmlParseComment(ctxt);
11034|  76.5k|                                ctxt->instate = XML_PARSER_CONTENT;
11035|  76.5k|                                break;
11036|  81.6k|                            }
11037|  81.7k|                        } else if (next == '[') {
  ------------------
  |  Branch (11037:36): [True: 15.8k, False: 264]
  ------------------
11038|  15.8k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11038:33): [True: 12.2k, False: 3.60k]
  |  Branch (11038:49): [True: 102, False: 12.1k]
  ------------------
11039|    102|                                goto done;
11040|  15.7k|                            if ((ctxt->input->cur[2] == '[') &&
  ------------------
  |  Branch (11040:33): [True: 15.7k, False: 0]
  ------------------
11041|  15.7k|                                (ctxt->input->cur[3] == 'C') &&
  ------------------
  |  Branch (11041:33): [True: 15.7k, False: 19]
  ------------------
11042|  15.7k|                                (ctxt->input->cur[4] == 'D') &&
  ------------------
  |  Branch (11042:33): [True: 15.7k, False: 8]
  ------------------
11043|  15.7k|                                (ctxt->input->cur[5] == 'A') &&
  ------------------
  |  Branch (11043:33): [True: 15.7k, False: 12]
  ------------------
11044|  15.7k|                                (ctxt->input->cur[6] == 'T') &&
  ------------------
  |  Branch (11044:33): [True: 15.6k, False: 16]
  ------------------
11045|  15.6k|                                (ctxt->input->cur[7] == 'A') &&
  ------------------
  |  Branch (11045:33): [True: 15.6k, False: 5]
  ------------------
11046|  15.6k|                                (ctxt->input->cur[8] == '[')) {
  ------------------
  |  Branch (11046:33): [True: 15.6k, False: 13]
  ------------------
11047|  15.6k|                                if ((!terminate) &&
  ------------------
  |  Branch (11047:37): [True: 12.1k, False: 3.56k]
  ------------------
11048|  12.1k|                                    (!xmlParseLookupString(ctxt, 9, "]]>", 3)))
  ------------------
  |  Branch (11048:37): [True: 5.65k, False: 6.45k]
  ------------------
11049|  5.65k|                                    goto done;
11050|  10.0k|                                ctxt->instate = XML_PARSER_CDATA_SECTION;
11051|  10.0k|                                xmlParseCDSect(ctxt);
11052|  10.0k|                                ctxt->instate = XML_PARSER_CONTENT;
11053|  10.0k|                                break;
11054|  15.6k|                            }
11055|  15.7k|                        }
11056|  97.9k|                    }
11057|  2.52M|		} else if (cur == '&') {
  ------------------
  |  Branch (11057:14): [True: 48.6k, False: 2.47M]
  ------------------
11058|  48.6k|		    if ((!terminate) && (!xmlParseLookupChar(ctxt, ';')))
  ------------------
  |  Branch (11058:11): [True: 39.4k, False: 9.21k]
  |  Branch (11058:27): [True: 24.3k, False: 15.0k]
  ------------------
11059|  24.3k|			goto done;
11060|  24.2k|		    xmlParseReference(ctxt);
11061|  24.2k|                    break;
11062|  2.47M|		} else {
11063|       |		    /* TODO Avoid the extra copy, handle directly !!! */
11064|       |		    /*
11065|       |		     * Goal of the following test is:
11066|       |		     *  - minimize calls to the SAX 'character' callback
11067|       |		     *    when they are mergeable
11068|       |		     *  - handle an problem for isBlank when we only parse
11069|       |		     *    a sequence of blank chars and the next one is
11070|       |		     *    not available to check against '<' presence.
11071|       |		     *  - tries to homogenize the differences in SAX
11072|       |		     *    callbacks between the push and pull versions
11073|       |		     *    of the parser.
11074|       |		     */
11075|  2.47M|		    if (avail < XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  2.47M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (11075:11): [True: 126k, False: 2.34M]
  ------------------
11076|   126k|			if ((!terminate) && (!xmlParseLookupCharData(ctxt)))
  ------------------
  |  Branch (11076:8): [True: 105k, False: 20.7k]
  |  Branch (11076:24): [True: 8.91k, False: 96.5k]
  ------------------
11077|  8.91k|			    goto done;
11078|   126k|                    }
11079|  2.46M|                    ctxt->checkIndex = 0;
11080|  2.46M|		    xmlParseCharDataInternal(ctxt, !terminate);
11081|  2.46M|                    break;
11082|  2.47M|		}
11083|       |
11084|   296k|                ctxt->instate = XML_PARSER_START_TAG;
11085|   296k|		break;
11086|  2.97M|	    }
11087|  47.1k|            case XML_PARSER_END_TAG:
  ------------------
  |  Branch (11087:13): [True: 47.1k, False: 3.86M]
  ------------------
11088|  47.1k|		if ((!terminate) && (!xmlParseLookupChar(ctxt, '>')))
  ------------------
  |  Branch (11088:7): [True: 36.7k, False: 10.3k]
  |  Branch (11088:23): [True: 5.63k, False: 31.1k]
  ------------------
11089|  5.63k|		    goto done;
11090|  41.4k|		if (ctxt->sax2) {
  ------------------
  |  Branch (11090:7): [True: 28.7k, False: 12.7k]
  ------------------
11091|  28.7k|	            xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
11092|  28.7k|		    nameNsPop(ctxt);
11093|  28.7k|		}
11094|  12.7k|#ifdef LIBXML_SAX1_ENABLED
11095|  12.7k|		  else
11096|  12.7k|		    xmlParseEndTag1(ctxt, 0);
11097|  41.4k|#endif /* LIBXML_SAX1_ENABLED */
11098|  41.4k|		if (ctxt->nameNr == 0) {
  ------------------
  |  Branch (11098:7): [True: 2.46k, False: 39.0k]
  ------------------
11099|  2.46k|		    ctxt->instate = XML_PARSER_EPILOG;
11100|  39.0k|		} else {
11101|  39.0k|		    ctxt->instate = XML_PARSER_CONTENT;
11102|  39.0k|		}
11103|  41.4k|		break;
11104|  93.0k|            case XML_PARSER_MISC:
  ------------------
  |  Branch (11104:13): [True: 93.0k, False: 3.82M]
  ------------------
11105|   183k|            case XML_PARSER_PROLOG:
  ------------------
  |  Branch (11105:13): [True: 90.7k, False: 3.82M]
  ------------------
11106|   188k|            case XML_PARSER_EPILOG:
  ------------------
  |  Branch (11106:13): [True: 5.22k, False: 3.91M]
  ------------------
11107|   188k|		SKIP_BLANKS;
  ------------------
  |  | 2275|   188k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
11108|   188k|                avail = ctxt->input->end - ctxt->input->cur;
11109|   188k|		if (avail < 1)
  ------------------
  |  Branch (11109:7): [True: 3.12k, False: 185k]
  ------------------
11110|  3.12k|		    goto done;
11111|   185k|		if (ctxt->input->cur[0] == '<') {
  ------------------
  |  Branch (11111:7): [True: 182k, False: 3.63k]
  ------------------
11112|   182k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11112:25): [True: 177k, False: 4.66k]
  |  Branch (11112:41): [True: 248, False: 177k]
  ------------------
11113|    248|                        goto done;
11114|   181k|                    next = ctxt->input->cur[1];
11115|   181k|                    if (next == '?') {
  ------------------
  |  Branch (11115:25): [True: 33.6k, False: 148k]
  ------------------
11116|  33.6k|                        if ((!terminate) &&
  ------------------
  |  Branch (11116:29): [True: 32.4k, False: 1.25k]
  ------------------
11117|  32.4k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11117:29): [True: 6.91k, False: 25.5k]
  ------------------
11118|  6.91k|                            goto done;
11119|  26.7k|                        xmlParsePI(ctxt);
11120|  26.7k|                        break;
11121|   148k|                    } else if (next == '!') {
  ------------------
  |  Branch (11121:32): [True: 120k, False: 28.1k]
  ------------------
11122|   120k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11122:29): [True: 118k, False: 2.13k]
  |  Branch (11122:45): [True: 150, False: 117k]
  ------------------
11123|    150|                            goto done;
11124|       |
11125|   120k|                        if (ctxt->input->cur[2] == '-') {
  ------------------
  |  Branch (11125:29): [True: 79.5k, False: 40.5k]
  ------------------
11126|  79.5k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11126:33): [True: 79.0k, False: 460]
  |  Branch (11126:49): [True: 175, False: 78.8k]
  ------------------
11127|    175|                                goto done;
11128|  79.3k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11128:33): [True: 79.3k, False: 6]
  ------------------
11129|  79.3k|                                if ((!terminate) &&
  ------------------
  |  Branch (11129:37): [True: 78.8k, False: 455]
  ------------------
11130|  78.8k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11130:37): [True: 8.01k, False: 70.8k]
  ------------------
11131|  8.01k|                                    goto done;
11132|  71.3k|                                xmlParseComment(ctxt);
11133|  71.3k|                                break;
11134|  79.3k|                            }
11135|  79.3k|                        } else if (ctxt->instate == XML_PARSER_MISC) {
  ------------------
  |  Branch (11135:36): [True: 40.4k, False: 81]
  ------------------
11136|  40.4k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11136:33): [True: 38.8k, False: 1.62k]
  |  Branch (11136:49): [True: 26, False: 38.8k]
  ------------------
11137|     26|                                goto done;
11138|  40.4k|                            if ((ctxt->input->cur[2] == 'D') &&
  ------------------
  |  Branch (11138:33): [True: 40.4k, False: 21]
  ------------------
11139|  40.4k|                                (ctxt->input->cur[3] == 'O') &&
  ------------------
  |  Branch (11139:33): [True: 40.4k, False: 11]
  ------------------
11140|  40.4k|                                (ctxt->input->cur[4] == 'C') &&
  ------------------
  |  Branch (11140:33): [True: 40.4k, False: 7]
  ------------------
11141|  40.4k|                                (ctxt->input->cur[5] == 'T') &&
  ------------------
  |  Branch (11141:33): [True: 40.3k, False: 10]
  ------------------
11142|  40.3k|                                (ctxt->input->cur[6] == 'Y') &&
  ------------------
  |  Branch (11142:33): [True: 40.3k, False: 1]
  ------------------
11143|  40.3k|                                (ctxt->input->cur[7] == 'P') &&
  ------------------
  |  Branch (11143:33): [True: 40.3k, False: 2]
  ------------------
11144|  40.3k|                                (ctxt->input->cur[8] == 'E')) {
  ------------------
  |  Branch (11144:33): [True: 40.3k, False: 6]
  ------------------
11145|  40.3k|                                if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (11145:37): [True: 38.8k, False: 1.58k]
  |  Branch (11145:53): [True: 24.5k, False: 14.2k]
  ------------------
11146|  24.5k|                                    goto done;
11147|  15.8k|                                ctxt->inSubset = 1;
11148|  15.8k|                                xmlParseDocTypeDecl(ctxt);
11149|  15.8k|                                if (RAW == '[') {
  ------------------
  |  | 2224|  15.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11149:37): [True: 12.1k, False: 3.66k]
  ------------------
11150|  12.1k|                                    ctxt->instate = XML_PARSER_DTD;
11151|  12.1k|                                } else {
11152|  3.66k|                                    if (RAW == '>')
  ------------------
  |  | 2224|  3.66k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11152:41): [True: 3.46k, False: 205]
  ------------------
11153|  3.46k|                                        NEXT;
  ------------------
  |  | 2279|  3.46k|#define NEXT xmlNextChar(ctxt)
  ------------------
11154|       |                                    /*
11155|       |                                     * Create and update the external subset.
11156|       |                                     */
11157|  3.66k|                                    ctxt->inSubset = 2;
11158|  3.66k|                                    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11158:41): [True: 3.66k, False: 0]
  ------------------
11159|  3.66k|                                        (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11159:41): [True: 3.56k, False: 104]
  ------------------
11160|  3.56k|                                        (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11160:41): [True: 3.56k, False: 0]
  ------------------
11161|  3.56k|                                        ctxt->sax->externalSubset(
11162|  3.56k|                                                ctxt->userData,
11163|  3.56k|                                                ctxt->intSubName,
11164|  3.56k|                                                ctxt->extSubSystem,
11165|  3.56k|                                                ctxt->extSubURI);
11166|  3.66k|                                    ctxt->inSubset = 0;
11167|  3.66k|                                    xmlCleanSpecialAttr(ctxt);
11168|  3.66k|                                    ctxt->instate = XML_PARSER_PROLOG;
11169|  3.66k|                                }
11170|  15.8k|                                break;
11171|  40.3k|                            }
11172|  40.4k|                        }
11173|   120k|                    }
11174|   181k|                }
11175|       |
11176|  31.8k|                if (ctxt->instate == XML_PARSER_EPILOG) {
  ------------------
  |  Branch (11176:21): [True: 1.96k, False: 29.9k]
  ------------------
11177|  1.96k|                    if (ctxt->errNo == XML_ERR_OK)
  ------------------
  |  Branch (11177:25): [True: 24, False: 1.94k]
  ------------------
11178|     24|                        xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL);
11179|  1.96k|		    ctxt->instate = XML_PARSER_EOF;
11180|  1.96k|                    xmlFinishDocument(ctxt);
11181|  29.9k|                } else {
11182|  29.9k|		    ctxt->instate = XML_PARSER_START_TAG;
11183|  29.9k|		}
11184|  31.8k|		break;
11185|  33.9k|            case XML_PARSER_DTD: {
  ------------------
  |  Branch (11185:13): [True: 33.9k, False: 3.88M]
  ------------------
11186|  33.9k|                if ((!terminate) && (!xmlParseLookupInternalSubset(ctxt)))
  ------------------
  |  Branch (11186:21): [True: 29.4k, False: 4.43k]
  |  Branch (11186:37): [True: 21.8k, False: 7.64k]
  ------------------
11187|  21.8k|                    goto done;
11188|  12.0k|		xmlParseInternalSubset(ctxt);
11189|  12.0k|		ctxt->inSubset = 2;
11190|  12.0k|		if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11190:7): [True: 12.0k, False: 0]
  |  Branch (11190:30): [True: 9.93k, False: 2.14k]
  ------------------
11191|  9.93k|		    (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11191:7): [True: 9.93k, False: 0]
  ------------------
11192|  9.93k|		    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
11193|  9.93k|			    ctxt->extSubSystem, ctxt->extSubURI);
11194|  12.0k|		ctxt->inSubset = 0;
11195|  12.0k|		xmlCleanSpecialAttr(ctxt);
11196|  12.0k|		ctxt->instate = XML_PARSER_PROLOG;
11197|  12.0k|                break;
11198|  33.9k|	    }
11199|      0|            default:
  ------------------
  |  Branch (11199:13): [True: 0, False: 3.91M]
  ------------------
11200|      0|                xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
11201|      0|			"PP: internal error\n");
11202|      0|		ctxt->instate = XML_PARSER_EOF;
11203|      0|		break;
11204|  3.91M|	}
11205|  3.91M|    }
11206|   431k|done:
11207|   431k|    return(ret);
11208|   431k|}
parser.c:xmlParseLookupString:
10610|   241k|                     const char *str, size_t strLen) {
10611|   241k|    const xmlChar *cur, *term;
10612|       |
10613|   241k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10613:9): [True: 196k, False: 44.8k]
  ------------------
10614|   196k|        cur = ctxt->input->cur + startDelta;
10615|   196k|    } else {
10616|  44.8k|        cur = ctxt->input->cur + ctxt->checkIndex;
10617|  44.8k|    }
10618|       |
10619|   241k|    term = BAD_CAST strstr((const char *) cur, str);
  ------------------
  |  |   34|   241k|#define BAD_CAST (xmlChar *)
  ------------------
10620|   241k|    if (term == NULL) {
  ------------------
  |  Branch (10620:9): [True: 46.8k, False: 194k]
  ------------------
10621|  46.8k|        const xmlChar *end = ctxt->input->end;
10622|  46.8k|        size_t index;
10623|       |
10624|       |        /* Rescan (strLen - 1) characters. */
10625|  46.8k|        if ((size_t) (end - cur) < strLen)
  ------------------
  |  Branch (10625:13): [True: 1.21k, False: 45.6k]
  ------------------
10626|  1.21k|            end = cur;
10627|  45.6k|        else
10628|  45.6k|            end -= strLen - 1;
10629|  46.8k|        index = end - ctxt->input->cur;
10630|  46.8k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10630:13): [True: 0, False: 46.8k]
  ------------------
10631|      0|            ctxt->checkIndex = 0;
10632|      0|            return(ctxt->input->end - strLen);
10633|      0|        }
10634|  46.8k|        ctxt->checkIndex = index;
10635|   194k|    } else {
10636|   194k|        ctxt->checkIndex = 0;
10637|   194k|    }
10638|       |
10639|   241k|    return(term);
10640|   241k|}
parser.c:xmlParseLookupGt:
10677|   542k|xmlParseLookupGt(xmlParserCtxtPtr ctxt) {
10678|   542k|    const xmlChar *cur;
10679|   542k|    const xmlChar *end = ctxt->input->end;
10680|   542k|    int state = ctxt->endCheckState;
10681|   542k|    size_t index;
10682|       |
10683|   542k|    if (ctxt->checkIndex == 0)
  ------------------
  |  Branch (10683:9): [True: 272k, False: 269k]
  ------------------
10684|   272k|        cur = ctxt->input->cur + 1;
10685|   269k|    else
10686|   269k|        cur = ctxt->input->cur + ctxt->checkIndex;
10687|       |
10688|   179M|    while (cur < end) {
  ------------------
  |  Branch (10688:12): [True: 179M, False: 278k]
  ------------------
10689|   179M|        if (state) {
  ------------------
  |  Branch (10689:13): [True: 152M, False: 26.2M]
  ------------------
10690|   152M|            if (*cur == state)
  ------------------
  |  Branch (10690:17): [True: 1.19M, False: 151M]
  ------------------
10691|  1.19M|                state = 0;
10692|   152M|        } else if (*cur == '\'' || *cur == '"') {
  ------------------
  |  Branch (10692:20): [True: 70.3k, False: 26.1M]
  |  Branch (10692:36): [True: 1.12M, False: 25.0M]
  ------------------
10693|  1.19M|            state = *cur;
10694|  25.0M|        } else if (*cur == '>') {
  ------------------
  |  Branch (10694:20): [True: 263k, False: 24.7M]
  ------------------
10695|   263k|            ctxt->checkIndex = 0;
10696|   263k|            ctxt->endCheckState = 0;
10697|   263k|            return(1);
10698|   263k|        }
10699|   178M|        cur++;
10700|   178M|    }
10701|       |
10702|   278k|    index = cur - ctxt->input->cur;
10703|   278k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10703:9): [True: 0, False: 278k]
  ------------------
10704|      0|        ctxt->checkIndex = 0;
10705|      0|        ctxt->endCheckState = 0;
10706|      0|        return(1);
10707|      0|    }
10708|   278k|    ctxt->checkIndex = index;
10709|   278k|    ctxt->endCheckState = state;
10710|   278k|    return(0);
10711|   278k|}
parser.c:xmlParseLookupChar:
10576|  76.1k|xmlParseLookupChar(xmlParserCtxtPtr ctxt, int c) {
10577|  76.1k|    const xmlChar *cur;
10578|       |
10579|  76.1k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10579:9): [True: 49.5k, False: 26.6k]
  ------------------
10580|  49.5k|        cur = ctxt->input->cur + 1;
10581|  49.5k|    } else {
10582|  26.6k|        cur = ctxt->input->cur + ctxt->checkIndex;
10583|  26.6k|    }
10584|       |
10585|  76.1k|    if (memchr(cur, c, ctxt->input->end - cur) == NULL) {
  ------------------
  |  Branch (10585:9): [True: 30.0k, False: 46.1k]
  ------------------
10586|  30.0k|        size_t index = ctxt->input->end - ctxt->input->cur;
10587|       |
10588|  30.0k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10588:13): [True: 0, False: 30.0k]
  ------------------
10589|      0|            ctxt->checkIndex = 0;
10590|      0|            return(1);
10591|      0|        }
10592|  30.0k|        ctxt->checkIndex = index;
10593|  30.0k|        return(0);
10594|  46.1k|    } else {
10595|  46.1k|        ctxt->checkIndex = 0;
10596|  46.1k|        return(1);
10597|  46.1k|    }
10598|  76.1k|}
parser.c:xmlParseLookupCharData:
10648|   105k|xmlParseLookupCharData(xmlParserCtxtPtr ctxt) {
10649|   105k|    const xmlChar *cur = ctxt->input->cur + ctxt->checkIndex;
10650|   105k|    const xmlChar *end = ctxt->input->end;
10651|   105k|    size_t index;
10652|       |
10653|   956k|    while (cur < end) {
  ------------------
  |  Branch (10653:12): [True: 947k, False: 8.91k]
  ------------------
10654|   947k|        if ((*cur == '<') || (*cur == '&')) {
  ------------------
  |  Branch (10654:13): [True: 90.1k, False: 857k]
  |  Branch (10654:30): [True: 6.38k, False: 851k]
  ------------------
10655|  96.5k|            ctxt->checkIndex = 0;
10656|  96.5k|            return(1);
10657|  96.5k|        }
10658|   851k|        cur++;
10659|   851k|    }
10660|       |
10661|  8.91k|    index = cur - ctxt->input->cur;
10662|  8.91k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10662:9): [True: 0, False: 8.91k]
  ------------------
10663|      0|        ctxt->checkIndex = 0;
10664|      0|        return(1);
10665|      0|    }
10666|  8.91k|    ctxt->checkIndex = index;
10667|  8.91k|    return(0);
10668|  8.91k|}
parser.c:nameNsPop:
 2112|  28.7k|{
 2113|  28.7k|    const xmlChar *ret;
 2114|       |
 2115|  28.7k|    if (ctxt->nameNr <= 0)
  ------------------
  |  Branch (2115:9): [True: 0, False: 28.7k]
  ------------------
 2116|      0|        return (NULL);
 2117|  28.7k|    ctxt->nameNr--;
 2118|  28.7k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2118:9): [True: 27.4k, False: 1.30k]
  ------------------
 2119|  27.4k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2120|  1.30k|    else
 2121|  1.30k|        ctxt->name = NULL;
 2122|  28.7k|    ret = ctxt->nameTab[ctxt->nameNr];
 2123|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2124|  28.7k|    return (ret);
 2125|  28.7k|}
parser.c:xmlParseLookupInternalSubset:
10720|  29.4k|xmlParseLookupInternalSubset(xmlParserCtxtPtr ctxt) {
10721|       |    /*
10722|       |     * Sorry, but progressive parsing of the internal subset is not
10723|       |     * supported. We first check that the full content of the internal
10724|       |     * subset is available and parsing is launched only at that point.
10725|       |     * Internal subset ends with "']' S? '>'" in an unescaped section and
10726|       |     * not in a ']]>' sequence which are conditional sections.
10727|       |     */
10728|  29.4k|    const xmlChar *cur, *start;
10729|  29.4k|    const xmlChar *end = ctxt->input->end;
10730|  29.4k|    int state = ctxt->endCheckState;
10731|  29.4k|    size_t index;
10732|       |
10733|  29.4k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10733:9): [True: 10.7k, False: 18.7k]
  ------------------
10734|  10.7k|        cur = ctxt->input->cur + 1;
10735|  18.7k|    } else {
10736|  18.7k|        cur = ctxt->input->cur + ctxt->checkIndex;
10737|  18.7k|    }
10738|  29.4k|    start = cur;
10739|       |
10740|  19.3M|    while (cur < end) {
  ------------------
  |  Branch (10740:12): [True: 19.3M, False: 21.8k]
  ------------------
10741|  19.3M|        if (state == '-') {
  ------------------
  |  Branch (10741:13): [True: 393k, False: 18.9M]
  ------------------
10742|   393k|            if ((*cur == '-') &&
  ------------------
  |  Branch (10742:17): [True: 39.2k, False: 353k]
  ------------------
10743|  39.2k|                (cur[1] == '-') &&
  ------------------
  |  Branch (10743:17): [True: 33.5k, False: 5.67k]
  ------------------
10744|  33.5k|                (cur[2] == '>')) {
  ------------------
  |  Branch (10744:17): [True: 25.2k, False: 8.29k]
  ------------------
10745|  25.2k|                state = 0;
10746|  25.2k|                cur += 3;
10747|  25.2k|                start = cur;
10748|  25.2k|                continue;
10749|  25.2k|            }
10750|   393k|        }
10751|  18.9M|        else if (state == ']') {
  ------------------
  |  Branch (10751:18): [True: 9.30k, False: 18.9M]
  ------------------
10752|  9.30k|            if (*cur == '>') {
  ------------------
  |  Branch (10752:17): [True: 7.42k, False: 1.88k]
  ------------------
10753|  7.42k|                ctxt->checkIndex = 0;
10754|  7.42k|                ctxt->endCheckState = 0;
10755|  7.42k|                return(1);
10756|  7.42k|            }
10757|  1.88k|            if (IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  1.88k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.88k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 371, False: 1.51k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.88k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.30k, False: 210]
  |  |  |  |  |  Branch (91:23): [True: 448, False: 859]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.88k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 300, False: 769]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10758|  1.11k|                state = ' ';
10759|  1.11k|            } else if (*cur != ']') {
  ------------------
  |  Branch (10759:24): [True: 484, False: 285]
  ------------------
10760|    484|                state = 0;
10761|    484|                start = cur;
10762|    484|                continue;
10763|    484|            }
10764|  1.88k|        }
10765|  18.9M|        else if (state == ' ') {
  ------------------
  |  Branch (10765:18): [True: 2.35k, False: 18.9M]
  ------------------
10766|  2.35k|            if (*cur == '>') {
  ------------------
  |  Branch (10766:17): [True: 227, False: 2.12k]
  ------------------
10767|    227|                ctxt->checkIndex = 0;
10768|    227|                ctxt->endCheckState = 0;
10769|    227|                return(1);
10770|    227|            }
10771|  2.12k|            if (!IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  2.12k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.12k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 225, False: 1.89k]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.12k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.60k, False: 297]
  |  |  |  |  |  Branch (91:23): [True: 798, False: 804]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.12k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 213, False: 888]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10772|    888|                state = 0;
10773|    888|                start = cur;
10774|    888|                continue;
10775|    888|            }
10776|  2.12k|        }
10777|  18.9M|        else if (state != 0) {
  ------------------
  |  Branch (10777:18): [True: 14.0M, False: 4.84M]
  ------------------
10778|  14.0M|            if (*cur == state) {
  ------------------
  |  Branch (10778:17): [True: 32.6k, False: 14.0M]
  ------------------
10779|  32.6k|                state = 0;
10780|  32.6k|                start = cur + 1;
10781|  32.6k|            }
10782|  14.0M|        }
10783|  4.84M|        else if (*cur == '<') {
  ------------------
  |  Branch (10783:18): [True: 64.5k, False: 4.78M]
  ------------------
10784|  64.5k|            if ((cur[1] == '!') &&
  ------------------
  |  Branch (10784:17): [True: 53.5k, False: 10.9k]
  ------------------
10785|  53.5k|                (cur[2] == '-') &&
  ------------------
  |  Branch (10785:17): [True: 25.6k, False: 27.8k]
  ------------------
10786|  25.6k|                (cur[3] == '-')) {
  ------------------
  |  Branch (10786:17): [True: 25.3k, False: 378]
  ------------------
10787|  25.3k|                state = '-';
10788|  25.3k|                cur += 4;
10789|       |                /* Don't treat <!--> as comment */
10790|  25.3k|                start = cur;
10791|  25.3k|                continue;
10792|  25.3k|            }
10793|  64.5k|        }
10794|  4.78M|        else if ((*cur == '"') || (*cur == '\'') || (*cur == ']')) {
  ------------------
  |  Branch (10794:18): [True: 20.1k, False: 4.76M]
  |  Branch (10794:35): [True: 12.8k, False: 4.74M]
  |  Branch (10794:53): [True: 9.04k, False: 4.73M]
  ------------------
10795|  42.0k|            state = *cur;
10796|  42.0k|        }
10797|       |
10798|  19.2M|        cur++;
10799|  19.2M|    }
10800|       |
10801|       |    /*
10802|       |     * Rescan the three last characters to detect "<!--" and "-->"
10803|       |     * split across chunks.
10804|       |     */
10805|  21.8k|    if ((state == 0) || (state == '-')) {
  ------------------
  |  Branch (10805:9): [True: 7.09k, False: 14.7k]
  |  Branch (10805:25): [True: 917, False: 13.8k]
  ------------------
10806|  8.01k|        if (cur - start < 3)
  ------------------
  |  Branch (10806:13): [True: 665, False: 7.35k]
  ------------------
10807|    665|            cur = start;
10808|  7.35k|        else
10809|  7.35k|            cur -= 3;
10810|  8.01k|    }
10811|  21.8k|    index = cur - ctxt->input->cur;
10812|  21.8k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10812:9): [True: 0, False: 21.8k]
  ------------------
10813|      0|        ctxt->checkIndex = 0;
10814|      0|        ctxt->endCheckState = 0;
10815|      0|        return(1);
10816|      0|    }
10817|  21.8k|    ctxt->checkIndex = index;
10818|  21.8k|    ctxt->endCheckState = state;
10819|  21.8k|    return(0);
10820|  21.8k|}
parser.c:xmlCtxtParseEntity:
11759|  7.46k|xmlCtxtParseEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) {
11760|  7.46k|    xmlParserInputPtr input;
11761|  7.46k|    xmlNodePtr list;
11762|  7.46k|    unsigned long consumed;
11763|  7.46k|    int isExternal;
11764|  7.46k|    int buildTree;
11765|  7.46k|    int oldMinNsIndex;
11766|  7.46k|    int oldNodelen, oldNodemem;
11767|       |
11768|  7.46k|    isExternal = (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY);
11769|  7.46k|    buildTree = (ctxt->node != NULL);
11770|       |
11771|       |    /*
11772|       |     * Recursion check
11773|       |     */
11774|  7.46k|    if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  7.46k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (11774:9): [True: 6, False: 7.45k]
  ------------------
11775|      6|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
11776|      6|        goto error;
11777|      6|    }
11778|       |
11779|       |    /*
11780|       |     * Load entity
11781|       |     */
11782|  7.45k|    input = xmlNewEntityInputStream(ctxt, ent);
11783|  7.45k|    if (input == NULL)
  ------------------
  |  Branch (11783:9): [True: 2.23k, False: 5.22k]
  ------------------
11784|  2.23k|        goto error;
11785|       |
11786|       |    /*
11787|       |     * When building a tree, we need to limit the scope of namespace
11788|       |     * declarations, so that entities don't reference xmlNs structs
11789|       |     * from the parent of a reference.
11790|       |     */
11791|  5.22k|    oldMinNsIndex = ctxt->nsdb->minNsIndex;
11792|  5.22k|    if (buildTree)
  ------------------
  |  Branch (11792:9): [True: 5.22k, False: 0]
  ------------------
11793|  5.22k|        ctxt->nsdb->minNsIndex = ctxt->nsNr;
11794|       |
11795|  5.22k|    oldNodelen = ctxt->nodelen;
11796|  5.22k|    oldNodemem = ctxt->nodemem;
11797|  5.22k|    ctxt->nodelen = 0;
11798|  5.22k|    ctxt->nodemem = 0;
11799|       |
11800|       |    /*
11801|       |     * Parse content
11802|       |     *
11803|       |     * This initiates a recursive call chain:
11804|       |     *
11805|       |     * - xmlCtxtParseContentInternal
11806|       |     * - xmlParseContentInternal
11807|       |     * - xmlParseReference
11808|       |     * - xmlCtxtParseEntity
11809|       |     *
11810|       |     * The nesting depth is limited by the maximum number of inputs,
11811|       |     * see xmlCtxtPushInput.
11812|       |     *
11813|       |     * It's possible to make this non-recursive (minNsIndex must be
11814|       |     * stored in the input struct) at the expense of code readability.
11815|       |     */
11816|       |
11817|  5.22k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  5.22k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11818|       |
11819|  5.22k|    list = xmlCtxtParseContentInternal(ctxt, input, isExternal, buildTree);
11820|       |
11821|  5.22k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  5.22k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11822|       |
11823|  5.22k|    ctxt->nsdb->minNsIndex = oldMinNsIndex;
11824|  5.22k|    ctxt->nodelen = oldNodelen;
11825|  5.22k|    ctxt->nodemem = oldNodemem;
11826|       |
11827|       |    /*
11828|       |     * Entity size accounting
11829|       |     */
11830|  5.22k|    consumed = input->consumed;
11831|  5.22k|    xmlSaturatedAddSizeT(&consumed, input->end - input->base);
11832|       |
11833|  5.22k|    if ((ent->flags & XML_ENT_CHECKED) == 0)
  ------------------
  |  |   20|  5.22k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (11833:9): [True: 3.24k, False: 1.97k]
  ------------------
11834|  3.24k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
11835|       |
11836|  5.22k|    if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  5.22k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (11836:9): [True: 3.24k, False: 1.97k]
  ------------------
11837|  3.24k|        if (isExternal)
  ------------------
  |  Branch (11837:13): [True: 1.47k, False: 1.77k]
  ------------------
11838|  1.47k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
11839|       |
11840|  3.24k|        ent->children = list;
11841|       |
11842|  23.4k|        while (list != NULL) {
  ------------------
  |  Branch (11842:16): [True: 20.2k, False: 3.24k]
  ------------------
11843|  20.2k|            list->parent = (xmlNodePtr) ent;
11844|       |
11845|       |            /*
11846|       |             * Downstream code like the nginx xslt module can set
11847|       |             * ctxt->myDoc->extSubset to a separate DTD, so the entity
11848|       |             * might have a different or a NULL document.
11849|       |             */
11850|  20.2k|            if (list->doc != ent->doc)
  ------------------
  |  Branch (11850:17): [True: 0, False: 20.2k]
  ------------------
11851|      0|                xmlSetTreeDoc(list, ent->doc);
11852|       |
11853|  20.2k|            if (list->next == NULL)
  ------------------
  |  Branch (11853:17): [True: 2.29k, False: 17.9k]
  ------------------
11854|  2.29k|                ent->last = list;
11855|  20.2k|            list = list->next;
11856|  20.2k|        }
11857|  3.24k|    } else {
11858|  1.97k|        xmlFreeNodeList(list);
11859|  1.97k|    }
11860|       |
11861|  5.22k|    xmlFreeInputStream(input);
11862|       |
11863|  7.46k|error:
11864|  7.46k|    ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   19|  7.46k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
                  ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   20|  7.46k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
11865|  7.46k|}
parser.c:xmlCtxtParseContentInternal:
11669|  5.22k|                            int hasTextDecl, int buildTree) {
11670|  5.22k|    xmlNodePtr root = NULL;
11671|  5.22k|    xmlNodePtr list = NULL;
11672|  5.22k|    xmlChar *rootName = BAD_CAST "#root";
  ------------------
  |  |   34|  5.22k|#define BAD_CAST (xmlChar *)
  ------------------
11673|  5.22k|    int result;
11674|       |
11675|  5.22k|    if (buildTree) {
  ------------------
  |  Branch (11675:9): [True: 5.22k, False: 0]
  ------------------
11676|  5.22k|        root = xmlNewDocNode(ctxt->myDoc, NULL, rootName, NULL);
11677|  5.22k|        if (root == NULL) {
  ------------------
  |  Branch (11677:13): [True: 4, False: 5.22k]
  ------------------
11678|      4|            xmlErrMemory(ctxt);
11679|      4|            goto error;
11680|      4|        }
11681|  5.22k|    }
11682|       |
11683|  5.22k|    if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (11683:9): [True: 2, False: 5.21k]
  ------------------
11684|      2|        goto error;
11685|       |
11686|  5.21k|    nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
11687|  5.21k|    spacePush(ctxt, -1);
11688|       |
11689|  5.21k|    if (buildTree)
  ------------------
  |  Branch (11689:9): [True: 5.21k, False: 0]
  ------------------
11690|  5.21k|        nodePush(ctxt, root);
11691|       |
11692|  5.21k|    if (hasTextDecl) {
  ------------------
  |  Branch (11692:9): [True: 1.79k, False: 3.42k]
  ------------------
11693|  1.79k|        xmlDetectEncoding(ctxt);
11694|       |
11695|       |        /*
11696|       |         * Parse a possible text declaration first
11697|       |         */
11698|  1.79k|        if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2234|  1.79k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2231|  3.58k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2231:5): [True: 1.08k, False: 703]
  |  |  |  |  |  Branch (2231:41): [True: 308, False: 781]
  |  |  |  |  ------------------
  |  |  |  | 2232|  1.79k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2232:5): [True: 285, False: 23]
  |  |  |  |  |  Branch (2232:41): [True: 283, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2234:34): [True: 279, False: 4]
  |  |  ------------------
  ------------------
11699|    279|            (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    279|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    279|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 203, False: 76]
  |  |  |  |  ------------------
  |  |  |  |   91|    279|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 75, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 42, False: 33]
  |  |  |  |  ------------------
  |  |  |  |   92|    279|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 32, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11700|    277|            xmlParseTextDecl(ctxt);
11701|       |            /*
11702|       |             * An XML-1.0 document can't reference an entity not XML-1.0
11703|       |             */
11704|    277|            if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|    277|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11704:17): [True: 274, False: 3]
  ------------------
11705|    274|                (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|    274|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11705:17): [True: 44, False: 230]
  ------------------
11706|     44|                xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
11707|     44|                               "Version mismatch between document and "
11708|     44|                               "entity\n");
11709|     44|            }
11710|    277|        }
11711|  1.79k|    }
11712|       |
11713|  5.21k|    xmlParseContentInternal(ctxt);
11714|       |
11715|  5.21k|    if (ctxt->input->cur < ctxt->input->end)
  ------------------
  |  Branch (11715:9): [True: 362, False: 4.85k]
  ------------------
11716|    362|	xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
11717|       |
11718|  5.21k|    if ((ctxt->wellFormed) ||
  ------------------
  |  Branch (11718:9): [True: 3.65k, False: 1.56k]
  ------------------
11719|  4.40k|        ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
  ------------------
  |  Branch (11719:10): [True: 885, False: 681]
  |  Branch (11719:30): [True: 749, False: 136]
  ------------------
11720|  4.40k|        if (root != NULL) {
  ------------------
  |  Branch (11720:13): [True: 4.40k, False: 0]
  ------------------
11721|  4.40k|            xmlNodePtr cur;
11722|       |
11723|       |            /*
11724|       |             * Unlink newly created node list.
11725|       |             */
11726|  4.40k|            list = root->children;
11727|  4.40k|            root->children = NULL;
11728|  4.40k|            root->last = NULL;
11729|  24.6k|            for (cur = list; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (11729:30): [True: 20.2k, False: 4.40k]
  ------------------
11730|  20.2k|                cur->parent = NULL;
11731|  4.40k|        }
11732|  4.40k|    }
11733|       |
11734|       |    /*
11735|       |     * Read the rest of the stream in case of errors. We want
11736|       |     * to account for the whole entity size.
11737|       |     */
11738|  5.42k|    do {
11739|  5.42k|        ctxt->input->cur = ctxt->input->end;
11740|  5.42k|        xmlParserShrink(ctxt);
11741|  5.42k|        result = xmlParserGrow(ctxt);
11742|  5.42k|    } while (result > 0);
  ------------------
  |  Branch (11742:14): [True: 204, False: 5.21k]
  ------------------
11743|       |
11744|  5.21k|    if (buildTree)
  ------------------
  |  Branch (11744:9): [True: 5.21k, False: 0]
  ------------------
11745|  5.21k|        nodePop(ctxt);
11746|       |
11747|  5.21k|    namePop(ctxt);
11748|  5.21k|    spacePop(ctxt);
11749|       |
11750|  5.21k|    xmlCtxtPopInput(ctxt);
11751|       |
11752|  5.22k|error:
11753|  5.22k|    xmlFreeNode(root);
11754|       |
11755|  5.22k|    return(list);
11756|  5.21k|}
parser.c:xmlParserNsPush:
 1666|   244k|                const xmlHashedString *uri, void *saxData, int defAttr) {
 1667|   244k|    xmlParserNsBucket *bucket = NULL;
 1668|   244k|    xmlParserNsExtra *extra;
 1669|   244k|    const xmlChar **ns;
 1670|   244k|    unsigned hashValue, nsIndex, oldIndex;
 1671|       |
 1672|   244k|    if ((prefix != NULL) && (prefix->name == ctxt->str_xml))
  ------------------
  |  Branch (1672:9): [True: 200k, False: 43.9k]
  |  Branch (1672:29): [True: 198, False: 200k]
  ------------------
 1673|    198|        return(0);
 1674|       |
 1675|   244k|    if ((ctxt->nsNr >= ctxt->nsMax) && (xmlParserNsGrow(ctxt) < 0)) {
  ------------------
  |  Branch (1675:9): [True: 14.4k, False: 230k]
  |  Branch (1675:40): [True: 17, False: 14.4k]
  ------------------
 1676|     17|        xmlErrMemory(ctxt);
 1677|     17|        return(-1);
 1678|     17|    }
 1679|       |
 1680|       |    /*
 1681|       |     * Default namespace and 'xml' namespace
 1682|       |     */
 1683|   244k|    if ((prefix == NULL) || (prefix->name == NULL)) {
  ------------------
  |  Branch (1683:9): [True: 43.9k, False: 200k]
  |  Branch (1683:29): [True: 0, False: 200k]
  ------------------
 1684|  43.9k|        oldIndex = ctxt->nsdb->defaultNsIndex;
 1685|       |
 1686|  43.9k|        if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1686:13): [True: 41.6k, False: 2.36k]
  ------------------
 1687|  41.6k|            extra = &ctxt->nsdb->extra[oldIndex];
 1688|       |
 1689|  41.6k|            if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1689:17): [True: 609, False: 41.0k]
  ------------------
 1690|    609|                if (defAttr == 0)
  ------------------
  |  Branch (1690:21): [True: 382, False: 227]
  ------------------
 1691|    382|                    xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
  ------------------
  |  |   34|    382|#define BAD_CAST (xmlChar *)
  ------------------
 1692|    609|                return(0);
 1693|    609|            }
 1694|       |
 1695|  41.0k|            if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1695:17): [True: 8.51k, False: 32.4k]
  ------------------
 1696|  8.51k|                (uri->name == ctxt->nsTab[oldIndex * 2 + 1]))
  ------------------
  |  Branch (1696:17): [True: 5.66k, False: 2.84k]
  ------------------
 1697|  5.66k|                return(0);
 1698|  41.0k|        }
 1699|       |
 1700|  37.7k|        ctxt->nsdb->defaultNsIndex = ctxt->nsNr;
 1701|  37.7k|        goto populate_entry;
 1702|  43.9k|    }
 1703|       |
 1704|       |    /*
 1705|       |     * Hash table lookup
 1706|       |     */
 1707|   200k|    oldIndex = xmlParserNsLookup(ctxt, prefix, &bucket);
 1708|   200k|    if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1708:9): [True: 161k, False: 39.5k]
  ------------------
 1709|   161k|        extra = &ctxt->nsdb->extra[oldIndex];
 1710|       |
 1711|       |        /*
 1712|       |         * Check for duplicate definitions on the same element.
 1713|       |         */
 1714|   161k|        if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1714:13): [True: 917, False: 160k]
  ------------------
 1715|    917|            if (defAttr == 0)
  ------------------
  |  Branch (1715:17): [True: 702, False: 215]
  ------------------
 1716|    702|                xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
  ------------------
  |  |   34|    702|#define BAD_CAST (xmlChar *)
  ------------------
 1717|    917|            return(0);
 1718|    917|        }
 1719|       |
 1720|   160k|        if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1720:13): [True: 4.32k, False: 155k]
  ------------------
 1721|  4.32k|            (uri->name == ctxt->nsTab[bucket->index * 2 + 1]))
  ------------------
  |  Branch (1721:13): [True: 2.91k, False: 1.40k]
  ------------------
 1722|  2.91k|            return(0);
 1723|       |
 1724|   157k|        bucket->index = ctxt->nsNr;
 1725|   157k|        goto populate_entry;
 1726|   160k|    }
 1727|       |
 1728|       |    /*
 1729|       |     * Insert new bucket
 1730|       |     */
 1731|       |
 1732|  39.5k|    hashValue = prefix->hashValue;
 1733|       |
 1734|       |    /*
 1735|       |     * Grow hash table, 50% fill factor
 1736|       |     */
 1737|  39.5k|    if (ctxt->nsdb->hashElems + 1 > ctxt->nsdb->hashSize / 2) {
  ------------------
  |  Branch (1737:9): [True: 7.88k, False: 31.6k]
  ------------------
 1738|  7.88k|        xmlParserNsBucket *newHash;
 1739|  7.88k|        unsigned newSize, i, index;
 1740|       |
 1741|  7.88k|        if (ctxt->nsdb->hashSize > UINT_MAX / 2) {
  ------------------
  |  Branch (1741:13): [True: 0, False: 7.88k]
  ------------------
 1742|      0|            xmlErrMemory(ctxt);
 1743|      0|            return(-1);
 1744|      0|        }
 1745|  7.88k|        newSize = ctxt->nsdb->hashSize ? ctxt->nsdb->hashSize * 2 : 16;
  ------------------
  |  Branch (1745:19): [True: 600, False: 7.28k]
  ------------------
 1746|  7.88k|        newHash = xmlMalloc(newSize * sizeof(newHash[0]));
 1747|  7.88k|        if (newHash == NULL) {
  ------------------
  |  Branch (1747:13): [True: 2, False: 7.88k]
  ------------------
 1748|      2|            xmlErrMemory(ctxt);
 1749|      2|            return(-1);
 1750|      2|        }
 1751|  7.88k|        memset(newHash, 0, newSize * sizeof(newHash[0]));
 1752|       |
 1753|   109k|        for (i = 0; i < ctxt->nsdb->hashSize; i++) {
  ------------------
  |  Branch (1753:21): [True: 101k, False: 7.88k]
  ------------------
 1754|   101k|            unsigned hv = ctxt->nsdb->hash[i].hashValue;
 1755|   101k|            unsigned newIndex;
 1756|       |
 1757|   101k|            if ((hv == 0) || (ctxt->nsdb->hash[i].index == INT_MAX))
  ------------------
  |  Branch (1757:17): [True: 98.3k, False: 2.85k]
  |  Branch (1757:30): [True: 1.31k, False: 1.54k]
  ------------------
 1758|  99.7k|                continue;
 1759|  1.54k|            newIndex = hv & (newSize - 1);
 1760|       |
 1761|  2.32k|            while (newHash[newIndex].hashValue != 0) {
  ------------------
  |  Branch (1761:20): [True: 780, False: 1.54k]
  ------------------
 1762|    780|                newIndex++;
 1763|    780|                if (newIndex == newSize)
  ------------------
  |  Branch (1763:21): [True: 174, False: 606]
  ------------------
 1764|    174|                    newIndex = 0;
 1765|    780|            }
 1766|       |
 1767|  1.54k|            newHash[newIndex] = ctxt->nsdb->hash[i];
 1768|  1.54k|        }
 1769|       |
 1770|  7.88k|        xmlFree(ctxt->nsdb->hash);
 1771|  7.88k|        ctxt->nsdb->hash = newHash;
 1772|  7.88k|        ctxt->nsdb->hashSize = newSize;
 1773|       |
 1774|       |        /*
 1775|       |         * Relookup
 1776|       |         */
 1777|  7.88k|        index = hashValue & (newSize - 1);
 1778|       |
 1779|  8.23k|        while (newHash[index].hashValue != 0) {
  ------------------
  |  Branch (1779:16): [True: 353, False: 7.88k]
  ------------------
 1780|    353|            index++;
 1781|    353|            if (index == newSize)
  ------------------
  |  Branch (1781:17): [True: 49, False: 304]
  ------------------
 1782|     49|                index = 0;
 1783|    353|        }
 1784|       |
 1785|  7.88k|        bucket = &newHash[index];
 1786|  7.88k|    }
 1787|       |
 1788|  39.5k|    bucket->hashValue = hashValue;
 1789|  39.5k|    bucket->index = ctxt->nsNr;
 1790|  39.5k|    ctxt->nsdb->hashElems++;
 1791|  39.5k|    oldIndex = INT_MAX;
 1792|       |
 1793|   234k|populate_entry:
 1794|   234k|    nsIndex = ctxt->nsNr;
 1795|       |
 1796|   234k|    ns = &ctxt->nsTab[nsIndex * 2];
 1797|   234k|    ns[0] = prefix ? prefix->name : NULL;
  ------------------
  |  Branch (1797:13): [True: 196k, False: 37.7k]
  ------------------
 1798|   234k|    ns[1] = uri->name;
 1799|       |
 1800|   234k|    extra = &ctxt->nsdb->extra[nsIndex];
 1801|   234k|    extra->saxData = saxData;
 1802|   234k|    extra->prefixHashValue = prefix ? prefix->hashValue : 0;
  ------------------
  |  Branch (1802:30): [True: 196k, False: 37.7k]
  ------------------
 1803|   234k|    extra->uriHashValue = uri->hashValue;
 1804|   234k|    extra->elementId = ctxt->nsdb->elementId;
 1805|   234k|    extra->oldIndex = oldIndex;
 1806|       |
 1807|   234k|    ctxt->nsNr++;
 1808|       |
 1809|   234k|    return(1);
 1810|  39.5k|}
parser.c:xmlParserNsGrow:
 1624|  14.4k|xmlParserNsGrow(xmlParserCtxtPtr ctxt) {
 1625|  14.4k|    const xmlChar **table;
 1626|  14.4k|    xmlParserNsExtra *extra;
 1627|  14.4k|    int newSize;
 1628|       |
 1629|  14.4k|    newSize = xmlGrowCapacity(ctxt->nsMax,
 1630|  14.4k|                              sizeof(table[0]) + sizeof(extra[0]),
 1631|  14.4k|                              16, XML_MAX_ITEMS);
  ------------------
  |  |   13|  14.4k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1632|  14.4k|    if (newSize < 0)
  ------------------
  |  Branch (1632:9): [True: 0, False: 14.4k]
  ------------------
 1633|      0|        goto error;
 1634|       |
 1635|  14.4k|    table = xmlRealloc(ctxt->nsTab, 2 * newSize * sizeof(table[0]));
 1636|  14.4k|    if (table == NULL)
  ------------------
  |  Branch (1636:9): [True: 8, False: 14.4k]
  ------------------
 1637|      8|        goto error;
 1638|  14.4k|    ctxt->nsTab = table;
 1639|       |
 1640|  14.4k|    extra = xmlRealloc(ctxt->nsdb->extra, newSize * sizeof(extra[0]));
 1641|  14.4k|    if (extra == NULL)
  ------------------
  |  Branch (1641:9): [True: 9, False: 14.4k]
  ------------------
 1642|      9|        goto error;
 1643|  14.4k|    ctxt->nsdb->extra = extra;
 1644|       |
 1645|  14.4k|    ctxt->nsMax = newSize;
 1646|  14.4k|    return(0);
 1647|       |
 1648|     17|error:
 1649|     17|    xmlErrMemory(ctxt);
 1650|     17|    return(-1);
 1651|  14.4k|}
parser.c:xmlParserNsPop:
 1821|  97.2k|{
 1822|  97.2k|    int i;
 1823|       |
 1824|       |    /* assert(nr <= ctxt->nsNr); */
 1825|       |
 1826|   279k|    for (i = ctxt->nsNr - 1; i >= ctxt->nsNr - nr; i--) {
  ------------------
  |  Branch (1826:30): [True: 181k, False: 97.2k]
  ------------------
 1827|   181k|        const xmlChar *prefix = ctxt->nsTab[i * 2];
 1828|   181k|        xmlParserNsExtra *extra = &ctxt->nsdb->extra[i];
 1829|       |
 1830|   181k|        if (prefix == NULL) {
  ------------------
  |  Branch (1830:13): [True: 23.6k, False: 158k]
  ------------------
 1831|  23.6k|            ctxt->nsdb->defaultNsIndex = extra->oldIndex;
 1832|   158k|        } else {
 1833|   158k|            xmlHashedString hprefix;
 1834|   158k|            xmlParserNsBucket *bucket = NULL;
 1835|       |
 1836|   158k|            hprefix.name = prefix;
 1837|   158k|            hprefix.hashValue = extra->prefixHashValue;
 1838|   158k|            xmlParserNsLookup(ctxt, &hprefix, &bucket);
 1839|       |            /* assert(bucket && bucket->hashValue); */
 1840|   158k|            bucket->index = extra->oldIndex;
 1841|   158k|        }
 1842|   181k|    }
 1843|       |
 1844|  97.2k|    ctxt->nsNr -= nr;
 1845|  97.2k|    return(nr);
 1846|  97.2k|}
parser.c:xmlCtxtSetOptionsInternal:
13132|  44.0k|{
13133|  44.0k|    int allMask;
13134|       |
13135|  44.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (13135:9): [True: 0, False: 44.0k]
  ------------------
13136|      0|        return(-1);
13137|       |
13138|       |    /*
13139|       |     * XInclude options aren't handled by the parser.
13140|       |     *
13141|       |     * XML_PARSE_XINCLUDE
13142|       |     * XML_PARSE_NOXINCNODE
13143|       |     * XML_PARSE_NOBASEFIX
13144|       |     */
13145|  44.0k|    allMask = XML_PARSE_RECOVER |
13146|  44.0k|              XML_PARSE_NOENT |
13147|  44.0k|              XML_PARSE_DTDLOAD |
13148|  44.0k|              XML_PARSE_DTDATTR |
13149|  44.0k|              XML_PARSE_DTDVALID |
13150|  44.0k|              XML_PARSE_NOERROR |
13151|  44.0k|              XML_PARSE_NOWARNING |
13152|  44.0k|              XML_PARSE_PEDANTIC |
13153|  44.0k|              XML_PARSE_NOBLANKS |
13154|  44.0k|#ifdef LIBXML_SAX1_ENABLED
13155|  44.0k|              XML_PARSE_SAX1 |
13156|  44.0k|#endif
13157|  44.0k|              XML_PARSE_NONET |
13158|  44.0k|              XML_PARSE_NODICT |
13159|  44.0k|              XML_PARSE_NSCLEAN |
13160|  44.0k|              XML_PARSE_NOCDATA |
13161|  44.0k|              XML_PARSE_COMPACT |
13162|  44.0k|              XML_PARSE_OLD10 |
13163|  44.0k|              XML_PARSE_HUGE |
13164|  44.0k|              XML_PARSE_OLDSAX |
13165|  44.0k|              XML_PARSE_IGNORE_ENC |
13166|  44.0k|              XML_PARSE_BIG_LINES |
13167|  44.0k|              XML_PARSE_NO_XXE |
13168|  44.0k|              XML_PARSE_UNZIP |
13169|  44.0k|              XML_PARSE_NO_SYS_CATALOG |
13170|  44.0k|              XML_PARSE_CATALOG_PI;
13171|       |
13172|  44.0k|    ctxt->options = (ctxt->options & keepMask) | (options & allMask);
13173|       |
13174|       |    /*
13175|       |     * For some options, struct members are historically the source
13176|       |     * of truth. The values are initalized from global variables and
13177|       |     * old code could also modify them directly. Several older API
13178|       |     * functions that don't take an options argument rely on these
13179|       |     * deprecated mechanisms.
13180|       |     *
13181|       |     * Once public access to struct members and the globals are
13182|       |     * disabled, we can use the options bitmask as source of
13183|       |     * truth, making all these struct members obsolete.
13184|       |     *
13185|       |     * The XML_DETECT_IDS flags is misnamed. It simply enables
13186|       |     * loading of the external subset.
13187|       |     */
13188|  44.0k|    ctxt->recovery = (options & XML_PARSE_RECOVER) ? 1 : 0;
  ------------------
  |  Branch (13188:22): [True: 22.3k, False: 21.6k]
  ------------------
13189|  44.0k|    ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0;
  ------------------
  |  Branch (13189:29): [True: 22.4k, False: 21.5k]
  ------------------
13190|  44.0k|    ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0;
  ------------------
  |  |  208|  24.5k|#define XML_DETECT_IDS		2
  ------------------
  |  Branch (13190:24): [True: 24.5k, False: 19.5k]
  ------------------
13191|  44.0k|    ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0;
  ------------------
  |  |  209|  21.3k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (13191:25): [True: 21.3k, False: 22.7k]
  ------------------
13192|  44.0k|    ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0;
  ------------------
  |  |  210|  21.2k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (13192:25): [True: 21.2k, False: 22.7k]
  ------------------
13193|  44.0k|    ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0;
  ------------------
  |  Branch (13193:22): [True: 20.7k, False: 23.3k]
  ------------------
13194|  44.0k|    ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0;
  ------------------
  |  Branch (13194:22): [True: 9.93k, False: 34.1k]
  ------------------
13195|  44.0k|    ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (13195:24): [True: 20.5k, False: 23.4k]
  ------------------
13196|  44.0k|    ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1;
  ------------------
  |  Branch (13196:23): [True: 18.8k, False: 25.1k]
  ------------------
13197|       |
13198|  44.0k|    return(options & ~allMask);
13199|  44.0k|}

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

xmlInitRelaxNGInternal:
 2719|      2|{
 2720|      2|    xmlInitMutex(&xmlRelaxNGMutex);
 2721|      2|}

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

xmlBuildQName:
  170|   364k|	      xmlChar *memory, int len) {
  171|   364k|    size_t lenn, lenp;
  172|   364k|    xmlChar *ret;
  173|       |
  174|   364k|    if ((ncname == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (174:9): [True: 0, False: 364k]
  |  Branch (174:29): [True: 0, False: 364k]
  ------------------
  175|   364k|    if (prefix == NULL) return((xmlChar *) ncname);
  ------------------
  |  Branch (175:9): [True: 242k, False: 122k]
  ------------------
  176|       |
  177|   122k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  178|       |    /* Make allocation more likely */
  179|   122k|    if (len > 8)
  ------------------
  |  Branch (179:9): [True: 83.5k, False: 38.8k]
  ------------------
  180|  83.5k|        len = 8;
  181|   122k|#endif
  182|       |
  183|   122k|    lenn = strlen((char *) ncname);
  184|   122k|    lenp = strlen((char *) prefix);
  185|   122k|    if (lenn >= SIZE_MAX - lenp - 1)
  ------------------
  |  Branch (185:9): [True: 0, False: 122k]
  ------------------
  186|      0|        return(NULL);
  187|       |
  188|   122k|    if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
  ------------------
  |  Branch (188:9): [True: 38.8k, False: 83.5k]
  |  Branch (188:29): [True: 30.3k, False: 53.1k]
  ------------------
  189|  69.2k|	ret = xmlMalloc(lenn + lenp + 2);
  190|  69.2k|	if (ret == NULL)
  ------------------
  |  Branch (190:6): [True: 62, False: 69.1k]
  ------------------
  191|     62|	    return(NULL);
  192|  69.2k|    } else {
  193|  53.1k|	ret = memory;
  194|  53.1k|    }
  195|   122k|    memcpy(&ret[0], prefix, lenp);
  196|   122k|    ret[lenp] = ':';
  197|   122k|    memcpy(&ret[lenp + 1], ncname, lenn);
  198|   122k|    ret[lenn + lenp + 1] = 0;
  199|   122k|    return(ret);
  200|   122k|}
xmlSplitQName3:
  268|   199k|xmlSplitQName3(const xmlChar *name, int *len) {
  269|   199k|    int l = 0;
  270|       |
  271|   199k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (271:9): [True: 0, False: 199k]
  ------------------
  272|   199k|    if (len == NULL) return(NULL);
  ------------------
  |  Branch (272:9): [True: 0, False: 199k]
  ------------------
  273|       |
  274|       |    /* nasty but valid */
  275|   199k|    if (name[0] == ':')
  ------------------
  |  Branch (275:9): [True: 1.60k, False: 197k]
  ------------------
  276|  1.60k|	return(NULL);
  277|       |
  278|       |    /*
  279|       |     * we are not trying to validate but just to cut, and yes it will
  280|       |     * work even if this is as set of UTF-8 encoded chars
  281|       |     */
  282|  1.01M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (282:12): [True: 830k, False: 183k]
  |  Branch (282:30): [True: 816k, False: 13.7k]
  ------------------
  283|   816k|	l++;
  284|       |
  285|   197k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (285:9): [True: 183k, False: 13.7k]
  |  Branch (285:27): [True: 367, False: 13.4k]
  ------------------
  286|   184k|	return(NULL);
  287|       |
  288|  13.4k|    *len = l;
  289|       |
  290|  13.4k|    return(&name[l+1]);
  291|   197k|}
xmlSplitQName4:
  306|   466k|xmlSplitQName4(const xmlChar *name, xmlChar **prefixPtr) {
  307|   466k|    xmlChar *prefix;
  308|   466k|    int l = 0;
  309|       |
  310|   466k|    if ((name == NULL) || (prefixPtr == NULL))
  ------------------
  |  Branch (310:9): [True: 0, False: 466k]
  |  Branch (310:27): [True: 0, False: 466k]
  ------------------
  311|      0|        return(NULL);
  312|       |
  313|   466k|    *prefixPtr = NULL;
  314|       |
  315|       |    /* nasty but valid */
  316|   466k|    if (name[0] == ':')
  ------------------
  |  Branch (316:9): [True: 2.79k, False: 464k]
  ------------------
  317|  2.79k|	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.08M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (323:12): [True: 1.73M, False: 354k]
  |  Branch (323:30): [True: 1.62M, False: 109k]
  ------------------
  324|  1.62M|	l++;
  325|       |
  326|       |    /*
  327|       |     * TODO: What about names with multiple colons?
  328|       |     */
  329|   464k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (329:9): [True: 354k, False: 109k]
  |  Branch (329:27): [True: 1.54k, False: 108k]
  ------------------
  330|   355k|	return(name);
  331|       |
  332|   108k|    prefix = xmlStrndup(name, l);
  333|   108k|    if (prefix == NULL)
  ------------------
  |  Branch (333:9): [True: 46, False: 108k]
  ------------------
  334|     46|        return(NULL);
  335|       |
  336|   108k|    *prefixPtr = prefix;
  337|   108k|    return(&name[l+1]);
  338|   108k|}
xmlValidateNCName:
  355|  3.43k|xmlValidateNCName(const xmlChar *value, int space) {
  356|  3.43k|    const xmlChar *cur;
  357|       |
  358|  3.43k|    if (value == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 3.43k]
  ------------------
  359|      0|        return(-1);
  360|       |
  361|  3.43k|    cur = value;
  362|       |
  363|  3.43k|    if (space) {
  ------------------
  |  Branch (363:9): [True: 3.43k, False: 0]
  ------------------
  364|  3.43k|	while (IS_BLANK_CH(*cur))
  365|    912|            cur++;
  366|  3.43k|    }
  367|       |
  368|  3.43k|    value = cur;
  369|  3.43k|    cur = xmlScanName(value, SIZE_MAX, XML_SCAN_NC);
  ------------------
  |  |   69|  3.43k|#define XML_SCAN_NC         1
  ------------------
  370|  3.43k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (370:9): [True: 0, False: 3.43k]
  |  Branch (370:26): [True: 681, False: 2.75k]
  ------------------
  371|    681|        return(1);
  372|       |
  373|  2.75k|    if (space) {
  ------------------
  |  Branch (373:9): [True: 2.75k, False: 0]
  ------------------
  374|  2.75k|	while (IS_BLANK_CH(*cur))
  375|  1.34k|            cur++;
  376|  2.75k|    }
  377|       |
  378|  2.75k|    return(*cur != 0);
  379|  3.43k|}
xmlNewNs:
  517|  4.13M|xmlNewNs(xmlNode *node, const xmlChar *href, const xmlChar *prefix) {
  518|  4.13M|    xmlNsPtr cur;
  519|       |
  520|  4.13M|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (520:9): [True: 58.5k, False: 4.07M]
  |  Branch (520:27): [True: 0, False: 58.5k]
  ------------------
  521|      0|	return(NULL);
  522|       |
  523|       |    /*
  524|       |     * Allocate a new Namespace and fill the fields.
  525|       |     */
  526|  4.13M|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
  527|  4.13M|    if (cur == NULL)
  ------------------
  |  Branch (527:9): [True: 46, False: 4.13M]
  ------------------
  528|     46|	return(NULL);
  529|  4.13M|    memset(cur, 0, sizeof(xmlNs));
  530|  4.13M|    cur->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  4.13M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  531|       |
  532|  4.13M|    if (href != NULL) {
  ------------------
  |  Branch (532:9): [True: 4.11M, False: 21.6k]
  ------------------
  533|  4.11M|	cur->href = xmlStrdup(href);
  534|  4.11M|        if (cur->href == NULL)
  ------------------
  |  Branch (534:13): [True: 44, False: 4.11M]
  ------------------
  535|     44|            goto error;
  536|  4.11M|    }
  537|  4.13M|    if (prefix != NULL) {
  ------------------
  |  Branch (537:9): [True: 4.07M, False: 56.6k]
  ------------------
  538|  4.07M|	cur->prefix = xmlStrdup(prefix);
  539|  4.07M|        if (cur->prefix == NULL)
  ------------------
  |  Branch (539:13): [True: 40, False: 4.07M]
  ------------------
  540|     40|            goto error;
  541|  4.07M|    }
  542|       |
  543|       |    /*
  544|       |     * Add it at the end to preserve parsing order ...
  545|       |     * and checks for existing use of the prefix
  546|       |     */
  547|  4.13M|    if (node != NULL) {
  ------------------
  |  Branch (547:9): [True: 58.5k, False: 4.07M]
  ------------------
  548|  58.5k|	if (node->nsDef == NULL) {
  ------------------
  |  Branch (548:6): [True: 50.5k, False: 7.95k]
  ------------------
  549|  50.5k|	    node->nsDef = cur;
  550|  50.5k|	} else {
  551|  7.95k|	    xmlNsPtr prev = node->nsDef;
  552|       |
  553|  7.95k|	    if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (553:10): [True: 0, False: 7.95k]
  ------------------
  554|      0|                (prev->href != NULL))
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                goto error;
  556|  11.1k|	    while (prev->next != NULL) {
  ------------------
  |  Branch (556:13): [True: 3.20k, False: 7.95k]
  ------------------
  557|  3.20k|	        prev = prev->next;
  558|  3.20k|		if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (558:7): [True: 0, False: 3.20k]
  ------------------
  559|      0|                    (prev->href != NULL))
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|      0|                    goto error;
  561|  3.20k|	    }
  562|  7.95k|	    prev->next = cur;
  563|  7.95k|	}
  564|  58.5k|    }
  565|  4.13M|    return(cur);
  566|       |
  567|     84|error:
  568|     84|    xmlFreeNs(cur);
  569|       |    return(NULL);
  570|  4.13M|}
xmlSetNs:
  580|  51.8k|xmlSetNs(xmlNode *node, xmlNs *ns) {
  581|  51.8k|    if (node == NULL) {
  ------------------
  |  Branch (581:9): [True: 0, False: 51.8k]
  ------------------
  582|      0|	return;
  583|      0|    }
  584|  51.8k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (584:9): [True: 51.8k, False: 0]
  ------------------
  585|      0|        (node->type == XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  ------------------
  586|  51.8k|	node->ns = ns;
  587|  51.8k|}
xmlFreeNs:
  595|  4.13M|xmlFreeNs(xmlNs *cur) {
  596|  4.13M|    if (cur == NULL) {
  ------------------
  |  Branch (596:9): [True: 0, False: 4.13M]
  ------------------
  597|      0|	return;
  598|      0|    }
  599|  4.13M|    if (cur->href != NULL) xmlFree((char *) cur->href);
  ------------------
  |  Branch (599:9): [True: 4.11M, False: 21.7k]
  ------------------
  600|  4.13M|    if (cur->prefix != NULL) xmlFree((char *) cur->prefix);
  ------------------
  |  Branch (600:9): [True: 4.08M, False: 56.7k]
  ------------------
  601|  4.13M|    xmlFree(cur);
  602|  4.13M|}
xmlFreeNsList:
  610|  4.00M|xmlFreeNsList(xmlNs *cur) {
  611|  4.00M|    xmlNsPtr next;
  612|  4.00M|    if (cur == NULL) {
  ------------------
  |  Branch (612:9): [True: 34, False: 4.00M]
  ------------------
  613|     34|	return;
  614|     34|    }
  615|  8.14M|    while (cur != NULL) {
  ------------------
  |  Branch (615:12): [True: 4.13M, False: 4.00M]
  ------------------
  616|  4.13M|        next = cur->next;
  617|  4.13M|        xmlFreeNs(cur);
  618|  4.13M|	cur = next;
  619|  4.13M|    }
  620|  4.00M|}
xmlNewDtd:
  640|  5.86k|          const xmlChar *systemId) {
  641|  5.86k|    xmlDtdPtr cur;
  642|       |
  643|  5.86k|    if ((doc != NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (643:9): [True: 1.39k, False: 4.47k]
  |  Branch (643:26): [True: 0, False: 1.39k]
  ------------------
  644|      0|	return(NULL);
  645|      0|    }
  646|       |
  647|       |    /*
  648|       |     * Allocate a new DTD and fill the fields.
  649|       |     */
  650|  5.86k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  651|  5.86k|    if (cur == NULL)
  ------------------
  |  Branch (651:9): [True: 6, False: 5.85k]
  ------------------
  652|      6|	return(NULL);
  653|  5.85k|    memset(cur, 0 , sizeof(xmlDtd));
  654|  5.85k|    cur->type = XML_DTD_NODE;
  655|       |
  656|  5.85k|    if (name != NULL) {
  ------------------
  |  Branch (656:9): [True: 5.85k, False: 0]
  ------------------
  657|  5.85k|	cur->name = xmlStrdup(name);
  658|  5.85k|        if (cur->name == NULL)
  ------------------
  |  Branch (658:13): [True: 12, False: 5.84k]
  ------------------
  659|     12|            goto error;
  660|  5.85k|    }
  661|  5.84k|    if (publicId != NULL) {
  ------------------
  |  Branch (661:9): [True: 260, False: 5.58k]
  ------------------
  662|    260|	cur->ExternalID = xmlStrdup(publicId);
  663|    260|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (663:13): [True: 1, False: 259]
  ------------------
  664|      1|            goto error;
  665|    260|    }
  666|  5.84k|    if (systemId != NULL) {
  ------------------
  |  Branch (666:9): [True: 1.94k, False: 3.89k]
  ------------------
  667|  1.94k|	cur->SystemID = xmlStrdup(systemId);
  668|  1.94k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (668:13): [True: 5, False: 1.94k]
  ------------------
  669|      5|            goto error;
  670|  1.94k|    }
  671|  5.84k|    if (doc != NULL)
  ------------------
  |  Branch (671:9): [True: 1.39k, False: 4.45k]
  ------------------
  672|  1.39k|	doc->extSubset = cur;
  673|  5.84k|    cur->doc = doc;
  674|       |
  675|  5.84k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (675:9): [True: 0, False: 5.84k]
  |  Branch (675:35): [True: 0, False: 0]
  ------------------
  676|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  677|  5.84k|    return(cur);
  678|       |
  679|     18|error:
  680|     18|    xmlFreeDtd(cur);
  681|       |    return(NULL);
  682|  5.84k|}
xmlGetIntSubset:
  691|  70.9k|xmlGetIntSubset(const xmlDoc *doc) {
  692|  70.9k|    xmlNodePtr cur;
  693|       |
  694|  70.9k|    if (doc == NULL)
  ------------------
  |  Branch (694:9): [True: 4.30k, False: 66.6k]
  ------------------
  695|  4.30k|	return(NULL);
  696|  66.6k|    cur = doc->children;
  697|  78.4k|    while (cur != NULL) {
  ------------------
  |  Branch (697:12): [True: 36.4k, False: 41.9k]
  ------------------
  698|  36.4k|	if (cur->type == XML_DTD_NODE)
  ------------------
  |  Branch (698:6): [True: 24.6k, False: 11.7k]
  ------------------
  699|  24.6k|	    return((xmlDtdPtr) cur);
  700|  11.7k|	cur = cur->next;
  701|  11.7k|    }
  702|  41.9k|    return((xmlDtdPtr) doc->intSubset);
  703|  66.6k|}
xmlCreateIntSubset:
  722|  18.1k|                   const xmlChar *systemId) {
  723|  18.1k|    xmlDtdPtr cur;
  724|       |
  725|  18.1k|    if (doc != NULL) {
  ------------------
  |  Branch (725:9): [True: 18.1k, False: 0]
  ------------------
  726|  18.1k|        cur = xmlGetIntSubset(doc);
  727|  18.1k|        if (cur != NULL)
  ------------------
  |  Branch (727:13): [True: 0, False: 18.1k]
  ------------------
  728|      0|            return(cur);
  729|  18.1k|    }
  730|       |
  731|       |    /*
  732|       |     * Allocate a new DTD and fill the fields.
  733|       |     */
  734|  18.1k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  735|  18.1k|    if (cur == NULL)
  ------------------
  |  Branch (735:9): [True: 4, False: 18.1k]
  ------------------
  736|      4|	return(NULL);
  737|  18.1k|    memset(cur, 0, sizeof(xmlDtd));
  738|  18.1k|    cur->type = XML_DTD_NODE;
  739|       |
  740|  18.1k|    if (name != NULL) {
  ------------------
  |  Branch (740:9): [True: 17.2k, False: 904]
  ------------------
  741|  17.2k|	cur->name = xmlStrdup(name);
  742|  17.2k|	if (cur->name == NULL)
  ------------------
  |  Branch (742:6): [True: 3, False: 17.2k]
  ------------------
  743|      3|            goto error;
  744|  17.2k|    }
  745|  18.1k|    if (publicId != NULL) {
  ------------------
  |  Branch (745:9): [True: 750, False: 17.3k]
  ------------------
  746|    750|	cur->ExternalID = xmlStrdup(publicId);
  747|    750|	if (cur->ExternalID  == NULL)
  ------------------
  |  Branch (747:6): [True: 2, False: 748]
  ------------------
  748|      2|            goto error;
  749|    750|    }
  750|  18.1k|    if (systemId != NULL) {
  ------------------
  |  Branch (750:9): [True: 2.64k, False: 15.4k]
  ------------------
  751|  2.64k|	cur->SystemID = xmlStrdup(systemId);
  752|  2.64k|	if (cur->SystemID == NULL)
  ------------------
  |  Branch (752:6): [True: 1, False: 2.64k]
  ------------------
  753|      1|            goto error;
  754|  2.64k|    }
  755|  18.1k|    if (doc != NULL) {
  ------------------
  |  Branch (755:9): [True: 18.1k, False: 0]
  ------------------
  756|  18.1k|	doc->intSubset = cur;
  757|  18.1k|	cur->parent = doc;
  758|  18.1k|	cur->doc = doc;
  759|  18.1k|	if (doc->children == NULL) {
  ------------------
  |  Branch (759:6): [True: 16.1k, False: 1.98k]
  ------------------
  760|  16.1k|	    doc->children = (xmlNodePtr) cur;
  761|  16.1k|	    doc->last = (xmlNodePtr) cur;
  762|  16.1k|	} else {
  763|  1.98k|	    if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (763:10): [True: 0, False: 1.98k]
  ------------------
  764|      0|		xmlNodePtr prev;
  765|       |
  766|      0|		prev = doc->children;
  767|      0|		prev->prev = (xmlNodePtr) cur;
  768|      0|		cur->next = prev;
  769|      0|		doc->children = (xmlNodePtr) cur;
  770|  1.98k|	    } else {
  771|  1.98k|		xmlNodePtr next;
  772|       |
  773|  1.98k|		next = doc->children;
  774|  3.96k|		while ((next != NULL) && (next->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (774:10): [True: 2.14k, False: 1.82k]
  |  Branch (774:28): [True: 1.98k, False: 161]
  ------------------
  775|  1.98k|		    next = next->next;
  776|  1.98k|		if (next == NULL) {
  ------------------
  |  Branch (776:7): [True: 1.82k, False: 161]
  ------------------
  777|  1.82k|		    cur->prev = doc->last;
  778|  1.82k|		    cur->prev->next = (xmlNodePtr) cur;
  779|  1.82k|		    cur->next = NULL;
  780|  1.82k|		    doc->last = (xmlNodePtr) cur;
  781|  1.82k|		} else {
  782|    161|		    cur->next = next;
  783|    161|		    cur->prev = next->prev;
  784|    161|		    if (cur->prev == NULL)
  ------------------
  |  Branch (784:11): [True: 156, False: 5]
  ------------------
  785|    156|			doc->children = (xmlNodePtr) cur;
  786|      5|		    else
  787|      5|			cur->prev->next = (xmlNodePtr) cur;
  788|    161|		    next->prev = (xmlNodePtr) cur;
  789|    161|		}
  790|  1.98k|	    }
  791|  1.98k|	}
  792|  18.1k|    }
  793|       |
  794|  18.1k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (794:9): [True: 0, False: 18.1k]
  |  Branch (794:35): [True: 0, False: 0]
  ------------------
  795|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  796|  18.1k|    return(cur);
  797|       |
  798|      6|error:
  799|      6|    xmlFreeDtd(cur);
  800|       |    return(NULL);
  801|  18.1k|}
xmlFreeDtd:
  820|  24.0k|xmlFreeDtd(xmlDtd *cur) {
  821|  24.0k|    xmlDictPtr dict = NULL;
  822|       |
  823|  24.0k|    if (cur == NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 24.0k]
  ------------------
  824|      0|	return;
  825|      0|    }
  826|  24.0k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (826:9): [True: 19.5k, False: 4.47k]
  ------------------
  827|       |
  828|  24.0k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (828:9): [True: 0, False: 24.0k]
  |  Branch (828:35): [True: 0, False: 0]
  ------------------
  829|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  830|       |
  831|  24.0k|    if (cur->children != NULL) {
  ------------------
  |  Branch (831:9): [True: 15.4k, False: 8.52k]
  ------------------
  832|  15.4k|	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|   391k|        while (c != NULL) {
  ------------------
  |  Branch (838:16): [True: 375k, False: 15.4k]
  ------------------
  839|   375k|	    next = c->next;
  840|   375k|	    if ((c->type != XML_ELEMENT_DECL) &&
  ------------------
  |  Branch (840:10): [True: 363k, False: 12.5k]
  ------------------
  841|   363k|		(c->type != XML_ATTRIBUTE_DECL) &&
  ------------------
  |  Branch (841:3): [True: 333k, False: 29.4k]
  ------------------
  842|   333k|		(c->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (842:3): [True: 312k, False: 21.3k]
  ------------------
  843|   312k|		xmlUnlinkNodeInternal(c);
  844|   312k|		xmlFreeNode(c);
  845|   312k|	    }
  846|   375k|	    c = next;
  847|   375k|	}
  848|  15.4k|    }
  849|       |
  850|  24.0k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  24.0k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 23.0k, False: 919]
  |  |  |  Branch (810:16): [True: 12.5k, False: 10.5k]
  |  |  ------------------
  |  |  811|  23.0k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 10.5k, False: 0]
  |  |  ------------------
  |  |  812|  24.0k|	    xmlFree((char *)(str));
  ------------------
  851|       |
  852|  24.0k|    if (cur->SystemID != NULL)
  ------------------
  |  Branch (852:9): [True: 4.58k, False: 19.4k]
  ------------------
  853|  4.58k|        xmlFree(cur->SystemID);
  854|  24.0k|    if (cur->ExternalID != NULL)
  ------------------
  |  Branch (854:9): [True: 1.00k, False: 22.9k]
  ------------------
  855|  1.00k|        xmlFree(cur->ExternalID);
  856|       |
  857|       |    /* TODO !!! */
  858|  24.0k|    if (cur->notations != NULL)
  ------------------
  |  Branch (858:9): [True: 853, False: 23.1k]
  ------------------
  859|    853|        xmlFreeNotationTable((xmlNotationTablePtr) cur->notations);
  860|       |
  861|  24.0k|    if (cur->elements != NULL)
  ------------------
  |  Branch (861:9): [True: 10.3k, False: 13.6k]
  ------------------
  862|  10.3k|        xmlFreeElementTable((xmlElementTablePtr) cur->elements);
  863|  24.0k|    if (cur->attributes != NULL)
  ------------------
  |  Branch (863:9): [True: 6.76k, False: 17.2k]
  ------------------
  864|  6.76k|        xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes);
  865|  24.0k|    if (cur->entities != NULL)
  ------------------
  |  Branch (865:9): [True: 5.47k, False: 18.5k]
  ------------------
  866|  5.47k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities);
  867|  24.0k|    if (cur->pentities != NULL)
  ------------------
  |  Branch (867:9): [True: 3.34k, False: 20.6k]
  ------------------
  868|  3.34k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities);
  869|       |
  870|  24.0k|    xmlFree(cur);
  871|  24.0k|}
xmlNewDoc:
  880|  42.2k|xmlNewDoc(const xmlChar *version) {
  881|  42.2k|    xmlDocPtr cur;
  882|       |
  883|  42.2k|    if (version == NULL)
  ------------------
  |  Branch (883:9): [True: 491, False: 41.7k]
  ------------------
  884|    491|	version = (const xmlChar *) "1.0";
  885|       |
  886|       |    /*
  887|       |     * Allocate a new document and fill the fields.
  888|       |     */
  889|  42.2k|    cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc));
  890|  42.2k|    if (cur == NULL)
  ------------------
  |  Branch (890:9): [True: 7, False: 42.2k]
  ------------------
  891|      7|	return(NULL);
  892|  42.2k|    memset(cur, 0, sizeof(xmlDoc));
  893|  42.2k|    cur->type = XML_DOCUMENT_NODE;
  894|       |
  895|  42.2k|    cur->version = xmlStrdup(version);
  896|  42.2k|    if (cur->version == NULL) {
  ------------------
  |  Branch (896:9): [True: 14, False: 42.2k]
  ------------------
  897|     14|	xmlFree(cur);
  898|     14|	return(NULL);
  899|     14|    }
  900|  42.2k|    cur->standalone = -1;
  901|  42.2k|    cur->compression = -1; /* not initialized */
  902|  42.2k|    cur->doc = cur;
  903|  42.2k|    cur->parseFlags = 0;
  904|  42.2k|    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|  42.2k|    cur->charset = XML_CHAR_ENCODING_UTF8;
  911|       |
  912|  42.2k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (912:9): [True: 0, False: 42.2k]
  |  Branch (912:35): [True: 0, False: 0]
  ------------------
  913|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  914|  42.2k|    return(cur);
  915|  42.2k|}
xmlFreeDoc:
  923|  12.5k|xmlFreeDoc(xmlDoc *cur) {
  924|  12.5k|    xmlDtdPtr extSubset, intSubset;
  925|  12.5k|    xmlDictPtr dict = NULL;
  926|       |
  927|  12.5k|    if (cur == NULL) {
  ------------------
  |  Branch (927:9): [True: 1.52k, False: 11.0k]
  ------------------
  928|  1.52k|	return;
  929|  1.52k|    }
  930|       |
  931|  11.0k|    dict = cur->dict;
  932|       |
  933|  11.0k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (933:9): [True: 0, False: 11.0k]
  |  Branch (933:35): [True: 0, False: 0]
  ------------------
  934|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  935|       |
  936|       |    /*
  937|       |     * Do this before freeing the children list to avoid ID lookups
  938|       |     */
  939|  11.0k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (939:9): [True: 206, False: 10.8k]
  ------------------
  940|  11.0k|    cur->ids = NULL;
  941|  11.0k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (941:9): [True: 257, False: 10.7k]
  ------------------
  942|  11.0k|    cur->refs = NULL;
  943|  11.0k|    extSubset = cur->extSubset;
  944|  11.0k|    intSubset = cur->intSubset;
  945|  11.0k|    if (intSubset == extSubset)
  ------------------
  |  Branch (945:9): [True: 6.99k, False: 4.03k]
  ------------------
  946|  6.99k|	extSubset = NULL;
  947|  11.0k|    if (extSubset != NULL) {
  ------------------
  |  Branch (947:9): [True: 168, False: 10.8k]
  ------------------
  948|    168|	xmlUnlinkNodeInternal((xmlNodePtr) cur->extSubset);
  949|    168|	cur->extSubset = NULL;
  950|    168|	xmlFreeDtd(extSubset);
  951|    168|    }
  952|  11.0k|    if (intSubset != NULL) {
  ------------------
  |  Branch (952:9): [True: 4.04k, False: 6.97k]
  ------------------
  953|  4.04k|	xmlUnlinkNodeInternal((xmlNodePtr) cur->intSubset);
  954|  4.04k|	cur->intSubset = NULL;
  955|  4.04k|	xmlFreeDtd(intSubset);
  956|  4.04k|    }
  957|       |
  958|  11.0k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (958:9): [True: 10.4k, False: 619]
  ------------------
  959|  11.0k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (959:9): [True: 1.47k, False: 9.54k]
  ------------------
  960|       |
  961|  11.0k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  11.0k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 0, False: 11.0k]
  |  |  |  Branch (810:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  811|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|  11.0k|	    xmlFree((char *)(str));
  ------------------
  962|       |
  963|  11.0k|    if (cur->version != NULL)
  ------------------
  |  Branch (963:9): [True: 11.0k, False: 0]
  ------------------
  964|  11.0k|        xmlFree(cur->version);
  965|  11.0k|    if (cur->encoding != NULL)
  ------------------
  |  Branch (965:9): [True: 94, False: 10.9k]
  ------------------
  966|     94|        xmlFree(cur->encoding);
  967|  11.0k|    if (cur->URL != NULL)
  ------------------
  |  Branch (967:9): [True: 7.55k, False: 3.46k]
  ------------------
  968|  7.55k|        xmlFree(cur->URL);
  969|       |
  970|  11.0k|    xmlFree(cur);
  971|  11.0k|    if (dict) xmlDictFree(dict);
  ------------------
  |  Branch (971:9): [True: 5.75k, False: 5.27k]
  ------------------
  972|  11.0k|}
xmlNodeParseAttValue:
  998|  70.7k|                     const xmlChar *value, size_t len, xmlNode **listPtr) {
  999|  70.7k|    xmlNodePtr head = NULL, last = NULL;
 1000|  70.7k|    xmlNodePtr node;
 1001|  70.7k|    xmlChar *val = NULL;
 1002|  70.7k|    const xmlChar *cur;
 1003|  70.7k|    const xmlChar *q;
 1004|  70.7k|    xmlEntityPtr ent;
 1005|  70.7k|    xmlBufPtr buf;
 1006|  70.7k|    size_t remaining = len;
 1007|       |
 1008|  70.7k|    if (listPtr != NULL)
  ------------------
  |  Branch (1008:9): [True: 0, False: 70.7k]
  ------------------
 1009|      0|        *listPtr = NULL;
 1010|       |
 1011|  70.7k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (1011:9): [True: 0, False: 70.7k]
  |  Branch (1011:28): [True: 3.75k, False: 67.0k]
  ------------------
 1012|  3.75k|        goto done;
 1013|       |
 1014|  67.0k|    cur = value;
 1015|       |
 1016|  67.0k|    buf = xmlBufCreate(50);
 1017|  67.0k|    if (buf == NULL)
  ------------------
  |  Branch (1017:9): [True: 31, False: 66.9k]
  ------------------
 1018|     31|        return(-1);
 1019|       |
 1020|  66.9k|    q = cur;
 1021|  86.4M|    while ((remaining > 0) && (*cur != 0)) {
  ------------------
  |  Branch (1021:12): [True: 86.4M, False: 40.5k]
  |  Branch (1021:31): [True: 86.3M, False: 26.2k]
  ------------------
 1022|  86.3M|	if (cur[0] == '&') {
  ------------------
  |  Branch (1022:6): [True: 39.6k, False: 86.3M]
  ------------------
 1023|  39.6k|	    int charval = 0;
 1024|       |
 1025|       |	    /*
 1026|       |	     * Save the current text.
 1027|       |	     */
 1028|  39.6k|            if (cur != q) {
  ------------------
  |  Branch (1028:17): [True: 26.4k, False: 13.2k]
  ------------------
 1029|  26.4k|		if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1029:7): [True: 1, False: 26.3k]
  ------------------
 1030|      1|		    goto out;
 1031|  26.3k|	        q = cur;
 1032|  26.3k|	    }
 1033|       |
 1034|  39.6k|	    if ((remaining > 2) && (cur[1] == '#') && (cur[2] == 'x')) {
  ------------------
  |  Branch (1034:10): [True: 39.6k, False: 0]
  |  Branch (1034:29): [True: 15.7k, False: 23.8k]
  |  Branch (1034:48): [True: 5.41k, False: 10.3k]
  ------------------
 1035|  5.41k|	        int tmp = 0;
 1036|       |
 1037|  5.41k|		cur += 3;
 1038|  5.41k|                remaining -= 3;
 1039|  22.6k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1039:10): [True: 22.6k, False: 0]
  |  Branch (1039:29): [True: 17.1k, False: 5.41k]
  ------------------
 1040|  17.1k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1040:11): [True: 17.1k, False: 0]
  |  Branch (1040:27): [True: 1.05k, False: 16.1k]
  ------------------
 1041|  1.05k|			charval = charval * 16 + (tmp - '0');
 1042|  16.1k|		    else if ((tmp >= 'a') && (tmp <= 'f'))
  ------------------
  |  Branch (1042:16): [True: 5.03k, False: 11.0k]
  |  Branch (1042:32): [True: 5.03k, False: 0]
  ------------------
 1043|  5.03k|			charval = charval * 16 + (tmp - 'a') + 10;
 1044|  11.0k|		    else if ((tmp >= 'A') && (tmp <= 'F'))
  ------------------
  |  Branch (1044:16): [True: 11.0k, False: 0]
  |  Branch (1044:32): [True: 11.0k, False: 0]
  ------------------
 1045|  11.0k|			charval = charval * 16 + (tmp - 'A') + 10;
 1046|      0|		    else {
 1047|      0|			charval = 0;
 1048|      0|			break;
 1049|      0|		    }
 1050|  17.1k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1050:25): [True: 0, False: 17.1k]
  ------------------
 1051|      0|                        charval = 0x110000;
 1052|  17.1k|		    cur++;
 1053|  17.1k|                    remaining--;
 1054|  17.1k|		}
 1055|  5.41k|		if (tmp == ';') {
  ------------------
  |  Branch (1055:7): [True: 5.41k, False: 0]
  ------------------
 1056|  5.41k|		    cur++;
 1057|  5.41k|                    remaining--;
 1058|  5.41k|                }
 1059|  5.41k|		q = cur;
 1060|  34.1k|	    } else if ((remaining > 1) && (cur[1] == '#')) {
  ------------------
  |  Branch (1060:17): [True: 34.1k, False: 0]
  |  Branch (1060:36): [True: 10.3k, False: 23.8k]
  ------------------
 1061|  10.3k|	        int tmp = 0;
 1062|       |
 1063|  10.3k|		cur += 2;
 1064|  10.3k|                remaining -= 2;
 1065|  30.9k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1065:10): [True: 30.9k, False: 0]
  |  Branch (1065:29): [True: 20.6k, False: 10.3k]
  ------------------
 1066|  20.6k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1066:11): [True: 20.6k, False: 0]
  |  Branch (1066:27): [True: 20.6k, False: 0]
  ------------------
 1067|  20.6k|			charval = charval * 10 + (tmp - '0');
 1068|      0|		    else {
 1069|      0|			charval = 0;
 1070|      0|			break;
 1071|      0|		    }
 1072|  20.6k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1072:25): [True: 0, False: 20.6k]
  ------------------
 1073|      0|                        charval = 0x110000;
 1074|  20.6k|		    cur++;
 1075|  20.6k|                    remaining--;
 1076|  20.6k|		}
 1077|  10.3k|		if (tmp == ';') {
  ------------------
  |  Branch (1077:7): [True: 10.3k, False: 0]
  ------------------
 1078|  10.3k|		    cur++;
 1079|  10.3k|                    remaining--;
 1080|  10.3k|                }
 1081|  10.3k|		q = cur;
 1082|  23.8k|	    } else {
 1083|       |		/*
 1084|       |		 * Read the entity string
 1085|       |		 */
 1086|  23.8k|		cur++;
 1087|  23.8k|                remaining--;
 1088|  23.8k|		q = cur;
 1089|   148k|		while ((remaining > 0) && (*cur != 0) && (*cur != ';')) {
  ------------------
  |  Branch (1089:10): [True: 148k, False: 0]
  |  Branch (1089:29): [True: 148k, False: 0]
  |  Branch (1089:44): [True: 124k, False: 23.8k]
  ------------------
 1090|   124k|                    cur++;
 1091|   124k|                    remaining--;
 1092|   124k|                }
 1093|  23.8k|		if ((remaining <= 0) || (*cur == 0))
  ------------------
  |  Branch (1093:7): [True: 0, False: 23.8k]
  |  Branch (1093:27): [True: 0, False: 23.8k]
  ------------------
 1094|      0|		    break;
 1095|  23.8k|		if (cur != q) {
  ------------------
  |  Branch (1095:7): [True: 23.8k, False: 0]
  ------------------
 1096|  23.8k|		    val = xmlStrndup(q, cur - q);
 1097|  23.8k|                    if (val == NULL)
  ------------------
  |  Branch (1097:25): [True: 12, False: 23.8k]
  ------------------
 1098|     12|                        goto out;
 1099|  23.8k|		    ent = xmlGetDocEntity(doc, val);
 1100|  23.8k|		    if ((ent != NULL) &&
  ------------------
  |  Branch (1100:11): [True: 18.1k, False: 5.70k]
  ------------------
 1101|  18.1k|			(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (1101:4): [True: 300, False: 17.8k]
  ------------------
 1102|       |                        /*
 1103|       |                         * Predefined entities don't generate nodes
 1104|       |                         */
 1105|    300|			if (xmlBufCat(buf, ent->content))
  ------------------
  |  Branch (1105:8): [True: 1, False: 299]
  ------------------
 1106|      1|			    goto out;
 1107|  23.5k|                    } else if (ent == NULL ||
  ------------------
  |  Branch (1107:32): [True: 5.70k, False: 17.8k]
  ------------------
 1108|  23.5k|                               (ent->flags & XML_ENT_EXPANDING) == 0) {
  ------------------
  |  |   22|  17.8k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (1108:32): [True: 17.8k, False: 0]
  ------------------
 1109|       |			/*
 1110|       |			 * Flush buffer so far
 1111|       |			 */
 1112|  23.5k|			if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1112:8): [True: 16.8k, False: 6.66k]
  ------------------
 1113|  16.8k|			    node = xmlNewDocText(doc, NULL);
 1114|  16.8k|			    if (node == NULL)
  ------------------
  |  Branch (1114:12): [True: 5, False: 16.8k]
  ------------------
 1115|      5|				goto out;
 1116|  16.8k|			    node->content = xmlBufDetach(buf);
 1117|  16.8k|                            node->parent = (xmlNode *) attr;
 1118|       |
 1119|  16.8k|			    if (last == NULL) {
  ------------------
  |  Branch (1119:12): [True: 655, False: 16.2k]
  ------------------
 1120|    655|				head = node;
 1121|  16.2k|			    } else {
 1122|  16.2k|                                last->next = node;
 1123|  16.2k|                                node->prev = last;
 1124|  16.2k|			    }
 1125|  16.8k|                            last = node;
 1126|  16.8k|			}
 1127|       |
 1128|  23.5k|			if ((ent != NULL) &&
  ------------------
  |  Branch (1128:8): [True: 17.8k, False: 5.70k]
  ------------------
 1129|  17.8k|                            ((ent->flags & XML_ENT_PARSED) == 0) &&
  ------------------
  |  |   19|  17.8k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (1129:29): [True: 925, False: 16.9k]
  ------------------
 1130|    925|                            (ent->content != NULL)) {
  ------------------
  |  Branch (1130:29): [True: 849, False: 76]
  ------------------
 1131|    849|                            int res;
 1132|       |
 1133|    849|                            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|    849|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1134|    849|                            res = xmlNodeParseAttValue(doc, (xmlAttr *) ent,
 1135|    849|                                                       ent->content, SIZE_MAX,
 1136|    849|                                                       NULL);
 1137|    849|                            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|    849|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1138|    849|                            if (res < 0)
  ------------------
  |  Branch (1138:33): [True: 114, False: 735]
  ------------------
 1139|    114|                                goto out;
 1140|    735|                            ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|    735|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 1141|    735|			}
 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: 6, False: 23.4k]
  ------------------
 1149|      6|			    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: 17.7k, False: 5.69k]
  ------------------
 1153|  17.7k|                            node->children = (xmlNodePtr) ent;
 1154|  17.7k|                            node->content = ent->content;
 1155|  17.7k|                        }
 1156|       |
 1157|  23.4k|			if (last == NULL) {
  ------------------
  |  Branch (1157:8): [True: 1.74k, False: 21.6k]
  ------------------
 1158|  1.74k|			    head = node;
 1159|  21.6k|			} else {
 1160|  21.6k|                            last->next = node;
 1161|  21.6k|                            node->prev = last;
 1162|  21.6k|			}
 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|  39.4k|	    if (charval != 0) {
  ------------------
  |  Branch (1172:10): [True: 15.7k, False: 23.7k]
  ------------------
 1173|  15.7k|		xmlChar buffer[10];
 1174|  15.7k|		int l;
 1175|       |
 1176|  15.7k|                if (charval >= 0x110000)
  ------------------
  |  Branch (1176:21): [True: 0, False: 15.7k]
  ------------------
 1177|      0|                    charval = 0xFFFD; /* replacement character */
 1178|       |
 1179|  15.7k|		l = xmlCopyCharMultiByte(buffer, charval);
 1180|  15.7k|		buffer[l] = 0;
 1181|       |
 1182|  15.7k|		if (xmlBufCat(buf, buffer))
  ------------------
  |  Branch (1182:7): [True: 1, False: 15.7k]
  ------------------
 1183|      1|		    goto out;
 1184|  15.7k|	    }
 1185|  86.3M|	} else {
 1186|  86.3M|	    cur++;
 1187|  86.3M|            remaining--;
 1188|  86.3M|        }
 1189|  86.3M|    }
 1190|       |
 1191|  66.8k|    if (cur != q) {
  ------------------
  |  Branch (1191:9): [True: 64.6k, False: 2.23k]
  ------------------
 1192|       |        /*
 1193|       |	 * Handle the last piece of text.
 1194|       |	 */
 1195|  64.6k|	if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1195:6): [True: 3, False: 64.6k]
  ------------------
 1196|      3|	    goto out;
 1197|  64.6k|    }
 1198|       |
 1199|  66.8k|    if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1199:9): [True: 65.3k, False: 1.46k]
  ------------------
 1200|  65.3k|	node = xmlNewDocText(doc, NULL);
 1201|  65.3k|	if (node == NULL)
  ------------------
  |  Branch (1201:6): [True: 19, False: 65.3k]
  ------------------
 1202|     19|            goto out;
 1203|  65.3k|        node->parent = (xmlNode *) attr;
 1204|  65.3k|	node->content = xmlBufDetach(buf);
 1205|       |
 1206|  65.3k|	if (last == NULL) {
  ------------------
  |  Branch (1206:6): [True: 64.4k, False: 884]
  ------------------
 1207|  64.4k|	    head = node;
 1208|  64.4k|	} else {
 1209|    884|            last->next = node;
 1210|    884|            node->prev = last;
 1211|    884|	}
 1212|  65.3k|        last = node;
 1213|  65.3k|    } 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|  66.8k|    xmlBufFree(buf);
 1222|       |
 1223|  70.5k|done:
 1224|  70.5k|    if (attr != NULL) {
  ------------------
  |  Branch (1224:9): [True: 70.5k, False: 0]
  ------------------
 1225|  70.5k|        if (attr->children != NULL)
  ------------------
  |  Branch (1225:13): [True: 0, False: 70.5k]
  ------------------
 1226|      0|            xmlFreeNodeList(attr->children);
 1227|  70.5k|        attr->children = head;
 1228|  70.5k|        attr->last = last;
 1229|  70.5k|    }
 1230|       |
 1231|  70.5k|    if (listPtr != NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 70.5k]
  ------------------
 1232|      0|        *listPtr = head;
 1233|       |
 1234|  70.5k|    return(0);
 1235|       |
 1236|    162|out:
 1237|    162|    xmlBufFree(buf);
 1238|    162|    if (val != NULL)
  ------------------
  |  Branch (1238:9): [True: 120, False: 42]
  ------------------
 1239|    120|        xmlFree(val);
 1240|    162|    if (head != NULL)
  ------------------
  |  Branch (1240:9): [True: 52, False: 110]
  ------------------
 1241|     52|        xmlFreeNodeList(head);
 1242|    162|    return(-1);
 1243|  66.8k|}
xmlNodeListGetStringInternal:
 1297|    948|xmlNodeListGetStringInternal(const xmlNode *node, int escape, int flags) {
 1298|    948|    xmlBufPtr buf;
 1299|    948|    xmlChar *ret;
 1300|       |
 1301|    948|    if (node == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 948]
  ------------------
 1302|      0|        return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1303|       |
 1304|    948|    if ((escape == 0) &&
  ------------------
  |  Branch (1304:9): [True: 948, False: 0]
  ------------------
 1305|    948|        ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1305:10): [True: 743, False: 205]
  ------------------
 1306|    205|         (node->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (1306:10): [True: 0, False: 205]
  ------------------
 1307|    743|        (node->next == NULL)) {
  ------------------
  |  Branch (1307:9): [True: 556, False: 187]
  ------------------
 1308|    556|        if (node->content == NULL)
  ------------------
  |  Branch (1308:13): [True: 0, False: 556]
  ------------------
 1309|      0|            return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1310|    556|        return(xmlStrdup(node->content));
 1311|    556|    }
 1312|       |
 1313|    392|    buf = xmlBufCreate(50);
 1314|    392|    if (buf == NULL)
  ------------------
  |  Branch (1314:9): [True: 3, False: 389]
  ------------------
 1315|      3|        return(NULL);
 1316|       |
 1317|  1.22k|    while (node != NULL) {
  ------------------
  |  Branch (1317:12): [True: 840, False: 389]
  ------------------
 1318|    840|        if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1318:13): [True: 323, False: 517]
  ------------------
 1319|    517|            (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1319:13): [True: 0, False: 517]
  ------------------
 1320|    323|            if (node->content != NULL) {
  ------------------
  |  Branch (1320:17): [True: 323, False: 0]
  ------------------
 1321|    323|                if (escape == 0) {
  ------------------
  |  Branch (1321:21): [True: 323, False: 0]
  ------------------
 1322|    323|                    xmlBufCat(buf, node->content);
 1323|    323|                } 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|    323|            }
 1333|    517|        } else if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1333:20): [True: 517, False: 0]
  ------------------
 1334|    517|            if (escape == 0) {
  ------------------
  |  Branch (1334:17): [True: 517, False: 0]
  ------------------
 1335|    517|                xmlBufGetNodeContent(buf, node);
 1336|    517|            } 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|    517|        }
 1342|       |
 1343|    840|        node = node->next;
 1344|    840|    }
 1345|       |
 1346|    389|    ret = xmlBufDetach(buf);
 1347|    389|    xmlBufFree(buf);
 1348|    389|    return(ret);
 1349|       |
 1350|      0|error:
 1351|      0|    xmlBufFree(buf);
 1352|       |    return(NULL);
 1353|    389|}
xmlNodeListGetString:
 1374|    948|{
 1375|    948|    int flags = 0;
 1376|    948|    int escape = 0;
 1377|       |
 1378|       |    /* backward compatibility */
 1379|    948|    if (list == NULL)
  ------------------
  |  Branch (1379:9): [True: 0, False: 948]
  ------------------
 1380|      0|        return(NULL);
 1381|       |
 1382|    948|    if (!inLine) {
  ------------------
  |  Branch (1382:9): [True: 0, False: 948]
  ------------------
 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|    948|    return(xmlNodeListGetStringInternal(list, escape, flags));
 1396|    948|}
xmlNewNsProp:
 1572|  63.3k|           const xmlChar *value) {
 1573|       |
 1574|  63.3k|    if (name == NULL) {
  ------------------
  |  Branch (1574:9): [True: 0, False: 63.3k]
  ------------------
 1575|      0|	return(NULL);
 1576|      0|    }
 1577|       |
 1578|  63.3k|    return xmlNewPropInternal(node, ns, name, value, 0);
 1579|  63.3k|}
xmlNewDocProp:
 1621|  1.57M|xmlNewDocProp(xmlDoc *doc, const xmlChar *name, const xmlChar *value) {
 1622|  1.57M|    xmlAttrPtr cur;
 1623|       |
 1624|  1.57M|    if (name == NULL) {
  ------------------
  |  Branch (1624:9): [True: 1.81k, False: 1.56M]
  ------------------
 1625|  1.81k|	return(NULL);
 1626|  1.81k|    }
 1627|       |
 1628|       |    /*
 1629|       |     * Allocate a new property and fill the fields.
 1630|       |     */
 1631|  1.56M|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1632|  1.56M|    if (cur == NULL)
  ------------------
  |  Branch (1632:9): [True: 20, False: 1.56M]
  ------------------
 1633|     20|	return(NULL);
 1634|  1.56M|    memset(cur, 0, sizeof(xmlAttr));
 1635|  1.56M|    cur->type = XML_ATTRIBUTE_NODE;
 1636|       |
 1637|  1.56M|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1637:9): [True: 1.56M, False: 106]
  |  Branch (1637:26): [True: 1.25M, False: 310k]
  ------------------
 1638|  1.25M|	cur->name = xmlDictLookup(doc->dict, name, -1);
 1639|   310k|    else
 1640|   310k|	cur->name = xmlStrdup(name);
 1641|  1.56M|    if (cur->name == NULL)
  ------------------
  |  Branch (1641:9): [True: 10, False: 1.56M]
  ------------------
 1642|     10|        goto error;
 1643|  1.56M|    cur->doc = doc;
 1644|  1.56M|    if (value != NULL) {
  ------------------
  |  Branch (1644:9): [True: 0, False: 1.56M]
  ------------------
 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.56M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1653:9): [True: 0, False: 1.56M]
  |  Branch (1653:35): [True: 0, False: 0]
  ------------------
 1654|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1655|  1.56M|    return(cur);
 1656|       |
 1657|     10|error:
 1658|     10|    xmlFreeProp(cur);
 1659|       |    return(NULL);
 1660|  1.56M|}
xmlFreePropList:
 1668|   405k|xmlFreePropList(xmlAttr *cur) {
 1669|   405k|    xmlAttrPtr next;
 1670|   405k|    if (cur == NULL) return;
  ------------------
  |  Branch (1670:9): [True: 1.20k, False: 404k]
  ------------------
 1671|  1.16M|    while (cur != NULL) {
  ------------------
  |  Branch (1671:12): [True: 761k, False: 404k]
  ------------------
 1672|   761k|        next = cur->next;
 1673|   761k|        xmlFreeProp(cur);
 1674|   761k|	cur = next;
 1675|   761k|    }
 1676|   404k|}
xmlFreeProp:
 1684|   762k|xmlFreeProp(xmlAttr *cur) {
 1685|   762k|    xmlDictPtr dict = NULL;
 1686|   762k|    if (cur == NULL) return;
  ------------------
  |  Branch (1686:9): [True: 0, False: 762k]
  ------------------
 1687|       |
 1688|   762k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (1688:9): [True: 762k, False: 116]
  ------------------
 1689|       |
 1690|   762k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (1690:9): [True: 0, False: 762k]
  |  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|   762k|    if (cur->doc != NULL && cur->id != NULL) {
  ------------------
  |  Branch (1694:9): [True: 762k, False: 116]
  |  Branch (1694:29): [True: 1.88k, False: 760k]
  ------------------
 1695|  1.88k|        xmlRemoveID(cur->doc, cur);
 1696|  1.88k|    }
 1697|   762k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (1697:9): [True: 598k, False: 163k]
  ------------------
 1698|   762k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|   762k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 762k, False: 46]
  |  |  |  Branch (810:16): [True: 358k, False: 404k]
  |  |  ------------------
  |  |  811|   762k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 404k]
  |  |  ------------------
  |  |  812|   762k|	    xmlFree((char *)(str));
  ------------------
 1699|   762k|    xmlFree(cur);
 1700|   762k|}
xmlNewDocPI:
 1753|  76.3k|xmlNewDocPI(xmlDoc *doc, const xmlChar *name, const xmlChar *content) {
 1754|  76.3k|    xmlNodePtr cur;
 1755|       |
 1756|  76.3k|    if (name == NULL) {
  ------------------
  |  Branch (1756:9): [True: 0, False: 76.3k]
  ------------------
 1757|      0|	return(NULL);
 1758|      0|    }
 1759|       |
 1760|       |    /*
 1761|       |     * Allocate a new node and fill the fields.
 1762|       |     */
 1763|  76.3k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1764|  76.3k|    if (cur == NULL)
  ------------------
  |  Branch (1764:9): [True: 5, False: 76.3k]
  ------------------
 1765|      5|	return(NULL);
 1766|  76.3k|    memset(cur, 0, sizeof(xmlNode));
 1767|  76.3k|    cur->type = XML_PI_NODE;
 1768|  76.3k|    cur->doc = doc;
 1769|       |
 1770|  76.3k|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1770:9): [True: 76.3k, False: 0]
  |  Branch (1770:26): [True: 45.6k, False: 30.7k]
  ------------------
 1771|  45.6k|        cur->name = xmlDictLookup(doc->dict, name, -1);
 1772|  30.7k|    else
 1773|  30.7k|	cur->name = xmlStrdup(name);
 1774|  76.3k|    if (cur->name == NULL)
  ------------------
  |  Branch (1774:9): [True: 1, False: 76.3k]
  ------------------
 1775|      1|        goto error;
 1776|  76.3k|    if (content != NULL) {
  ------------------
  |  Branch (1776:9): [True: 17.1k, False: 59.2k]
  ------------------
 1777|  17.1k|	cur->content = xmlStrdup(content);
 1778|  17.1k|        if (cur->content == NULL)
  ------------------
  |  Branch (1778:13): [True: 3, False: 17.1k]
  ------------------
 1779|      3|            goto error;
 1780|  17.1k|    }
 1781|       |
 1782|  76.3k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1782:9): [True: 0, False: 76.3k]
  |  Branch (1782:35): [True: 0, False: 0]
  ------------------
 1783|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1784|  76.3k|    return(cur);
 1785|       |
 1786|      4|error:
 1787|      4|    xmlFreeNode(cur);
 1788|       |    return(NULL);
 1789|  76.3k|}
xmlNewDocNode:
 1900|   422k|              const xmlChar *name, const xmlChar *content) {
 1901|   422k|    xmlNodePtr cur;
 1902|   422k|    xmlChar *copy;
 1903|       |
 1904|   422k|    if (name == NULL)
  ------------------
  |  Branch (1904:9): [True: 0, False: 422k]
  ------------------
 1905|      0|        return(NULL);
 1906|       |
 1907|   422k|    if ((doc != NULL) && (doc->dict != NULL)) {
  ------------------
  |  Branch (1907:9): [True: 422k, False: 0]
  |  Branch (1907:26): [True: 97.6k, False: 325k]
  ------------------
 1908|  97.6k|        const xmlChar *dictName = xmlDictLookup(doc->dict, name, -1);
 1909|       |
 1910|  97.6k|        if (dictName == NULL)
  ------------------
  |  Branch (1910:13): [True: 1, False: 97.6k]
  ------------------
 1911|      1|            return(NULL);
 1912|  97.6k|        return(xmlNewElem(doc, ns, dictName, content));
 1913|  97.6k|    }
 1914|       |
 1915|   325k|    copy = xmlStrdup(name);
 1916|   325k|    if (copy == NULL)
  ------------------
  |  Branch (1916:9): [True: 36, False: 325k]
  ------------------
 1917|     36|        return(NULL);
 1918|       |
 1919|   325k|    cur = xmlNewElem(doc, ns, copy, content);
 1920|   325k|    if (cur == NULL) {
  ------------------
  |  Branch (1920:9): [True: 39, False: 325k]
  ------------------
 1921|     39|        xmlFree(copy);
 1922|     39|        return(NULL);
 1923|     39|    }
 1924|       |
 1925|   325k|    return(cur);
 1926|   325k|}
xmlNewDocNodeEatName:
 1944|   270k|                     xmlChar *name, const xmlChar *content) {
 1945|   270k|    xmlNodePtr cur;
 1946|       |
 1947|   270k|    if (name == NULL)
  ------------------
  |  Branch (1947:9): [True: 0, False: 270k]
  ------------------
 1948|      0|        return(NULL);
 1949|       |
 1950|   270k|    cur = xmlNewElem(doc, ns, name, content);
 1951|   270k|    if (cur == NULL) {
  ------------------
  |  Branch (1951:9): [True: 41, False: 270k]
  ------------------
 1952|       |        /* if name doesn't come from the doc dictionary free it here */
 1953|     41|        if ((doc == NULL) ||
  ------------------
  |  Branch (1953:13): [True: 0, False: 41]
  ------------------
 1954|     41|            (doc->dict == NULL) ||
  ------------------
  |  Branch (1954:13): [True: 1, False: 40]
  ------------------
 1955|     40|            (!xmlDictOwns(doc->dict, name)))
  ------------------
  |  Branch (1955:13): [True: 0, False: 40]
  ------------------
 1956|      1|            xmlFree(name);
 1957|     41|        return(NULL);
 1958|     41|    }
 1959|       |
 1960|   270k|    return(cur);
 1961|   270k|}
xmlNewText:
 2037|   118k|xmlNewText(const xmlChar *content) {
 2038|   118k|    xmlNodePtr cur;
 2039|       |
 2040|       |    /*
 2041|       |     * Allocate a new node and fill the fields.
 2042|       |     */
 2043|   118k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2044|   118k|    if (cur == NULL)
  ------------------
  |  Branch (2044:9): [True: 42, False: 118k]
  ------------------
 2045|     42|	return(NULL);
 2046|   118k|    memset(cur, 0, sizeof(xmlNode));
 2047|   118k|    cur->type = XML_TEXT_NODE;
 2048|       |
 2049|   118k|    cur->name = xmlStringText;
 2050|   118k|    if (content != NULL) {
  ------------------
  |  Branch (2050:9): [True: 35.9k, False: 82.4k]
  ------------------
 2051|  35.9k|	cur->content = xmlStrdup(content);
 2052|  35.9k|        if (cur->content == NULL)
  ------------------
  |  Branch (2052:13): [True: 19, False: 35.9k]
  ------------------
 2053|     19|            goto error;
 2054|  35.9k|    }
 2055|       |
 2056|   118k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2056:9): [True: 0, False: 118k]
  |  Branch (2056:35): [True: 0, False: 0]
  ------------------
 2057|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2058|   118k|    return(cur);
 2059|       |
 2060|     19|error:
 2061|     19|    xmlFreeNode(cur);
 2062|       |    return(NULL);
 2063|   118k|}
xmlNewReference:
 2209|  28.9k|xmlNewReference(const xmlDoc *doc, const xmlChar *name) {
 2210|  28.9k|    xmlNodePtr cur;
 2211|  28.9k|    xmlEntityPtr ent;
 2212|       |
 2213|  28.9k|    if (name == NULL)
  ------------------
  |  Branch (2213:9): [True: 0, False: 28.9k]
  ------------------
 2214|      0|        return(NULL);
 2215|       |
 2216|       |    /*
 2217|       |     * Allocate a new node and fill the fields.
 2218|       |     */
 2219|  28.9k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2220|  28.9k|    if (cur == NULL)
  ------------------
  |  Branch (2220:9): [True: 4, False: 28.9k]
  ------------------
 2221|      4|	return(NULL);
 2222|  28.9k|    memset(cur, 0, sizeof(xmlNode));
 2223|  28.9k|    cur->type = XML_ENTITY_REF_NODE;
 2224|       |
 2225|  28.9k|    cur->doc = (xmlDoc *)doc;
 2226|  28.9k|    if (name[0] == '&') {
  ------------------
  |  Branch (2226:9): [True: 0, False: 28.9k]
  ------------------
 2227|      0|        int len;
 2228|      0|        name++;
 2229|      0|	len = xmlStrlen(name);
 2230|      0|	if (name[len - 1] == ';')
  ------------------
  |  Branch (2230:6): [True: 0, False: 0]
  ------------------
 2231|      0|	    cur->name = xmlStrndup(name, len - 1);
 2232|      0|	else
 2233|      0|	    cur->name = xmlStrndup(name, len);
 2234|      0|    } else
 2235|  28.9k|	cur->name = xmlStrdup(name);
 2236|  28.9k|    if (cur->name == NULL)
  ------------------
  |  Branch (2236:9): [True: 3, False: 28.9k]
  ------------------
 2237|      3|        goto error;
 2238|       |
 2239|  28.9k|    ent = xmlGetDocEntity(doc, cur->name);
 2240|  28.9k|    if (ent != NULL) {
  ------------------
  |  Branch (2240:9): [True: 5.95k, False: 22.9k]
  ------------------
 2241|  5.95k|	cur->content = ent->content;
 2242|       |	/*
 2243|       |	 * The parent pointer in entity is a DTD pointer and thus is NOT
 2244|       |	 * updated.  Not sure if this is 100% correct.
 2245|       |	 *  -George
 2246|       |	 */
 2247|  5.95k|	cur->children = (xmlNodePtr) ent;
 2248|  5.95k|	cur->last = (xmlNodePtr) ent;
 2249|  5.95k|    }
 2250|       |
 2251|  28.9k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2251:9): [True: 0, False: 28.9k]
  |  Branch (2251:35): [True: 0, False: 0]
  ------------------
 2252|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2253|  28.9k|    return(cur);
 2254|       |
 2255|      3|error:
 2256|      3|    xmlFreeNode(cur);
 2257|       |    return(NULL);
 2258|  28.9k|}
xmlNewDocText:
 2269|   118k|xmlNewDocText(const xmlDoc *doc, const xmlChar *content) {
 2270|   118k|    xmlNodePtr cur;
 2271|       |
 2272|   118k|    cur = xmlNewText(content);
 2273|   118k|    if (cur != NULL) cur->doc = (xmlDoc *)doc;
  ------------------
  |  Branch (2273:9): [True: 118k, False: 61]
  ------------------
 2274|   118k|    return(cur);
 2275|   118k|}
xmlNewComment:
 2342|   457k|xmlNewComment(const xmlChar *content) {
 2343|   457k|    xmlNodePtr cur;
 2344|       |
 2345|       |    /*
 2346|       |     * Allocate a new node and fill the fields.
 2347|       |     */
 2348|   457k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2349|   457k|    if (cur == NULL)
  ------------------
  |  Branch (2349:9): [True: 5, False: 457k]
  ------------------
 2350|      5|	return(NULL);
 2351|   457k|    memset(cur, 0, sizeof(xmlNode));
 2352|   457k|    cur->type = XML_COMMENT_NODE;
 2353|       |
 2354|   457k|    cur->name = xmlStringComment;
 2355|   457k|    if (content != NULL) {
  ------------------
  |  Branch (2355:9): [True: 457k, False: 0]
  ------------------
 2356|   457k|	cur->content = xmlStrdup(content);
 2357|   457k|        if (cur->content == NULL)
  ------------------
  |  Branch (2357:13): [True: 4, False: 457k]
  ------------------
 2358|      4|            goto error;
 2359|   457k|    }
 2360|       |
 2361|   457k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2361:9): [True: 0, False: 457k]
  |  Branch (2361:35): [True: 0, False: 0]
  ------------------
 2362|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2363|   457k|    return(cur);
 2364|       |
 2365|      4|error:
 2366|      4|    xmlFreeNode(cur);
 2367|       |    return(NULL);
 2368|   457k|}
xmlNewCDataBlock:
 2380|  19.8k|xmlNewCDataBlock(xmlDoc *doc, const xmlChar *content, int len) {
 2381|  19.8k|    xmlNodePtr cur;
 2382|       |
 2383|       |    /*
 2384|       |     * Allocate a new node and fill the fields.
 2385|       |     */
 2386|  19.8k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2387|  19.8k|    if (cur == NULL)
  ------------------
  |  Branch (2387:9): [True: 1, False: 19.8k]
  ------------------
 2388|      1|	return(NULL);
 2389|  19.8k|    memset(cur, 0, sizeof(xmlNode));
 2390|  19.8k|    cur->type = XML_CDATA_SECTION_NODE;
 2391|  19.8k|    cur->doc = doc;
 2392|       |
 2393|  19.8k|    if (content != NULL) {
  ------------------
  |  Branch (2393:9): [True: 19.8k, False: 0]
  ------------------
 2394|  19.8k|	cur->content = xmlStrndup(content, len);
 2395|  19.8k|        if (cur->content == NULL) {
  ------------------
  |  Branch (2395:13): [True: 4, False: 19.8k]
  ------------------
 2396|      4|            xmlFree(cur);
 2397|      4|            return(NULL);
 2398|      4|        }
 2399|  19.8k|    }
 2400|       |
 2401|  19.8k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2401:9): [True: 0, False: 19.8k]
  |  Branch (2401:35): [True: 0, False: 0]
  ------------------
 2402|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2403|  19.8k|    return(cur);
 2404|  19.8k|}
xmlNewDocComment:
 2415|   457k|xmlNewDocComment(xmlDoc *doc, const xmlChar *content) {
 2416|   457k|    xmlNodePtr cur;
 2417|       |
 2418|   457k|    cur = xmlNewComment(content);
 2419|   457k|    if (cur != NULL) cur->doc = doc;
  ------------------
  |  Branch (2419:9): [True: 457k, False: 9]
  ------------------
 2420|   457k|    return(cur);
 2421|   457k|}
xmlAddNextSibling:
 2893|  11.3k|xmlAddNextSibling(xmlNode *prev, xmlNode *cur) {
 2894|  11.3k|    if ((prev == NULL) || (prev->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2894:9): [True: 0, False: 11.3k]
  |  Branch (2894:27): [True: 0, False: 11.3k]
  ------------------
 2895|  11.3k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2895:9): [True: 0, False: 11.3k]
  |  Branch (2895:26): [True: 0, False: 11.3k]
  ------------------
 2896|  11.3k|        (cur == prev))
  ------------------
  |  Branch (2896:9): [True: 0, False: 11.3k]
  ------------------
 2897|      0|	return(NULL);
 2898|       |
 2899|  11.3k|    if (cur == prev->next)
  ------------------
  |  Branch (2899:9): [True: 0, False: 11.3k]
  ------------------
 2900|      0|        return(cur);
 2901|       |
 2902|  11.3k|    return(xmlInsertNode(prev->doc, cur, prev->parent, prev, prev->next, 0));
 2903|  11.3k|}
xmlAddPrevSibling:
 2922|   109k|xmlAddPrevSibling(xmlNode *next, xmlNode *cur) {
 2923|   109k|    if ((next == NULL) || (next->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2923:9): [True: 0, False: 109k]
  |  Branch (2923:27): [True: 0, False: 109k]
  ------------------
 2924|   109k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2924:9): [True: 0, False: 109k]
  |  Branch (2924:26): [True: 0, False: 109k]
  ------------------
 2925|   109k|        (cur == next))
  ------------------
  |  Branch (2925:9): [True: 0, False: 109k]
  ------------------
 2926|      0|	return(NULL);
 2927|       |
 2928|   109k|    if (cur == next->prev)
  ------------------
  |  Branch (2928:9): [True: 0, False: 109k]
  ------------------
 2929|      0|        return(cur);
 2930|       |
 2931|   109k|    return(xmlInsertNode(next->doc, cur, next->parent, next->prev, next, 0));
 2932|   109k|}
xmlGetLastChild:
 3141|  12.6k|xmlGetLastChild(const xmlNode *parent) {
 3142|  12.6k|    if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (3142:9): [True: 0, False: 12.6k]
  |  Branch (3142:29): [True: 0, False: 12.6k]
  ------------------
 3143|      0|	return(NULL);
 3144|      0|    }
 3145|  12.6k|    return(parent->last);
 3146|  12.6k|}
xmlFreeNodeList:
 3328|   630k|xmlFreeNodeList(xmlNode *cur) {
 3329|   630k|    xmlNodePtr next;
 3330|   630k|    xmlNodePtr parent;
 3331|   630k|    xmlDictPtr dict = NULL;
 3332|   630k|    size_t depth = 0;
 3333|       |
 3334|   630k|    if (cur == NULL) return;
  ------------------
  |  Branch (3334:9): [True: 7.58k, False: 622k]
  ------------------
 3335|   622k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3335:9): [True: 0, False: 622k]
  ------------------
 3336|      0|	xmlFreeNsList((xmlNsPtr) cur);
 3337|      0|	return;
 3338|      0|    }
 3339|   622k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3339:9): [True: 621k, False: 725]
  ------------------
 3340|  5.26M|    while (1) {
  ------------------
  |  Branch (3340:12): [True: 5.26M, Folded]
  ------------------
 3341|  6.90M|        while ((cur->children != NULL) &&
  ------------------
  |  Branch (3341:16): [True: 1.64M, False: 5.25M]
  ------------------
 3342|  1.64M|               (cur->type != XML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3342:16): [True: 1.64M, False: 0]
  ------------------
 3343|  1.64M|               (cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3343:16): [True: 1.64M, False: 0]
  ------------------
 3344|  1.64M|               (cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (3344:16): [True: 1.64M, False: 0]
  ------------------
 3345|  1.64M|               (cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (3345:16): [True: 1.64M, False: 6.16k]
  ------------------
 3346|  1.64M|            cur = cur->children;
 3347|  1.64M|            depth += 1;
 3348|  1.64M|        }
 3349|       |
 3350|  5.26M|        next = cur->next;
 3351|  5.26M|        parent = cur->parent;
 3352|  5.26M|	if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (3352:6): [True: 0, False: 5.26M]
  ------------------
 3353|  5.26M|            (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (3353:13): [True: 0, False: 5.26M]
  ------------------
 3354|      0|            xmlFreeDoc((xmlDocPtr) cur);
 3355|  5.26M|        } else if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3355:20): [True: 0, False: 5.26M]
  ------------------
 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|  5.26M|        } else {
 3363|  5.26M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3363:10): [True: 0, False: 5.26M]
  |  Branch (3363:36): [True: 0, False: 0]
  ------------------
 3364|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3365|       |
 3366|  5.26M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3366:11): [True: 2.32M, False: 2.93M]
  ------------------
 3367|  2.93M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3367:4): [True: 3.86k, False: 2.93M]
  ------------------
 3368|  2.93M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3368:4): [True: 708k, False: 2.22M]
  ------------------
 3369|  3.03M|		(cur->properties != NULL))
  ------------------
  |  Branch (3369:3): [True: 398k, False: 2.63M]
  ------------------
 3370|   398k|		xmlFreePropList(cur->properties);
 3371|  5.26M|	    if ((cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3371:10): [True: 2.93M, False: 2.32M]
  ------------------
 3372|  2.93M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (3372:3): [True: 2.93M, False: 3.86k]
  ------------------
 3373|  2.93M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3373:3): [True: 2.22M, False: 708k]
  ------------------
 3374|  2.22M|		(cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3374:3): [True: 2.13M, False: 92.3k]
  ------------------
 3375|  2.13M|		(cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3375:3): [True: 1.96M, False: 163k]
  ------------------
 3376|  1.96M|		DICT_FREE(cur->content)
  ------------------
  |  |  810|  1.96M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 1.88M, False: 83.4k]
  |  |  |  Branch (810:16): [True: 761k, False: 1.12M]
  |  |  ------------------
  |  |  811|  1.88M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 1.12M, False: 304]
  |  |  ------------------
  |  |  812|  1.96M|	    xmlFree((char *)(str));
  ------------------
 3377|  1.96M|	    }
 3378|  5.26M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3378:11): [True: 2.32M, False: 2.93M]
  ------------------
 3379|  2.93M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3379:11): [True: 3.86k, False: 2.93M]
  ------------------
 3380|  2.93M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3380:4): [True: 708k, False: 2.22M]
  ------------------
 3381|  3.03M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (3381:3): [True: 1.07M, False: 1.96M]
  ------------------
 3382|  1.07M|		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|  5.26M|	    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3390:10): [True: 5.21M, False: 51.6k]
  ------------------
 3391|  5.21M|		(cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3391:3): [True: 3.30M, False: 1.90M]
  ------------------
 3392|  3.30M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3392:3): [True: 3.21M, False: 93.8k]
  ------------------
 3393|  3.21M|		DICT_FREE(cur->name)
  ------------------
  |  |  810|  3.21M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 3.21M, False: 0]
  |  |  |  Branch (810:16): [True: 957k, False: 2.25M]
  |  |  ------------------
  |  |  811|  3.21M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 16.4k, False: 2.24M]
  |  |  ------------------
  |  |  812|  3.21M|	    xmlFree((char *)(str));
  ------------------
 3394|  5.26M|	    xmlFree(cur);
 3395|  5.26M|	}
 3396|       |
 3397|  5.26M|        if (next != NULL) {
  ------------------
  |  Branch (3397:13): [True: 2.99M, False: 2.26M]
  ------------------
 3398|  2.99M|	    cur = next;
 3399|  2.99M|        } else {
 3400|  2.26M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (3400:17): [True: 622k, False: 1.64M]
  |  Branch (3400:33): [True: 0, False: 1.64M]
  ------------------
 3401|   622k|                break;
 3402|  1.64M|            depth -= 1;
 3403|  1.64M|            cur = parent;
 3404|       |            cur->children = NULL;
 3405|  1.64M|        }
 3406|  5.26M|    }
 3407|   622k|}
xmlFreeNode:
 3418|   363k|xmlFreeNode(xmlNode *cur) {
 3419|   363k|    xmlDictPtr dict = NULL;
 3420|       |
 3421|   363k|    if (cur == NULL) return;
  ------------------
  |  Branch (3421:9): [True: 95, False: 363k]
  ------------------
 3422|       |
 3423|       |    /* use xmlFreeDtd for DTD nodes */
 3424|   363k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3424:9): [True: 4.30k, False: 359k]
  ------------------
 3425|  4.30k|	xmlFreeDtd((xmlDtdPtr) cur);
 3426|  4.30k|	return;
 3427|  4.30k|    }
 3428|   359k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3428:9): [True: 0, False: 359k]
  ------------------
 3429|      0|	xmlFreeNs((xmlNsPtr) cur);
 3430|      0|        return;
 3431|      0|    }
 3432|   359k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3432:9): [True: 0, False: 359k]
  ------------------
 3433|      0|	xmlFreeProp((xmlAttrPtr) cur);
 3434|      0|	return;
 3435|      0|    }
 3436|   359k|    if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (3436:9): [True: 0, False: 359k]
  ------------------
 3437|      0|        xmlFreeEntity((xmlEntityPtr) cur);
 3438|      0|        return;
 3439|      0|    }
 3440|       |
 3441|   359k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3441:9): [True: 0, False: 359k]
  |  Branch (3441:35): [True: 0, False: 0]
  ------------------
 3442|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3443|       |
 3444|   359k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3444:9): [True: 359k, False: 46]
  ------------------
 3445|       |
 3446|   359k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (3446:9): [True: 8.38k, False: 351k]
  ------------------
 3447|  8.38k|	(cur->type != XML_ENTITY_REF_NODE))
  ------------------
  |  Branch (3447:2): [True: 7.85k, False: 536]
  ------------------
 3448|  7.85k|	xmlFreeNodeList(cur->children);
 3449|       |
 3450|   359k|    if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3450:9): [True: 28.8k, False: 330k]
  ------------------
 3451|   330k|        (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3451:9): [True: 768, False: 329k]
  ------------------
 3452|   329k|        (cur->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (3452:9): [True: 361, False: 329k]
  ------------------
 3453|  30.0k|        if (cur->properties != NULL)
  ------------------
  |  Branch (3453:13): [True: 4.92k, False: 25.0k]
  ------------------
 3454|  4.92k|            xmlFreePropList(cur->properties);
 3455|  30.0k|        if (cur->nsDef != NULL)
  ------------------
  |  Branch (3455:13): [True: 5.56k, False: 24.4k]
  ------------------
 3456|  5.56k|            xmlFreeNsList(cur->nsDef);
 3457|   329k|    } else if ((cur->content != NULL) &&
  ------------------
  |  Branch (3457:16): [True: 324k, False: 4.71k]
  ------------------
 3458|   324k|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3458:16): [True: 324k, False: 267]
  ------------------
 3459|   324k|               (cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3459:16): [True: 323k, False: 1.43k]
  ------------------
 3460|   323k|        DICT_FREE(cur->content)
  ------------------
  |  |  810|   323k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 323k, False: 0]
  |  |  |  Branch (810:16): [True: 51.8k, False: 271k]
  |  |  ------------------
  |  |  811|   323k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 270k, False: 196]
  |  |  ------------------
  |  |  812|   323k|	    xmlFree((char *)(str));
  ------------------
 3461|   323k|    }
 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|   359k|    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3468:9): [True: 358k, False: 816]
  ------------------
 3469|   358k|        (cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3469:9): [True: 345k, False: 12.9k]
  ------------------
 3470|   345k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3470:9): [True: 44.7k, False: 300k]
  ------------------
 3471|  44.7k|	DICT_FREE(cur->name)
  ------------------
  |  |  810|  44.7k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 44.7k, False: 0]
  |  |  |  Branch (810:16): [True: 16.1k, False: 28.5k]
  |  |  ------------------
  |  |  811|  44.7k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 241, False: 28.3k]
  |  |  ------------------
  |  |  812|  44.7k|	    xmlFree((char *)(str));
  ------------------
 3472|       |
 3473|   359k|    xmlFree(cur);
 3474|   359k|}
xmlUnlinkNode:
 3518|   251k|xmlUnlinkNode(xmlNode *cur) {
 3519|   251k|    if (cur == NULL)
  ------------------
  |  Branch (3519:9): [True: 0, False: 251k]
  ------------------
 3520|      0|	return;
 3521|       |
 3522|   251k|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3522:9): [True: 0, False: 251k]
  ------------------
 3523|      0|        return;
 3524|       |
 3525|   251k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3525:9): [True: 15.3k, False: 236k]
  ------------------
 3526|  15.3k|	xmlDocPtr doc = cur->doc;
 3527|       |
 3528|  15.3k|	if (doc != NULL) {
  ------------------
  |  Branch (3528:6): [True: 15.3k, False: 0]
  ------------------
 3529|  15.3k|	    if (doc->intSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3529:10): [True: 14.1k, False: 1.20k]
  ------------------
 3530|  14.1k|		doc->intSubset = NULL;
 3531|  15.3k|	    if (doc->extSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3531:10): [True: 1.20k, False: 14.1k]
  ------------------
 3532|  1.20k|		doc->extSubset = NULL;
 3533|  15.3k|	}
 3534|  15.3k|    }
 3535|       |
 3536|   251k|    if (cur->type == XML_ENTITY_DECL)
  ------------------
  |  Branch (3536:9): [True: 0, False: 251k]
  ------------------
 3537|      0|        xmlRemoveEntity((xmlEntityPtr) cur);
 3538|       |
 3539|   251k|    xmlUnlinkNodeInternal(cur);
 3540|   251k|}
xmlCopyNamespace:
 3616|  3.89M|xmlCopyNamespace(xmlNs *cur) {
 3617|  3.89M|    xmlNsPtr ret;
 3618|       |
 3619|  3.89M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3619:9): [True: 0, False: 3.89M]
  ------------------
 3620|  3.89M|    switch (cur->type) {
 3621|  3.89M|	case XML_LOCAL_NAMESPACE:
  ------------------
  |  |  500|  3.89M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (3621:2): [True: 3.89M, False: 0]
  ------------------
 3622|  3.89M|	    ret = xmlNewNs(NULL, cur->href, cur->prefix);
 3623|  3.89M|	    break;
 3624|      0|	default:
  ------------------
  |  Branch (3624:2): [True: 0, False: 3.89M]
  ------------------
 3625|      0|	    return(NULL);
 3626|  3.89M|    }
 3627|  3.89M|    return(ret);
 3628|  3.89M|}
xmlCopyNamespaceList:
 3638|  3.88M|xmlCopyNamespaceList(xmlNs *cur) {
 3639|  3.88M|    xmlNsPtr ret = NULL;
 3640|  3.88M|    xmlNsPtr p = NULL,q;
 3641|       |
 3642|  7.78M|    while (cur != NULL) {
  ------------------
  |  Branch (3642:12): [True: 3.89M, False: 3.88M]
  ------------------
 3643|  3.89M|        q = xmlCopyNamespace(cur);
 3644|  3.89M|        if (q == NULL) {
  ------------------
  |  Branch (3644:13): [True: 48, False: 3.89M]
  ------------------
 3645|     48|            xmlFreeNsList(ret);
 3646|     48|            return(NULL);
 3647|     48|        }
 3648|  3.89M|	if (p == NULL) {
  ------------------
  |  Branch (3648:6): [True: 3.88M, False: 13.0k]
  ------------------
 3649|  3.88M|	    ret = p = q;
 3650|  3.88M|	} else {
 3651|  13.0k|	    p->next = q;
 3652|  13.0k|	    p = q;
 3653|  13.0k|	}
 3654|  3.89M|	cur = cur->next;
 3655|  3.89M|    }
 3656|  3.88M|    return(ret);
 3657|  3.88M|}
xmlCopyProp:
 3792|  1.57M|xmlCopyProp(xmlNode *target, xmlAttr *cur) {
 3793|       |	return xmlCopyPropInternal(NULL, target, cur);
 3794|  1.57M|}
xmlCopyPropList:
 3807|   888k|xmlCopyPropList(xmlNode *target, xmlAttr *cur) {
 3808|   888k|    xmlAttrPtr ret = NULL;
 3809|   888k|    xmlAttrPtr p = NULL,q;
 3810|       |
 3811|   888k|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3811:9): [True: 888k, False: 0]
  |  Branch (3811:29): [True: 0, False: 888k]
  ------------------
 3812|      0|        return(NULL);
 3813|  2.45M|    while (cur != NULL) {
  ------------------
  |  Branch (3813:12): [True: 1.57M, False: 886k]
  ------------------
 3814|  1.57M|        q = xmlCopyProp(target, cur);
 3815|  1.57M|	if (q == NULL) {
  ------------------
  |  Branch (3815:6): [True: 1.88k, False: 1.56M]
  ------------------
 3816|  1.88k|            xmlFreePropList(ret);
 3817|  1.88k|	    return(NULL);
 3818|  1.88k|        }
 3819|  1.56M|	if (p == NULL) {
  ------------------
  |  Branch (3819:6): [True: 887k, False: 681k]
  ------------------
 3820|   887k|	    ret = p = q;
 3821|   887k|	} else {
 3822|   681k|	    p->next = q;
 3823|   681k|	    q->prev = p;
 3824|   681k|	    p = q;
 3825|   681k|	}
 3826|  1.56M|	cur = cur->next;
 3827|  1.56M|    }
 3828|   886k|    return(ret);
 3829|   888k|}
xmlStaticCopyNode:
 3861|  15.8M|                  int extended) {
 3862|  15.8M|    xmlNodePtr ret;
 3863|       |
 3864|  15.8M|    if (node == NULL) return(NULL);
  ------------------
  |  Branch (3864:9): [True: 0, False: 15.8M]
  ------------------
 3865|  15.8M|    switch (node->type) {
 3866|  4.77M|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3866:9): [True: 4.77M, False: 11.0M]
  ------------------
 3867|  4.81M|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3867:9): [True: 39.6k, False: 15.7M]
  ------------------
 3868|  12.4M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3868:9): [True: 7.67M, False: 8.15M]
  ------------------
 3869|  12.4M|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3869:9): [True: 0, False: 15.8M]
  ------------------
 3870|  12.5M|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3870:9): [True: 60.5k, False: 15.7M]
  ------------------
 3871|  12.6M|        case XML_PI_NODE:
  ------------------
  |  Branch (3871:9): [True: 59.5k, False: 15.7M]
  ------------------
 3872|  12.6M|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3872:9): [True: 12.9k, False: 15.8M]
  ------------------
 3873|  12.6M|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3873:9): [True: 3.20k, False: 15.8M]
  ------------------
 3874|  15.8M|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3874:9): [True: 3.19M, False: 12.6M]
  ------------------
 3875|  15.8M|	    break;
 3876|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3876:9): [True: 0, False: 15.8M]
  ------------------
 3877|      0|		return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
 3878|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3878:9): [True: 0, False: 15.8M]
  ------------------
 3879|      0|	    return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
 3880|  4.47k|        case XML_DTD_NODE:
  ------------------
  |  Branch (3880:9): [True: 4.47k, False: 15.8M]
  ------------------
 3881|  4.47k|            return((xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node));
 3882|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3882:9): [True: 0, False: 15.8M]
  ------------------
 3883|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3883:9): [True: 0, False: 15.8M]
  ------------------
 3884|      0|	    return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, extended));
 3885|      0|        default:
  ------------------
  |  Branch (3885:9): [True: 0, False: 15.8M]
  ------------------
 3886|      0|            return(NULL);
 3887|  15.8M|    }
 3888|       |
 3889|       |    /*
 3890|       |     * Allocate a new node and fill the fields.
 3891|       |     */
 3892|  15.8M|    ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 3893|  15.8M|    if (ret == NULL)
  ------------------
  |  Branch (3893:9): [True: 146, False: 15.8M]
  ------------------
 3894|    146|	return(NULL);
 3895|  15.8M|    memset(ret, 0, sizeof(xmlNode));
 3896|  15.8M|    ret->type = node->type;
 3897|       |
 3898|  15.8M|    ret->doc = doc;
 3899|  15.8M|    ret->parent = parent;
 3900|  15.8M|    if (node->name == xmlStringText)
  ------------------
  |  Branch (3900:9): [True: 4.77M, False: 11.0M]
  ------------------
 3901|  4.77M|	ret->name = xmlStringText;
 3902|  11.0M|    else if (node->name == xmlStringTextNoenc)
  ------------------
  |  Branch (3902:14): [True: 0, False: 11.0M]
  ------------------
 3903|      0|	ret->name = xmlStringTextNoenc;
 3904|  11.0M|    else if (node->name == xmlStringComment)
  ------------------
  |  Branch (3904:14): [True: 12.9k, False: 11.0M]
  ------------------
 3905|  12.9k|	ret->name = xmlStringComment;
 3906|  11.0M|    else if (node->name != NULL) {
  ------------------
  |  Branch (3906:14): [True: 10.9M, False: 39.6k]
  ------------------
 3907|  10.9M|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (3907:13): [True: 10.9M, False: 2.15k]
  |  Branch (3907:30): [True: 10.2M, False: 752k]
  ------------------
 3908|  10.2M|	    ret->name = xmlDictLookup(doc->dict, node->name, -1);
 3909|   754k|	else
 3910|   754k|	    ret->name = xmlStrdup(node->name);
 3911|  10.9M|        if (ret->name == NULL)
  ------------------
  |  Branch (3911:13): [True: 32, False: 10.9M]
  ------------------
 3912|     32|            goto error;
 3913|  10.9M|    }
 3914|  15.8M|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3914:9): [True: 8.15M, False: 7.67M]
  ------------------
 3915|  8.15M|	(node->content != NULL) &&
  ------------------
  |  Branch (3915:2): [True: 4.83M, False: 3.31M]
  ------------------
 3916|  4.83M|	(node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3916:2): [True: 4.83M, False: 1.23k]
  ------------------
 3917|  4.83M|	(node->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3917:2): [True: 4.83M, False: 0]
  ------------------
 3918|  4.83M|	(node->type != XML_XINCLUDE_START)) {
  ------------------
  |  Branch (3918:2): [True: 4.83M, False: 0]
  ------------------
 3919|  4.83M|	ret->content = xmlStrdup(node->content);
 3920|  4.83M|        if (ret->content == NULL)
  ------------------
  |  Branch (3920:13): [True: 67, False: 4.83M]
  ------------------
 3921|     67|            goto error;
 3922|  10.9M|    }else{
 3923|  10.9M|      if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3923:11): [True: 7.67M, False: 3.31M]
  ------------------
 3924|  7.67M|        ret->line = node->line;
 3925|  10.9M|    }
 3926|       |
 3927|  15.8M|    if (!extended)
  ------------------
  |  Branch (3927:9): [True: 17, False: 15.8M]
  ------------------
 3928|     17|	goto out;
 3929|  15.8M|    if (((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3929:10): [True: 7.67M, False: 8.15M]
  ------------------
 3930|  8.15M|         (node->type == XML_XINCLUDE_START)) && (node->nsDef != NULL)) {
  ------------------
  |  Branch (3930:10): [True: 3.20k, False: 8.14M]
  |  Branch (3930:49): [True: 3.88M, False: 3.79M]
  ------------------
 3931|  3.88M|        ret->nsDef = xmlCopyNamespaceList(node->nsDef);
 3932|  3.88M|        if (ret->nsDef == NULL)
  ------------------
  |  Branch (3932:13): [True: 48, False: 3.88M]
  ------------------
 3933|     48|            goto error;
 3934|  3.88M|    }
 3935|       |
 3936|  15.8M|    if ((node->type == XML_ELEMENT_NODE) && (node->ns != NULL)) {
  ------------------
  |  Branch (3936:9): [True: 7.67M, False: 8.15M]
  |  Branch (3936:45): [True: 809k, False: 6.86M]
  ------------------
 3937|   809k|        xmlNsPtr ns = NULL;
 3938|   809k|        int res;
 3939|       |
 3940|   809k|	res = xmlSearchNsSafe(ret, node->ns->prefix, &ns);
 3941|   809k|        if (res < 0)
  ------------------
  |  Branch (3941:13): [True: 1, False: 809k]
  ------------------
 3942|      1|            goto error;
 3943|   809k|	if (ns == NULL) {
  ------------------
  |  Branch (3943:6): [True: 997, False: 808k]
  ------------------
 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|    997|	    res = xmlSearchNsSafe(node, node->ns->prefix, &ns);
 3953|    997|            if (res < 0)
  ------------------
  |  Branch (3953:17): [True: 0, False: 997]
  ------------------
 3954|      0|                goto error;
 3955|    997|	    if (ns != NULL) {
  ------------------
  |  Branch (3955:10): [True: 997, False: 0]
  ------------------
 3956|    997|	        xmlNodePtr root = ret;
 3957|       |
 3958|  1.49k|		while (root->parent != NULL) root = root->parent;
  ------------------
  |  Branch (3958:10): [True: 497, False: 997]
  ------------------
 3959|    997|		ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3960|    997|            } else {
 3961|      0|                ret->ns = xmlNewReconciledNs(ret, node->ns);
 3962|      0|	    }
 3963|    997|            if (ret->ns == NULL)
  ------------------
  |  Branch (3963:17): [True: 1, False: 996]
  ------------------
 3964|      1|                goto error;
 3965|   808k|	} else {
 3966|       |	    /*
 3967|       |	     * reference the existing namespace definition in our own tree.
 3968|       |	     */
 3969|   808k|	    ret->ns = ns;
 3970|   808k|	}
 3971|   809k|    }
 3972|  15.8M|    if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL)) {
  ------------------
  |  Branch (3972:9): [True: 7.67M, False: 8.15M]
  |  Branch (3972:45): [True: 888k, False: 6.78M]
  ------------------
 3973|   888k|        ret->properties = xmlCopyPropList(ret, node->properties);
 3974|   888k|        if (ret->properties == NULL)
  ------------------
  |  Branch (3974:13): [True: 1.88k, False: 886k]
  ------------------
 3975|  1.88k|            goto error;
 3976|   888k|    }
 3977|  15.8M|    if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (3977:9): [True: 60.5k, False: 15.7M]
  ------------------
 3978|  60.5k|	if ((doc == NULL) || (node->doc != doc)) {
  ------------------
  |  Branch (3978:6): [True: 370, False: 60.1k]
  |  Branch (3978:23): [True: 267, False: 59.8k]
  ------------------
 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|    637|	    ret->children = (xmlNodePtr) xmlGetDocEntity(doc, ret->name);
 3986|  59.8k|	} else {
 3987|  59.8k|            ret->children = node->children;
 3988|  59.8k|	}
 3989|  60.5k|	ret->last = ret->children;
 3990|  15.7M|    } else if ((node->children != NULL) && (extended != 2)) {
  ------------------
  |  Branch (3990:16): [True: 6.29M, False: 9.46M]
  |  Branch (3990:44): [True: 14.4k, False: 6.28M]
  ------------------
 3991|  14.4k|        xmlNodePtr cur, insert;
 3992|       |
 3993|  14.4k|        cur = node->children;
 3994|  14.4k|        insert = ret;
 3995|  13.5M|        while (cur != NULL) {
  ------------------
  |  Branch (3995:16): [True: 13.5M, False: 12.9k]
  ------------------
 3996|  13.5M|            xmlNodePtr copy = xmlStaticCopyNode(cur, doc, insert, 2);
 3997|  13.5M|            if (copy == NULL)
  ------------------
  |  Branch (3997:17): [True: 1.49k, False: 13.5M]
  ------------------
 3998|  1.49k|                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: 5.86M, False: 7.66M]
  ------------------
 4003|  5.86M|                    insert->children = copy;
 4004|  7.66M|                } else {
 4005|  7.66M|                    copy->prev = insert->last;
 4006|  7.66M|                    insert->last->next = copy;
 4007|  7.66M|                }
 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.4M, False: 58.5k]
  ------------------
 4012|  13.4M|                (cur->children != NULL)) {
  ------------------
  |  Branch (4012:17): [True: 5.85M, False: 7.61M]
  ------------------
 4013|  5.85M|                cur = cur->children;
 4014|  5.85M|                insert = copy;
 4015|  5.85M|                continue;
 4016|  5.85M|            }
 4017|       |
 4018|  13.4M|            while (1) {
  ------------------
  |  Branch (4018:20): [True: 13.4M, Folded]
  ------------------
 4019|  13.4M|                if (cur->next != NULL) {
  ------------------
  |  Branch (4019:21): [True: 7.66M, False: 5.81M]
  ------------------
 4020|  7.66M|                    cur = cur->next;
 4021|  7.66M|                    break;
 4022|  7.66M|                }
 4023|       |
 4024|  5.81M|                cur = cur->parent;
 4025|  5.81M|                insert = insert->parent;
 4026|  5.81M|                if (cur == node) {
  ------------------
  |  Branch (4026:21): [True: 12.9k, False: 5.80M]
  ------------------
 4027|  12.9k|                    cur = NULL;
 4028|  12.9k|                    break;
 4029|  12.9k|                }
 4030|  5.81M|            }
 4031|  7.67M|        }
 4032|  14.4k|    }
 4033|       |
 4034|  15.8M|out:
 4035|  15.8M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (4035:9): [True: 0, False: 15.8M]
  |  Branch (4035:35): [True: 0, False: 0]
  ------------------
 4036|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 4037|  15.8M|    return(ret);
 4038|       |
 4039|  3.52k|error:
 4040|  3.52k|    xmlFreeNode(ret);
 4041|       |    return(NULL);
 4042|  15.8M|}
xmlStaticCopyNodeList:
 4055|  1.20M|xmlStaticCopyNodeList(xmlNode *node, xmlDoc *doc, xmlNode *parent) {
 4056|  1.20M|    xmlNodePtr ret = NULL;
 4057|  1.20M|    xmlNodePtr p = NULL,q;
 4058|  1.20M|    xmlDtdPtr newSubset = NULL;
 4059|  1.20M|    int linkedSubset = 0;
 4060|       |
 4061|  2.41M|    while (node != NULL) {
  ------------------
  |  Branch (4061:12): [True: 1.20M, False: 1.20M]
  ------------------
 4062|  1.20M|        xmlNodePtr next = node->next;
 4063|       |
 4064|  1.20M|	if (node->type == XML_DTD_NODE ) {
  ------------------
  |  Branch (4064:6): [True: 0, False: 1.20M]
  ------------------
 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.20M|	    q = xmlStaticCopyNode(node, doc, parent, 1);
 4102|  1.20M|	if (q == NULL) goto error;
  ------------------
  |  Branch (4102:6): [True: 35, False: 1.20M]
  ------------------
 4103|  1.20M|	if (ret == NULL) {
  ------------------
  |  Branch (4103:6): [True: 1.20M, False: 2.93k]
  ------------------
 4104|  1.20M|	    q->prev = NULL;
 4105|  1.20M|	    ret = p = q;
 4106|  1.20M|	} else if (p != q) {
  ------------------
  |  Branch (4106:13): [True: 2.93k, False: 0]
  ------------------
 4107|       |	/* the test is required if xmlStaticCopyNode coalesced 2 text nodes */
 4108|  2.93k|	    p->next = q;
 4109|  2.93k|	    q->prev = p;
 4110|  2.93k|	    p = q;
 4111|  2.93k|	}
 4112|  1.20M|	node = next;
 4113|  1.20M|    }
 4114|  1.20M|    if ((doc != NULL) && (newSubset != NULL))
  ------------------
  |  Branch (4114:9): [True: 1.20M, False: 719]
  |  Branch (4114:26): [True: 0, False: 1.20M]
  ------------------
 4115|      0|        doc->intSubset = newSubset;
 4116|  1.20M|    return(ret);
 4117|     35|error:
 4118|     35|    xmlFreeNodeList(ret);
 4119|     35|    if (newSubset != NULL)
  ------------------
  |  Branch (4119:9): [True: 0, False: 35]
  ------------------
 4120|      0|        xmlFreeDtd(newSubset);
 4121|     35|    if (linkedSubset != 0) {
  ------------------
  |  Branch (4121:9): [True: 0, False: 35]
  ------------------
 4122|      0|        doc->intSubset->next = NULL;
 4123|      0|        doc->intSubset->prev = NULL;
 4124|      0|    }
 4125|       |    return(NULL);
 4126|  1.20M|}
xmlCopyNode:
 4146|     17|xmlCopyNode(xmlNode *node, int extended) {
 4147|     17|    xmlNodePtr ret;
 4148|       |
 4149|     17|    ret = xmlStaticCopyNode(node, NULL, NULL, extended);
 4150|     17|    return(ret);
 4151|     17|}
xmlDocCopyNode:
 4170|  78.9k|xmlDocCopyNode(xmlNode *node, xmlDoc *doc, int extended) {
 4171|  78.9k|    xmlNodePtr ret;
 4172|       |
 4173|       |    ret = xmlStaticCopyNode(node, doc, NULL, extended);
 4174|  78.9k|    return(ret);
 4175|  78.9k|}
xmlCopyDtd:
 4211|  4.47k|xmlCopyDtd(xmlDtd *dtd) {
 4212|  4.47k|    xmlDtdPtr ret;
 4213|  4.47k|    xmlNodePtr cur, p = NULL, q;
 4214|       |
 4215|  4.47k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (4215:9): [True: 0, False: 4.47k]
  ------------------
 4216|  4.47k|    ret = xmlNewDtd(NULL, dtd->name, dtd->ExternalID, dtd->SystemID);
 4217|  4.47k|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (4217:9): [True: 19, False: 4.45k]
  ------------------
 4218|  4.45k|    if (dtd->entities != NULL) {
  ------------------
  |  Branch (4218:9): [True: 937, False: 3.51k]
  ------------------
 4219|    937|        ret->entities = (void *) xmlCopyEntitiesTable(
 4220|    937|	                    (xmlEntitiesTablePtr) dtd->entities);
 4221|    937|        if (ret->entities == NULL)
  ------------------
  |  Branch (4221:13): [True: 14, False: 923]
  ------------------
 4222|     14|            goto error;
 4223|    937|    }
 4224|  4.43k|    if (dtd->notations != NULL) {
  ------------------
  |  Branch (4224:9): [True: 609, False: 3.82k]
  ------------------
 4225|    609|        ret->notations = (void *) xmlCopyNotationTable(
 4226|    609|	                    (xmlNotationTablePtr) dtd->notations);
 4227|    609|        if (ret->notations == NULL)
  ------------------
  |  Branch (4227:13): [True: 4, False: 605]
  ------------------
 4228|      4|            goto error;
 4229|    609|    }
 4230|  4.43k|    if (dtd->elements != NULL) {
  ------------------
  |  Branch (4230:9): [True: 3.04k, False: 1.38k]
  ------------------
 4231|  3.04k|        ret->elements = (void *) xmlCopyElementTable(
 4232|  3.04k|	                    (xmlElementTablePtr) dtd->elements);
 4233|  3.04k|        if (ret->elements == NULL)
  ------------------
  |  Branch (4233:13): [True: 66, False: 2.98k]
  ------------------
 4234|     66|            goto error;
 4235|  3.04k|    }
 4236|  4.36k|    if (dtd->attributes != NULL) {
  ------------------
  |  Branch (4236:9): [True: 2.16k, False: 2.20k]
  ------------------
 4237|  2.16k|        ret->attributes = (void *) xmlCopyAttributeTable(
 4238|  2.16k|	                    (xmlAttributeTablePtr) dtd->attributes);
 4239|  2.16k|        if (ret->attributes == NULL)
  ------------------
  |  Branch (4239:13): [True: 52, False: 2.11k]
  ------------------
 4240|     52|            goto error;
 4241|  2.16k|    }
 4242|  4.31k|    if (dtd->pentities != NULL) {
  ------------------
  |  Branch (4242:9): [True: 270, False: 4.04k]
  ------------------
 4243|    270|	ret->pentities = (void *) xmlCopyEntitiesTable(
 4244|    270|			    (xmlEntitiesTablePtr) dtd->pentities);
 4245|    270|        if (ret->pentities == NULL)
  ------------------
  |  Branch (4245:13): [True: 6, False: 264]
  ------------------
 4246|      6|            goto error;
 4247|    270|    }
 4248|       |
 4249|  4.30k|    cur = dtd->children;
 4250|  15.7k|    while (cur != NULL) {
  ------------------
  |  Branch (4250:12): [True: 11.4k, False: 4.30k]
  ------------------
 4251|  11.4k|	q = NULL;
 4252|       |
 4253|  11.4k|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (4253:6): [True: 1.87k, False: 9.61k]
  ------------------
 4254|  1.87k|	    xmlEntityPtr tmp = (xmlEntityPtr) cur;
 4255|  1.87k|	    switch (tmp->etype) {
  ------------------
  |  Branch (4255:14): [True: 1.87k, False: 0]
  ------------------
 4256|    994|		case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (4256:3): [True: 994, False: 884]
  ------------------
 4257|  1.53k|		case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (4257:3): [True: 541, False: 1.33k]
  ------------------
 4258|  1.60k|		case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (4258:3): [True: 73, False: 1.80k]
  ------------------
 4259|  1.60k|		    q = (xmlNodePtr) xmlGetEntityFromDtd(ret, tmp->name);
 4260|  1.60k|		    break;
 4261|    115|		case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4261:3): [True: 115, False: 1.76k]
  ------------------
 4262|    270|		case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4262:3): [True: 155, False: 1.72k]
  ------------------
 4263|    270|		    q = (xmlNodePtr)
 4264|    270|			xmlGetParameterEntityFromDtd(ret, tmp->name);
 4265|    270|		    break;
 4266|      0|		case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (4266:3): [True: 0, False: 1.87k]
  ------------------
 4267|      0|		    break;
 4268|  1.87k|	    }
 4269|  9.61k|	} else if (cur->type == XML_ELEMENT_DECL) {
  ------------------
  |  Branch (4269:13): [True: 3.25k, False: 6.35k]
  ------------------
 4270|  3.25k|	    xmlElementPtr tmp = (xmlElementPtr) cur;
 4271|  3.25k|	    q = (xmlNodePtr)
 4272|  3.25k|		xmlGetDtdQElementDesc(ret, tmp->name, tmp->prefix);
 4273|  6.35k|	} else if (cur->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (4273:13): [True: 6.25k, False: 96]
  ------------------
 4274|  6.25k|	    xmlAttributePtr tmp = (xmlAttributePtr) cur;
 4275|  6.25k|	    q = (xmlNodePtr)
 4276|  6.25k|		xmlGetDtdQAttrDesc(ret, tmp->elem, tmp->name, tmp->prefix);
 4277|  6.25k|	} else if (cur->type == XML_COMMENT_NODE) {
  ------------------
  |  Branch (4277:13): [True: 17, False: 79]
  ------------------
 4278|     17|	    q = xmlCopyNode(cur, 0);
 4279|     17|            if (q == NULL)
  ------------------
  |  Branch (4279:17): [True: 0, False: 17]
  ------------------
 4280|      0|                goto error;
 4281|     17|	}
 4282|       |
 4283|  11.4k|	if (q == NULL) {
  ------------------
  |  Branch (4283:6): [True: 79, False: 11.4k]
  ------------------
 4284|     79|	    cur = cur->next;
 4285|     79|	    continue;
 4286|     79|	}
 4287|       |
 4288|  11.4k|	if (p == NULL)
  ------------------
  |  Branch (4288:6): [True: 3.35k, False: 8.05k]
  ------------------
 4289|  3.35k|	    ret->children = q;
 4290|  8.05k|	else
 4291|  8.05k|	    p->next = q;
 4292|       |
 4293|  11.4k|	q->prev = p;
 4294|  11.4k|	q->parent = (xmlNodePtr) ret;
 4295|  11.4k|	q->next = NULL;
 4296|  11.4k|	ret->last = q;
 4297|  11.4k|	p = q;
 4298|  11.4k|	cur = cur->next;
 4299|  11.4k|    }
 4300|       |
 4301|  4.30k|    return(ret);
 4302|       |
 4303|    142|error:
 4304|    142|    xmlFreeDtd(ret);
 4305|       |    return(NULL);
 4306|  4.30k|}
xmlGetLineNo:
 4446|  26.9k|{
 4447|  26.9k|    return(xmlGetLineNoInternal(node, 0));
 4448|  26.9k|}
xmlDocGetRootElement:
 4674|   187k|xmlDocGetRootElement(const xmlDoc *doc) {
 4675|   187k|    xmlNodePtr ret;
 4676|       |
 4677|   187k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4677:9): [True: 0, False: 187k]
  ------------------
 4678|   187k|    ret = doc->children;
 4679|   233k|    while (ret != NULL) {
  ------------------
  |  Branch (4679:12): [True: 233k, False: 1]
  ------------------
 4680|   233k|	if (ret->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (4680:6): [True: 187k, False: 45.8k]
  ------------------
 4681|   187k|	    return(ret);
 4682|  45.8k|        ret = ret->next;
 4683|  45.8k|    }
 4684|      1|    return(ret);
 4685|   187k|}
xmlNodeGetLang:
 4771|  6.47k|xmlNodeGetLang(const xmlNode *cur) {
 4772|  6.47k|    xmlChar *lang;
 4773|  6.47k|    int res;
 4774|       |
 4775|  6.47k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4775:9): [True: 0, False: 6.47k]
  |  Branch (4775:26): [True: 0, False: 6.47k]
  ------------------
 4776|      0|        return(NULL);
 4777|       |
 4778|   861k|    while (cur != NULL) {
  ------------------
  |  Branch (4778:12): [True: 855k, False: 5.85k]
  ------------------
 4779|   855k|        res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|   855k|#define BAD_CAST (xmlChar *)
  ------------------
                      res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|   855k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4780|   855k|                                  &lang);
 4781|   855k|        if (res < 0)
  ------------------
  |  Branch (4781:13): [True: 2, False: 855k]
  ------------------
 4782|      2|            return(NULL);
 4783|   855k|	if (lang != NULL)
  ------------------
  |  Branch (4783:6): [True: 611, False: 854k]
  ------------------
 4784|    611|	    return(lang);
 4785|       |
 4786|   854k|	cur = cur->parent;
 4787|   854k|    }
 4788|       |
 4789|  5.85k|    return(NULL);
 4790|  6.47k|}
xmlNodeGetSpacePreserve:
 4837|  1.00k|xmlNodeGetSpacePreserve(const xmlNode *cur) {
 4838|  1.00k|    xmlChar *space;
 4839|  1.00k|        int res;
 4840|       |
 4841|  1.00k|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (4841:9): [True: 0, False: 1.00k]
  |  Branch (4841:26): [True: 1.00k, False: 0]
  ------------------
 4842|  1.00k|        return(-1);
 4843|       |
 4844|      0|    while (cur != NULL) {
  ------------------
  |  Branch (4844:12): [True: 0, False: 0]
  ------------------
 4845|      0|	res = xmlNodeGetAttrValue(cur, BAD_CAST "space", XML_XML_NAMESPACE,
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
              	res = xmlNodeGetAttrValue(cur, BAD_CAST "space", XML_XML_NAMESPACE,
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4846|      0|                                  &space);
 4847|      0|        if (res < 0)
  ------------------
  |  Branch (4847:13): [True: 0, False: 0]
  ------------------
 4848|      0|            return(-1);
 4849|      0|	if (space != NULL) {
  ------------------
  |  Branch (4849:6): [True: 0, False: 0]
  ------------------
 4850|      0|	    if (xmlStrEqual(space, BAD_CAST "preserve")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4850:10): [True: 0, False: 0]
  ------------------
 4851|      0|		xmlFree(space);
 4852|      0|		return(1);
 4853|      0|	    }
 4854|      0|	    if (xmlStrEqual(space, BAD_CAST "default")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4854:10): [True: 0, False: 0]
  ------------------
 4855|      0|		xmlFree(space);
 4856|      0|		return(0);
 4857|      0|	    }
 4858|      0|	    xmlFree(space);
 4859|      0|	}
 4860|       |
 4861|      0|	cur = cur->parent;
 4862|      0|    }
 4863|       |
 4864|      0|    return(-1);
 4865|      0|}
xmlNodeSetBase:
 4921|  1.83k|xmlNodeSetBase(xmlNode *cur, const xmlChar* uri) {
 4922|  1.83k|    xmlNsPtr ns;
 4923|  1.83k|    xmlChar* fixed;
 4924|       |
 4925|  1.83k|    if (cur == NULL)
  ------------------
  |  Branch (4925:9): [True: 0, False: 1.83k]
  ------------------
 4926|      0|        return(-1);
 4927|  1.83k|    switch(cur->type) {
 4928|  1.83k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4928:9): [True: 1.83k, False: 0]
  ------------------
 4929|  1.83k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4929:9): [True: 0, False: 1.83k]
  ------------------
 4930|  1.83k|	    break;
 4931|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4931:9): [True: 0, False: 1.83k]
  ------------------
 4932|      0|        case XML_HTML_DOCUMENT_NODE: {
  ------------------
  |  Branch (4932:9): [True: 0, False: 1.83k]
  ------------------
 4933|      0|	    xmlDocPtr doc = (xmlDocPtr) cur;
 4934|       |
 4935|      0|	    if (doc->URL != NULL)
  ------------------
  |  Branch (4935:10): [True: 0, False: 0]
  ------------------
 4936|      0|		xmlFree(doc->URL);
 4937|      0|	    if (uri == NULL) {
  ------------------
  |  Branch (4937:10): [True: 0, False: 0]
  ------------------
 4938|      0|		doc->URL = NULL;
 4939|      0|            } else {
 4940|      0|		doc->URL = xmlPathToURI(uri);
 4941|      0|                if (doc->URL == NULL)
  ------------------
  |  Branch (4941:21): [True: 0, False: 0]
  ------------------
 4942|      0|                    return(-1);
 4943|      0|            }
 4944|      0|	    return(0);
 4945|      0|	}
 4946|      0|        default:
  ------------------
  |  Branch (4946:9): [True: 0, False: 1.83k]
  ------------------
 4947|      0|	    return(-1);
 4948|  1.83k|    }
 4949|       |
 4950|  1.83k|    xmlSearchNsByHrefSafe(cur, XML_XML_NAMESPACE, &ns);
  ------------------
  |  |  146|  1.83k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4951|  1.83k|    if (ns == NULL)
  ------------------
  |  Branch (4951:9): [True: 2, False: 1.82k]
  ------------------
 4952|      2|	return(-1);
 4953|  1.82k|    fixed = xmlPathToURI(uri);
 4954|  1.82k|    if (fixed == NULL)
  ------------------
  |  Branch (4954:9): [True: 6, False: 1.82k]
  ------------------
 4955|      6|        return(-1);
 4956|  1.82k|    if (xmlSetNsProp(cur, ns, BAD_CAST "base", fixed) == NULL) {
  ------------------
  |  |   34|  1.82k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4956:9): [True: 13, False: 1.80k]
  ------------------
 4957|     13|        xmlFree(fixed);
 4958|     13|        return(-1);
 4959|     13|    }
 4960|  1.80k|    xmlFree(fixed);
 4961|       |
 4962|  1.80k|    return(0);
 4963|  1.82k|}
xmlNodeGetBaseSafe:
 4982|  78.5k|xmlNodeGetBaseSafe(const xmlDoc *doc, const xmlNode *cur, xmlChar **baseOut) {
 4983|  78.5k|    xmlChar *ret = NULL;
 4984|  78.5k|    xmlChar *base, *newbase;
 4985|  78.5k|    int res;
 4986|       |
 4987|  78.5k|    if (baseOut == NULL)
  ------------------
  |  Branch (4987:9): [True: 0, False: 78.5k]
  ------------------
 4988|      0|        return(1);
 4989|  78.5k|    *baseOut = NULL;
 4990|  78.5k|    if ((cur == NULL) && (doc == NULL))
  ------------------
  |  Branch (4990:9): [True: 0, False: 78.5k]
  |  Branch (4990:26): [True: 0, False: 0]
  ------------------
 4991|      0|        return(1);
 4992|  78.5k|    if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4992:9): [True: 78.5k, False: 0]
  |  Branch (4992:26): [True: 0, False: 78.5k]
  ------------------
 4993|      0|        return(1);
 4994|  78.5k|    if (doc == NULL)
  ------------------
  |  Branch (4994:9): [True: 48.2k, False: 30.3k]
  ------------------
 4995|  48.2k|        doc = cur->doc;
 4996|       |
 4997|  78.5k|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (4997:9): [True: 78.5k, False: 0]
  |  Branch (4997:26): [True: 0, False: 78.5k]
  ------------------
 4998|      0|        cur = doc->children;
 4999|      0|	while ((cur != NULL) && (cur->name != NULL)) {
  ------------------
  |  Branch (4999:9): [True: 0, False: 0]
  |  Branch (4999:26): [True: 0, False: 0]
  ------------------
 5000|      0|	    if (cur->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5000:10): [True: 0, False: 0]
  ------------------
 5001|      0|	        cur = cur->next;
 5002|      0|		continue;
 5003|      0|	    }
 5004|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "html")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5004:10): [True: 0, False: 0]
  ------------------
 5005|      0|	        cur = cur->children;
 5006|      0|		continue;
 5007|      0|	    }
 5008|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "head")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5008:10): [True: 0, False: 0]
  ------------------
 5009|      0|	        cur = cur->children;
 5010|      0|		continue;
 5011|      0|	    }
 5012|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "base")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5012:10): [True: 0, False: 0]
  ------------------
 5013|      0|                if (xmlNodeGetAttrValue(cur, BAD_CAST "href", NULL, &ret) < 0)
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5013:21): [True: 0, False: 0]
  ------------------
 5014|      0|                    return(-1);
 5015|      0|                if (ret == NULL)
  ------------------
  |  Branch (5015:21): [True: 0, False: 0]
  ------------------
 5016|      0|                    return(1);
 5017|      0|                goto found;
 5018|      0|	    }
 5019|      0|	    cur = cur->next;
 5020|      0|	}
 5021|      0|	return(0);
 5022|      0|    }
 5023|       |
 5024|  5.38M|    while (cur != NULL) {
  ------------------
  |  Branch (5024:12): [True: 5.32M, False: 62.4k]
  ------------------
 5025|  5.32M|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (5025:6): [True: 449, False: 5.32M]
  ------------------
 5026|    449|	    xmlEntityPtr ent = (xmlEntityPtr) cur;
 5027|       |
 5028|    449|            if (ent->URI == NULL)
  ------------------
  |  Branch (5028:17): [True: 200, False: 249]
  ------------------
 5029|    200|                break;
 5030|    249|            xmlFree(ret);
 5031|    249|	    ret = xmlStrdup(ent->URI);
 5032|    249|            if (ret == NULL)
  ------------------
  |  Branch (5032:17): [True: 1, False: 248]
  ------------------
 5033|      1|                return(-1);
 5034|    248|            goto found;
 5035|    249|	}
 5036|  5.32M|	if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5036:6): [True: 5.25M, False: 65.2k]
  ------------------
 5037|  5.25M|	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  5.25M|#define BAD_CAST (xmlChar *)
  ------------------
              	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  5.25M|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5037:10): [True: 146, False: 5.25M]
  ------------------
 5038|  5.25M|                                    &base) < 0) {
 5039|    146|                xmlFree(ret);
 5040|    146|                return(-1);
 5041|    146|            }
 5042|  5.25M|	    if (base != NULL) {
  ------------------
  |  Branch (5042:10): [True: 779k, False: 4.48M]
  ------------------
 5043|   779k|		if (ret != NULL) {
  ------------------
  |  Branch (5043:7): [True: 730k, False: 48.8k]
  ------------------
 5044|   730k|		    res = xmlBuildURISafe(ret, base, &newbase);
 5045|   730k|                    xmlFree(ret);
 5046|   730k|                    xmlFree(base);
 5047|   730k|                    if (res != 0)
  ------------------
  |  Branch (5047:25): [True: 12.8k, False: 717k]
  ------------------
 5048|  12.8k|                        return(res);
 5049|   717k|		    ret = newbase;
 5050|   717k|		} else {
 5051|  48.8k|		    ret = base;
 5052|  48.8k|		}
 5053|   766k|		if ((!xmlStrncmp(ret, BAD_CAST "http://", 7)) ||
  ------------------
  |  |   34|   766k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5053:7): [True: 493, False: 765k]
  ------------------
 5054|   765k|		    (!xmlStrncmp(ret, BAD_CAST "ftp://", 6)) ||
  ------------------
  |  |   34|   765k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5054:7): [True: 678, False: 765k]
  ------------------
 5055|   765k|		    (!xmlStrncmp(ret, BAD_CAST "urn:", 4)))
  ------------------
  |  |   34|   765k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5055:7): [True: 1.49k, False: 763k]
  ------------------
 5056|  2.66k|                    goto found;
 5057|   766k|	    }
 5058|  5.25M|	}
 5059|  5.30M|	cur = cur->parent;
 5060|  5.30M|    }
 5061|       |
 5062|  62.6k|    if ((doc != NULL) && (doc->URL != NULL)) {
  ------------------
  |  Branch (5062:9): [True: 62.6k, False: 0]
  |  Branch (5062:26): [True: 13.9k, False: 48.7k]
  ------------------
 5063|  13.9k|	if (ret == NULL) {
  ------------------
  |  Branch (5063:6): [True: 12.9k, False: 1.07k]
  ------------------
 5064|  12.9k|	    ret = xmlStrdup(doc->URL);
 5065|  12.9k|            if (ret == NULL)
  ------------------
  |  Branch (5065:17): [True: 20, False: 12.8k]
  ------------------
 5066|     20|                return(-1);
 5067|  12.9k|        } else {
 5068|  1.07k|            res = xmlBuildURISafe(ret, doc->URL, &newbase);
 5069|  1.07k|            xmlFree(ret);
 5070|  1.07k|            if (res != 0)
  ------------------
  |  Branch (5070:17): [True: 372, False: 701]
  ------------------
 5071|    372|                return(res);
 5072|    701|            ret = newbase;
 5073|    701|        }
 5074|  13.9k|    }
 5075|       |
 5076|  65.2k|found:
 5077|  65.2k|    *baseOut = ret;
 5078|  65.2k|    return(0);
 5079|  62.6k|}
xmlBufGetNodeContent:
 5202|   168k|{
 5203|   168k|    if ((cur == NULL) || (buf == NULL))
  ------------------
  |  Branch (5203:9): [True: 0, False: 168k]
  |  Branch (5203:26): [True: 0, False: 168k]
  ------------------
 5204|      0|        return(-1);
 5205|       |
 5206|   168k|    switch (cur->type) {
 5207|  82.6k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5207:9): [True: 82.6k, False: 86.2k]
  ------------------
 5208|  82.6k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5208:9): [True: 0, False: 168k]
  ------------------
 5209|  82.6k|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5209:9): [True: 0, False: 168k]
  ------------------
 5210|   167k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5210:9): [True: 84.5k, False: 84.3k]
  ------------------
 5211|   168k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5211:9): [True: 1.19k, False: 167k]
  ------------------
 5212|   168k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (5212:9): [True: 0, False: 168k]
  ------------------
 5213|   168k|            xmlBufGetChildContent(buf, cur);
 5214|   168k|            break;
 5215|       |
 5216|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5216:9): [True: 0, False: 168k]
  ------------------
 5217|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5217:9): [True: 0, False: 168k]
  ------------------
 5218|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5218:9): [True: 0, False: 168k]
  ------------------
 5219|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5219:9): [True: 0, False: 168k]
  ------------------
 5220|      0|	    xmlBufCat(buf, cur->content);
 5221|      0|            break;
 5222|       |
 5223|    517|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5223:9): [True: 517, False: 168k]
  ------------------
 5224|    517|            xmlBufGetEntityRefContent(buf, cur);
 5225|    517|            break;
 5226|       |
 5227|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5227:9): [True: 0, False: 168k]
  ------------------
 5228|      0|	    xmlBufCat(buf, ((xmlNsPtr) cur)->href);
 5229|      0|	    break;
 5230|       |
 5231|      0|        default:
  ------------------
  |  Branch (5231:9): [True: 0, False: 168k]
  ------------------
 5232|      0|            break;
 5233|   168k|    }
 5234|       |
 5235|   168k|    return(0);
 5236|   168k|}
xmlNodeGetContent:
 5253|  1.16M|{
 5254|  1.16M|    xmlBufPtr buf;
 5255|  1.16M|    xmlChar *ret;
 5256|       |
 5257|  1.16M|    if (cur == NULL)
  ------------------
  |  Branch (5257:9): [True: 0, False: 1.16M]
  ------------------
 5258|      0|        return (NULL);
 5259|       |
 5260|  1.16M|    switch (cur->type) {
 5261|  82.7k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5261:9): [True: 82.7k, False: 1.08M]
  ------------------
 5262|  82.7k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5262:9): [True: 0, False: 1.16M]
  ------------------
 5263|  82.7k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5263:9): [True: 0, False: 1.16M]
  ------------------
 5264|  82.7k|            break;
 5265|       |
 5266|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5266:9): [True: 0, False: 1.16M]
  ------------------
 5267|   238k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5267:9): [True: 238k, False: 929k]
  ------------------
 5268|  1.05M|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5268:9): [True: 814k, False: 353k]
  ------------------
 5269|  1.05M|        case XML_ENTITY_DECL: {
  ------------------
  |  Branch (5269:9): [True: 0, False: 1.16M]
  ------------------
 5270|  1.05M|            xmlNodePtr children = cur->children;
 5271|       |
 5272|  1.05M|            if (children == NULL)
  ------------------
  |  Branch (5272:17): [True: 498k, False: 554k]
  ------------------
 5273|   498k|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|   498k|#define BAD_CAST (xmlChar *)
  ------------------
 5274|       |
 5275|       |            /* Optimization for single text children */
 5276|   554k|            if (((children->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (5276:18): [True: 500k, False: 54.1k]
  ------------------
 5277|  54.1k|                 (children->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (5277:18): [True: 2.21k, False: 51.9k]
  ------------------
 5278|   502k|                (children->next == NULL)) {
  ------------------
  |  Branch (5278:17): [True: 469k, False: 32.9k]
  ------------------
 5279|   469k|                if (children->content == NULL)
  ------------------
  |  Branch (5279:21): [True: 0, False: 469k]
  ------------------
 5280|      0|                    return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5281|   469k|                return(xmlStrdup(children->content));
 5282|   469k|            }
 5283|       |
 5284|  84.8k|            break;
 5285|   554k|        }
 5286|       |
 5287|  84.8k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5287:9): [True: 893, False: 1.16M]
  ------------------
 5288|  31.8k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5288:9): [True: 30.9k, False: 1.13M]
  ------------------
 5289|  32.1k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5289:9): [True: 232, False: 1.16M]
  ------------------
 5290|  32.4k|        case XML_PI_NODE:
  ------------------
  |  Branch (5290:9): [True: 345, False: 1.16M]
  ------------------
 5291|  32.4k|            if (cur->content != NULL)
  ------------------
  |  Branch (5291:17): [True: 32.1k, False: 345]
  ------------------
 5292|  32.1k|                return(xmlStrdup(cur->content));
 5293|    345|            else
 5294|    345|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|    345|#define BAD_CAST (xmlChar *)
  ------------------
 5295|       |
 5296|    267|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5296:9): [True: 267, False: 1.16M]
  ------------------
 5297|    267|	    return(xmlStrdup(((xmlNsPtr) cur)->href));
 5298|       |
 5299|      0|        default:
  ------------------
  |  Branch (5299:9): [True: 0, False: 1.16M]
  ------------------
 5300|      0|            return(NULL);
 5301|  1.16M|    }
 5302|       |
 5303|   167k|    buf = xmlBufCreate(50);
 5304|   167k|    if (buf == NULL)
  ------------------
  |  Branch (5304:9): [True: 57, False: 167k]
  ------------------
 5305|     57|        return (NULL);
 5306|   167k|    xmlBufGetNodeContent(buf, cur);
 5307|   167k|    ret = xmlBufDetach(buf);
 5308|   167k|    xmlBufFree(buf);
 5309|       |
 5310|   167k|    return(ret);
 5311|   167k|}
xmlNodeAddContentLen:
 5414|     42|xmlNodeAddContentLen(xmlNode *cur, const xmlChar *content, int len) {
 5415|     42|    if (cur == NULL)
  ------------------
  |  Branch (5415:9): [True: 0, False: 42]
  ------------------
 5416|      0|	return(1);
 5417|     42|    if ((content == NULL) || (len <= 0))
  ------------------
  |  Branch (5417:9): [True: 0, False: 42]
  |  Branch (5417:30): [True: 16, False: 26]
  ------------------
 5418|     16|        return(0);
 5419|       |
 5420|     26|    switch (cur->type) {
 5421|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5421:9): [True: 0, False: 26]
  ------------------
 5422|      0|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5422:9): [True: 0, False: 26]
  ------------------
 5423|      0|        case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (5423:9): [True: 0, False: 26]
  ------------------
 5424|      0|	    xmlNodePtr newNode, tmp;
 5425|       |
 5426|      0|	    newNode = xmlNewDocTextLen(cur->doc, content, len);
 5427|      0|	    if (newNode == NULL)
  ------------------
  |  Branch (5427:10): [True: 0, False: 0]
  ------------------
 5428|      0|                return(-1);
 5429|      0|            tmp = xmlAddChild(cur, newNode);
 5430|      0|            if (tmp == NULL) {
  ------------------
  |  Branch (5430:17): [True: 0, False: 0]
  ------------------
 5431|      0|                xmlFreeNode(newNode);
 5432|      0|                return(-1);
 5433|      0|            }
 5434|      0|	    break;
 5435|      0|	}
 5436|      0|	    break;
 5437|     26|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5437:9): [True: 26, False: 0]
  ------------------
 5438|     26|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5438:9): [True: 0, False: 26]
  ------------------
 5439|     26|        case XML_PI_NODE:
  ------------------
  |  Branch (5439:9): [True: 0, False: 26]
  ------------------
 5440|     26|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5440:9): [True: 0, False: 26]
  ------------------
 5441|     26|            return(xmlTextAddContent(cur, content, len));
 5442|      0|        default:
  ------------------
  |  Branch (5442:9): [True: 0, False: 26]
  ------------------
 5443|      0|            break;
 5444|     26|    }
 5445|       |
 5446|      0|    return(0);
 5447|     26|}
xmlGetNsListSafe:
 5513|  33.6k|{
 5514|  33.6k|    xmlNsPtr cur;
 5515|  33.6k|    xmlNsPtr *namespaces = NULL;
 5516|  33.6k|    int nbns = 0;
 5517|  33.6k|    int maxns = 0;
 5518|  33.6k|    int i;
 5519|       |
 5520|  33.6k|    if (out == NULL)
  ------------------
  |  Branch (5520:9): [True: 0, False: 33.6k]
  ------------------
 5521|      0|        return(1);
 5522|  33.6k|    *out = NULL;
 5523|  33.6k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5523:9): [True: 0, False: 33.6k]
  |  Branch (5523:27): [True: 0, False: 33.6k]
  ------------------
 5524|      0|        return(1);
 5525|       |
 5526|   210k|    while (node != NULL) {
  ------------------
  |  Branch (5526:12): [True: 176k, False: 33.6k]
  ------------------
 5527|   176k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5527:13): [True: 143k, False: 33.6k]
  ------------------
 5528|   143k|            cur = node->nsDef;
 5529|   189k|            while (cur != NULL) {
  ------------------
  |  Branch (5529:20): [True: 46.5k, False: 143k]
  ------------------
 5530|  59.0k|                for (i = 0; i < nbns; i++) {
  ------------------
  |  Branch (5530:29): [True: 14.3k, False: 44.7k]
  ------------------
 5531|  14.3k|                    if ((cur->prefix == namespaces[i]->prefix) ||
  ------------------
  |  Branch (5531:25): [True: 315, False: 14.0k]
  ------------------
 5532|  14.0k|                        (xmlStrEqual(cur->prefix, namespaces[i]->prefix)))
  ------------------
  |  Branch (5532:25): [True: 1.49k, False: 12.5k]
  ------------------
 5533|  1.80k|                        break;
 5534|  14.3k|                }
 5535|  46.5k|                if (i >= nbns) {
  ------------------
  |  Branch (5535:21): [True: 44.7k, False: 1.80k]
  ------------------
 5536|  44.7k|                    if (nbns >= maxns) {
  ------------------
  |  Branch (5536:25): [True: 32.9k, False: 11.7k]
  ------------------
 5537|  32.9k|                        xmlNsPtr *tmp;
 5538|  32.9k|                        int newSize;
 5539|       |
 5540|  32.9k|                        newSize = xmlGrowCapacity(maxns, sizeof(tmp[0]),
 5541|  32.9k|                                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  32.9k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 5542|  32.9k|                        if (newSize < 0) {
  ------------------
  |  Branch (5542:29): [True: 0, False: 32.9k]
  ------------------
 5543|      0|                            xmlFree(namespaces);
 5544|      0|                            return(-1);
 5545|      0|                        }
 5546|  32.9k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 5547|  32.9k|                        if (newSize < 2)
  ------------------
  |  Branch (5547:29): [True: 32.5k, False: 370]
  ------------------
 5548|  32.5k|                            newSize = 2;
 5549|  32.9k|#endif
 5550|  32.9k|                        tmp = xmlRealloc(namespaces,
 5551|  32.9k|                                         (newSize + 1) * sizeof(tmp[0]));
 5552|  32.9k|                        if (tmp == NULL) {
  ------------------
  |  Branch (5552:29): [True: 5, False: 32.9k]
  ------------------
 5553|      5|                            xmlFree(namespaces);
 5554|      5|                            return(-1);
 5555|      5|                        }
 5556|  32.9k|                        namespaces = tmp;
 5557|  32.9k|                        maxns = newSize;
 5558|  32.9k|                    }
 5559|  44.7k|                    namespaces[nbns++] = cur;
 5560|  44.7k|                    namespaces[nbns] = NULL;
 5561|  44.7k|                }
 5562|       |
 5563|  46.5k|                cur = cur->next;
 5564|  46.5k|            }
 5565|   143k|        }
 5566|   176k|        node = node->parent;
 5567|   176k|    }
 5568|       |
 5569|  33.6k|    *out = namespaces;
 5570|  33.6k|    return((namespaces == NULL) ? 1 : 0);
  ------------------
  |  Branch (5570:12): [True: 1.07k, False: 32.5k]
  ------------------
 5571|  33.6k|}
xmlSearchNsSafe:
 5650|  2.10M|                xmlNs **out) {
 5651|  2.10M|    xmlNsPtr cur;
 5652|  2.10M|    xmlDocPtr doc;
 5653|  2.10M|    xmlNodePtr orig = node;
 5654|  2.10M|    xmlNodePtr parent;
 5655|       |
 5656|  2.10M|    if (out == NULL)
  ------------------
  |  Branch (5656:9): [True: 0, False: 2.10M]
  ------------------
 5657|      0|        return(1);
 5658|  2.10M|    *out = NULL;
 5659|  2.10M|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5659:9): [True: 0, False: 2.10M]
  |  Branch (5659:27): [True: 0, False: 2.10M]
  ------------------
 5660|      0|        return(1);
 5661|       |
 5662|  2.10M|    doc = node->doc;
 5663|       |
 5664|  2.10M|    if ((doc != NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|  2.10M|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 1.75M, False: 347k]
  |  |  |  Branch (100:43): [True: 995k, False: 763k]
  |  |  ------------------
  |  |  101|  2.10M|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 869k, False: 126k]
  |  |  |  Branch (101:22): [True: 867k, False: 1.49k]
  |  |  |  Branch (101:41): [True: 865k, False: 2.68k]
  |  |  ------------------
  ------------------
  |  Branch (5664:9): [True: 2.10M, False: 658]
  ------------------
 5665|   865k|        cur = xmlTreeEnsureXMLDecl(doc);
 5666|   865k|        if (cur == NULL)
  ------------------
  |  Branch (5666:13): [True: 24, False: 865k]
  ------------------
 5667|     24|            return(-1);
 5668|   865k|        *out = cur;
 5669|   865k|        return(0);
 5670|   865k|    }
 5671|       |
 5672|  1.24M|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5672:12): [True: 14.0k, False: 1.22M]
  ------------------
 5673|  14.0k|        node = node->parent;
 5674|  14.0k|        if (node == NULL)
  ------------------
  |  Branch (5674:13): [True: 12.3k, False: 1.76k]
  ------------------
 5675|  12.3k|            return(0);
 5676|  14.0k|    }
 5677|       |
 5678|  1.22M|    parent = node;
 5679|       |
 5680|  37.8M|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5680:12): [True: 37.7M, False: 32.3k]
  |  Branch (5680:30): [True: 37.4M, False: 296k]
  ------------------
 5681|  37.4M|        cur = node->nsDef;
 5682|  44.1M|        while (cur != NULL) {
  ------------------
  |  Branch (5682:16): [True: 7.49M, False: 36.6M]
  ------------------
 5683|  7.49M|            if ((xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5683:17): [True: 2.77M, False: 4.72M]
  ------------------
 5684|  2.77M|                (cur->href != NULL)) {
  ------------------
  |  Branch (5684:17): [True: 833k, False: 1.93M]
  ------------------
 5685|   833k|                *out = cur;
 5686|   833k|                return(0);
 5687|   833k|            }
 5688|  6.66M|            cur = cur->next;
 5689|  6.66M|        }
 5690|  36.6M|        if (orig != node) {
  ------------------
  |  Branch (5690:13): [True: 36.1M, False: 512k]
  ------------------
 5691|  36.1M|            cur = node->ns;
 5692|  36.1M|            if ((cur != NULL) &&
  ------------------
  |  Branch (5692:17): [True: 2.50M, False: 33.6M]
  ------------------
 5693|  2.50M|                (xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5693:17): [True: 66.9k, False: 2.43M]
  ------------------
 5694|  66.9k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5694:17): [True: 66.9k, False: 0]
  ------------------
 5695|  66.9k|                *out = cur;
 5696|  66.9k|                return(0);
 5697|  66.9k|            }
 5698|  36.1M|        }
 5699|       |
 5700|  36.5M|	node = node->parent;
 5701|  36.5M|    }
 5702|       |
 5703|       |    /*
 5704|       |     * The XML-1.0 namespace is normally held on the document
 5705|       |     * element. In this case exceptionally create it on the
 5706|       |     * node element.
 5707|       |     */
 5708|   329k|    if ((doc == NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|    629|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 629, False: 0]
  |  |  |  Branch (100:43): [True: 629, False: 0]
  |  |  ------------------
  |  |  101|    629|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 629, False: 0]
  |  |  |  Branch (101:22): [True: 629, False: 0]
  |  |  |  Branch (101:41): [True: 629, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5708:9): [True: 629, False: 328k]
  ------------------
 5709|    629|        cur = xmlNewXmlNs();
 5710|    629|        if (cur == NULL)
  ------------------
  |  Branch (5710:13): [True: 2, False: 627]
  ------------------
 5711|      2|            return(-1);
 5712|    627|        cur->next = parent->nsDef;
 5713|    627|        parent->nsDef = cur;
 5714|    627|        *out = cur;
 5715|    627|    }
 5716|       |
 5717|   329k|    return(0);
 5718|   329k|}
xmlSearchNsByHrefSafe:
 5797|  3.48k|                      xmlNs **out) {
 5798|  3.48k|    xmlNsPtr cur;
 5799|  3.48k|    xmlDocPtr doc;
 5800|  3.48k|    xmlNodePtr orig = node;
 5801|  3.48k|    xmlNodePtr parent;
 5802|  3.48k|    int is_attr;
 5803|       |
 5804|  3.48k|    if (out == NULL)
  ------------------
  |  Branch (5804:9): [True: 0, False: 3.48k]
  ------------------
 5805|      0|        return(1);
 5806|  3.48k|    *out = NULL;
 5807|  3.48k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5807:9): [True: 0, False: 3.48k]
  |  Branch (5807:27): [True: 0, False: 3.48k]
  ------------------
 5808|      0|        return(1);
 5809|       |
 5810|  3.48k|    doc = node->doc;
 5811|       |
 5812|  3.48k|    if ((doc != NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|  3.48k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5812:9): [True: 3.48k, False: 0]
  |  Branch (5812:26): [True: 1.83k, False: 1.65k]
  ------------------
 5813|  1.83k|        cur = xmlTreeEnsureXMLDecl(doc);
 5814|  1.83k|        if (cur == NULL)
  ------------------
  |  Branch (5814:13): [True: 2, False: 1.82k]
  ------------------
 5815|      2|            return(-1);
 5816|  1.82k|        *out = cur;
 5817|  1.82k|        return(0);
 5818|  1.83k|    }
 5819|       |
 5820|  1.65k|    is_attr = (node->type == XML_ATTRIBUTE_NODE);
 5821|       |
 5822|  1.65k|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5822:12): [True: 0, False: 1.65k]
  ------------------
 5823|      0|        node = node->parent;
 5824|      0|        if (node == NULL)
  ------------------
  |  Branch (5824:13): [True: 0, False: 0]
  ------------------
 5825|      0|            return(0);
 5826|      0|    }
 5827|       |
 5828|  1.65k|    parent = node;
 5829|       |
 5830|  12.8k|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5830:12): [True: 12.2k, False: 629]
  |  Branch (5830:30): [True: 12.2k, False: 0]
  ------------------
 5831|  12.2k|        cur = node->nsDef;
 5832|  24.7k|        while (cur != NULL) {
  ------------------
  |  Branch (5832:16): [True: 13.3k, False: 11.4k]
  ------------------
 5833|  13.3k|            if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5833:17): [True: 3.46k, False: 9.86k]
  ------------------
 5834|  3.46k|                if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5834:22): [True: 3.46k, False: 0]
  |  Branch (5834:36): [True: 0, False: 0]
  ------------------
 5835|  3.46k|                    (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) {
  ------------------
  |  Branch (5835:21): [True: 783, False: 2.67k]
  ------------------
 5836|    783|                    *out = cur;
 5837|    783|                    return(0);
 5838|    783|                }
 5839|  3.46k|            }
 5840|  12.5k|            cur = cur->next;
 5841|  12.5k|        }
 5842|  11.4k|        if (orig != node) {
  ------------------
  |  Branch (5842:13): [True: 9.90k, False: 1.51k]
  ------------------
 5843|  9.90k|            cur = node->ns;
 5844|  9.90k|            if (cur != NULL) {
  ------------------
  |  Branch (5844:17): [True: 8.14k, False: 1.76k]
  ------------------
 5845|  8.14k|                if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5845:21): [True: 3.42k, False: 4.72k]
  ------------------
 5846|  3.42k|                    if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5846:26): [True: 3.42k, False: 0]
  |  Branch (5846:40): [True: 0, False: 0]
  ------------------
 5847|  3.42k|                        (xmlNsInScope(doc, orig, node,
  ------------------
  |  Branch (5847:25): [True: 247, False: 3.17k]
  ------------------
 5848|  3.42k|                                      cur->prefix) == 1)) {
 5849|    247|                        *out = cur;
 5850|    247|                        return(0);
 5851|    247|                    }
 5852|  3.42k|                }
 5853|  8.14k|            }
 5854|  9.90k|        }
 5855|       |
 5856|  11.1k|        node = node->parent;
 5857|  11.1k|    }
 5858|       |
 5859|       |    /*
 5860|       |     * The XML-1.0 namespace is normally held on the document
 5861|       |     * element. In this case exceptionally create it on the
 5862|       |     * node element.
 5863|       |     */
 5864|    629|    if ((doc == NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5864:9): [True: 0, False: 629]
  |  Branch (5864:26): [True: 0, False: 0]
  ------------------
 5865|      0|        cur = xmlNewXmlNs();
 5866|      0|        if (cur == NULL)
  ------------------
  |  Branch (5866:13): [True: 0, False: 0]
  ------------------
 5867|      0|            return(-1);
 5868|      0|        cur->next = parent->nsDef;
 5869|      0|        parent->nsDef = cur;
 5870|      0|        *out = cur;
 5871|      0|    }
 5872|       |
 5873|    629|    return(0);
 5874|    629|}
xmlNodeGetAttrValue:
 6351|  6.31M|                    const xmlChar *nsUri, xmlChar **out) {
 6352|  6.31M|    xmlAttrPtr prop;
 6353|       |
 6354|  6.31M|    if (out == NULL)
  ------------------
  |  Branch (6354:9): [True: 0, False: 6.31M]
  ------------------
 6355|      0|        return(1);
 6356|  6.31M|    *out = NULL;
 6357|       |
 6358|  6.31M|    prop = xmlGetPropNodeInternal(node, name, nsUri, 0);
 6359|  6.31M|    if (prop == NULL)
  ------------------
  |  Branch (6359:9): [True: 5.50M, False: 809k]
  ------------------
 6360|  5.50M|	return(1);
 6361|       |
 6362|   809k|    *out = xmlGetPropNodeValueInternal(prop);
 6363|   809k|    if (*out == NULL)
  ------------------
  |  Branch (6363:9): [True: 211, False: 808k]
  ------------------
 6364|    211|        return(-1);
 6365|   808k|    return(0);
 6366|   809k|}
xmlUnsetProp:
 6468|    151|xmlUnsetProp(xmlNode *node, const xmlChar *name) {
 6469|    151|    xmlAttrPtr prop;
 6470|       |
 6471|    151|    prop = xmlGetPropNodeInternal(node, name, NULL, 0);
 6472|    151|    if (prop == NULL)
  ------------------
  |  Branch (6472:9): [True: 35, False: 116]
  ------------------
 6473|     35|	return(-1);
 6474|    116|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6475|    116|    xmlFreeProp(prop);
 6476|    116|    return(0);
 6477|    151|}
xmlUnsetNsProp:
 6488|  10.3k|xmlUnsetNsProp(xmlNode *node, xmlNs *ns, const xmlChar *name) {
 6489|  10.3k|    xmlAttrPtr prop;
 6490|       |
 6491|  10.3k|    prop = xmlGetPropNodeInternal(node, name,
 6492|  10.3k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6492:35): [True: 10.3k, False: 0]
  ------------------
 6493|  10.3k|    if (prop == NULL)
  ------------------
  |  Branch (6493:9): [True: 9.38k, False: 1.00k]
  ------------------
 6494|  9.38k|	return(-1);
 6495|  1.00k|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6496|  1.00k|    xmlFreeProp(prop);
 6497|  1.00k|    return(0);
 6498|  10.3k|}
xmlSetNsProp:
 6553|  1.82k|{
 6554|  1.82k|    xmlAttrPtr prop;
 6555|       |
 6556|  1.82k|    if (ns && (ns->href == NULL))
  ------------------
  |  Branch (6556:9): [True: 1.82k, False: 0]
  |  Branch (6556:15): [True: 0, False: 1.82k]
  ------------------
 6557|      0|	return(NULL);
 6558|  1.82k|    if (name == NULL)
  ------------------
  |  Branch (6558:9): [True: 0, False: 1.82k]
  ------------------
 6559|      0|        return(NULL);
 6560|  1.82k|    prop = xmlGetPropNodeInternal(node, name,
 6561|  1.82k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6561:35): [True: 1.82k, False: 0]
  ------------------
 6562|  1.82k|    if (prop != NULL) {
  ------------------
  |  Branch (6562:9): [True: 1.32k, False: 501]
  ------------------
 6563|  1.32k|        xmlNodePtr children = NULL;
 6564|       |
 6565|       |	/*
 6566|       |	* Modify the attribute's value.
 6567|       |	*/
 6568|  1.32k|        if (value != NULL) {
  ------------------
  |  Branch (6568:13): [True: 1.32k, False: 0]
  ------------------
 6569|  1.32k|	    children = xmlNewDocText(node->doc, value);
 6570|  1.32k|            if (children == NULL)
  ------------------
  |  Branch (6570:17): [True: 9, False: 1.31k]
  ------------------
 6571|      9|                return(NULL);
 6572|  1.32k|        }
 6573|       |
 6574|  1.31k|	if (prop->id != NULL) {
  ------------------
  |  Branch (6574:6): [True: 0, False: 1.31k]
  ------------------
 6575|      0|	    xmlRemoveID(node->doc, prop);
 6576|      0|	    prop->atype = XML_ATTRIBUTE_ID;
 6577|      0|	}
 6578|  1.31k|	if (prop->children != NULL)
  ------------------
  |  Branch (6578:6): [True: 1.28k, False: 23]
  ------------------
 6579|  1.28k|	    xmlFreeNodeList(prop->children);
 6580|  1.31k|	prop->children = NULL;
 6581|  1.31k|	prop->last = NULL;
 6582|  1.31k|	prop->ns = ns;
 6583|  1.31k|	if (value != NULL) {
  ------------------
  |  Branch (6583:6): [True: 1.31k, False: 0]
  ------------------
 6584|  1.31k|	    xmlNodePtr tmp;
 6585|       |
 6586|  1.31k|	    prop->children = children;
 6587|  1.31k|	    prop->last = NULL;
 6588|  1.31k|	    tmp = prop->children;
 6589|  2.62k|	    while (tmp != NULL) {
  ------------------
  |  Branch (6589:13): [True: 1.31k, False: 1.31k]
  ------------------
 6590|  1.31k|		tmp->parent = (xmlNodePtr) prop;
 6591|  1.31k|		if (tmp->next == NULL)
  ------------------
  |  Branch (6591:7): [True: 1.31k, False: 0]
  ------------------
 6592|  1.31k|		    prop->last = tmp;
 6593|  1.31k|		tmp = tmp->next;
 6594|  1.31k|	    }
 6595|  1.31k|	}
 6596|  1.31k|	if ((prop->atype == XML_ATTRIBUTE_ID) &&
  ------------------
  |  Branch (6596:6): [True: 0, False: 1.31k]
  ------------------
 6597|      0|	    (xmlAddIDSafe(prop, value) < 0)) {
  ------------------
  |  Branch (6597:6): [True: 0, False: 0]
  ------------------
 6598|      0|            return(NULL);
 6599|      0|        }
 6600|  1.31k|	return(prop);
 6601|  1.31k|    }
 6602|       |    /*
 6603|       |    * No equal attr found; create a new one.
 6604|       |    */
 6605|    501|    return(xmlNewPropInternal(node, ns, name, value, 0));
 6606|  1.82k|}
xmlNodeIsText:
 6615|  4.42k|xmlNodeIsText(const xmlNode *node) {
 6616|  4.42k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6616:9): [True: 0, False: 4.42k]
  ------------------
 6617|       |
 6618|  4.42k|    if (node->type == XML_TEXT_NODE) return(1);
  ------------------
  |  Branch (6618:9): [True: 579, False: 3.84k]
  ------------------
 6619|  3.84k|    return(0);
 6620|  4.42k|}
xmlIsBlankNode:
 6630|  8.35k|xmlIsBlankNode(const xmlNode *node) {
 6631|  8.35k|    const xmlChar *cur;
 6632|  8.35k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6632:9): [True: 0, False: 8.35k]
  ------------------
 6633|       |
 6634|  8.35k|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (6634:9): [True: 276, False: 8.07k]
  ------------------
 6635|    276|        (node->type != XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (6635:9): [True: 276, False: 0]
  ------------------
 6636|    276|	return(0);
 6637|  8.07k|    if (node->content == NULL) return(1);
  ------------------
  |  Branch (6637:9): [True: 66, False: 8.01k]
  ------------------
 6638|  8.01k|    cur = node->content;
 6639|  17.0k|    while (*cur != 0) {
  ------------------
  |  Branch (6639:12): [True: 13.8k, False: 3.21k]
  ------------------
 6640|  13.8k|	if (!IS_BLANK_CH(*cur)) return(0);
  ------------------
  |  |  137|  13.8k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  13.8k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 4.11k, False: 9.69k]
  |  |  |  |  ------------------
  |  |  |  |   91|  13.8k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 9.67k, False: 12]
  |  |  |  |  |  Branch (91:23): [True: 4.57k, False: 5.10k]
  |  |  |  |  ------------------
  |  |  |  |   92|  13.8k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 314, False: 4.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6641|  9.00k|	cur++;
 6642|  9.00k|    }
 6643|       |
 6644|  3.21k|    return(1);
 6645|  8.01k|}
xmlIsXHTML:
 8846|  24.6k|xmlIsXHTML(const xmlChar *systemID, const xmlChar *publicID) {
 8847|  24.6k|    if ((systemID == NULL) && (publicID == NULL))
  ------------------
  |  Branch (8847:9): [True: 7.22k, False: 17.4k]
  |  Branch (8847:31): [True: 7.22k, False: 0]
  ------------------
 8848|  7.22k|	return(-1);
 8849|  17.4k|    if (publicID != NULL) {
  ------------------
  |  Branch (8849:9): [True: 16.7k, False: 723]
  ------------------
 8850|  16.7k|	if (xmlStrEqual(publicID, XHTML_STRICT_PUBLIC_ID)) return(1);
  ------------------
  |  | 8825|  16.7k|#define XHTML_STRICT_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  16.7k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8826|  16.7k|   "-//W3C//DTD XHTML 1.0 Strict//EN"
  ------------------
  |  Branch (8850:6): [True: 634, False: 16.1k]
  ------------------
 8851|  16.1k|	if (xmlStrEqual(publicID, XHTML_FRAME_PUBLIC_ID)) return(1);
  ------------------
  |  | 8829|  16.1k|#define XHTML_FRAME_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  16.1k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8830|  16.1k|   "-//W3C//DTD XHTML 1.0 Frameset//EN"
  ------------------
  |  Branch (8851:6): [True: 5.55k, False: 10.5k]
  ------------------
 8852|  10.5k|	if (xmlStrEqual(publicID, XHTML_TRANS_PUBLIC_ID)) return(1);
  ------------------
  |  | 8833|  10.5k|#define XHTML_TRANS_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  10.5k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8834|  10.5k|   "-//W3C//DTD XHTML 1.0 Transitional//EN"
  ------------------
  |  Branch (8852:6): [True: 1.52k, False: 9.02k]
  ------------------
 8853|  10.5k|    }
 8854|  9.74k|    if (systemID != NULL) {
  ------------------
  |  Branch (8854:9): [True: 9.74k, False: 0]
  ------------------
 8855|  9.74k|	if (xmlStrEqual(systemID, XHTML_STRICT_SYSTEM_ID)) return(1);
  ------------------
  |  | 8827|  9.74k|#define XHTML_STRICT_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  9.74k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8828|  9.74k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  ------------------
  |  Branch (8855:6): [True: 7.04k, False: 2.70k]
  ------------------
 8856|  2.70k|	if (xmlStrEqual(systemID, XHTML_FRAME_SYSTEM_ID)) return(1);
  ------------------
  |  | 8831|  2.70k|#define XHTML_FRAME_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  2.70k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8832|  2.70k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
  ------------------
  |  Branch (8856:6): [True: 828, False: 1.88k]
  ------------------
 8857|  1.88k|	if (xmlStrEqual(systemID, XHTML_TRANS_SYSTEM_ID)) return(1);
  ------------------
  |  | 8835|  1.88k|#define XHTML_TRANS_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  1.88k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8836|  1.88k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  ------------------
  |  Branch (8857:6): [True: 108, False: 1.77k]
  ------------------
 8858|  1.88k|    }
 8859|  1.77k|    return(0);
 8860|  9.74k|}
tree.c:xmlNewPropInternal:
 1435|  63.8k|{
 1436|  63.8k|    xmlAttrPtr cur;
 1437|  63.8k|    xmlDocPtr doc = NULL;
 1438|       |
 1439|  63.8k|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1439:9): [True: 63.8k, False: 0]
  |  Branch (1439:27): [True: 0, False: 63.8k]
  ------------------
 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|  63.8k|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1451|  63.8k|    if (cur == NULL) {
  ------------------
  |  Branch (1451:9): [True: 20, False: 63.8k]
  ------------------
 1452|     20|        if ((eatname == 1) &&
  ------------------
  |  Branch (1452:13): [True: 0, False: 20]
  ------------------
 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|     20|        return (NULL);
 1458|     20|    }
 1459|  63.8k|    memset(cur, 0, sizeof(xmlAttr));
 1460|  63.8k|    cur->type = XML_ATTRIBUTE_NODE;
 1461|       |
 1462|  63.8k|    cur->parent = node;
 1463|  63.8k|    if (node != NULL) {
  ------------------
  |  Branch (1463:9): [True: 63.8k, False: 0]
  ------------------
 1464|  63.8k|        doc = node->doc;
 1465|  63.8k|        cur->doc = doc;
 1466|  63.8k|    }
 1467|  63.8k|    cur->ns = ns;
 1468|       |
 1469|  63.8k|    if (eatname == 0) {
  ------------------
  |  Branch (1469:9): [True: 63.8k, False: 0]
  ------------------
 1470|  63.8k|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1470:13): [True: 63.8k, False: 0]
  |  Branch (1470:30): [True: 25.7k, False: 38.1k]
  ------------------
 1471|  25.7k|            cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1);
 1472|  38.1k|        else
 1473|  38.1k|            cur->name = xmlStrdup(name);
 1474|  63.8k|        if (cur->name == NULL)
  ------------------
  |  Branch (1474:13): [True: 13, False: 63.8k]
  ------------------
 1475|     13|            goto error;
 1476|  63.8k|    } else
 1477|      0|        cur->name = name;
 1478|       |
 1479|  63.8k|    if (value != NULL) {
  ------------------
  |  Branch (1479:9): [True: 501, False: 63.3k]
  ------------------
 1480|    501|        xmlNodePtr tmp;
 1481|       |
 1482|    501|        cur->children = xmlNewDocText(doc, value);
 1483|    501|        if (cur->children == NULL)
  ------------------
  |  Branch (1483:13): [True: 3, False: 498]
  ------------------
 1484|      3|            goto error;
 1485|    498|        cur->last = NULL;
 1486|    498|        tmp = cur->children;
 1487|    996|        while (tmp != NULL) {
  ------------------
  |  Branch (1487:16): [True: 498, False: 498]
  ------------------
 1488|    498|            tmp->parent = (xmlNodePtr) cur;
 1489|    498|            if (tmp->next == NULL)
  ------------------
  |  Branch (1489:17): [True: 498, False: 0]
  ------------------
 1490|    498|                cur->last = tmp;
 1491|    498|            tmp = tmp->next;
 1492|    498|        }
 1493|       |
 1494|    498|        if (doc != NULL) {
  ------------------
  |  Branch (1494:13): [True: 498, False: 0]
  ------------------
 1495|    498|            int res = xmlIsID(doc, node, cur);
 1496|       |
 1497|    498|            if (res < 0)
  ------------------
  |  Branch (1497:17): [True: 1, False: 497]
  ------------------
 1498|      1|                goto error;
 1499|    497|            if ((res == 1) && (xmlAddIDSafe(cur, value) < 0))
  ------------------
  |  Branch (1499:17): [True: 0, False: 497]
  |  Branch (1499:31): [True: 0, False: 0]
  ------------------
 1500|      0|                goto error;
 1501|    497|        }
 1502|    498|    }
 1503|       |
 1504|       |    /*
 1505|       |     * Add it at the end to preserve parsing order ...
 1506|       |     */
 1507|  63.8k|    if (node != NULL) {
  ------------------
  |  Branch (1507:9): [True: 63.8k, False: 0]
  ------------------
 1508|  63.8k|        if (node->properties == NULL) {
  ------------------
  |  Branch (1508:13): [True: 43.5k, False: 20.2k]
  ------------------
 1509|  43.5k|            node->properties = cur;
 1510|  43.5k|        } else {
 1511|  20.2k|            xmlAttrPtr prev = node->properties;
 1512|       |
 1513|   124k|            while (prev->next != NULL)
  ------------------
  |  Branch (1513:20): [True: 104k, False: 20.2k]
  ------------------
 1514|   104k|                prev = prev->next;
 1515|  20.2k|            prev->next = cur;
 1516|  20.2k|            cur->prev = prev;
 1517|  20.2k|        }
 1518|  63.8k|    }
 1519|       |
 1520|  63.8k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1520:9): [True: 0, False: 63.8k]
  |  Branch (1520:35): [True: 0, False: 0]
  ------------------
 1521|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1522|  63.8k|    return (cur);
 1523|       |
 1524|     17|error:
 1525|     17|    xmlFreeProp(cur);
 1526|       |    return(NULL);
 1527|  63.8k|}
tree.c:xmlNewElem:
 1842|   693k|           const xmlChar *content) {
 1843|   693k|    xmlNodePtr cur;
 1844|       |
 1845|   693k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1846|   693k|    if (cur == NULL)
  ------------------
  |  Branch (1846:9): [True: 96, False: 693k]
  ------------------
 1847|     96|	return(NULL);
 1848|   693k|    memset(cur, 0, sizeof(xmlNode));
 1849|       |
 1850|   693k|    cur->type = XML_ELEMENT_NODE;
 1851|   693k|    cur->doc = doc;
 1852|   693k|    cur->name = name;
 1853|   693k|    cur->ns = ns;
 1854|       |
 1855|   693k|    if (content != NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 693k]
  ------------------
 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|   693k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1868:9): [True: 0, False: 693k]
  |  Branch (1868:35): [True: 0, False: 0]
  ------------------
 1869|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1870|       |
 1871|   693k|    return(cur);
 1872|   693k|}
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: 6, False: 23.4k]
  ------------------
 2145|      6|        xmlFree(name);
 2146|      6|	return(NULL);
 2147|      6|    }
 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|   121k|              xmlNodePtr prev, xmlNodePtr next, int coalesce) {
 2792|   121k|    xmlNodePtr oldParent;
 2793|       |
 2794|   121k|    if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (2794:9): [True: 0, False: 121k]
  ------------------
 2795|      0|	return xmlInsertProp(doc, cur, parent, prev, next);
 2796|       |
 2797|       |    /*
 2798|       |     * Coalesce text nodes
 2799|       |     */
 2800|   121k|    if ((coalesce) && (cur->type == XML_TEXT_NODE)) {
  ------------------
  |  Branch (2800:9): [True: 0, False: 121k]
  |  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|   121k|    oldParent = cur->parent;
 2829|   121k|    if (oldParent != NULL) {
  ------------------
  |  Branch (2829:9): [True: 0, False: 121k]
  ------------------
 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|   121k|    if (cur->next != NULL)
  ------------------
  |  Branch (2835:9): [True: 104k, False: 16.3k]
  ------------------
 2836|   104k|        cur->next->prev = cur->prev;
 2837|   121k|    if (cur->prev != NULL)
  ------------------
  |  Branch (2837:9): [True: 0, False: 121k]
  ------------------
 2838|      0|        cur->prev->next = cur->next;
 2839|       |
 2840|   121k|    if (cur->doc != doc) {
  ------------------
  |  Branch (2840:9): [True: 0, False: 121k]
  ------------------
 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|   121k|    cur->parent = parent;
 2857|   121k|    cur->prev = prev;
 2858|   121k|    cur->next = next;
 2859|       |
 2860|   121k|    if (prev == NULL) {
  ------------------
  |  Branch (2860:9): [True: 0, False: 121k]
  ------------------
 2861|      0|        if (parent != NULL)
  ------------------
  |  Branch (2861:13): [True: 0, False: 0]
  ------------------
 2862|      0|            parent->children = cur;
 2863|   121k|    } else {
 2864|   121k|        prev->next = cur;
 2865|   121k|    }
 2866|   121k|    if (next == NULL) {
  ------------------
  |  Branch (2866:9): [True: 1.08k, False: 120k]
  ------------------
 2867|  1.08k|        if (parent != NULL)
  ------------------
  |  Branch (2867:13): [True: 1.08k, False: 0]
  ------------------
 2868|  1.08k|            parent->last = cur;
 2869|   120k|    } else {
 2870|   120k|        next->prev = cur;
 2871|   120k|    }
 2872|       |
 2873|   121k|    return(cur);
 2874|   121k|}
tree.c:xmlTextSetContent:
 2717|     25|xmlTextSetContent(xmlNodePtr text, xmlChar *content) {
 2718|     25|    if ((text->content != NULL) &&
  ------------------
  |  Branch (2718:9): [True: 0, False: 25]
  ------------------
 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|     25|    text->content = content;
 2729|       |    text->properties = NULL;
 2730|     25|}
tree.c:xmlTextAddContent:
 2733|     26|xmlTextAddContent(xmlNodePtr text, const xmlChar *content, int len) {
 2734|     26|    xmlChar *merged;
 2735|       |
 2736|     26|    if (content == NULL)
  ------------------
  |  Branch (2736:9): [True: 0, False: 26]
  ------------------
 2737|      0|        return(0);
 2738|       |
 2739|     26|    merged = xmlStrncatNew(text->content, content, len);
 2740|     26|    if (merged == NULL)
  ------------------
  |  Branch (2740:9): [True: 1, False: 25]
  ------------------
 2741|      1|        return(-1);
 2742|       |
 2743|     25|    xmlTextSetContent(text, merged);
 2744|     25|    return(0);
 2745|     26|}
tree.c:xmlUnlinkNodeInternal:
 3485|   569k|xmlUnlinkNodeInternal(xmlNodePtr cur) {
 3486|   569k|    if (cur->parent != NULL) {
  ------------------
  |  Branch (3486:9): [True: 536k, False: 32.4k]
  ------------------
 3487|   536k|	xmlNodePtr parent;
 3488|   536k|	parent = cur->parent;
 3489|   536k|	if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3489:6): [True: 1.11k, False: 535k]
  ------------------
 3490|  1.11k|	    if (parent->properties == (xmlAttrPtr) cur)
  ------------------
  |  Branch (3490:10): [True: 1.05k, False: 58]
  ------------------
 3491|  1.05k|		parent->properties = ((xmlAttrPtr) cur)->next;
 3492|   535k|	} else {
 3493|   535k|	    if (parent->children == cur)
  ------------------
  |  Branch (3493:10): [True: 189k, False: 345k]
  ------------------
 3494|   189k|		parent->children = cur->next;
 3495|   535k|	    if (parent->last == cur)
  ------------------
  |  Branch (3495:10): [True: 37.2k, False: 498k]
  ------------------
 3496|  37.2k|		parent->last = cur->prev;
 3497|   535k|	}
 3498|   536k|	cur->parent = NULL;
 3499|   536k|    }
 3500|       |
 3501|   569k|    if (cur->next != NULL)
  ------------------
  |  Branch (3501:9): [True: 498k, False: 70.3k]
  ------------------
 3502|   498k|        cur->next->prev = cur->prev;
 3503|   569k|    if (cur->prev != NULL)
  ------------------
  |  Branch (3503:9): [True: 346k, False: 223k]
  ------------------
 3504|   346k|        cur->prev->next = cur->next;
 3505|   569k|    cur->next = NULL;
 3506|       |    cur->prev = NULL;
 3507|   569k|}
tree.c:xmlCopyPropInternal:
 3660|  1.57M|xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) {
 3661|  1.57M|    xmlAttrPtr ret = NULL;
 3662|       |
 3663|  1.57M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3663:9): [True: 0, False: 1.57M]
  ------------------
 3664|  1.57M|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3664:9): [True: 1.57M, False: 0]
  |  Branch (3664:29): [True: 0, False: 1.57M]
  ------------------
 3665|      0|        return(NULL);
 3666|  1.57M|    if (target != NULL)
  ------------------
  |  Branch (3666:9): [True: 1.57M, False: 0]
  ------------------
 3667|  1.57M|	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.57M|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (3676:9): [True: 1.84k, False: 1.56M]
  ------------------
 3677|  1.56M|    ret->parent = target;
 3678|       |
 3679|  1.56M|    if ((cur->ns != NULL) && (target != NULL)) {
  ------------------
  |  Branch (3679:9): [True: 820k, False: 749k]
  |  Branch (3679:30): [True: 820k, False: 0]
  ------------------
 3680|   820k|      xmlNsPtr ns;
 3681|   820k|      int res;
 3682|       |
 3683|   820k|      res = xmlSearchNsSafe(target, cur->ns->prefix, &ns);
 3684|   820k|      if (res < 0)
  ------------------
  |  Branch (3684:11): [True: 2, False: 820k]
  ------------------
 3685|      2|          goto error;
 3686|   820k|      if (ns == NULL) {
  ------------------
  |  Branch (3686:11): [True: 506, False: 819k]
  ------------------
 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|    506|        res = xmlSearchNsSafe(cur->parent, cur->ns->prefix, &ns);
 3693|    506|        if (res < 0)
  ------------------
  |  Branch (3693:13): [True: 0, False: 506]
  ------------------
 3694|      0|          goto error;
 3695|    506|        if (ns != NULL) {
  ------------------
  |  Branch (3695:13): [True: 506, False: 0]
  ------------------
 3696|    506|          xmlNodePtr root = target;
 3697|    506|          xmlNodePtr pred = NULL;
 3698|       |
 3699|    744|          while (root->parent != NULL) {
  ------------------
  |  Branch (3699:18): [True: 238, False: 506]
  ------------------
 3700|    238|            pred = root;
 3701|    238|            root = root->parent;
 3702|    238|          }
 3703|    506|          if (root == (xmlNodePtr) target->doc) {
  ------------------
  |  Branch (3703:15): [True: 0, False: 506]
  ------------------
 3704|       |            /* correct possibly cycling above the document elt */
 3705|      0|            root = pred;
 3706|      0|          }
 3707|    506|          ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3708|    506|          if (ret->ns == NULL)
  ------------------
  |  Branch (3708:15): [True: 1, False: 505]
  ------------------
 3709|      1|              goto error;
 3710|    506|        }
 3711|   819k|      } 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|   819k|        if (xmlStrEqual(ns->href, cur->ns->href)) {
  ------------------
  |  Branch (3717:13): [True: 817k, False: 1.65k]
  ------------------
 3718|       |          /* this is the nice case */
 3719|   817k|          ret->ns = ns;
 3720|   817k|        } else {
 3721|       |          /*
 3722|       |           * we are in trouble: we need a new reconciled namespace.
 3723|       |           * This is expensive
 3724|       |           */
 3725|  1.65k|          ret->ns = xmlNewReconciledNs(target, cur->ns);
 3726|  1.65k|          if (ret->ns == NULL)
  ------------------
  |  Branch (3726:15): [True: 1, False: 1.65k]
  ------------------
 3727|      1|              goto error;
 3728|  1.65k|        }
 3729|   819k|      }
 3730|       |
 3731|   820k|    } else
 3732|   749k|        ret->ns = NULL;
 3733|       |
 3734|  1.56M|    if (cur->children != NULL) {
  ------------------
  |  Branch (3734:9): [True: 1.20M, False: 363k]
  ------------------
 3735|  1.20M|	xmlNodePtr tmp;
 3736|       |
 3737|  1.20M|	ret->children = xmlStaticCopyNodeList(cur->children, ret->doc, (xmlNodePtr) ret);
 3738|  1.20M|        if (ret->children == NULL)
  ------------------
  |  Branch (3738:13): [True: 29, False: 1.20M]
  ------------------
 3739|     29|            goto error;
 3740|  1.20M|	ret->last = NULL;
 3741|  1.20M|	tmp = ret->children;
 3742|  2.41M|	while (tmp != NULL) {
  ------------------
  |  Branch (3742:9): [True: 1.20M, False: 1.20M]
  ------------------
 3743|       |	    /* tmp->parent = (xmlNodePtr)ret; */
 3744|  1.20M|	    if (tmp->next == NULL)
  ------------------
  |  Branch (3744:10): [True: 1.20M, False: 620]
  ------------------
 3745|  1.20M|	        ret->last = tmp;
 3746|  1.20M|	    tmp = tmp->next;
 3747|  1.20M|	}
 3748|  1.20M|    }
 3749|       |    /*
 3750|       |     * Try to handle IDs
 3751|       |     */
 3752|  1.56M|    if ((target != NULL) && (cur != NULL) &&
  ------------------
  |  Branch (3752:9): [True: 1.56M, False: 0]
  |  Branch (3752:29): [True: 1.56M, False: 0]
  ------------------
 3753|  1.56M|	(target->doc != NULL) && (cur->doc != NULL) &&
  ------------------
  |  Branch (3753:2): [True: 1.56M, False: 104]
  |  Branch (3753:27): [True: 1.56M, False: 0]
  ------------------
 3754|  1.56M|        (cur->parent != NULL) &&
  ------------------
  |  Branch (3754:9): [True: 1.56M, False: 0]
  ------------------
 3755|  1.56M|        (cur->children != NULL)) {
  ------------------
  |  Branch (3755:9): [True: 1.20M, False: 363k]
  ------------------
 3756|  1.20M|        int res = xmlIsID(cur->doc, cur->parent, cur);
 3757|       |
 3758|  1.20M|        if (res < 0)
  ------------------
  |  Branch (3758:13): [True: 3, False: 1.20M]
  ------------------
 3759|      3|            goto error;
 3760|  1.20M|	if (res != 0) {
  ------------------
  |  Branch (3760:6): [True: 3.95k, False: 1.20M]
  ------------------
 3761|  3.95k|	    xmlChar *id;
 3762|       |
 3763|  3.95k|	    id = xmlNodeGetContent((xmlNodePtr) cur);
 3764|  3.95k|	    if (id == NULL)
  ------------------
  |  Branch (3764:10): [True: 2, False: 3.94k]
  ------------------
 3765|      2|                goto error;
 3766|  3.94k|            res = xmlAddIDSafe(ret, id);
 3767|  3.94k|	    xmlFree(id);
 3768|  3.94k|            if (res < 0)
  ------------------
  |  Branch (3768:17): [True: 4, False: 3.94k]
  ------------------
 3769|      4|                goto error;
 3770|  3.94k|	}
 3771|  1.20M|    }
 3772|  1.56M|    return(ret);
 3773|       |
 3774|     42|error:
 3775|     42|    xmlFreeProp(ret);
 3776|       |    return(NULL);
 3777|  1.56M|}
tree.c:xmlGetEntityFromDtd:
  119|  1.60k|xmlGetEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  120|  1.60k|    xmlEntitiesTablePtr table;
  121|       |
  122|  1.60k|    if((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (122:8): [True: 1.60k, False: 0]
  |  Branch (122:25): [True: 1.60k, False: 0]
  ------------------
  123|  1.60k|	table = (xmlEntitiesTablePtr) dtd->entities;
  124|  1.60k|	return((xmlEntityPtr) xmlHashLookup(table, name));
  125|       |	/* return(xmlGetEntityFromTable(table, name)); */
  126|  1.60k|    }
  127|      0|    return(NULL);
  128|  1.60k|}
tree.c:xmlGetParameterEntityFromDtd:
  137|    270|xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  138|    270|    xmlEntitiesTablePtr table;
  139|       |
  140|    270|    if ((dtd != NULL) && (dtd->pentities != NULL)) {
  ------------------
  |  Branch (140:9): [True: 270, False: 0]
  |  Branch (140:26): [True: 270, False: 0]
  ------------------
  141|    270|	table = (xmlEntitiesTablePtr) dtd->pentities;
  142|    270|	return((xmlEntityPtr) xmlHashLookup(table, name));
  143|       |	/* return(xmlGetEntityFromTable(table, name)); */
  144|    270|    }
  145|      0|    return(NULL);
  146|    270|}
tree.c:xmlGetLineNoInternal:
 4398|  57.5k|{
 4399|  57.5k|    long result = -1;
 4400|       |
 4401|  57.5k|    if (depth >= 5)
  ------------------
  |  Branch (4401:9): [True: 5.56k, False: 52.0k]
  ------------------
 4402|  5.56k|        return(-1);
 4403|       |
 4404|  52.0k|    if (!node)
  ------------------
  |  Branch (4404:9): [True: 0, False: 52.0k]
  ------------------
 4405|      0|        return result;
 4406|  52.0k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4406:9): [True: 41.2k, False: 10.7k]
  ------------------
 4407|  10.7k|        (node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4407:9): [True: 9.15k, False: 1.57k]
  ------------------
 4408|  1.57k|	(node->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4408:2): [True: 76, False: 1.50k]
  ------------------
 4409|  51.0k|	(node->type == XML_PI_NODE)) {
  ------------------
  |  Branch (4409:2): [True: 535, False: 967]
  ------------------
 4410|  51.0k|	if (node->line == 65535) {
  ------------------
  |  Branch (4410:6): [True: 37.8k, False: 13.1k]
  ------------------
 4411|  37.8k|	    if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
  ------------------
  |  Branch (4411:10): [True: 9.15k, False: 28.7k]
  |  Branch (4411:43): [True: 1.06k, False: 8.09k]
  ------------------
 4412|  1.06k|	        result = XML_PTR_TO_INT(node->psvi);
  ------------------
  |  |   58|  1.06k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 4413|  36.8k|	    else if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (4413:15): [True: 28.1k, False: 8.70k]
  ------------------
 4414|  28.1k|	             (node->children != NULL))
  ------------------
  |  Branch (4414:15): [True: 3.42k, False: 24.7k]
  ------------------
 4415|  3.42k|	        result = xmlGetLineNoInternal(node->children, depth + 1);
 4416|  33.4k|	    else if (node->next != NULL)
  ------------------
  |  Branch (4416:15): [True: 10.8k, False: 22.5k]
  ------------------
 4417|  10.8k|	        result = xmlGetLineNoInternal(node->next, depth + 1);
 4418|  22.5k|	    else if (node->prev != NULL)
  ------------------
  |  Branch (4418:15): [True: 15.4k, False: 7.17k]
  ------------------
 4419|  15.4k|	        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4420|  37.8k|	}
 4421|  51.0k|	if ((result == -1) || (result == 65535))
  ------------------
  |  Branch (4421:6): [True: 25.8k, False: 25.1k]
  |  Branch (4421:24): [True: 22.2k, False: 2.93k]
  ------------------
 4422|  48.0k|	    result = node->line;
 4423|  51.0k|    } else if ((node->prev != NULL) &&
  ------------------
  |  Branch (4423:16): [True: 855, False: 112]
  ------------------
 4424|    855|             ((node->prev->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4424:15): [True: 110, False: 745]
  ------------------
 4425|    745|	      (node->prev->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4425:8): [True: 394, False: 351]
  ------------------
 4426|    351|	      (node->prev->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4426:8): [True: 0, False: 351]
  ------------------
 4427|    351|	      (node->prev->type == XML_PI_NODE)))
  ------------------
  |  Branch (4427:8): [True: 72, False: 279]
  ------------------
 4428|    576|        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4429|    391|    else if ((node->parent != NULL) &&
  ------------------
  |  Branch (4429:14): [True: 391, False: 0]
  ------------------
 4430|    391|             (node->parent->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (4430:14): [True: 390, False: 1]
  ------------------
 4431|    390|        result = xmlGetLineNoInternal(node->parent, depth + 1);
 4432|       |
 4433|  52.0k|    return result;
 4434|  52.0k|}
tree.c:xmlBufGetChildContent:
 5157|   170k|xmlBufGetChildContent(xmlBufPtr buf, const xmlNode *tree) {
 5158|   170k|    const xmlNode *cur = tree->children;
 5159|       |
 5160|  20.1M|    while (cur != NULL) {
  ------------------
  |  Branch (5160:12): [True: 20.1M, False: 1.58k]
  ------------------
 5161|  20.1M|        switch (cur->type) {
 5162|  4.23M|            case XML_TEXT_NODE:
  ------------------
  |  Branch (5162:13): [True: 4.23M, False: 15.9M]
  ------------------
 5163|  4.25M|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5163:13): [True: 20.6k, False: 20.1M]
  ------------------
 5164|  4.25M|                xmlBufCat(buf, cur->content);
 5165|  4.25M|                break;
 5166|       |
 5167|  2.15k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5167:13): [True: 2.15k, False: 20.1M]
  ------------------
 5168|  2.15k|                xmlBufGetEntityRefContent(buf, cur);
 5169|  2.15k|                break;
 5170|       |
 5171|  15.9M|            default:
  ------------------
  |  Branch (5171:13): [True: 15.9M, False: 4.26M]
  ------------------
 5172|  15.9M|                if (cur->children != NULL) {
  ------------------
  |  Branch (5172:21): [True: 14.1M, False: 1.77M]
  ------------------
 5173|  14.1M|                    cur = cur->children;
 5174|  14.1M|                    continue;
 5175|  14.1M|                }
 5176|  1.77M|                break;
 5177|  20.1M|        }
 5178|       |
 5179|  20.1M|        while (cur->next == NULL) {
  ------------------
  |  Branch (5179:16): [True: 14.3M, False: 5.86M]
  ------------------
 5180|  14.3M|            cur = cur->parent;
 5181|  14.3M|            if (cur == tree)
  ------------------
  |  Branch (5181:17): [True: 169k, False: 14.1M]
  ------------------
 5182|   169k|                return;
 5183|  14.3M|        }
 5184|  5.86M|        cur = cur->next;
 5185|  5.86M|    }
 5186|   170k|}
tree.c:xmlBufGetEntityRefContent:
 5126|  2.67k|xmlBufGetEntityRefContent(xmlBufPtr buf, const xmlNode *ref) {
 5127|  2.67k|    xmlEntityPtr ent;
 5128|       |
 5129|  2.67k|    if (ref->children != NULL) {
  ------------------
  |  Branch (5129:9): [True: 2.43k, False: 235]
  ------------------
 5130|  2.43k|        ent = (xmlEntityPtr) ref->children;
 5131|  2.43k|    } else {
 5132|       |        /* lookup entity declaration */
 5133|    235|        ent = xmlGetDocEntity(ref->doc, ref->name);
 5134|    235|        if (ent == NULL)
  ------------------
  |  Branch (5134:13): [True: 235, False: 0]
  ------------------
 5135|    235|            return;
 5136|    235|    }
 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.43k|    if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (5143:9): [True: 0, False: 2.43k]
  ------------------
 5144|      0|        xmlBufCat(buf, ent->content);
 5145|      0|        return;
 5146|      0|    }
 5147|       |
 5148|  2.43k|    if (ent->flags & XML_ENT_EXPANDING)
  ------------------
  |  |   22|  2.43k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (5148:9): [True: 0, False: 2.43k]
  ------------------
 5149|      0|        return;
 5150|       |
 5151|  2.43k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.43k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5152|  2.43k|    xmlBufGetChildContent(buf, (xmlNodePtr) ent);
 5153|  2.43k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.43k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5154|  2.43k|}
tree.c:xmlTreeEnsureXMLDecl:
 5626|   867k|{
 5627|   867k|    xmlNsPtr ns;
 5628|       |
 5629|   867k|    ns = doc->oldNs;
 5630|   867k|    if (ns != NULL)
  ------------------
  |  Branch (5630:9): [True: 861k, False: 5.33k]
  ------------------
 5631|   861k|	return (ns);
 5632|       |
 5633|  5.33k|    ns = xmlNewXmlNs();
 5634|  5.33k|    doc->oldNs = ns;
 5635|       |
 5636|  5.33k|    return(ns);
 5637|   867k|}
tree.c:xmlNewXmlNs:
 5594|  5.96k|xmlNewXmlNs(void) {
 5595|  5.96k|    xmlNsPtr ns;
 5596|       |
 5597|  5.96k|    ns = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 5598|  5.96k|    if (ns == NULL)
  ------------------
  |  Branch (5598:9): [True: 10, False: 5.95k]
  ------------------
 5599|     10|        return(NULL);
 5600|  5.95k|    memset(ns, 0, sizeof(xmlNs));
 5601|  5.95k|    ns->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  5.95k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
 5602|  5.95k|    ns->href = xmlStrdup(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  5.95k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 5603|  5.95k|    if (ns->href == NULL) {
  ------------------
  |  Branch (5603:9): [True: 9, False: 5.94k]
  ------------------
 5604|      9|        xmlFreeNs(ns);
 5605|      9|        return(NULL);
 5606|      9|    }
 5607|  5.94k|    ns->prefix = xmlStrdup(BAD_CAST "xml");
  ------------------
  |  |   34|  5.94k|#define BAD_CAST (xmlChar *)
  ------------------
 5608|  5.94k|    if (ns->prefix == NULL) {
  ------------------
  |  Branch (5608:9): [True: 9, False: 5.93k]
  ------------------
 5609|      9|        xmlFreeNs(ns);
 5610|      9|        return(NULL);
 5611|      9|    }
 5612|       |
 5613|  5.93k|    return(ns);
 5614|  5.94k|}
tree.c:xmlNsInScope:
 5759|  6.88k|{
 5760|  6.88k|    xmlNsPtr tst;
 5761|       |
 5762|  14.4k|    while ((node != NULL) && (node != ancestor)) {
  ------------------
  |  Branch (5762:12): [True: 14.4k, False: 0]
  |  Branch (5762:30): [True: 13.3k, False: 1.03k]
  ------------------
 5763|  13.3k|        if ((node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (5763:13): [True: 0, False: 13.3k]
  ------------------
 5764|  13.3k|            (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (5764:13): [True: 0, False: 13.3k]
  ------------------
 5765|      0|            return (-1);
 5766|  13.3k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5766:13): [True: 13.3k, False: 0]
  ------------------
 5767|  13.3k|            tst = node->nsDef;
 5768|  22.9k|            while (tst != NULL) {
  ------------------
  |  Branch (5768:20): [True: 15.3k, False: 7.52k]
  ------------------
 5769|  15.3k|                if ((tst->prefix == NULL)
  ------------------
  |  Branch (5769:21): [True: 1.91k, False: 13.4k]
  ------------------
 5770|  1.91k|                    && (prefix == NULL))
  ------------------
  |  Branch (5770:24): [True: 165, False: 1.75k]
  ------------------
 5771|    165|                    return (0);
 5772|  15.2k|                if ((tst->prefix != NULL)
  ------------------
  |  Branch (5772:21): [True: 13.4k, False: 1.75k]
  ------------------
 5773|  13.4k|                    && (prefix != NULL)
  ------------------
  |  Branch (5773:24): [True: 11.7k, False: 1.67k]
  ------------------
 5774|  11.7k|                    && (xmlStrEqual(tst->prefix, prefix)))
  ------------------
  |  Branch (5774:24): [True: 5.69k, False: 6.10k]
  ------------------
 5775|  5.69k|                    return (0);
 5776|  9.52k|                tst = tst->next;
 5777|  9.52k|            }
 5778|  13.3k|        }
 5779|  7.52k|        node = node->parent;
 5780|  7.52k|    }
 5781|  1.03k|    if (node != ancestor)
  ------------------
  |  Branch (5781:9): [True: 0, False: 1.03k]
  ------------------
 5782|      0|        return (-1);
 5783|  1.03k|    return (1);
 5784|  1.03k|}
tree.c:xmlNewReconciledNs:
 5909|  1.65k|xmlNewReconciledNs(xmlNodePtr tree, xmlNsPtr ns) {
 5910|  1.65k|    xmlNsPtr def;
 5911|  1.65k|    xmlChar prefix[50];
 5912|  1.65k|    int counter = 1;
 5913|  1.65k|    int res;
 5914|       |
 5915|  1.65k|    if ((tree == NULL) || (tree->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5915:9): [True: 0, False: 1.65k]
  |  Branch (5915:27): [True: 0, False: 1.65k]
  ------------------
 5916|      0|	return(NULL);
 5917|      0|    }
 5918|  1.65k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (5918:9): [True: 0, False: 1.65k]
  |  Branch (5918:25): [True: 0, False: 1.65k]
  ------------------
 5919|      0|	return(NULL);
 5920|      0|    }
 5921|       |    /*
 5922|       |     * Search an existing namespace definition inherited.
 5923|       |     */
 5924|  1.65k|    res = xmlSearchNsByHrefSafe(tree, ns->href, &def);
 5925|  1.65k|    if (res < 0)
  ------------------
  |  Branch (5925:9): [True: 0, False: 1.65k]
  ------------------
 5926|      0|        return(NULL);
 5927|  1.65k|    if (def != NULL)
  ------------------
  |  Branch (5927:9): [True: 1.03k, False: 629]
  ------------------
 5928|  1.03k|        return(def);
 5929|       |
 5930|       |    /*
 5931|       |     * Find a close prefix which is not already in use.
 5932|       |     * Let's strip namespace prefixes longer than 20 chars !
 5933|       |     */
 5934|    629|    if (ns->prefix == NULL)
  ------------------
  |  Branch (5934:9): [True: 0, False: 629]
  ------------------
 5935|      0|	snprintf((char *) prefix, sizeof(prefix), "default");
 5936|    629|    else
 5937|    629|	snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix);
 5938|       |
 5939|    629|    res = xmlSearchNsSafe(tree, prefix, &def);
 5940|    629|    if (res < 0)
  ------------------
  |  Branch (5940:9): [True: 0, False: 629]
  ------------------
 5941|      0|        return(NULL);
 5942|  2.04k|    while (def != NULL) {
  ------------------
  |  Branch (5942:12): [True: 1.42k, False: 629]
  ------------------
 5943|  1.42k|        if (counter > 1000) return(NULL);
  ------------------
  |  Branch (5943:13): [True: 0, False: 1.42k]
  ------------------
 5944|  1.42k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (5944:6): [True: 0, False: 1.42k]
  ------------------
 5945|      0|	    snprintf((char *) prefix, sizeof(prefix), "default%d", counter++);
 5946|  1.42k|	else
 5947|  1.42k|	    snprintf((char *) prefix, sizeof(prefix), "%.20s%d",
 5948|  1.42k|		(char *)ns->prefix, counter++);
 5949|  1.42k|	res = xmlSearchNsSafe(tree, prefix, &def);
 5950|  1.42k|        if (res < 0)
  ------------------
  |  Branch (5950:13): [True: 0, False: 1.42k]
  ------------------
 5951|      0|            return(NULL);
 5952|  1.42k|    }
 5953|       |
 5954|       |    /*
 5955|       |     * OK, now we are ready to create a new one.
 5956|       |     */
 5957|    629|    def = xmlNewNs(tree, ns->href, prefix);
 5958|    629|    return(def);
 5959|    629|}
tree.c:xmlGetPropNodeInternal:
 6119|  6.32M|{
 6120|  6.32M|    xmlAttrPtr prop;
 6121|       |
 6122|       |    /* Avoid unused variable warning if features are disabled. */
 6123|  6.32M|    (void) useDTD;
 6124|       |
 6125|  6.32M|    if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
  ------------------
  |  Branch (6125:9): [True: 0, False: 6.32M]
  |  Branch (6125:27): [True: 13.0k, False: 6.31M]
  |  Branch (6125:63): [True: 0, False: 6.31M]
  ------------------
 6126|  13.0k|	return(NULL);
 6127|       |
 6128|  6.31M|    if (node->properties != NULL) {
  ------------------
  |  Branch (6128:9): [True: 1.73M, False: 4.57M]
  ------------------
 6129|  1.73M|	prop = node->properties;
 6130|  1.73M|	if (nsName == NULL) {
  ------------------
  |  Branch (6130:6): [True: 59.3k, False: 1.67M]
  ------------------
 6131|       |	    /*
 6132|       |	    * We want the attr to be in no namespace.
 6133|       |	    */
 6134|  98.4k|	    do {
 6135|  98.4k|		if ((prop->ns == NULL) && xmlStrEqual(prop->name, name)) {
  ------------------
  |  Branch (6135:7): [True: 89.1k, False: 9.33k]
  |  Branch (6135:29): [True: 28.7k, False: 60.3k]
  ------------------
 6136|  28.7k|		    return(prop);
 6137|  28.7k|		}
 6138|  69.7k|		prop = prop->next;
 6139|  69.7k|	    } while (prop != NULL);
  ------------------
  |  Branch (6139:15): [True: 39.1k, False: 30.5k]
  ------------------
 6140|  1.67M|	} else {
 6141|       |	    /*
 6142|       |	    * We want the attr to be in the specified namespace.
 6143|       |	    */
 6144|  2.49M|	    do {
 6145|  2.49M|		if ((prop->ns != NULL) && xmlStrEqual(prop->name, name) &&
  ------------------
  |  Branch (6145:7): [True: 1.56M, False: 936k]
  |  Branch (6145:29): [True: 783k, False: 779k]
  ------------------
 6146|   783k|		    ((prop->ns->href == nsName) ||
  ------------------
  |  Branch (6146:8): [True: 1.58k, False: 781k]
  ------------------
 6147|   781k|		     xmlStrEqual(prop->ns->href, nsName)))
  ------------------
  |  Branch (6147:8): [True: 781k, False: 633]
  ------------------
 6148|   782k|		{
 6149|   782k|		    return(prop);
 6150|   782k|		}
 6151|  1.71M|		prop = prop->next;
 6152|  1.71M|	    } while (prop != NULL);
  ------------------
  |  Branch (6152:15): [True: 823k, False: 893k]
  ------------------
 6153|  1.67M|	}
 6154|  1.73M|    }
 6155|       |
 6156|  5.50M|    if (! useDTD)
  ------------------
  |  Branch (6156:9): [True: 5.50M, False: 0]
  ------------------
 6157|  5.50M|	return(NULL);
 6158|       |    /*
 6159|       |     * Check if there is a default/fixed attribute declaration in
 6160|       |     * the internal or external subset.
 6161|       |     */
 6162|      0|    if ((node->doc != NULL) && (node->doc->intSubset != NULL)) {
  ------------------
  |  Branch (6162:9): [True: 0, False: 0]
  |  Branch (6162:32): [True: 0, False: 0]
  ------------------
 6163|      0|	xmlDocPtr doc = node->doc;
 6164|      0|	xmlAttributePtr attrDecl = NULL;
 6165|      0|	xmlChar *elemQName, *tmpstr = NULL;
 6166|       |
 6167|       |	/*
 6168|       |	* We need the QName of the element for the DTD-lookup.
 6169|       |	*/
 6170|      0|	if ((node->ns != NULL) && (node->ns->prefix != NULL)) {
  ------------------
  |  Branch (6170:6): [True: 0, False: 0]
  |  Branch (6170:28): [True: 0, False: 0]
  ------------------
 6171|      0|	    tmpstr = xmlStrdup(node->ns->prefix);
 6172|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6172:10): [True: 0, False: 0]
  ------------------
 6173|      0|		return(NULL);
 6174|      0|	    tmpstr = xmlStrcat(tmpstr, BAD_CAST ":");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6175|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6175:10): [True: 0, False: 0]
  ------------------
 6176|      0|		return(NULL);
 6177|      0|	    tmpstr = xmlStrcat(tmpstr, node->name);
 6178|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6178:10): [True: 0, False: 0]
  ------------------
 6179|      0|		return(NULL);
 6180|      0|	    elemQName = tmpstr;
 6181|      0|	} else
 6182|      0|	    elemQName = (xmlChar *) node->name;
 6183|      0|	if (nsName == NULL) {
  ------------------
  |  Branch (6183:6): [True: 0, False: 0]
  ------------------
 6184|       |	    /*
 6185|       |	    * The common and nice case: Attr in no namespace.
 6186|       |	    */
 6187|      0|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
 6188|      0|		elemQName, name, NULL);
 6189|      0|	    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (6189:10): [True: 0, False: 0]
  |  Branch (6189:32): [True: 0, False: 0]
  ------------------
 6190|      0|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
 6191|      0|		    elemQName, name, NULL);
 6192|      0|	    }
 6193|      0|        } else if (xmlStrEqual(nsName, XML_XML_NAMESPACE)) {
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (6193:20): [True: 0, False: 0]
  ------------------
 6194|       |	    /*
 6195|       |	    * The XML namespace must be bound to prefix 'xml'.
 6196|       |	    */
 6197|      0|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
 6198|      0|		elemQName, name, BAD_CAST "xml");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6199|      0|	    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (6199:10): [True: 0, False: 0]
  |  Branch (6199:32): [True: 0, False: 0]
  ------------------
 6200|      0|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
 6201|      0|		    elemQName, name, BAD_CAST "xml");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6202|      0|	    }
 6203|      0|	} else {
 6204|      0|	    xmlNsPtr *nsList, *cur;
 6205|       |
 6206|       |	    /*
 6207|       |	    * The ugly case: Search using the prefixes of in-scope
 6208|       |	    * ns-decls corresponding to @nsName.
 6209|       |	    */
 6210|      0|	    nsList = xmlGetNsList(node->doc, node);
 6211|      0|	    if (nsList == NULL) {
  ------------------
  |  Branch (6211:10): [True: 0, False: 0]
  ------------------
 6212|      0|		if (tmpstr != NULL)
  ------------------
  |  Branch (6212:7): [True: 0, False: 0]
  ------------------
 6213|      0|		    xmlFree(tmpstr);
 6214|      0|		return(NULL);
 6215|      0|	    }
 6216|      0|	    cur = nsList;
 6217|      0|	    while (*cur != NULL) {
  ------------------
  |  Branch (6217:13): [True: 0, False: 0]
  ------------------
 6218|      0|		if (xmlStrEqual((*cur)->href, nsName)) {
  ------------------
  |  Branch (6218:7): [True: 0, False: 0]
  ------------------
 6219|      0|		    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elemQName,
 6220|      0|			name, (*cur)->prefix);
 6221|      0|		    if (attrDecl)
  ------------------
  |  Branch (6221:11): [True: 0, False: 0]
  ------------------
 6222|      0|			break;
 6223|      0|		    if (doc->extSubset != NULL) {
  ------------------
  |  Branch (6223:11): [True: 0, False: 0]
  ------------------
 6224|      0|			attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elemQName,
 6225|      0|			    name, (*cur)->prefix);
 6226|      0|			if (attrDecl)
  ------------------
  |  Branch (6226:8): [True: 0, False: 0]
  ------------------
 6227|      0|			    break;
 6228|      0|		    }
 6229|      0|		}
 6230|      0|		cur++;
 6231|      0|	    }
 6232|      0|	    xmlFree(nsList);
 6233|      0|	}
 6234|      0|	if (tmpstr != NULL)
  ------------------
  |  Branch (6234:6): [True: 0, False: 0]
  ------------------
 6235|      0|	    xmlFree(tmpstr);
 6236|       |	/*
 6237|       |	* Only default/fixed attrs are relevant.
 6238|       |	*/
 6239|      0|	if ((attrDecl != NULL) && (attrDecl->defaultValue != NULL))
  ------------------
  |  Branch (6239:6): [True: 0, False: 0]
  |  Branch (6239:28): [True: 0, False: 0]
  ------------------
 6240|      0|	    return((xmlAttrPtr) attrDecl);
 6241|      0|    }
 6242|       |
 6243|      0|    return(NULL);
 6244|      0|}
tree.c:xmlGetPropNodeValueInternal:
 6248|   809k|{
 6249|   809k|    if (prop == NULL)
  ------------------
  |  Branch (6249:9): [True: 0, False: 809k]
  ------------------
 6250|      0|	return(NULL);
 6251|   809k|    if (prop->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6251:9): [True: 809k, False: 0]
  ------------------
 6252|   809k|	return(xmlNodeGetContent((xmlNodePtr) prop));
 6253|   809k|    } else if (prop->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (6253:16): [True: 0, False: 0]
  ------------------
 6254|      0|	return(xmlStrdup(((xmlAttributePtr)prop)->defaultValue));
 6255|      0|    }
 6256|      0|    return(NULL);
 6257|   809k|}

xmlParseURISafe:
  962|   831k|xmlParseURISafe(const char *str, xmlURI **uriOut) {
  963|   831k|    xmlURIPtr uri;
  964|   831k|    int ret;
  965|       |
  966|   831k|    if (uriOut == NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 831k]
  ------------------
  967|      0|        return(1);
  968|   831k|    *uriOut = NULL;
  969|   831k|    if (str == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 831k]
  ------------------
  970|      0|	return(1);
  971|       |
  972|   831k|    uri = xmlCreateURI();
  973|   831k|    if (uri == NULL)
  ------------------
  |  Branch (973:9): [True: 157, False: 830k]
  ------------------
  974|    157|        return(-1);
  975|       |
  976|   830k|    ret = xmlParse3986URIReference(uri, str);
  977|   830k|    if (ret) {
  ------------------
  |  Branch (977:9): [True: 27.5k, False: 803k]
  ------------------
  978|  27.5k|        xmlFreeURI(uri);
  979|  27.5k|        return(ret);
  980|  27.5k|    }
  981|       |
  982|   803k|    *uriOut = uri;
  983|   803k|    return(0);
  984|   830k|}
xmlParseURIReference:
 1012|    583|xmlParseURIReference(xmlURI *uri, const char *str) {
 1013|    583|    return(xmlParse3986URIReference(uri, str));
 1014|    583|}
xmlCreateURI:
 1058|   856k|xmlCreateURI(void) {
 1059|   856k|    xmlURIPtr ret;
 1060|       |
 1061|   856k|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1062|   856k|    if (ret == NULL)
  ------------------
  |  Branch (1062:9): [True: 198, False: 856k]
  ------------------
 1063|    198|	return(NULL);
 1064|   856k|    memset(ret, 0, sizeof(xmlURI));
 1065|   856k|    ret->port = PORT_EMPTY;
  ------------------
  |  |   36|   856k|#define PORT_EMPTY           0
  ------------------
 1066|   856k|    return(ret);
 1067|   856k|}
xmlSaveUri:
 1095|  47.6k|xmlSaveUri(xmlURI *uri) {
 1096|  47.6k|    xmlChar *ret = NULL;
 1097|  47.6k|    xmlChar *temp;
 1098|  47.6k|    const char *p;
 1099|  47.6k|    int len;
 1100|  47.6k|    int max;
 1101|       |
 1102|  47.6k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1102:9): [True: 0, False: 47.6k]
  ------------------
 1103|       |
 1104|       |
 1105|  47.6k|    max = 80;
 1106|  47.6k|    ret = xmlMalloc(max + 1);
 1107|  47.6k|    if (ret == NULL)
  ------------------
  |  Branch (1107:9): [True: 93, False: 47.5k]
  ------------------
 1108|     93|	return(NULL);
 1109|  47.5k|    len = 0;
 1110|       |
 1111|  47.5k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1111:9): [True: 12.2k, False: 35.2k]
  ------------------
 1112|  12.2k|	p = uri->scheme;
 1113|   113k|	while (*p != 0) {
  ------------------
  |  Branch (1113:9): [True: 100k, False: 12.2k]
  ------------------
 1114|   100k|	    if (len >= max) {
  ------------------
  |  Branch (1114:10): [True: 233, False: 100k]
  ------------------
 1115|    233|                temp = xmlSaveUriRealloc(ret, &max);
 1116|    233|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1116:21): [True: 2, False: 231]
  ------------------
 1117|    231|		ret = temp;
 1118|    231|	    }
 1119|   100k|	    ret[len++] = *p++;
 1120|   100k|	}
 1121|  12.2k|	if (len >= max) {
  ------------------
  |  Branch (1121:6): [True: 206, False: 12.0k]
  ------------------
 1122|    206|            temp = xmlSaveUriRealloc(ret, &max);
 1123|    206|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1123:17): [True: 1, False: 205]
  ------------------
 1124|    205|            ret = temp;
 1125|    205|	}
 1126|  12.2k|	ret[len++] = ':';
 1127|  12.2k|    }
 1128|  47.5k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1128:9): [True: 0, False: 47.5k]
  ------------------
 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|  47.5k|    } else {
 1147|  47.5k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  38.2k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1147:6): [True: 9.30k, False: 38.2k]
  |  Branch (1147:31): [True: 2.76k, False: 35.4k]
  ------------------
 1148|  12.0k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1148:10): [True: 205, False: 11.8k]
  ------------------
 1149|    205|                temp = xmlSaveUriRealloc(ret, &max);
 1150|    205|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1150:21): [True: 3, False: 202]
  ------------------
 1151|    202|                ret = temp;
 1152|    202|	    }
 1153|  12.0k|	    ret[len++] = '/';
 1154|  12.0k|	    ret[len++] = '/';
 1155|  12.0k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1155:10): [True: 4.42k, False: 7.63k]
  ------------------
 1156|  4.42k|		p = uri->user;
 1157|  35.1M|		while (*p != 0) {
  ------------------
  |  Branch (1157:10): [True: 35.1M, False: 4.41k]
  ------------------
 1158|  35.1M|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1158:11): [True: 2.48k, False: 35.1M]
  ------------------
 1159|  2.48k|                        temp = xmlSaveUriRealloc(ret, &max);
 1160|  2.48k|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1160:29): [True: 13, False: 2.46k]
  ------------------
 1161|  2.46k|                        ret = temp;
 1162|  2.46k|		    }
 1163|  35.1M|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  103|  35.1M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  70.3M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  70.3M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  70.3M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 22.1k, False: 35.1M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 20.5k, False: 1.56k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  35.1M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 34.8M, False: 292k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 34.8M, False: 2.47k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|   295k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 49.1k, False: 246k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 27.9k, False: 21.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|   267k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 1.46k, False: 265k]
  |  |  |  |  |  Branch (79:37): [True: 910, False: 265k]
  |  |  |  |  |  Branch (79:53): [True: 2.80k, False: 262k]
  |  |  |  |  ------------------
  |  |  |  |   80|   267k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 1.22k, False: 261k]
  |  |  |  |  |  Branch (80:21): [True: 1.55k, False: 259k]
  |  |  |  |  |  Branch (80:37): [True: 1.24k, False: 258k]
  |  |  |  |  |  Branch (80:53): [True: 607, False: 257k]
  |  |  |  |  ------------------
  |  |  |  |   81|   267k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.73k, False: 255k]
  |  |  |  |  |  Branch (81:21): [True: 1.43k, False: 254k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|   254k|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1164:4): [True: 3.88k, False: 250k]
  |  Branch (1164:23): [True: 2.90k, False: 247k]
  ------------------
 1165|   247k|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1165:4): [True: 336, False: 247k]
  |  Branch (1165:23): [True: 1.30k, False: 246k]
  ------------------
 1166|   246k|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1166:4): [True: 1.54k, False: 244k]
  |  Branch (1166:23): [True: 1.19k, False: 243k]
  ------------------
 1167|   243k|			((*(p) == ',')))
  ------------------
  |  Branch (1167:4): [True: 810, False: 242k]
  ------------------
 1168|  34.9M|			ret[len++] = *p++;
 1169|   242k|		    else {
 1170|   242k|			int val = *(unsigned char *)p++;
 1171|   242k|			int hi = val / 0x10, lo = val % 0x10;
 1172|   242k|			ret[len++] = '%';
 1173|   242k|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1173:23): [True: 842, False: 241k]
  ------------------
 1174|   242k|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1174:23): [True: 39.7k, False: 202k]
  ------------------
 1175|   242k|		    }
 1176|  35.1M|		}
 1177|  4.41k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1177:7): [True: 200, False: 4.21k]
  ------------------
 1178|    200|                    temp = xmlSaveUriRealloc(ret, &max);
 1179|    200|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1179:25): [True: 1, False: 199]
  ------------------
 1180|    199|                    ret = temp;
 1181|    199|		}
 1182|  4.41k|		ret[len++] = '@';
 1183|  4.41k|	    }
 1184|  12.0k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1184:10): [True: 9.29k, False: 2.75k]
  ------------------
 1185|  9.29k|		p = uri->server;
 1186|  7.41M|		while (*p != 0) {
  ------------------
  |  Branch (1186:10): [True: 7.40M, False: 9.28k]
  ------------------
 1187|  7.40M|		    if (len >= max) {
  ------------------
  |  Branch (1187:11): [True: 294, False: 7.40M]
  ------------------
 1188|    294|			temp = xmlSaveUriRealloc(ret, &max);
 1189|    294|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1189:8): [True: 8, False: 286]
  ------------------
 1190|    286|			ret = temp;
 1191|    286|		    }
 1192|       |                    /* TODO: escaping? */
 1193|  7.40M|		    ret[len++] = (xmlChar) *p++;
 1194|  7.40M|		}
 1195|  9.29k|	    }
 1196|  12.0k|            if (uri->port > 0) {
  ------------------
  |  Branch (1196:17): [True: 1.08k, False: 10.9k]
  ------------------
 1197|  1.08k|                if (len + 10 >= max) {
  ------------------
  |  Branch (1197:21): [True: 201, False: 888]
  ------------------
 1198|    201|                    temp = xmlSaveUriRealloc(ret, &max);
 1199|    201|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1199:25): [True: 1, False: 200]
  ------------------
 1200|    200|                    ret = temp;
 1201|    200|                }
 1202|  1.08k|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1203|  1.08k|            }
 1204|  35.4k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 35.4k]
  ------------------
 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|  35.4k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1232:13): [True: 642, False: 34.8k]
  ------------------
 1233|    642|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1233:10): [True: 216, False: 426]
  ------------------
 1234|    216|                temp = xmlSaveUriRealloc(ret, &max);
 1235|    216|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1235:21): [True: 3, False: 213]
  ------------------
 1236|    213|                ret = temp;
 1237|    213|	    }
 1238|    642|	}
 1239|  47.5k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1239:6): [True: 40.2k, False: 7.22k]
  ------------------
 1240|  40.2k|	    p = uri->path;
 1241|       |	    /*
 1242|       |	     * the colon in file:///d: should not be escaped or
 1243|       |	     * Windows accesses fail later.
 1244|       |	     */
 1245|  40.2k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1245:10): [True: 8.19k, False: 32.0k]
  ------------------
 1246|  8.19k|		(p[0] == '/') &&
  ------------------
  |  Branch (1246:3): [True: 7.40k, False: 790]
  ------------------
 1247|  7.40k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1247:5): [True: 1.33k, False: 6.07k]
  |  Branch (1247:22): [True: 1.05k, False: 279]
  ------------------
 1248|  6.35k|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1248:5): [True: 1.02k, False: 5.32k]
  |  Branch (1248:22): [True: 729, False: 297]
  ------------------
 1249|  1.78k|		(p[2] == ':') &&
  ------------------
  |  Branch (1249:3): [True: 697, False: 1.08k]
  ------------------
 1250|    697|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    697|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    697|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1250:10): [True: 423, False: 274]
  ------------------
 1251|    423|		if (len + 3 >= max) {
  ------------------
  |  Branch (1251:7): [True: 199, False: 224]
  ------------------
 1252|    199|                    temp = xmlSaveUriRealloc(ret, &max);
 1253|    199|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1253:25): [True: 2, False: 197]
  ------------------
 1254|    197|                    ret = temp;
 1255|    197|		}
 1256|    421|		ret[len++] = *p++;
 1257|    421|		ret[len++] = *p++;
 1258|    421|		ret[len++] = *p++;
 1259|    421|	    }
 1260|  5.66M|	    while (*p != 0) {
  ------------------
  |  Branch (1260:13): [True: 5.62M, False: 40.2k]
  ------------------
 1261|  5.62M|		if (len + 3 >= max) {
  ------------------
  |  Branch (1261:7): [True: 2.03k, False: 5.62M]
  ------------------
 1262|  2.03k|                    temp = xmlSaveUriRealloc(ret, &max);
 1263|  2.03k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1263:25): [True: 3, False: 2.03k]
  ------------------
 1264|  2.03k|                    ret = temp;
 1265|  2.03k|		}
 1266|  5.62M|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  103|  5.62M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  11.2M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  11.2M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  11.2M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 219k, False: 5.40M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 218k, False: 1.40k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  5.41M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 3.13M, False: 2.27M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 3.13M, False: 2.12k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  2.27M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 51.7k, False: 2.22M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 38.2k, False: 13.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  2.24M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 42.5k, False: 2.19M]
  |  |  |  |  |  Branch (79:37): [True: 689, False: 2.19M]
  |  |  |  |  |  Branch (79:53): [True: 53.5k, False: 2.14M]
  |  |  |  |  ------------------
  |  |  |  |   80|  2.24M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 2.81k, False: 2.14M]
  |  |  |  |  |  Branch (80:21): [True: 1.31k, False: 2.14M]
  |  |  |  |  |  Branch (80:37): [True: 2.00M, False: 138k]
  |  |  |  |  |  Branch (80:53): [True: 1.37k, False: 137k]
  |  |  |  |  ------------------
  |  |  |  |   81|  2.24M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.78k, False: 135k]
  |  |  |  |  |  Branch (81:21): [True: 1.47k, False: 133k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1266:32): [True: 101k, False: 32.4k]
  ------------------
 1267|  32.4k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1267:21): [True: 1.73k, False: 30.7k]
  |  Branch (1267:40): [True: 2.95k, False: 27.7k]
  |  Branch (1267:59): [True: 246, False: 27.5k]
  ------------------
 1268|  27.5k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1268:14): [True: 2.51k, False: 25.0k]
  |  Branch (1268:33): [True: 1.56k, False: 23.4k]
  |  Branch (1268:52): [True: 4.49k, False: 18.9k]
  ------------------
 1269|  18.9k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1269:14): [True: 2.57k, False: 16.3k]
  ------------------
 1270|  5.61M|		    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.04k, False: 15.3k]
  ------------------
 1276|  16.3k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1276:26): [True: 5.22k, False: 11.1k]
  ------------------
 1277|  16.3k|		}
 1278|  5.62M|	    }
 1279|  40.2k|	}
 1280|  47.5k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1280:6): [True: 4.33k, False: 43.1k]
  ------------------
 1281|  4.33k|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1281:10): [True: 199, False: 4.13k]
  ------------------
 1282|    199|                temp = xmlSaveUriRealloc(ret, &max);
 1283|    199|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1283:21): [True: 1, False: 198]
  ------------------
 1284|    198|                ret = temp;
 1285|    198|	    }
 1286|  4.33k|	    ret[len++] = '?';
 1287|  4.33k|	    p = uri->query_raw;
 1288|  8.82M|	    while (*p != 0) {
  ------------------
  |  Branch (1288:13): [True: 8.81M, False: 4.32k]
  ------------------
 1289|  8.81M|		if (len + 1 >= max) {
  ------------------
  |  Branch (1289:7): [True: 1.62k, False: 8.81M]
  ------------------
 1290|  1.62k|                    temp = xmlSaveUriRealloc(ret, &max);
 1291|  1.62k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1291:25): [True: 11, False: 1.61k]
  ------------------
 1292|  1.61k|                    ret = temp;
 1293|  1.61k|		}
 1294|  8.81M|		ret[len++] = *p++;
 1295|  8.81M|	    }
 1296|  43.1k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1296:13): [True: 0, False: 43.1k]
  ------------------
 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|  47.5k|    }
 1322|  47.4k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1322:9): [True: 7.66k, False: 39.8k]
  ------------------
 1323|  7.66k|	if (len + 3 >= max) {
  ------------------
  |  Branch (1323:6): [True: 339, False: 7.32k]
  ------------------
 1324|    339|            temp = xmlSaveUriRealloc(ret, &max);
 1325|    339|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1325:17): [True: 2, False: 337]
  ------------------
 1326|    337|            ret = temp;
 1327|    337|	}
 1328|  7.66k|	ret[len++] = '#';
 1329|  7.66k|	p = uri->fragment;
 1330|  37.1k|	while (*p != 0) {
  ------------------
  |  Branch (1330:9): [True: 29.4k, False: 7.66k]
  ------------------
 1331|  29.4k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1331:10): [True: 291, False: 29.1k]
  ------------------
 1332|    291|                temp = xmlSaveUriRealloc(ret, &max);
 1333|    291|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1333:21): [True: 1, False: 290]
  ------------------
 1334|    290|                ret = temp;
 1335|    290|	    }
 1336|  29.4k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  103|  29.4k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  58.9k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  58.9k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  58.9k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 4.34k, False: 25.1k]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 2.94k, False: 1.40k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  26.5k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 7.45k, False: 19.0k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 2.68k, False: 4.77k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  23.8k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 12.0k, False: 11.8k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 3.05k, False: 8.95k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  20.8k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 492, False: 20.3k]
  |  |  |  |  |  Branch (79:37): [True: 291, False: 20.0k]
  |  |  |  |  |  Branch (79:53): [True: 1.21k, False: 18.8k]
  |  |  |  |  ------------------
  |  |  |  |   80|  20.8k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 283, False: 18.5k]
  |  |  |  |  |  Branch (80:21): [True: 1.40k, False: 17.1k]
  |  |  |  |  |  Branch (80:37): [True: 1.65k, False: 15.4k]
  |  |  |  |  |  Branch (80:53): [True: 551, False: 14.9k]
  |  |  |  |  ------------------
  |  |  |  |   81|  20.8k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 590, False: 14.3k]
  |  |  |  |  |  Branch (81:21): [True: 327, False: 13.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   95|  13.9k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 1.02k, False: 12.9k]
  |  |  |  Branch (95:41): [True: 586, False: 12.3k]
  |  |  |  Branch (95:57): [True: 1.97k, False: 10.4k]
  |  |  ------------------
  |  |   96|  13.9k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 502, False: 9.91k]
  |  |  |  Branch (96:25): [True: 386, False: 9.52k]
  |  |  |  Branch (96:41): [True: 250, False: 9.27k]
  |  |  |  Branch (96:57): [True: 302, False: 8.97k]
  |  |  ------------------
  |  |   97|  13.9k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 1.34k, False: 7.63k]
  |  |  |  Branch (97:25): [True: 375, False: 7.26k]
  |  |  |  Branch (97:41): [True: 3.79k, False: 3.46k]
  |  |  |  Branch (97:57): [True: 461, False: 3.00k]
  |  |  ------------------
  |  |   98|  13.9k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 2.61k, False: 389]
  |  |  ------------------
  ------------------
 1337|  29.0k|		ret[len++] = *p++;
 1338|    389|	    else {
 1339|    389|		int val = *(unsigned char *)p++;
 1340|    389|		int hi = val / 0x10, lo = val % 0x10;
 1341|    389|		ret[len++] = '%';
 1342|    389|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1342:22): [True: 288, False: 101]
  ------------------
 1343|    389|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1343:22): [True: 247, False: 142]
  ------------------
 1344|    389|	    }
 1345|  29.4k|	}
 1346|  7.66k|    }
 1347|  47.4k|    if (len >= max) {
  ------------------
  |  Branch (1347:9): [True: 212, False: 47.2k]
  ------------------
 1348|    212|        temp = xmlSaveUriRealloc(ret, &max);
 1349|    212|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1349:13): [True: 1, False: 211]
  ------------------
 1350|    211|        ret = temp;
 1351|    211|    }
 1352|  47.4k|    ret[len] = 0;
 1353|  47.4k|    return(ret);
 1354|       |
 1355|     53|mem_error:
 1356|     53|    xmlFree(ret);
 1357|       |    return(NULL);
 1358|  47.4k|}
xmlFreeURI:
 1412|   871k|xmlFreeURI(xmlURI *uri) {
 1413|   871k|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 15.1k, False: 856k]
  ------------------
 1414|       |
 1415|   856k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 41.2k, False: 814k]
  ------------------
 1416|   856k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1416:9): [True: 29.8k, False: 826k]
  ------------------
 1417|   856k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1417:9): [True: 8.18k, False: 847k]
  ------------------
 1418|   856k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1418:9): [True: 185k, False: 670k]
  ------------------
 1419|   856k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1419:9): [True: 637k, False: 218k]
  ------------------
 1420|   856k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1420:9): [True: 0, False: 856k]
  ------------------
 1421|   856k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1421:9): [True: 0, False: 856k]
  ------------------
 1422|   856k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1422:9): [True: 7.22k, False: 848k]
  ------------------
 1423|   856k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1423:9): [True: 10.0k, False: 845k]
  ------------------
 1424|   856k|    xmlFree(uri);
 1425|   856k|}
xmlNormalizeURIPath:
 1555|  7.10k|xmlNormalizeURIPath(char *path) {
 1556|  7.10k|    return(xmlNormalizePath(path, 0));
 1557|  7.10k|}
xmlURIUnescapeString:
 1580|  1.56M|xmlURIUnescapeString(const char *str, int len, char *target) {
 1581|  1.56M|    char *ret, *out;
 1582|  1.56M|    const char *in;
 1583|       |
 1584|  1.56M|    if (str == NULL)
  ------------------
  |  Branch (1584:9): [True: 0, False: 1.56M]
  ------------------
 1585|      0|	return(NULL);
 1586|  1.56M|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1586:9): [True: 709k, False: 854k]
  ------------------
 1587|  1.56M|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1587:9): [True: 0, False: 1.56M]
  ------------------
 1588|       |
 1589|  1.56M|    if (target == NULL) {
  ------------------
  |  Branch (1589:9): [True: 1.56M, False: 0]
  ------------------
 1590|  1.56M|	ret = xmlMalloc(len + 1);
 1591|  1.56M|	if (ret == NULL)
  ------------------
  |  Branch (1591:6): [True: 317, False: 1.56M]
  ------------------
 1592|    317|	    return(NULL);
 1593|  1.56M|    } else
 1594|      0|	ret = target;
 1595|  1.56M|    in = str;
 1596|  1.56M|    out = ret;
 1597|   141M|    while(len > 0) {
  ------------------
  |  Branch (1597:11): [True: 139M, False: 1.56M]
  ------------------
 1598|   139M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1598:6): [True: 138M, False: 1.68M]
  |  Branch (1598:19): [True: 239k, False: 137M]
  |  Branch (1598:35): [True: 237k, False: 2.01k]
  |  Branch (1598:54): [True: 236k, False: 1.29k]
  ------------------
 1599|   236k|            int c = 0;
 1600|   236k|	    in++;
 1601|   236k|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1601:10): [True: 236k, False: 0]
  |  Branch (1601:26): [True: 222k, False: 13.3k]
  ------------------
 1602|   222k|	        c = (*in - '0');
 1603|  13.3k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1603:15): [True: 5.71k, False: 7.67k]
  |  Branch (1603:31): [True: 5.71k, False: 0]
  ------------------
 1604|  5.71k|	        c = (*in - 'a') + 10;
 1605|  7.67k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1605:15): [True: 7.67k, False: 0]
  |  Branch (1605:31): [True: 7.67k, False: 0]
  ------------------
 1606|  7.67k|	        c = (*in - 'A') + 10;
 1607|   236k|	    in++;
 1608|   236k|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1608:10): [True: 236k, False: 0]
  |  Branch (1608:26): [True: 221k, False: 14.5k]
  ------------------
 1609|   221k|	        c = c * 16 + (*in - '0');
 1610|  14.5k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1610:15): [True: 6.35k, False: 8.18k]
  |  Branch (1610:31): [True: 6.35k, False: 0]
  ------------------
 1611|  6.35k|	        c = c * 16 + (*in - 'a') + 10;
 1612|  8.18k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1612:15): [True: 8.18k, False: 0]
  |  Branch (1612:31): [True: 8.18k, False: 0]
  ------------------
 1613|  8.18k|	        c = c * 16 + (*in - 'A') + 10;
 1614|   236k|	    in++;
 1615|   236k|	    len -= 3;
 1616|       |            /* Explicit sign change */
 1617|   236k|	    *out++ = (char) c;
 1618|   139M|	} else {
 1619|   139M|	    *out++ = *in++;
 1620|   139M|	    len--;
 1621|   139M|	}
 1622|   139M|    }
 1623|  1.56M|    *out = 0;
 1624|  1.56M|    return(ret);
 1625|  1.56M|}
xmlURIEscapeStr:
 1637|  1.47k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1638|  1.47k|    xmlChar *ret, ch;
 1639|  1.47k|    const xmlChar *in;
 1640|  1.47k|    int len, out;
 1641|       |
 1642|  1.47k|    if (str == NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 1.47k]
  ------------------
 1643|      0|	return(NULL);
 1644|  1.47k|    if (str[0] == 0)
  ------------------
  |  Branch (1644:9): [True: 0, False: 1.47k]
  ------------------
 1645|      0|	return(xmlStrdup(str));
 1646|  1.47k|    len = xmlStrlen(str);
 1647|  1.47k|    if (len == 0)
  ------------------
  |  Branch (1647:9): [True: 0, False: 1.47k]
  ------------------
 1648|      0|        return(NULL);
 1649|       |
 1650|  1.47k|    len += 20;
 1651|  1.47k|    ret = xmlMalloc(len);
 1652|  1.47k|    if (ret == NULL)
  ------------------
  |  Branch (1652:9): [True: 7, False: 1.46k]
  ------------------
 1653|      7|	return(NULL);
 1654|  1.46k|    in = (const xmlChar *) str;
 1655|  1.46k|    out = 0;
 1656|  3.28M|    while(*in != 0) {
  ------------------
  |  Branch (1656:11): [True: 3.28M, False: 1.46k]
  ------------------
 1657|  3.28M|	if (len - out <= 3) {
  ------------------
  |  Branch (1657:6): [True: 615, False: 3.28M]
  ------------------
 1658|    615|            xmlChar *temp;
 1659|    615|            int newSize;
 1660|       |
 1661|    615|            newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|    615|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1662|    615|            if (newSize < 0) {
  ------------------
  |  Branch (1662:17): [True: 0, False: 615]
  ------------------
 1663|      0|		xmlFree(ret);
 1664|      0|                return(NULL);
 1665|      0|            }
 1666|    615|            temp = xmlRealloc(ret, newSize);
 1667|    615|	    if (temp == NULL) {
  ------------------
  |  Branch (1667:10): [True: 2, False: 613]
  ------------------
 1668|      2|		xmlFree(ret);
 1669|      2|		return(NULL);
 1670|      2|	    }
 1671|    613|	    ret = temp;
 1672|    613|            len = newSize;
 1673|    613|	}
 1674|       |
 1675|  3.28M|	ch = *in;
 1676|       |
 1677|  3.28M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  103|  3.28M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  6.56M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  6.56M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  6.56M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 114k, False: 3.16M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 109k, False: 4.86k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.17M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 303k, False: 2.86M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 298k, False: 5.56k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  2.87M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 56.1k, False: 2.81M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 46.1k, False: 10.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  2.82M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 52.1k, False: 2.77M]
  |  |  |  |  |  Branch (79:37): [True: 333, False: 2.77M]
  |  |  |  |  |  Branch (79:53): [True: 156k, False: 2.61M]
  |  |  |  |  ------------------
  |  |  |  |   80|  2.82M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 3.70k, False: 2.61M]
  |  |  |  |  |  Branch (80:21): [True: 1.43k, False: 2.61M]
  |  |  |  |  |  Branch (80:37): [True: 2.31M, False: 293k]
  |  |  |  |  |  Branch (80:53): [True: 1.40k, False: 292k]
  |  |  |  |  ------------------
  |  |  |  |   81|  2.82M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 604, False: 291k]
  |  |  |  |  |  Branch (81:21): [True: 1.34k, False: 290k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1677:6): [True: 3.28M, False: 811]
  |  Branch (1677:45): [True: 164k, False: 125k]
  ------------------
 1678|   164k|	    unsigned char val;
 1679|   164k|	    ret[out++] = '%';
 1680|   164k|	    val = ch >> 4;
 1681|   164k|	    if (val <= 9)
  ------------------
  |  Branch (1681:10): [True: 163k, False: 1.80k]
  ------------------
 1682|   163k|		ret[out++] = '0' + val;
 1683|  1.80k|	    else
 1684|  1.80k|		ret[out++] = 'A' + val - 0xA;
 1685|   164k|	    val = ch & 0xF;
 1686|   164k|	    if (val <= 9)
  ------------------
  |  Branch (1686:10): [True: 159k, False: 5.68k]
  ------------------
 1687|   159k|		ret[out++] = '0' + val;
 1688|  5.68k|	    else
 1689|  5.68k|		ret[out++] = 'A' + val - 0xA;
 1690|   164k|	    in++;
 1691|  3.11M|	} else {
 1692|  3.11M|	    ret[out++] = *in++;
 1693|  3.11M|	}
 1694|       |
 1695|  3.28M|    }
 1696|  1.46k|    ret[out] = 0;
 1697|  1.46k|    return(ret);
 1698|  1.46k|}
xmlBuildURISafe:
 1972|   757k|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 1973|   757k|    xmlChar *val = NULL;
 1974|   757k|    int ret, len, indx, cur, out;
 1975|   757k|    xmlURIPtr ref = NULL;
 1976|   757k|    xmlURIPtr bas = NULL;
 1977|   757k|    xmlURIPtr res = NULL;
 1978|       |
 1979|   757k|    if (valPtr == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 757k]
  ------------------
 1980|      0|        return(1);
 1981|   757k|    *valPtr = NULL;
 1982|       |
 1983|   757k|    if (URI == NULL)
  ------------------
  |  Branch (1983:9): [True: 0, False: 757k]
  ------------------
 1984|      0|        return(1);
 1985|       |
 1986|   757k|    if (base == NULL) {
  ------------------
  |  Branch (1986:9): [True: 18.0k, False: 739k]
  ------------------
 1987|  18.0k|        val = xmlStrdup(URI);
 1988|  18.0k|        if (val == NULL)
  ------------------
  |  Branch (1988:13): [True: 7, False: 18.0k]
  ------------------
 1989|      7|            return(-1);
 1990|  18.0k|        *valPtr = val;
 1991|  18.0k|        return(0);
 1992|  18.0k|    }
 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|   739k|    if (URI[0] != 0)
  ------------------
  |  Branch (2002:9): [True: 732k, False: 6.96k]
  ------------------
 2003|   732k|        ret = xmlParseURISafe((const char *) URI, &ref);
 2004|  6.96k|    else
 2005|  6.96k|        ret = 0;
 2006|   739k|    if (ret != 0)
  ------------------
  |  Branch (2006:9): [True: 8.25k, False: 731k]
  ------------------
 2007|  8.25k|	goto done;
 2008|   731k|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2008:9): [True: 724k, False: 6.96k]
  |  Branch (2008:26): [True: 4.95k, False: 719k]
  ------------------
 2009|       |	/*
 2010|       |	 * The URI is absolute don't modify.
 2011|       |	 */
 2012|  4.95k|	val = xmlStrdup(URI);
 2013|  4.95k|        if (val == NULL)
  ------------------
  |  Branch (2013:13): [True: 27, False: 4.92k]
  ------------------
 2014|     27|            ret = -1;
 2015|  4.95k|	goto done;
 2016|  4.95k|    }
 2017|       |
 2018|       |    /*
 2019|       |     * If base has no scheme or authority, it is assumed to be a
 2020|       |     * filesystem path.
 2021|       |     */
 2022|   726k|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|   726k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2022:9): [True: 703k, False: 23.1k]
  ------------------
 2023|   703k|        xmlFreeURI(ref);
 2024|   703k|        return(xmlResolvePath(URI, base, valPtr));
 2025|   703k|    }
 2026|       |
 2027|       |#if defined(LIBXML_WINPATH_ENABLED)
 2028|       |    /*
 2029|       |     * Resolve paths with a Windows drive letter as filesystem path
 2030|       |     * even if base has a scheme.
 2031|       |     */
 2032|       |    if ((ref != NULL) && (ref->path != NULL)) {
 2033|       |        int c = ref->path[0];
 2034|       |
 2035|       |        if ((((c >= 'A') && (c <= 'Z')) ||
 2036|       |             ((c >= 'a') && (c <= 'z'))) &&
 2037|       |            (ref->path[1] == ':')) {
 2038|       |            xmlFreeURI(ref);
 2039|       |            return(xmlResolvePath(URI, base, valPtr));
 2040|       |        }
 2041|       |    }
 2042|       |#endif
 2043|       |
 2044|  23.1k|    ret = xmlParseURISafe((const char *) base, &bas);
 2045|  23.1k|    if (ret < 0)
  ------------------
  |  Branch (2045:9): [True: 170, False: 23.0k]
  ------------------
 2046|    170|        goto done;
 2047|  23.0k|    if (ret != 0) {
  ------------------
  |  Branch (2047:9): [True: 7.13k, False: 15.8k]
  ------------------
 2048|  7.13k|	if (ref) {
  ------------------
  |  Branch (2048:6): [True: 6.07k, False: 1.05k]
  ------------------
 2049|  6.07k|            ret = 0;
 2050|  6.07k|	    val = xmlSaveUri(ref);
 2051|  6.07k|            if (val == NULL)
  ------------------
  |  Branch (2051:17): [True: 19, False: 6.05k]
  ------------------
 2052|     19|                ret = -1;
 2053|  6.07k|        }
 2054|  7.13k|	goto done;
 2055|  7.13k|    }
 2056|  15.8k|    if (ref == NULL) {
  ------------------
  |  Branch (2056:9): [True: 1.89k, False: 13.9k]
  ------------------
 2057|       |	/*
 2058|       |	 * the base fragment must be ignored
 2059|       |	 */
 2060|  1.89k|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2060:6): [True: 242, False: 1.65k]
  ------------------
 2061|    242|	    xmlFree(bas->fragment);
 2062|    242|	    bas->fragment = NULL;
 2063|    242|	}
 2064|  1.89k|	val = xmlSaveUri(bas);
 2065|  1.89k|        if (val == NULL)
  ------------------
  |  Branch (2065:13): [True: 18, False: 1.87k]
  ------------------
 2066|     18|            ret = -1;
 2067|  1.89k|	goto done;
 2068|  1.89k|    }
 2069|       |
 2070|       |    /*
 2071|       |     * 2) If the path component is empty and the scheme, authority, and
 2072|       |     *    query components are undefined, then it is a reference to the
 2073|       |     *    current document and we are done.  Otherwise, the reference URI's
 2074|       |     *    query and fragment components are defined as found (or not found)
 2075|       |     *    within the URI reference and not inherited from the base URI.
 2076|       |     *
 2077|       |     *    NOTE that in modern browsers, the parsing differs from the above
 2078|       |     *    in the following aspect:  the query component is allowed to be
 2079|       |     *    defined while still treating this as a reference to the current
 2080|       |     *    document.
 2081|       |     */
 2082|  13.9k|    ret = -1;
 2083|  13.9k|    res = xmlCreateURI();
 2084|  13.9k|    if (res == NULL)
  ------------------
  |  Branch (2084:9): [True: 21, False: 13.9k]
  ------------------
 2085|     21|	goto done;
 2086|  13.9k|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2086:9): [True: 13.9k, False: 0]
  |  Branch (2086:34): [True: 5.12k, False: 8.85k]
  ------------------
 2087|  5.12k|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2087:3): [True: 5.12k, False: 0]
  |  Branch (2087:31): [True: 4.52k, False: 600]
  ------------------
 2088|  4.52k|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   36|  4.52k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2088:10): [True: 4.27k, False: 248]
  ------------------
 2089|  4.27k|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2089:6): [True: 3.63k, False: 640]
  ------------------
 2090|  3.63k|	    res->scheme = xmlMemStrdup(bas->scheme);
 2091|  3.63k|            if (res->scheme == NULL)
  ------------------
  |  Branch (2091:17): [True: 10, False: 3.62k]
  ------------------
 2092|     10|                goto done;
 2093|  3.63k|        }
 2094|  4.26k|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2094:6): [True: 0, False: 4.26k]
  ------------------
 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.26k|        } else {
 2099|  4.26k|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2099:10): [True: 2.75k, False: 1.51k]
  ------------------
 2100|  2.75k|		res->server = xmlMemStrdup(bas->server);
 2101|  2.75k|                if (res->server == NULL)
  ------------------
  |  Branch (2101:21): [True: 8, False: 2.74k]
  ------------------
 2102|      8|                    goto done;
 2103|  2.75k|            }
 2104|  4.25k|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2104:10): [True: 1.91k, False: 2.33k]
  ------------------
 2105|  1.91k|		res->user = xmlMemStrdup(bas->user);
 2106|  1.91k|                if (res->user == NULL)
  ------------------
  |  Branch (2106:21): [True: 5, False: 1.91k]
  ------------------
 2107|      5|                    goto done;
 2108|  1.91k|            }
 2109|  4.25k|	    res->port = bas->port;
 2110|  4.25k|	}
 2111|  4.25k|	if (bas->path != NULL) {
  ------------------
  |  Branch (2111:6): [True: 2.10k, False: 2.15k]
  ------------------
 2112|  2.10k|	    res->path = xmlMemStrdup(bas->path);
 2113|  2.10k|            if (res->path == NULL)
  ------------------
  |  Branch (2113:17): [True: 9, False: 2.09k]
  ------------------
 2114|      9|                goto done;
 2115|  2.10k|        }
 2116|  4.24k|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2116:6): [True: 439, False: 3.80k]
  ------------------
 2117|    439|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2118|    439|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2118:17): [True: 7, False: 432]
  ------------------
 2119|      7|                goto done;
 2120|  3.80k|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2120:20): [True: 0, False: 3.80k]
  ------------------
 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.80k|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2124:20): [True: 1.49k, False: 2.31k]
  ------------------
 2125|  1.49k|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2126|  1.49k|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2126:17): [True: 5, False: 1.48k]
  ------------------
 2127|      5|                goto done;
 2128|  2.31k|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2128:20): [True: 0, False: 2.31k]
  ------------------
 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.23k|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2133:6): [True: 3.79k, False: 439]
  ------------------
 2134|  3.79k|	    res->fragment = xmlMemStrdup(ref->fragment);
 2135|  3.79k|            if (res->fragment == NULL)
  ------------------
  |  Branch (2135:17): [True: 8, False: 3.78k]
  ------------------
 2136|      8|                goto done;
 2137|  3.79k|        }
 2138|  4.22k|	goto step_7;
 2139|  4.23k|    }
 2140|       |
 2141|       |    /*
 2142|       |     * 3) If the scheme component is defined, indicating that the reference
 2143|       |     *    starts with a scheme name, then the reference is interpreted as an
 2144|       |     *    absolute URI and we are done.  Otherwise, the reference URI's
 2145|       |     *    scheme is inherited from the base URI's scheme component.
 2146|       |     */
 2147|  9.70k|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 9.70k]
  ------------------
 2148|      0|	val = xmlSaveUri(ref);
 2149|      0|        if (val != NULL)
  ------------------
  |  Branch (2149:13): [True: 0, False: 0]
  ------------------
 2150|      0|            ret = 0;
 2151|      0|	goto done;
 2152|      0|    }
 2153|  9.70k|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 6.84k, False: 2.86k]
  ------------------
 2154|  6.84k|	res->scheme = xmlMemStrdup(bas->scheme);
 2155|  6.84k|        if (res->scheme == NULL)
  ------------------
  |  Branch (2155:13): [True: 15, False: 6.82k]
  ------------------
 2156|     15|            goto done;
 2157|  6.84k|    }
 2158|       |
 2159|  9.68k|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2159:9): [True: 913, False: 8.77k]
  ------------------
 2160|    913|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2161|    913|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2161:13): [True: 2, False: 911]
  ------------------
 2162|      2|            goto done;
 2163|  8.77k|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2163:16): [True: 0, False: 8.77k]
  ------------------
 2164|      0|	res->query = xmlMemStrdup(ref->query);
 2165|      0|        if (res->query == NULL)
  ------------------
  |  Branch (2165:13): [True: 0, False: 0]
  ------------------
 2166|      0|            goto done;
 2167|      0|    }
 2168|  9.68k|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2168:9): [True: 1.71k, False: 7.96k]
  ------------------
 2169|  1.71k|	res->fragment = xmlMemStrdup(ref->fragment);
 2170|  1.71k|        if (res->fragment == NULL)
  ------------------
  |  Branch (2170:13): [True: 4, False: 1.71k]
  ------------------
 2171|      4|            goto done;
 2172|  1.71k|    }
 2173|       |
 2174|       |    /*
 2175|       |     * 4) If the authority component is defined, then the reference is a
 2176|       |     *    network-path and we skip to step 7.  Otherwise, the reference
 2177|       |     *    URI's authority is inherited from the base URI's authority
 2178|       |     *    component, which will also be undefined if the URI scheme does not
 2179|       |     *    use an authority component.
 2180|       |     */
 2181|  9.67k|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 9.67k]
  |  Branch (2181:37): [True: 956, False: 8.72k]
  ------------------
 2182|  8.72k|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  8.72k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2182:10): [True: 247, False: 8.47k]
  ------------------
 2183|  1.20k|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 1.20k]
  ------------------
 2184|      0|	    res->authority = xmlMemStrdup(ref->authority);
 2185|      0|            if (res->authority == NULL)
  ------------------
  |  Branch (2185:17): [True: 0, False: 0]
  ------------------
 2186|      0|                goto done;
 2187|  1.20k|        } else {
 2188|  1.20k|            if (ref->server != NULL) {
  ------------------
  |  Branch (2188:17): [True: 956, False: 247]
  ------------------
 2189|    956|                res->server = xmlMemStrdup(ref->server);
 2190|    956|                if (res->server == NULL)
  ------------------
  |  Branch (2190:21): [True: 4, False: 952]
  ------------------
 2191|      4|                    goto done;
 2192|    956|            }
 2193|  1.19k|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2193:10): [True: 256, False: 943]
  ------------------
 2194|    256|		res->user = xmlMemStrdup(ref->user);
 2195|    256|                if (res->user == NULL)
  ------------------
  |  Branch (2195:21): [True: 2, False: 254]
  ------------------
 2196|      2|                    goto done;
 2197|    256|            }
 2198|  1.19k|            res->port = ref->port;
 2199|  1.19k|	}
 2200|  1.19k|	if (ref->path != NULL) {
  ------------------
  |  Branch (2200:6): [True: 356, False: 841]
  ------------------
 2201|    356|	    res->path = xmlMemStrdup(ref->path);
 2202|    356|            if (res->path == NULL)
  ------------------
  |  Branch (2202:17): [True: 1, False: 355]
  ------------------
 2203|      1|                goto done;
 2204|    356|        }
 2205|  1.19k|	goto step_7;
 2206|  1.19k|    }
 2207|  8.47k|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 8.47k]
  ------------------
 2208|      0|	res->authority = xmlMemStrdup(bas->authority);
 2209|      0|        if (res->authority == NULL)
  ------------------
  |  Branch (2209:13): [True: 0, False: 0]
  ------------------
 2210|      0|            goto done;
 2211|  8.47k|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  4.48k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2211:16): [True: 3.99k, False: 4.48k]
  |  Branch (2211:41): [True: 1.49k, False: 2.99k]
  ------------------
 2212|  5.48k|	if (bas->server != NULL) {
  ------------------
  |  Branch (2212:6): [True: 3.99k, False: 1.49k]
  ------------------
 2213|  3.99k|	    res->server = xmlMemStrdup(bas->server);
 2214|  3.99k|            if (res->server == NULL)
  ------------------
  |  Branch (2214:17): [True: 13, False: 3.97k]
  ------------------
 2215|     13|                goto done;
 2216|  3.99k|        }
 2217|  5.47k|	if (bas->user != NULL) {
  ------------------
  |  Branch (2217:6): [True: 1.37k, False: 4.09k]
  ------------------
 2218|  1.37k|	    res->user = xmlMemStrdup(bas->user);
 2219|  1.37k|            if (res->user == NULL)
  ------------------
  |  Branch (2219:17): [True: 1, False: 1.37k]
  ------------------
 2220|      1|                goto done;
 2221|  1.37k|        }
 2222|  5.47k|	res->port = bas->port;
 2223|  5.47k|    }
 2224|       |
 2225|       |    /*
 2226|       |     * 5) If the path component begins with a slash character ("/"), then
 2227|       |     *    the reference is an absolute-path and we skip to step 7.
 2228|       |     */
 2229|  8.46k|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2229:9): [True: 8.46k, False: 0]
  |  Branch (2229:32): [True: 1.34k, False: 7.12k]
  ------------------
 2230|  1.34k|	res->path = xmlMemStrdup(ref->path);
 2231|  1.34k|        if (res->path == NULL)
  ------------------
  |  Branch (2231:13): [True: 3, False: 1.33k]
  ------------------
 2232|      3|            goto done;
 2233|  1.33k|	goto step_7;
 2234|  1.34k|    }
 2235|       |
 2236|       |
 2237|       |    /*
 2238|       |     * 6) If this step is reached, then we are resolving a relative-path
 2239|       |     *    reference.  The relative path needs to be merged with the base
 2240|       |     *    URI's path.  Although there are many ways to do this, we will
 2241|       |     *    describe a simple method using a separate string buffer.
 2242|       |     *
 2243|       |     * Allocate a buffer large enough for the result string.
 2244|       |     */
 2245|  7.12k|    len = 2; /* extra / and 0 */
 2246|  7.12k|    if (ref->path != NULL)
  ------------------
  |  Branch (2246:9): [True: 7.12k, False: 0]
  ------------------
 2247|  7.12k|	len += strlen(ref->path);
 2248|  7.12k|    if (bas->path != NULL)
  ------------------
  |  Branch (2248:9): [True: 3.44k, False: 3.67k]
  ------------------
 2249|  3.44k|	len += strlen(bas->path);
 2250|  7.12k|    res->path = xmlMalloc(len);
 2251|  7.12k|    if (res->path == NULL)
  ------------------
  |  Branch (2251:9): [True: 14, False: 7.10k]
  ------------------
 2252|     14|	goto done;
 2253|  7.10k|    res->path[0] = 0;
 2254|       |
 2255|       |    /*
 2256|       |     * a) All but the last segment of the base URI's path component is
 2257|       |     *    copied to the buffer.  In other words, any characters after the
 2258|       |     *    last (right-most) slash character, if any, are excluded.
 2259|       |     */
 2260|  7.10k|    cur = 0;
 2261|  7.10k|    out = 0;
 2262|  7.10k|    if (bas->path != NULL) {
  ------------------
  |  Branch (2262:9): [True: 3.43k, False: 3.66k]
  ------------------
 2263|  53.9k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2263:9): [True: 53.0k, False: 904]
  ------------------
 2264|  2.18M|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2264:13): [True: 2.18M, False: 2.53k]
  |  Branch (2264:38): [True: 2.12M, False: 50.4k]
  ------------------
 2265|  2.12M|		cur++;
 2266|  53.0k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2266:10): [True: 2.53k, False: 50.4k]
  ------------------
 2267|  2.53k|		break;
 2268|       |
 2269|  50.4k|	    cur++;
 2270|  2.13M|	    while (out < cur) {
  ------------------
  |  Branch (2270:13): [True: 2.08M, False: 50.4k]
  ------------------
 2271|  2.08M|		res->path[out] = bas->path[out];
 2272|  2.08M|		out++;
 2273|  2.08M|	    }
 2274|  50.4k|	}
 2275|  3.43k|    }
 2276|  7.10k|    res->path[out] = 0;
 2277|       |
 2278|       |    /*
 2279|       |     * b) The reference's path component is appended to the buffer
 2280|       |     *    string.
 2281|       |     */
 2282|  7.10k|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2282:9): [True: 7.10k, False: 0]
  |  Branch (2282:30): [True: 6.90k, False: 200]
  ------------------
 2283|  6.90k|	indx = 0;
 2284|       |	/*
 2285|       |	 * Ensure the path includes a '/'
 2286|       |	 */
 2287|  6.90k|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   36|  1.88k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2287:6): [True: 4.05k, False: 2.85k]
  |  Branch (2287:21): [True: 2.16k, False: 1.88k]
  |  Branch (2287:46): [True: 788, False: 1.09k]
  ------------------
 2288|  2.95k|	    res->path[out++] = '/';
 2289|  91.6k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2289:9): [True: 84.7k, False: 6.90k]
  ------------------
 2290|  84.7k|	    res->path[out++] = ref->path[indx++];
 2291|  84.7k|	}
 2292|  6.90k|    }
 2293|  7.10k|    res->path[out] = 0;
 2294|       |
 2295|       |    /*
 2296|       |     * Steps c) to h) are really path normalization steps
 2297|       |     */
 2298|  7.10k|    xmlNormalizeURIPath(res->path);
 2299|       |
 2300|  13.8k|step_7:
 2301|       |
 2302|       |    /*
 2303|       |     * 7) The resulting URI components, including any inherited from the
 2304|       |     *    base URI, are recombined to give the absolute form of the URI
 2305|       |     *    reference.
 2306|       |     */
 2307|  13.8k|    val = xmlSaveUri(res);
 2308|  13.8k|    if (val != NULL)
  ------------------
  |  Branch (2308:9): [True: 13.7k, False: 86]
  ------------------
 2309|  13.7k|        ret = 0;
 2310|       |
 2311|  36.4k|done:
 2312|  36.4k|    if (ref != NULL)
  ------------------
  |  Branch (2312:9): [True: 25.1k, False: 11.2k]
  ------------------
 2313|  25.1k|	xmlFreeURI(ref);
 2314|  36.4k|    if (bas != NULL)
  ------------------
  |  Branch (2314:9): [True: 15.8k, False: 20.5k]
  ------------------
 2315|  15.8k|	xmlFreeURI(bas);
 2316|  36.4k|    if (res != NULL)
  ------------------
  |  Branch (2316:9): [True: 13.9k, False: 22.4k]
  ------------------
 2317|  13.9k|	xmlFreeURI(res);
 2318|  36.4k|    *valPtr = val;
 2319|  36.4k|    return(ret);
 2320|  13.8k|}
xmlBuildRelativeURISafe:
 2493|  10.0k|{
 2494|  10.0k|    xmlChar *val = NULL;
 2495|  10.0k|    int ret = 0;
 2496|  10.0k|    size_t ix = 0;
 2497|  10.0k|    size_t nbslash = 0;
 2498|  10.0k|    size_t len = 0;
 2499|  10.0k|    xmlURIPtr ref = NULL;
 2500|  10.0k|    xmlURIPtr bas = NULL;
 2501|  10.0k|    const xmlChar *bptr, *uptr, *rptr;
 2502|  10.0k|    xmlChar *vptr;
 2503|  10.0k|    int remove_path = 0;
 2504|  10.0k|    int refDrive, baseDrive;
 2505|       |
 2506|  10.0k|    if (valPtr == NULL)
  ------------------
  |  Branch (2506:9): [True: 0, False: 10.0k]
  ------------------
 2507|      0|        return(1);
 2508|  10.0k|    *valPtr = NULL;
 2509|  10.0k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2509:9): [True: 0, False: 10.0k]
  |  Branch (2509:26): [True: 455, False: 9.55k]
  ------------------
 2510|    455|	return(1);
 2511|       |
 2512|  9.55k|    ret = xmlParseUriOrPath((char *) URI, &ref, &refDrive);
 2513|  9.55k|    if (ret < 0)
  ------------------
  |  Branch (2513:9): [True: 35, False: 9.51k]
  ------------------
 2514|     35|        goto done;
 2515|  9.51k|    if (ret != 0) {
  ------------------
  |  Branch (2515:9): [True: 236, False: 9.27k]
  ------------------
 2516|       |        /* Return URI if URI is invalid */
 2517|    236|        ret = 0;
 2518|    236|        val = xmlStrdup(URI);
 2519|    236|        if (val == NULL)
  ------------------
  |  Branch (2519:13): [True: 1, False: 235]
  ------------------
 2520|      1|            ret = -1;
 2521|    236|        goto done;
 2522|    236|    }
 2523|       |
 2524|       |    /* Return URI if base is empty */
 2525|  9.27k|    if ((base == NULL) || (*base == 0))
  ------------------
  |  Branch (2525:9): [True: 0, False: 9.27k]
  |  Branch (2525:27): [True: 7.70k, False: 1.57k]
  ------------------
 2526|  7.70k|        goto done;
 2527|       |
 2528|  1.57k|    ret = xmlParseUriOrPath((char *) base, &bas, &baseDrive);
 2529|  1.57k|    if (ret < 0)
  ------------------
  |  Branch (2529:9): [True: 8, False: 1.56k]
  ------------------
 2530|      8|        goto done;
 2531|  1.56k|    if (ret != 0) {
  ------------------
  |  Branch (2531:9): [True: 197, False: 1.36k]
  ------------------
 2532|       |        /* Return URI if base is invalid */
 2533|    197|        ret = 0;
 2534|    197|        goto done;
 2535|    197|    }
 2536|       |
 2537|       |    /*
 2538|       |     * If the scheme / server on the URI differs from the base,
 2539|       |     * just return the URI
 2540|       |     */
 2541|  1.36k|    if ((xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2541:9): [True: 78, False: 1.28k]
  ------------------
 2542|  1.28k|	(xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2542:2): [True: 10, False: 1.27k]
  ------------------
 2543|  1.27k|        (bas->port != ref->port) ||
  ------------------
  |  Branch (2543:9): [True: 0, False: 1.27k]
  ------------------
 2544|  1.27k|        (baseDrive != refDrive)) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 1.27k]
  ------------------
 2545|     88|	goto done;
 2546|     88|    }
 2547|  1.27k|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2547:9): [True: 143, False: 1.13k]
  ------------------
 2548|    143|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    143|#define BAD_CAST (xmlChar *)
  ------------------
 2549|    143|        if (val == NULL)
  ------------------
  |  Branch (2549:13): [True: 1, False: 142]
  ------------------
 2550|      1|            ret = -1;
 2551|    143|	goto done;
 2552|    143|    }
 2553|  1.13k|    if (bas->path == NULL) {
  ------------------
  |  Branch (2553:9): [True: 10, False: 1.12k]
  ------------------
 2554|     10|	val = xmlStrdup((xmlChar *)ref->path);
 2555|     10|        if (val == NULL) {
  ------------------
  |  Branch (2555:13): [True: 1, False: 9]
  ------------------
 2556|      1|            ret = -1;
 2557|      1|            goto done;
 2558|      1|        }
 2559|      9|	goto escape;
 2560|     10|    }
 2561|  1.12k|    if (ref->path == NULL) {
  ------------------
  |  Branch (2561:9): [True: 10, False: 1.11k]
  ------------------
 2562|     10|        ref->path = (char *) "/";
 2563|     10|	remove_path = 1;
 2564|     10|    }
 2565|       |
 2566|  1.12k|    bptr = (xmlChar *) bas->path;
 2567|  1.12k|    rptr = (xmlChar *) ref->path;
 2568|       |
 2569|       |    /*
 2570|       |     * Return URI if URI and base aren't both absolute or relative.
 2571|       |     */
 2572|  1.12k|    if ((bptr[0] == '/') != (rptr[0] == '/'))
  ------------------
  |  Branch (2572:9): [True: 127, False: 998]
  ------------------
 2573|    127|        goto done;
 2574|       |
 2575|       |    /*
 2576|       |     * At this point we can compare the two paths
 2577|       |     */
 2578|    998|    {
 2579|    998|        size_t pos = 0;
 2580|       |
 2581|       |        /*
 2582|       |         * Next we compare the two strings and find where they first differ
 2583|       |         */
 2584|  3.29k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2584:9): [True: 2.30k, False: 998]
  |  Branch (2584:37): [True: 2.30k, False: 0]
  ------------------
 2585|  2.30k|	    pos++;
 2586|       |
 2587|    998|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2587:6): [True: 0, False: 998]
  ------------------
 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|    998|	ix = pos;
 2599|  1.93k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2599:9): [True: 1.10k, False: 834]
  ------------------
 2600|  1.10k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2600:10): [True: 164, False: 938]
  ------------------
 2601|    164|		break;
 2602|  1.10k|	}
 2603|    998|	uptr = (xmlChar *)&rptr[ix];
 2604|       |
 2605|       |	/*
 2606|       |	 * In base, count the number of '/' from the differing point
 2607|       |	 */
 2608|   219k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2608:9): [True: 218k, False: 998]
  ------------------
 2609|   218k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2609:10): [True: 58.8k, False: 160k]
  ------------------
 2610|  58.8k|		nbslash++;
 2611|   218k|	}
 2612|       |
 2613|       |	/*
 2614|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2615|       |	 */
 2616|    998|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2616:6): [True: 255, False: 743]
  |  Branch (2616:22): [True: 2, False: 253]
  ------------------
 2617|      2|	    val = xmlStrdup(BAD_CAST "./");
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 2618|      2|            if (val == NULL)
  ------------------
  |  Branch (2618:17): [True: 1, False: 1]
  ------------------
 2619|      1|                ret = -1;
 2620|      2|	    goto done;
 2621|      2|	}
 2622|       |
 2623|    996|	len = (size_t) xmlStrlen (uptr) + 1;
 2624|    996|    }
 2625|       |
 2626|    996|    if (nbslash == 0) {
  ------------------
  |  Branch (2626:9): [True: 253, False: 743]
  ------------------
 2627|    253|	if (uptr != NULL) {
  ------------------
  |  Branch (2627:6): [True: 253, False: 0]
  ------------------
 2628|       |	    /* exception characters from xmlSaveUri */
 2629|    253|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    253|#define BAD_CAST (xmlChar *)
  ------------------
 2630|    253|            if (val == NULL)
  ------------------
  |  Branch (2630:17): [True: 3, False: 250]
  ------------------
 2631|      3|                ret = -1;
 2632|    253|        }
 2633|    253|	goto done;
 2634|    253|    }
 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|    743|    if (len + 3 * nbslash > SIZE_MAX) {
  ------------------
  |  Branch (2641:9): [True: 0, False: 743]
  ------------------
 2642|      0|        ret = -1;
 2643|      0|        goto done;
 2644|      0|    }
 2645|    743|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2646|    743|    if (val == NULL) {
  ------------------
  |  Branch (2646:9): [True: 2, False: 741]
  ------------------
 2647|      2|        ret = -1;
 2648|      2|	goto done;
 2649|      2|    }
 2650|    741|    vptr = val;
 2651|       |    /*
 2652|       |     * Put in as many "../" as needed
 2653|       |     */
 2654|  59.5k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2654:12): [True: 58.8k, False: 741]
  ------------------
 2655|  58.8k|	*vptr++ = '.';
 2656|  58.8k|	*vptr++ = '.';
 2657|  58.8k|	*vptr++ = '/';
 2658|  58.8k|    }
 2659|       |    /*
 2660|       |     * Finish up with the end of the URI
 2661|       |     */
 2662|    741|    if (uptr != NULL) {
  ------------------
  |  Branch (2662:9): [True: 741, False: 0]
  ------------------
 2663|    741|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2663:13): [True: 741, False: 0]
  |  Branch (2663:29): [True: 741, False: 0]
  ------------------
 2664|    741|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2664:6): [True: 0, False: 741]
  |  Branch (2664:26): [True: 0, False: 0]
  ------------------
 2665|      0|	    memcpy (vptr, uptr + 1, len - 1);
 2666|      0|	    vptr[len - 2] = 0;
 2667|    741|	} else {
 2668|    741|	    memcpy (vptr, uptr, len);
 2669|    741|	    vptr[len - 1] = 0;
 2670|    741|	}
 2671|    741|    } else {
 2672|      0|	vptr[len - 1] = 0;
 2673|      0|    }
 2674|       |
 2675|    750|escape:
 2676|       |    /* escape the freshly-built path */
 2677|    750|    vptr = val;
 2678|       |    /* exception characters from xmlSaveUri */
 2679|    750|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    750|#define BAD_CAST (xmlChar *)
  ------------------
 2680|    750|    if (val == NULL)
  ------------------
  |  Branch (2680:9): [True: 3, False: 747]
  ------------------
 2681|      3|        ret = -1;
 2682|    747|    else
 2683|    747|        ret = 0;
 2684|    750|    xmlFree(vptr);
 2685|       |
 2686|  9.55k|done:
 2687|  9.55k|    if ((ret == 0) && (val == NULL)) {
  ------------------
  |  Branch (2687:9): [True: 9.49k, False: 55]
  |  Branch (2687:23): [True: 8.12k, False: 1.37k]
  ------------------
 2688|  8.12k|        val = xmlSaveUri(ref);
 2689|  8.12k|        if (val == NULL)
  ------------------
  |  Branch (2689:13): [True: 9, False: 8.11k]
  ------------------
 2690|      9|            ret = -1;
 2691|  8.12k|    }
 2692|       |
 2693|       |    /*
 2694|       |     * Free the working variables
 2695|       |     */
 2696|  9.55k|    if (remove_path != 0)
  ------------------
  |  Branch (2696:9): [True: 10, False: 9.54k]
  ------------------
 2697|     10|        ref->path = NULL;
 2698|  9.55k|    if (ref != NULL)
  ------------------
  |  Branch (2698:9): [True: 9.27k, False: 271]
  ------------------
 2699|  9.27k|	xmlFreeURI (ref);
 2700|  9.55k|    if (bas != NULL)
  ------------------
  |  Branch (2700:9): [True: 1.36k, False: 8.18k]
  ------------------
 2701|  1.36k|	xmlFreeURI (bas);
 2702|  9.55k|    if (ret != 0) {
  ------------------
  |  Branch (2702:9): [True: 64, False: 9.48k]
  ------------------
 2703|     64|        xmlFree(val);
 2704|     64|        val = NULL;
 2705|     64|    }
 2706|       |
 2707|  9.55k|    *valPtr = val;
 2708|  9.55k|    return(ret);
 2709|    750|}
xmlCanonicPath:
 2747|  9.39k|{
 2748|  9.39k|    xmlChar *ret;
 2749|       |
 2750|  9.39k|    if (path == NULL)
  ------------------
  |  Branch (2750:9): [True: 0, False: 9.39k]
  ------------------
 2751|      0|	return(NULL);
 2752|       |
 2753|       |    /* Check if this is an "absolute uri" */
 2754|  9.39k|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   34|  9.39k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2754:9): [True: 467, False: 8.92k]
  ------------------
 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|    467|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   34|    467|#define BAD_CAST (xmlChar *)
  ------------------
 2763|  8.92k|    } else {
 2764|  8.92k|        ret = xmlStrdup((const xmlChar *) path);
 2765|  8.92k|    }
 2766|       |
 2767|  9.39k|    return(ret);
 2768|  9.39k|}
xmlPathToURI:
 2781|  9.39k|{
 2782|  9.39k|    return(xmlCanonicPath(path));
 2783|  9.39k|}
uri.c:xmlParse3986URIReference:
  924|   831k|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  925|   831k|    int ret;
  926|       |
  927|   831k|    if (str == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 831k]
  ------------------
  928|      0|	return(-1);
  929|   831k|    xmlCleanURI(uri);
  930|       |
  931|       |    /*
  932|       |     * Try first to parse absolute refs, then fallback to relative if
  933|       |     * it fails.
  934|       |     */
  935|   831k|    ret = xmlParse3986URI(uri, str);
  936|   831k|    if (ret < 0)
  ------------------
  |  Branch (936:9): [True: 161, False: 831k]
  ------------------
  937|    161|        return(ret);
  938|   831k|    if (ret != 0) {
  ------------------
  |  Branch (938:9): [True: 800k, False: 30.6k]
  ------------------
  939|   800k|	xmlCleanURI(uri);
  940|   800k|        ret = xmlParse3986RelativeRef(uri, str);
  941|   800k|	if (ret != 0) {
  ------------------
  |  Branch (941:6): [True: 27.7k, False: 772k]
  ------------------
  942|  27.7k|	    xmlCleanURI(uri);
  943|  27.7k|	    return(ret);
  944|  27.7k|	}
  945|   800k|    }
  946|   803k|    return(0);
  947|   831k|}
uri.c:xmlCleanURI:
 1383|  1.69M|xmlCleanURI(xmlURIPtr uri) {
 1384|  1.69M|    if (uri == NULL) return;
  ------------------
  |  Branch (1384:9): [True: 0, False: 1.69M]
  ------------------
 1385|       |
 1386|  1.69M|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1386:9): [True: 52.1k, False: 1.64M]
  ------------------
 1387|  1.69M|    uri->scheme = NULL;
 1388|  1.69M|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1388:9): [True: 4.91k, False: 1.69M]
  ------------------
 1389|  1.69M|    uri->server = NULL;
 1390|  1.69M|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1390:9): [True: 880, False: 1.69M]
  ------------------
 1391|  1.69M|    uri->user = NULL;
 1392|  1.69M|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1392:9): [True: 23.5k, False: 1.67M]
  ------------------
 1393|  1.69M|    uri->path = NULL;
 1394|  1.69M|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1394:9): [True: 2.06k, False: 1.69M]
  ------------------
 1395|  1.69M|    uri->fragment = NULL;
 1396|  1.69M|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1396:9): [True: 0, False: 1.69M]
  ------------------
 1397|  1.69M|    uri->opaque = NULL;
 1398|  1.69M|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1398:9): [True: 0, False: 1.69M]
  ------------------
 1399|  1.69M|    uri->authority = NULL;
 1400|  1.69M|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1400:9): [True: 1.91k, False: 1.69M]
  ------------------
 1401|  1.69M|    uri->query = NULL;
 1402|  1.69M|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1402:9): [True: 1.89k, False: 1.69M]
  ------------------
 1403|       |    uri->query_raw = NULL;
 1404|  1.69M|}
uri.c:xmlParse3986URI:
  885|   831k|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  886|   831k|    int ret;
  887|       |
  888|   831k|    ret = xmlParse3986Scheme(uri, &str);
  889|   831k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (889:9): [True: 748k, False: 82.8k]
  ------------------
  890|  82.8k|    if (*str != ':') {
  ------------------
  |  Branch (890:9): [True: 42.0k, False: 40.8k]
  ------------------
  891|  42.0k|	return(1);
  892|  42.0k|    }
  893|  40.8k|    str++;
  894|  40.8k|    ret = xmlParse3986HierPart(uri, &str);
  895|  40.8k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (895:9): [True: 1.00k, False: 39.8k]
  ------------------
  896|  39.8k|    if (*str == '?') {
  ------------------
  |  Branch (896:9): [True: 3.18k, False: 36.6k]
  ------------------
  897|  3.18k|	str++;
  898|  3.18k|	ret = xmlParse3986Query(uri, &str);
  899|  3.18k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (899:6): [True: 9, False: 3.17k]
  ------------------
  900|  3.18k|    }
  901|  39.8k|    if (*str == '#') {
  ------------------
  |  Branch (901:9): [True: 1.97k, False: 37.8k]
  ------------------
  902|  1.97k|	str++;
  903|  1.97k|	ret = xmlParse3986Fragment(uri, &str);
  904|  1.97k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (904:6): [True: 4, False: 1.96k]
  ------------------
  905|  1.97k|    }
  906|  39.8k|    if (*str != 0) {
  ------------------
  |  Branch (906:9): [True: 9.17k, False: 30.6k]
  ------------------
  907|  9.17k|	xmlCleanURI(uri);
  908|  9.17k|	return(1);
  909|  9.17k|    }
  910|  30.6k|    return(0);
  911|  39.8k|}
uri.c:xmlParse3986Scheme:
  224|   831k|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  225|   831k|    const char *cur;
  226|       |
  227|   831k|    cur = *str;
  228|   831k|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  128|   831k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 79.5k, False: 752k]
  |  |  |  Branch (128:41): [True: 78.2k, False: 1.29k]
  |  |  ------------------
  |  |  129|   831k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 6.35k, False: 746k]
  |  |  |  Branch (129:41): [True: 4.72k, False: 1.63k]
  |  |  ------------------
  ------------------
  229|   748k|	return(1);
  230|  82.9k|    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|   275k|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  128|   550k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 97.8k, False: 177k]
  |  |  |  Branch (128:41): [True: 97.4k, False: 357]
  |  |  ------------------
  |  |  129|   550k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 75.4k, False: 102k]
  |  |  |  Branch (129:41): [True: 74.9k, False: 550]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  127|   377k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 53.8k, False: 48.9k]
  |  |  |  Branch (127:40): [True: 10.0k, False: 43.7k]
  |  |  ------------------
  ------------------
  241|   192k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (241:12): [True: 5.93k, False: 86.7k]
  |  Branch (241:29): [True: 1.27k, False: 85.4k]
  |  Branch (241:46): [True: 2.53k, False: 82.9k]
  ------------------
  242|  82.9k|    if (uri != NULL) {
  ------------------
  |  Branch (242:9): [True: 82.9k, False: 0]
  ------------------
  243|  82.9k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (243:6): [True: 0, False: 82.9k]
  ------------------
  244|  82.9k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|  82.9k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  245|  82.9k|        if (uri->scheme == NULL)
  ------------------
  |  Branch (245:13): [True: 70, False: 82.8k]
  ------------------
  246|     70|            return(-1);
  247|  82.9k|    }
  248|  82.8k|    *str = cur;
  249|  82.8k|    return(0);
  250|  82.9k|}
uri.c:xmlParse3986HierPart:
  782|  40.8k|{
  783|  40.8k|    const char *cur;
  784|  40.8k|    int ret;
  785|       |
  786|  40.8k|    cur = *str;
  787|       |
  788|  40.8k|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (788:9): [True: 30.6k, False: 10.1k]
  |  Branch (788:26): [True: 29.2k, False: 1.48k]
  ------------------
  789|  29.2k|        cur += 2;
  790|  29.2k|	ret = xmlParse3986Authority(uri, &cur);
  791|  29.2k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (791:6): [True: 971, False: 28.2k]
  ------------------
  792|       |        /*
  793|       |         * An empty server is marked with a special URI value.
  794|       |         */
  795|  28.2k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   36|  3.58k|#define PORT_EMPTY           0
  ------------------
  |  Branch (795:6): [True: 3.58k, False: 24.6k]
  |  Branch (795:31): [True: 3.32k, False: 259]
  ------------------
  796|  3.32k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   37|  3.32k|#define PORT_EMPTY_SERVER   -1
  ------------------
  797|  28.2k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  798|  28.2k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (798:6): [True: 9, False: 28.2k]
  ------------------
  799|  28.2k|	*str = cur;
  800|  28.2k|	return(0);
  801|  28.2k|    } else if (*cur == '/') {
  ------------------
  |  Branch (801:16): [True: 1.48k, False: 10.1k]
  ------------------
  802|  1.48k|        ret = xmlParse3986PathAbsolute(uri, &cur);
  803|  1.48k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (803:6): [True: 1, False: 1.48k]
  ------------------
  804|  10.1k|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  174|  10.1k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  20.3k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 2.91k, False: 7.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  17.4k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.09k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  4.19k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.83k, False: 259]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 288, False: 1.55k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.14k, False: 662]
  |  |  |  |  |  |  |  Branch (131:43): [True: 950, False: 197]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.09k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 589, False: 270]
  |  |  |  |  |  |  |  Branch (132:27): [True: 380, False: 209]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.61k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  3.23k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.39k, False: 225]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 287, False: 1.10k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 663, False: 668]
  |  |  |  |  |  |  |  Branch (131:43): [True: 456, False: 207]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.61k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 646, False: 229]
  |  |  |  |  |  |  |  Branch (132:27): [True: 311, False: 335]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 2.09k, False: 5.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  16.4k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 257, False: 5.96k]
  |  |  |  |  |  Branch (139:27): [True: 204, False: 5.76k]
  |  |  |  |  |  Branch (139:46): [True: 337, False: 5.42k]
  |  |  |  |  ------------------
  |  |  |  |  140|  6.22k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 210, False: 5.21k]
  |  |  |  |  |  Branch (140:27): [True: 200, False: 5.01k]
  |  |  |  |  |  Branch (140:46): [True: 238, False: 4.77k]
  |  |  |  |  ------------------
  |  |  |  |  141|  6.22k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 482, False: 4.29k]
  |  |  |  |  |  Branch (141:27): [True: 376, False: 3.91k]
  |  |  |  |  |  Branch (141:46): [True: 364, False: 3.55k]
  |  |  |  |  ------------------
  |  |  |  |  142|  6.22k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 199, False: 3.35k]
  |  |  |  |  |  Branch (142:27): [True: 202, False: 3.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  10.1k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 390, False: 2.76k]
  |  |  |  Branch (175:26): [True: 207, False: 2.55k]
  |  |  ------------------
  ------------------
  805|  7.63k|        ret = xmlParse3986PathRootless(uri, &cur);
  806|  7.63k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (806:6): [True: 19, False: 7.61k]
  ------------------
  807|  7.63k|    } else {
  808|       |	/* path-empty is effectively empty */
  809|  2.55k|	if (uri != NULL) {
  ------------------
  |  Branch (809:6): [True: 2.55k, False: 0]
  ------------------
  810|  2.55k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (810:10): [True: 0, False: 2.55k]
  ------------------
  811|  2.55k|	    uri->path = NULL;
  812|  2.55k|	}
  813|  2.55k|    }
  814|  11.6k|    *str = cur;
  815|  11.6k|    return (0);
  816|  40.8k|}
uri.c:xmlParse3986Authority:
  529|  32.4k|{
  530|  32.4k|    const char *cur;
  531|  32.4k|    int ret;
  532|       |
  533|  32.4k|    cur = *str;
  534|       |    /*
  535|       |     * try to parse an userinfo and check for the trailing @
  536|       |     */
  537|  32.4k|    ret = xmlParse3986Userinfo(uri, &cur);
  538|  32.4k|    if (ret < 0)
  ------------------
  |  Branch (538:9): [True: 17, False: 32.4k]
  ------------------
  539|     17|        return(ret);
  540|  32.4k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (540:9): [True: 26.8k, False: 5.52k]
  |  Branch (540:23): [True: 0, False: 5.52k]
  ------------------
  541|  26.8k|        cur = *str;
  542|  5.52k|    else
  543|  5.52k|        cur++;
  544|  32.4k|    ret = xmlParse3986Host(uri, &cur);
  545|  32.4k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (545:9): [True: 312, False: 32.1k]
  ------------------
  546|  32.1k|    if (*cur == ':') {
  ------------------
  |  Branch (546:9): [True: 2.75k, False: 29.3k]
  ------------------
  547|  2.75k|        cur++;
  548|  2.75k|        ret = xmlParse3986Port(uri, &cur);
  549|  2.75k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (549:6): [True: 960, False: 1.79k]
  ------------------
  550|  2.75k|    }
  551|  31.1k|    *str = cur;
  552|  31.1k|    return(0);
  553|  32.1k|}
uri.c:xmlParse3986Userinfo:
  379|  32.4k|{
  380|  32.4k|    const char *cur;
  381|       |
  382|  32.4k|    cur = *str;
  383|   435k|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  189|   871k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 179k, False: 256k]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  168|   692k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|   210k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|   421k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 210k, False: 279]
  |  |  |  |  |  |  |  Branch (127:40): [True: 206k, False: 3.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.27k, False: 2.54k]
  |  |  |  |  |  Branch (131:43): [True: 1.05k, False: 213]
  |  |  |  |  ------------------
  |  |  |  |  132|   210k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 2.34k, False: 413]
  |  |  |  |  |  Branch (132:27): [True: 2.11k, False: 230]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|   209k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|   419k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 209k, False: 354]
  |  |  |  |  |  |  |  Branch (127:40): [True: 207k, False: 2.63k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.03k, False: 1.95k]
  |  |  |  |  |  Branch (131:43): [True: 735, False: 300]
  |  |  |  |  ------------------
  |  |  |  |  132|   209k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.68k, False: 573]
  |  |  |  |  |  Branch (132:27): [True: 1.38k, False: 300]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 210k, False: 45.9k]
  |  |  ------------------
  ------------------
  384|  47.4k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  139|   483k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 1.61k, False: 45.8k]
  |  |  |  Branch (139:27): [True: 668, False: 45.2k]
  |  |  |  Branch (139:46): [True: 548, False: 44.6k]
  |  |  ------------------
  |  |  140|  47.4k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 577, False: 44.0k]
  |  |  |  Branch (140:27): [True: 1.74k, False: 42.3k]
  |  |  |  Branch (140:46): [True: 1.48k, False: 40.8k]
  |  |  ------------------
  |  |  141|  47.4k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.07k, False: 39.7k]
  |  |  |  Branch (141:27): [True: 670, False: 39.1k]
  |  |  |  Branch (141:46): [True: 1.27k, False: 37.8k]
  |  |  ------------------
  |  |  142|  47.4k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.59k, False: 36.2k]
  |  |  |  Branch (142:27): [True: 1.43k, False: 34.8k]
  |  |  ------------------
  ------------------
  |  Branch (384:34): [True: 2.36k, False: 32.4k]
  ------------------
  385|   403k|	NEXT(cur);
  ------------------
  |  |  108|   403k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 209k, False: 194k]
  |  |  ------------------
  ------------------
  386|  32.4k|    if (*cur == '@') {
  ------------------
  |  Branch (386:9): [True: 5.54k, False: 26.8k]
  ------------------
  387|  5.54k|	if (uri != NULL) {
  ------------------
  |  Branch (387:6): [True: 5.54k, False: 0]
  ------------------
  388|  5.54k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (388:10): [True: 0, False: 5.54k]
  ------------------
  389|  5.54k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  5.54k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (389:10): [True: 0, False: 5.54k]
  ------------------
  390|      0|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  391|  5.54k|	    else
  392|  5.54k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  393|  5.54k|            if (uri->user == NULL)
  ------------------
  |  Branch (393:17): [True: 17, False: 5.52k]
  ------------------
  394|     17|                return(-1);
  395|  5.54k|	}
  396|  5.52k|	*str = cur;
  397|  5.52k|	return(0);
  398|  5.54k|    }
  399|  26.8k|    return(1);
  400|  32.4k|}
uri.c:xmlParse3986Host:
  452|  32.4k|{
  453|  32.4k|    const char *cur = *str;
  454|  32.4k|    const char *host;
  455|       |
  456|  32.4k|    host = cur;
  457|       |    /*
  458|       |     * IPv6 and future addressing scheme are enclosed between brackets
  459|       |     */
  460|  32.4k|    if (*cur == '[') {
  ------------------
  |  Branch (460:9): [True: 467, False: 31.9k]
  ------------------
  461|    467|        cur++;
  462|  3.01k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (462:9): [True: 2.81k, False: 193]
  |  Branch (462:26): [True: 2.54k, False: 274]
  ------------------
  463|  2.54k|	    cur++;
  464|    467|	if (*cur != ']')
  ------------------
  |  Branch (464:6): [True: 274, False: 193]
  ------------------
  465|    274|	    return(1);
  466|    193|	cur++;
  467|    193|	goto found;
  468|    467|    }
  469|       |    /*
  470|       |     * try to parse an IPv4
  471|       |     */
  472|  31.9k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  31.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 23.9k, False: 7.98k]
  |  |  |  Branch (127:40): [True: 7.02k, False: 16.9k]
  |  |  ------------------
  ------------------
  473|  7.02k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (473:13): [True: 806, False: 6.22k]
  ------------------
  474|    806|	    goto not_ipv4;
  475|  6.22k|	if (*cur != '.')
  ------------------
  |  Branch (475:6): [True: 3.35k, False: 2.86k]
  ------------------
  476|  3.35k|	    goto not_ipv4;
  477|  2.86k|	cur++;
  478|  2.86k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (478:13): [True: 1.20k, False: 1.66k]
  ------------------
  479|  1.20k|	    goto not_ipv4;
  480|  1.66k|	if (*cur != '.')
  ------------------
  |  Branch (480:6): [True: 1.42k, False: 242]
  ------------------
  481|  1.42k|	    goto not_ipv4;
  482|    242|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (482:13): [True: 242, False: 0]
  ------------------
  483|    242|	    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.02k|not_ipv4:
  490|  7.02k|        cur = *str;
  491|  7.02k|    }
  492|       |    /*
  493|       |     * then this should be a hostname which can be empty
  494|       |     */
  495|  9.35M|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  189|  18.7M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 9.29M, False: 63.2k]
  |  |  ------------------
  ------------------
  496|  63.2k|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  168|  9.42M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  13.4k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  26.8k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 13.1k, False: 297]
  |  |  |  |  |  |  |  Branch (127:40): [True: 9.93k, False: 3.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.34k, False: 2.16k]
  |  |  |  |  |  Branch (131:43): [True: 1.12k, False: 221]
  |  |  |  |  ------------------
  |  |  |  |  132|  13.4k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.95k, False: 431]
  |  |  |  |  |  Branch (132:27): [True: 1.71k, False: 238]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(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.4k, False: 361]
  |  |  |  |  |  |  |  Branch (127:40): [True: 9.85k, False: 2.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.09k, False: 1.82k]
  |  |  |  |  |  Branch (131:43): [True: 792, False: 300]
  |  |  |  |  ------------------
  |  |  |  |  132|  12.7k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.54k, False: 580]
  |  |  |  |  |  Branch (132:27): [True: 1.24k, False: 300]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 13.4k, False: 49.7k]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  139|  51.3k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 2.90k, False: 48.4k]
  |  |  |  Branch (139:27): [True: 1.36k, False: 47.0k]
  |  |  |  Branch (139:46): [True: 420, False: 46.6k]
  |  |  ------------------
  |  |  140|  51.3k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 1.94k, False: 44.6k]
  |  |  |  Branch (140:27): [True: 1.98k, False: 42.7k]
  |  |  |  Branch (140:46): [True: 1.72k, False: 40.9k]
  |  |  ------------------
  |  |  141|  51.3k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.44k, False: 39.5k]
  |  |  |  Branch (141:27): [True: 679, False: 38.8k]
  |  |  |  Branch (141:46): [True: 3.68k, False: 35.1k]
  |  |  ------------------
  |  |  142|  51.3k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.86k, False: 33.3k]
  |  |  |  Branch (142:27): [True: 1.34k, False: 31.9k]
  |  |  ------------------
  ------------------
  497|  9.32M|        NEXT(cur);
  ------------------
  |  |  108|  9.35M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 11.8k, False: 9.31M]
  |  |  ------------------
  ------------------
  498|  32.1k|found:
  499|  32.1k|    if (uri != NULL) {
  ------------------
  |  Branch (499:9): [True: 32.1k, False: 0]
  ------------------
  500|  32.1k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (500:6): [True: 0, False: 32.1k]
  ------------------
  501|  32.1k|	uri->authority = NULL;
  502|  32.1k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (502:6): [True: 0, False: 32.1k]
  ------------------
  503|  32.1k|	if (cur != host) {
  ------------------
  |  Branch (503:6): [True: 27.1k, False: 5.00k]
  ------------------
  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: 38, False: 27.1k]
  ------------------
  509|     38|                return(-1);
  510|  27.1k|	} else
  511|  5.00k|	    uri->server = NULL;
  512|  32.1k|    }
  513|  32.1k|    *str = cur;
  514|  32.1k|    return(0);
  515|  32.1k|}
uri.c:xmlParse3986DecOctet:
  415|  10.1k|xmlParse3986DecOctet(const char **str) {
  416|  10.1k|    const char *cur = *str;
  417|       |
  418|  10.1k|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  127|  10.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 9.42k, False: 713]
  |  |  |  Branch (127:40): [True: 9.17k, False: 248]
  |  |  ------------------
  ------------------
  419|    961|        return(1);
  420|  9.17k|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  127|  9.17k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 5.46k, False: 3.71k]
  |  |  |  Branch (127:40): [True: 4.65k, False: 811]
  |  |  ------------------
  ------------------
  421|  4.52k|	cur++;
  422|  4.65k|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  4.05k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 4.05k, False: 0]
  |  |  |  Branch (127:40): [True: 4.05k, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  4.05k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.08k, False: 969]
  |  |  |  Branch (127:40): [True: 2.23k, False: 850]
  |  |  ------------------
  ------------------
  |  Branch (422:14): [True: 4.05k, False: 598]
  ------------------
  423|  1.81k|	cur += 2;
  424|  2.83k|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    417|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 417, False: 0]
  |  |  |  Branch (127:40): [True: 417, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    417|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 417, False: 0]
  |  |  |  Branch (127:40): [True: 417, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (424:14): [True: 417, False: 2.41k]
  ------------------
  425|    417|	cur += 3;
  426|  2.41k|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (426:14): [True: 1.54k, False: 875]
  |  Branch (426:31): [True: 1.54k, False: 0]
  ------------------
  427|  1.54k|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    580|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 580, False: 0]
  |  |  |  Branch (127:40): [True: 580, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:7): [True: 580, False: 963]
  ------------------
  428|    580|	cur += 3;
  429|  1.83k|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (429:14): [True: 963, False: 875]
  |  Branch (429:31): [True: 551, False: 412]
  ------------------
  430|    551|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (430:7): [True: 551, False: 0]
  |  Branch (430:30): [True: 551, False: 0]
  ------------------
  431|    551|	cur += 3;
  432|  1.28k|    else
  433|  1.28k|        return(1);
  434|  7.89k|    *str = cur;
  435|  7.89k|    return(0);
  436|  9.17k|}
uri.c:xmlParse3986Port:
  342|  2.75k|{
  343|  2.75k|    const char *cur = *str;
  344|  2.75k|    int port = 0;
  345|       |
  346|  2.75k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  2.75k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 2.45k, False: 307]
  |  |  |  Branch (127:40): [True: 2.06k, False: 385]
  |  |  ------------------
  ------------------
  347|  8.48k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  8.48k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 7.02k, False: 1.45k]
  |  |  |  Branch (127:40): [True: 6.68k, False: 346]
  |  |  ------------------
  ------------------
  348|  6.68k|            int digit = *cur - '0';
  349|       |
  350|  6.68k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (350:17): [True: 201, False: 6.48k]
  ------------------
  351|    201|                return(1);
  352|  6.48k|            port *= 10;
  353|  6.48k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (353:17): [True: 67, False: 6.41k]
  ------------------
  354|     67|                return(1);
  355|  6.41k|	    port += digit;
  356|       |
  357|  6.41k|	    cur++;
  358|  6.41k|	}
  359|  1.79k|	if (uri != NULL)
  ------------------
  |  Branch (359:6): [True: 1.79k, False: 0]
  ------------------
  360|  1.79k|	    uri->port = port;
  361|  1.79k|	*str = cur;
  362|  1.79k|	return(0);
  363|  2.06k|    }
  364|    692|    return(1);
  365|  2.75k|}
uri.c:xmlParse3986PathAbEmpty:
  609|  31.1k|{
  610|  31.1k|    const char *cur;
  611|  31.1k|    int ret;
  612|       |
  613|  31.1k|    cur = *str;
  614|       |
  615|   128k|    while (*cur == '/') {
  ------------------
  |  Branch (615:12): [True: 97.6k, False: 31.1k]
  ------------------
  616|  97.6k|        cur++;
  617|  97.6k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  618|  97.6k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (618:6): [True: 0, False: 97.6k]
  ------------------
  619|  97.6k|    }
  620|  31.1k|    if (uri != NULL) {
  ------------------
  |  Branch (620:9): [True: 31.1k, False: 0]
  ------------------
  621|  31.1k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (621:6): [True: 0, False: 31.1k]
  ------------------
  622|  31.1k|        if (*str != cur) {
  ------------------
  |  Branch (622:13): [True: 16.6k, False: 14.4k]
  ------------------
  623|  16.6k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  16.6k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (623:17): [True: 0, False: 16.6k]
  ------------------
  624|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  625|  16.6k|            else
  626|  16.6k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  627|  16.6k|            if (uri->path == NULL)
  ------------------
  |  Branch (627:17): [True: 12, False: 16.6k]
  ------------------
  628|     12|                return (-1);
  629|  16.6k|        } else {
  630|  14.4k|            uri->path = NULL;
  631|  14.4k|        }
  632|  31.1k|    }
  633|  31.1k|    *str = cur;
  634|  31.1k|    return (0);
  635|  31.1k|}
uri.c:xmlParse3986Segment:
  572|   333k|{
  573|   333k|    const char *cur;
  574|       |
  575|   333k|    cur = *str;
  576|   333k|    if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) {
  ------------------
  |  |  174|   666k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   666k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 227k, False: 105k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   438k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  5.13k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  10.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.83k, False: 297]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.46k, False: 3.37k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.98k, False: 1.69k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.75k, False: 223]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  5.13k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.43k, False: 481]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.08k, False: 353]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.29k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  8.59k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.10k, False: 196]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.33k, False: 2.77k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.24k, False: 1.71k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.04k, False: 200]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.29k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.68k, False: 228]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.32k, False: 368]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 5.13k, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   435k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.03k, False: 99.7k]
  |  |  |  |  |  Branch (139:27): [True: 1.96k, False: 97.8k]
  |  |  |  |  |  Branch (139:46): [True: 719, False: 97.0k]
  |  |  |  |  ------------------
  |  |  |  |  140|   101k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.69k, False: 95.3k]
  |  |  |  |  |  Branch (140:27): [True: 1.34k, False: 94.0k]
  |  |  |  |  |  Branch (140:46): [True: 48.0k, False: 46.0k]
  |  |  |  |  ------------------
  |  |  |  |  141|   101k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.81k, False: 44.2k]
  |  |  |  |  |  Branch (141:27): [True: 1.34k, False: 42.8k]
  |  |  |  |  |  Branch (141:46): [True: 1.66k, False: 41.2k]
  |  |  |  |  ------------------
  |  |  |  |  142|   101k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.19k, False: 40.0k]
  |  |  |  |  |  Branch (142:27): [True: 1.78k, False: 38.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   333k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 3.35k, False: 34.8k]
  |  |  |  Branch (175:26): [True: 2.89k, False: 31.9k]
  |  |  ------------------
  ------------------
  |  Branch (576:33): [True: 898, False: 300k]
  ------------------
  577|  32.8k|        if (empty)
  ------------------
  |  Branch (577:13): [True: 29.6k, False: 3.21k]
  ------------------
  578|  29.6k|	    return(0);
  579|  3.21k|	return(1);
  580|  32.8k|    }
  581|   300k|    NEXT(cur);
  ------------------
  |  |  108|   300k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 3.70k, False: 296k]
  |  |  ------------------
  ------------------
  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|  7.25M|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  174|  14.5M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  14.5M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 4.42M, False: 2.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  10.0M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  11.8k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  23.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 11.4k, False: 447]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.74k, False: 3.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.44k, False: 2.67k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.22k, False: 227]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  11.8k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.30k, False: 603]
  |  |  |  |  |  |  |  Branch (132:27): [True: 2.02k, False: 274]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  10.9k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  21.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 10.4k, False: 503]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.27k, False: 3.20k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.28k, False: 2.42k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.07k, False: 215]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.9k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.09k, False: 540]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.55k, False: 547]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 11.8k, False: 2.81M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  10.0M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 3.06k, False: 2.81M]
  |  |  |  |  |  Branch (139:27): [True: 4.12k, False: 2.81M]
  |  |  |  |  |  Branch (139:46): [True: 340, False: 2.81M]
  |  |  |  |  ------------------
  |  |  |  |  140|  2.81M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.68k, False: 2.80M]
  |  |  |  |  |  Branch (140:27): [True: 1.37k, False: 2.80M]
  |  |  |  |  |  Branch (140:46): [True: 2.48M, False: 319k]
  |  |  |  |  ------------------
  |  |  |  |  141|  2.81M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.63k, False: 318k]
  |  |  |  |  |  Branch (141:27): [True: 2.38k, False: 315k]
  |  |  |  |  |  Branch (141:46): [True: 1.60k, False: 314k]
  |  |  |  |  ------------------
  |  |  |  |  142|  2.81M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 5.31k, False: 308k]
  |  |  |  |  |  Branch (142:27): [True: 1.84k, False: 306k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  7.25M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 16.4k, False: 290k]
  |  |  |  Branch (175:26): [True: 1.55k, False: 288k]
  |  |  ------------------
  ------------------
  |  Branch (591:35): [True: 6.95M, False: 11.6k]
  ------------------
  592|  6.95M|        NEXT(cur);
  ------------------
  |  |  108|  7.25M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 9.90k, False: 6.94M]
  |  |  ------------------
  ------------------
  593|   300k|    *str = cur;
  594|   300k|    return (0);
  595|   333k|}
uri.c:xmlParse3986PathAbsolute:
  649|  9.25k|{
  650|  9.25k|    const char *cur;
  651|  9.25k|    int ret;
  652|       |
  653|  9.25k|    cur = *str;
  654|       |
  655|  9.25k|    if (*cur != '/')
  ------------------
  |  Branch (655:9): [True: 0, False: 9.25k]
  ------------------
  656|      0|        return(1);
  657|  9.25k|    cur++;
  658|  9.25k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  659|  9.25k|    if (ret == 0) {
  ------------------
  |  Branch (659:9): [True: 6.93k, False: 2.32k]
  ------------------
  660|  21.3k|	while (*cur == '/') {
  ------------------
  |  Branch (660:9): [True: 14.3k, False: 6.93k]
  ------------------
  661|  14.3k|	    cur++;
  662|  14.3k|	    ret = xmlParse3986Segment(uri, &cur, 0, 1);
  663|  14.3k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (663:10): [True: 0, False: 14.3k]
  ------------------
  664|  14.3k|	}
  665|  6.93k|    }
  666|  9.25k|    if (uri != NULL) {
  ------------------
  |  Branch (666:9): [True: 9.25k, False: 0]
  ------------------
  667|  9.25k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (667:6): [True: 0, False: 9.25k]
  ------------------
  668|  9.25k|        if (cur != *str) {
  ------------------
  |  Branch (668:13): [True: 9.25k, False: 0]
  ------------------
  669|  9.25k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  9.25k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (669:17): [True: 0, False: 9.25k]
  ------------------
  670|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  671|  9.25k|            else
  672|  9.25k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  673|  9.25k|            if (uri->path == NULL)
  ------------------
  |  Branch (673:17): [True: 18, False: 9.23k]
  ------------------
  674|     18|                return (-1);
  675|  9.25k|        } else {
  676|      0|            uri->path = NULL;
  677|      0|        }
  678|  9.25k|    }
  679|  9.23k|    *str = cur;
  680|  9.23k|    return (0);
  681|  9.25k|}
uri.c:xmlIsUnreserved:
  196|  56.8M|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  197|  56.8M|    if (uri == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 56.8M]
  ------------------
  198|      0|        return(0);
  199|       |
  200|  56.8M|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  161|  56.8M|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|  56.8M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:24): [True: 4.56M, False: 52.3M]
  |  |  |  |  |  Branch (128:41): [True: 4.55M, False: 15.3k]
  |  |  |  |  ------------------
  |  |  |  |  129|  56.8M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 38.1M, False: 14.2M]
  |  |  |  |  |  Branch (129:41): [True: 38.0M, False: 25.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  127|  14.2M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:23): [True: 1.72M, False: 12.5M]
  |  |  |  |  |  Branch (127:40): [True: 962k, False: 761k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (161:44): [True: 91.8k, False: 13.1M]
  |  |  ------------------
  |  |  162|  56.8M|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (162:8): [True: 296k, False: 12.8M]
  |  |  |  Branch (162:27): [True: 2.96k, False: 12.8M]
  |  |  |  Branch (162:46): [True: 14.4k, False: 12.8M]
  |  |  ------------------
  ------------------
  201|  44.0M|        return(1);
  202|       |
  203|  12.8M|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  191|  12.8M|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (203:9): [True: 0, False: 12.8M]
  ------------------
  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|  12.8M|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  193|  12.8M|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (206:16): [True: 0, False: 12.8M]
  ------------------
  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|  12.8M|    return(0);
  212|  12.8M|}
uri.c:xmlParse3986PathRootless:
  695|  7.63k|{
  696|  7.63k|    const char *cur;
  697|  7.63k|    int ret;
  698|       |
  699|  7.63k|    cur = *str;
  700|       |
  701|  7.63k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  702|  7.63k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (702:9): [True: 0, False: 7.63k]
  ------------------
  703|  11.4k|    while (*cur == '/') {
  ------------------
  |  Branch (703:12): [True: 3.84k, False: 7.63k]
  ------------------
  704|  3.84k|        cur++;
  705|  3.84k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  706|  3.84k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (706:6): [True: 0, False: 3.84k]
  ------------------
  707|  3.84k|    }
  708|  7.63k|    if (uri != NULL) {
  ------------------
  |  Branch (708:9): [True: 7.63k, False: 0]
  ------------------
  709|  7.63k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (709:6): [True: 0, False: 7.63k]
  ------------------
  710|  7.63k|        if (cur != *str) {
  ------------------
  |  Branch (710:13): [True: 7.63k, False: 0]
  ------------------
  711|  7.63k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  7.63k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (711:17): [True: 0, False: 7.63k]
  ------------------
  712|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  713|  7.63k|            else
  714|  7.63k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  715|  7.63k|            if (uri->path == NULL)
  ------------------
  |  Branch (715:17): [True: 19, False: 7.61k]
  ------------------
  716|     19|                return (-1);
  717|  7.63k|        } else {
  718|      0|            uri->path = NULL;
  719|      0|        }
  720|  7.63k|    }
  721|  7.61k|    *str = cur;
  722|  7.61k|    return (0);
  723|  7.63k|}
uri.c:xmlParse3986Query:
  300|  9.15k|{
  301|  9.15k|    const char *cur;
  302|       |
  303|  9.15k|    cur = *str;
  304|       |
  305|  26.1M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?'))
  ------------------
  |  |  174|  26.1M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  52.3M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 25.1M, False: 971k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  27.1M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  5.54k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  11.0k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 5.29k, False: 247]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 2.61k, False: 2.68k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.43k, False: 1.49k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.13k, False: 299]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  5.54k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.53k, False: 263]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.19k, False: 332]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.94k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  9.89k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.61k, False: 335]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.95k, False: 2.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.27k, False: 1.71k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.05k, False: 216]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.94k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.57k, False: 358]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.20k, False: 373]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 5.54k, False: 966k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  27.1M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.82k, False: 964k]
  |  |  |  |  |  Branch (139:27): [True: 451, False: 964k]
  |  |  |  |  |  Branch (139:46): [True: 312, False: 963k]
  |  |  |  |  ------------------
  |  |  |  |  140|   967k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 516, False: 963k]
  |  |  |  |  |  Branch (140:27): [True: 791, False: 962k]
  |  |  |  |  |  Branch (140:46): [True: 849k, False: 112k]
  |  |  |  |  ------------------
  |  |  |  |  141|   967k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 887, False: 111k]
  |  |  |  |  |  Branch (141:27): [True: 552, False: 111k]
  |  |  |  |  |  Branch (141:46): [True: 1.00k, False: 110k]
  |  |  |  |  ------------------
  |  |  |  |  142|   967k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 543, False: 109k]
  |  |  |  |  |  Branch (142:27): [True: 399, False: 109k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  26.1M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 4.09k, False: 105k]
  |  |  |  Branch (175:26): [True: 4.86k, False: 100k]
  |  |  ------------------
  ------------------
  |  Branch (305:37): [True: 45.4k, False: 54.9k]
  |  Branch (305:54): [True: 45.7k, False: 9.15k]
  ------------------
  306|  26.1M|        NEXT(cur);
  ------------------
  |  |  108|  26.1M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 4.21k, False: 26.1M]
  |  |  ------------------
  ------------------
  307|  9.15k|    if (uri != NULL) {
  ------------------
  |  Branch (307:9): [True: 9.15k, False: 0]
  ------------------
  308|  9.15k|        if (uri->query != NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 9.15k]
  ------------------
  309|      0|            xmlFree(uri->query);
  310|  9.15k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  9.15k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (310:6): [True: 0, False: 9.15k]
  ------------------
  311|      0|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  312|  9.15k|	else
  313|  9.15k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  314|  9.15k|        if (uri->query == NULL)
  ------------------
  |  Branch (314:13): [True: 26, False: 9.13k]
  ------------------
  315|     26|            return (-1);
  316|       |
  317|       |	/* Save the raw bytes of the query as well.
  318|       |	 * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00114
  319|       |	 */
  320|  9.13k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 9.13k]
  ------------------
  321|      0|	    xmlFree (uri->query_raw);
  322|  9.13k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  119|  9.13k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  323|  9.13k|        if (uri->query_raw == NULL)
  ------------------
  |  Branch (323:13): [True: 15, False: 9.11k]
  ------------------
  324|     15|            return (-1);
  325|  9.13k|    }
  326|  9.11k|    *str = cur;
  327|  9.11k|    return (0);
  328|  9.15k|}
uri.c:xmlParse3986Fragment:
  267|   635k|{
  268|   635k|    const char *cur;
  269|       |
  270|   635k|    cur = *str;
  271|       |
  272|  12.5M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  174|  12.5M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  25.0M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 4.56M, False: 7.97M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  20.5M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  8.07k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  16.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 7.80k, False: 268]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 4.54k, False: 3.26k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.29k, False: 2.23k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.09k, False: 209]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  8.07k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.98k, False: 456]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.73k, False: 251]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  7.36k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  14.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 7.06k, False: 301]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 3.98k, False: 3.08k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.48k, False: 1.90k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.01k, False: 467]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  7.36k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.02k, False: 343]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.39k, False: 628]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 8.07k, False: 7.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  20.5M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 3.86M, False: 4.10M]
  |  |  |  |  |  Branch (139:27): [True: 14.4k, False: 4.08M]
  |  |  |  |  |  Branch (139:46): [True: 455, False: 4.08M]
  |  |  |  |  ------------------
  |  |  |  |  140|  7.97M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 532k, False: 3.55M]
  |  |  |  |  |  Branch (140:27): [True: 537k, False: 3.01M]
  |  |  |  |  |  Branch (140:46): [True: 38.0k, False: 2.98M]
  |  |  |  |  ------------------
  |  |  |  |  141|  7.97M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.89k, False: 2.97M]
  |  |  |  |  |  Branch (141:27): [True: 553k, False: 2.42M]
  |  |  |  |  |  Branch (141:46): [True: 531k, False: 1.89M]
  |  |  |  |  ------------------
  |  |  |  |  142|  7.97M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 873, False: 1.89M]
  |  |  |  |  |  Branch (142:27): [True: 1.16k, False: 1.89M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  12.5M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 69.5k, False: 1.82M]
  |  |  |  Branch (175:26): [True: 3.58k, False: 1.81M]
  |  |  ------------------
  ------------------
  |  Branch (272:37): [True: 1.17M, False: 645k]
  |  Branch (272:54): [True: 4.31k, False: 641k]
  ------------------
  273|   641k|           (*cur == '[') || (*cur == ']'))
  ------------------
  |  Branch (273:12): [True: 1.65k, False: 639k]
  |  Branch (273:29): [True: 4.13k, False: 635k]
  ------------------
  274|  11.9M|        NEXT(cur);
  ------------------
  |  |  108|  11.9M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 6.39k, False: 11.8M]
  |  |  ------------------
  ------------------
  275|   635k|    if (uri != NULL) {
  ------------------
  |  Branch (275:9): [True: 635k, False: 0]
  ------------------
  276|   635k|        if (uri->fragment != NULL)
  ------------------
  |  Branch (276:13): [True: 0, False: 635k]
  ------------------
  277|      0|            xmlFree(uri->fragment);
  278|   635k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   635k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (278:6): [True: 0, False: 635k]
  ------------------
  279|      0|	    uri->fragment = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  280|   635k|	else
  281|   635k|	    uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
  282|   635k|        if (uri->fragment == NULL)
  ------------------
  |  Branch (282:13): [True: 42, False: 635k]
  ------------------
  283|     42|            return (-1);
  284|   635k|    }
  285|   635k|    *str = cur;
  286|   635k|    return (0);
  287|   635k|}
uri.c:xmlParse3986RelativeRef:
  833|   800k|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  834|   800k|    int ret;
  835|       |
  836|   800k|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (836:9): [True: 11.0k, False: 789k]
  |  Branch (836:26): [True: 3.23k, False: 7.77k]
  ------------------
  837|  3.23k|        str += 2;
  838|  3.23k|	ret = xmlParse3986Authority(uri, &str);
  839|  3.23k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (839:6): [True: 318, False: 2.91k]
  ------------------
  840|  2.91k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  841|  2.91k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (841:6): [True: 3, False: 2.91k]
  ------------------
  842|   797k|    } else if (*str == '/') {
  ------------------
  |  Branch (842:16): [True: 7.77k, False: 789k]
  ------------------
  843|  7.77k|	ret = xmlParse3986PathAbsolute(uri, &str);
  844|  7.77k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (844:6): [True: 17, False: 7.75k]
  ------------------
  845|   789k|    } else if (ISA_PCHAR(uri, str)) {
  ------------------
  |  |  174|   789k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  1.57M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 140k, False: 649k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  1.43M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.85k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  7.71k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.62k, False: 228]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 948, False: 2.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.47k, False: 1.43k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.24k, False: 232]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.85k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.28k, False: 384]
  |  |  |  |  |  |  |  Branch (132:27): [True: 913, False: 369]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.10k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  6.20k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 2.80k, False: 294]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.02k, False: 1.78k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 638, False: 1.44k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 432, False: 206]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.10k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.08k, False: 561]
  |  |  |  |  |  |  |  Branch (132:27): [True: 750, False: 338]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 3.85k, False: 645k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  1.43M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.36k, False: 645k]
  |  |  |  |  |  Branch (139:27): [True: 1.31k, False: 644k]
  |  |  |  |  |  Branch (139:46): [True: 330, False: 644k]
  |  |  |  |  ------------------
  |  |  |  |  140|   647k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.26k, False: 642k]
  |  |  |  |  |  Branch (140:27): [True: 641, False: 642k]
  |  |  |  |  |  Branch (140:46): [True: 1.88k, False: 640k]
  |  |  |  |  ------------------
  |  |  |  |  141|   647k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 906, False: 639k]
  |  |  |  |  |  Branch (141:27): [True: 723, False: 638k]
  |  |  |  |  |  Branch (141:46): [True: 699, False: 638k]
  |  |  |  |  ------------------
  |  |  |  |  142|   647k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 961, False: 637k]
  |  |  |  |  |  Branch (142:27): [True: 904, False: 636k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   789k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 898, False: 635k]
  |  |  |  Branch (175:26): [True: 793, False: 634k]
  |  |  ------------------
  ------------------
  846|   155k|        ret = xmlParse3986PathNoScheme(uri, &str);
  847|   155k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (847:6): [True: 997, False: 154k]
  ------------------
  848|   634k|    } else {
  849|       |	/* path-empty is effectively empty */
  850|   634k|	if (uri != NULL) {
  ------------------
  |  Branch (850:6): [True: 634k, False: 0]
  ------------------
  851|   634k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (851:10): [True: 0, False: 634k]
  ------------------
  852|   634k|	    uri->path = NULL;
  853|   634k|	}
  854|   634k|    }
  855|       |
  856|   799k|    if (*str == '?') {
  ------------------
  |  Branch (856:9): [True: 5.97k, False: 793k]
  ------------------
  857|  5.97k|	str++;
  858|  5.97k|	ret = xmlParse3986Query(uri, &str);
  859|  5.97k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (859:6): [True: 32, False: 5.94k]
  ------------------
  860|  5.97k|    }
  861|   799k|    if (*str == '#') {
  ------------------
  |  Branch (861:9): [True: 633k, False: 165k]
  ------------------
  862|   633k|	str++;
  863|   633k|	ret = xmlParse3986Fragment(uri, &str);
  864|   633k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (864:6): [True: 38, False: 633k]
  ------------------
  865|   633k|    }
  866|   799k|    if (*str != 0) {
  ------------------
  |  Branch (866:9): [True: 26.3k, False: 772k]
  ------------------
  867|  26.3k|	xmlCleanURI(uri);
  868|  26.3k|	return(1);
  869|  26.3k|    }
  870|   772k|    return(0);
  871|   799k|}
uri.c:xmlParse3986PathNoScheme:
  737|   155k|{
  738|   155k|    const char *cur;
  739|   155k|    int ret;
  740|       |
  741|   155k|    cur = *str;
  742|       |
  743|   155k|    ret = xmlParse3986Segment(uri, &cur, ':', 0);
  744|   155k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (744:9): [True: 898, False: 154k]
  ------------------
  745|   199k|    while (*cur == '/') {
  ------------------
  |  Branch (745:12): [True: 45.5k, False: 154k]
  ------------------
  746|  45.5k|        cur++;
  747|  45.5k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  748|  45.5k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (748:6): [True: 0, False: 45.5k]
  ------------------
  749|  45.5k|    }
  750|   154k|    if (uri != NULL) {
  ------------------
  |  Branch (750:9): [True: 154k, False: 0]
  ------------------
  751|   154k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (751:6): [True: 0, False: 154k]
  ------------------
  752|   154k|        if (cur != *str) {
  ------------------
  |  Branch (752:13): [True: 154k, False: 0]
  ------------------
  753|   154k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   154k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (753:17): [True: 0, False: 154k]
  ------------------
  754|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  755|   154k|            else
  756|   154k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  757|   154k|            if (uri->path == NULL)
  ------------------
  |  Branch (757:17): [True: 99, False: 154k]
  ------------------
  758|     99|                return (-1);
  759|   154k|        } else {
  760|      0|            uri->path = NULL;
  761|      0|        }
  762|   154k|    }
  763|   154k|    *str = cur;
  764|   154k|    return (0);
  765|   154k|}
uri.c:xmlSaveUriRealloc:
 1074|  8.93k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1075|  8.93k|    xmlChar *temp;
 1076|  8.93k|    int newSize;
 1077|       |
 1078|  8.93k|    newSize = xmlGrowCapacity(*max, 1, 80, MAX_URI_LENGTH);
  ------------------
  |  |   34|  8.93k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
 1079|  8.93k|    if (newSize < 0)
  ------------------
  |  Branch (1079:9): [True: 24, False: 8.90k]
  ------------------
 1080|     24|        return(NULL);
 1081|  8.90k|    temp = xmlRealloc(ret, newSize + 1);
 1082|  8.90k|    if (temp == NULL)
  ------------------
  |  Branch (1082:9): [True: 29, False: 8.88k]
  ------------------
 1083|     29|        return(NULL);
 1084|  8.88k|    *max = newSize;
 1085|  8.88k|    return(temp);
 1086|  8.90k|}
uri.c:xmlNormalizePath:
 1456|  92.3k|xmlNormalizePath(char *path, int isFile) {
 1457|  92.3k|    char *cur, *out;
 1458|  92.3k|    int numSeg = 0;
 1459|       |
 1460|  92.3k|    if (path == NULL)
  ------------------
  |  Branch (1460:9): [True: 1.25k, False: 91.0k]
  ------------------
 1461|  1.25k|	return(-1);
 1462|       |
 1463|  91.0k|    cur = path;
 1464|  91.0k|    out = path;
 1465|       |
 1466|  91.0k|    if (*cur == 0)
  ------------------
  |  Branch (1466:9): [True: 200, False: 90.8k]
  ------------------
 1467|    200|        return(0);
 1468|       |
 1469|  90.8k|    if (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1469:9): [True: 6.50k, False: 84.3k]
  ------------------
 1470|  6.50k|        cur++;
 1471|  6.50k|        *out++ = '/';
 1472|  6.50k|    }
 1473|       |
 1474|   329k|    while (*cur != 0) {
  ------------------
  |  Branch (1474:12): [True: 305k, False: 24.0k]
  ------------------
 1475|       |        /*
 1476|       |         * At this point, out is either empty or ends with a separator.
 1477|       |         * Collapse multiple separators first.
 1478|       |         */
 1479|   346k|        while (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1479:16): [True: 41.2k, False: 305k]
  ------------------
 1480|       |#if defined(LIBXML_WINPATH_ENABLED)
 1481|       |            /* Allow two separators at start of path */
 1482|       |            if ((isFile) && (out == path + 1))
 1483|       |                *out++ = '/';
 1484|       |#endif
 1485|  41.2k|            cur++;
 1486|  41.2k|        }
 1487|       |
 1488|   305k|        if (*cur == '.') {
  ------------------
  |  Branch (1488:13): [True: 204k, False: 100k]
  ------------------
 1489|   204k|            if (cur[1] == 0) {
  ------------------
  |  Branch (1489:17): [True: 66.3k, False: 138k]
  ------------------
 1490|       |                /* Ignore "." at end of path */
 1491|  66.3k|                break;
 1492|   138k|            } else if (xmlIsPathSeparator(cur[1], isFile)) {
  ------------------
  |  Branch (1492:24): [True: 76.0k, False: 62.1k]
  ------------------
 1493|       |                /* Skip "./" */
 1494|  76.0k|                cur += 2;
 1495|  76.0k|                continue;
 1496|  76.0k|            } else if ((cur[1] == '.') &&
  ------------------
  |  Branch (1496:24): [True: 60.5k, False: 1.57k]
  ------------------
 1497|  60.5k|                       ((cur[2] == 0) || xmlIsPathSeparator(cur[2], isFile))) {
  ------------------
  |  Branch (1497:25): [True: 463, False: 60.1k]
  |  Branch (1497:42): [True: 59.5k, False: 547]
  ------------------
 1498|  60.0k|                if (numSeg > 0) {
  ------------------
  |  Branch (1498:21): [True: 4.07k, False: 55.9k]
  ------------------
 1499|       |                    /* Handle ".." by removing last segment */
 1500|  20.6k|                    do {
 1501|  20.6k|                        out--;
 1502|  20.6k|                    } while ((out > path) &&
  ------------------
  |  Branch (1502:30): [True: 20.2k, False: 420]
  ------------------
 1503|  20.2k|                             !xmlIsPathSeparator(out[-1], isFile));
  ------------------
  |  Branch (1503:30): [True: 16.5k, False: 3.65k]
  ------------------
 1504|  4.07k|                    numSeg--;
 1505|       |
 1506|  4.07k|                    if (cur[2] == 0)
  ------------------
  |  Branch (1506:25): [True: 245, False: 3.83k]
  ------------------
 1507|    245|                        break;
 1508|  3.83k|                    cur += 3;
 1509|  3.83k|                    continue;
 1510|  55.9k|                } else if (out[0] == '/') {
  ------------------
  |  Branch (1510:28): [True: 421, False: 55.5k]
  ------------------
 1511|       |                    /* Ignore extraneous ".." in absolute paths */
 1512|    421|                    if (cur[2] == 0)
  ------------------
  |  Branch (1512:25): [True: 198, False: 223]
  ------------------
 1513|    198|                        break;
 1514|    223|                    cur += 3;
 1515|    223|                    continue;
 1516|  55.5k|                } else {
 1517|       |                    /* Keep "../" at start of relative path */
 1518|  55.5k|                    numSeg--;
 1519|  55.5k|                }
 1520|  60.0k|            }
 1521|   204k|        }
 1522|       |
 1523|       |        /* Copy segment */
 1524|  2.66M|        while ((*cur != 0) && !xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1524:16): [True: 2.64M, False: 22.7k]
  |  Branch (1524:31): [True: 2.51M, False: 135k]
  ------------------
 1525|  2.51M|            *out++ = *cur++;
 1526|  2.51M|        }
 1527|       |
 1528|       |        /* Copy separator */
 1529|   158k|        if (*cur != 0) {
  ------------------
  |  Branch (1529:13): [True: 135k, False: 22.7k]
  ------------------
 1530|   135k|            cur++;
 1531|   135k|            *out++ = '/';
 1532|   135k|        }
 1533|       |
 1534|   158k|        numSeg++;
 1535|   158k|    }
 1536|       |
 1537|       |    /* Keep "." if output is empty and it's a file */
 1538|  90.8k|    if ((isFile) && (out <= path))
  ------------------
  |  Branch (1538:9): [True: 83.8k, False: 7.01k]
  |  Branch (1538:21): [True: 66.0k, False: 17.7k]
  ------------------
 1539|  66.0k|        *out++ = '.';
 1540|  90.8k|    *out = 0;
 1541|       |
 1542|  90.8k|    return(0);
 1543|  91.0k|}
uri.c:xmlIsPathSeparator:
 1434|  3.51M|xmlIsPathSeparator(int c, int isFile) {
 1435|  3.51M|    (void) isFile;
 1436|       |
 1437|  3.51M|    if (c == '/')
  ------------------
  |  Branch (1437:9): [True: 398k, False: 3.11M]
  ------------------
 1438|   398k|        return(1);
 1439|       |
 1440|       |#if defined(LIBXML_WINPATH_ENABLED)
 1441|       |    if (isFile && (c == '\\'))
 1442|       |        return(1);
 1443|       |#endif
 1444|       |
 1445|  3.11M|    return(0);
 1446|  3.51M|}
uri.c:is_hex:
 1559|   477k|static int is_hex(char c) {
 1560|   477k|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1560:10): [True: 475k, False: 1.81k]
  |  Branch (1560:24): [True: 445k, False: 30.0k]
  ------------------
 1561|  31.8k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1561:10): [True: 13.3k, False: 18.5k]
  |  Branch (1561:24): [True: 12.5k, False: 856]
  ------------------
 1562|  19.3k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1562:10): [True: 17.2k, False: 2.14k]
  |  Branch (1562:24): [True: 16.0k, False: 1.16k]
  ------------------
 1563|   474k|	return(1);
 1564|  3.31k|    return(0);
 1565|   477k|}
uri.c:xmlResolvePath:
 1863|   703k|xmlResolvePath(const xmlChar *escRef, const xmlChar *base, xmlChar **out) {
 1864|   703k|    const xmlChar *fragment;
 1865|   703k|    xmlChar *tmp = NULL;
 1866|   703k|    xmlChar *ref = NULL;
 1867|   703k|    xmlChar *result = NULL;
 1868|   703k|    int ret = -1;
 1869|   703k|    int i;
 1870|       |
 1871|   703k|    if (out == NULL)
  ------------------
  |  Branch (1871:9): [True: 0, False: 703k]
  ------------------
 1872|      0|        return(1);
 1873|   703k|    *out = NULL;
 1874|       |
 1875|   703k|    if ((escRef == NULL) || (escRef[0] == 0)) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 703k]
  |  Branch (1875:29): [True: 3.97k, False: 699k]
  ------------------
 1876|  3.97k|        if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1876:13): [True: 0, False: 3.97k]
  |  Branch (1876:31): [True: 3.52k, False: 455]
  ------------------
 1877|  3.52k|            return(1);
 1878|    455|        ref = xmlStrdup(base);
 1879|    455|        if (ref == NULL)
  ------------------
  |  Branch (1879:13): [True: 3, False: 452]
  ------------------
 1880|      3|            goto err_memory;
 1881|    452|        *out = ref;
 1882|    452|        return(0);
 1883|    455|    }
 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|   699k|    fragment = xmlStrchr(escRef, '#');
 1891|   699k|    if (fragment != NULL) {
  ------------------
  |  Branch (1891:9): [True: 621k, False: 77.1k]
  ------------------
 1892|   621k|        tmp = xmlStrndup(escRef, fragment - escRef);
 1893|   621k|        if (tmp == NULL)
  ------------------
  |  Branch (1893:13): [True: 10, False: 621k]
  ------------------
 1894|     10|            goto err_memory;
 1895|   621k|        escRef = tmp;
 1896|   621k|    }
 1897|       |
 1898|   699k|    ref = (xmlChar *) xmlURIUnescapeString((char *) escRef, -1, NULL);
 1899|   699k|    if (ref == NULL)
  ------------------
  |  Branch (1899:9): [True: 46, False: 699k]
  ------------------
 1900|     46|        goto err_memory;
 1901|       |
 1902|   699k|    if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1902:9): [True: 0, False: 699k]
  |  Branch (1902:27): [True: 622k, False: 76.4k]
  ------------------
 1903|   622k|        goto done;
 1904|       |
 1905|  76.4k|    if (xmlIsAbsolutePath(ref))
  ------------------
  |  Branch (1905:9): [True: 1.84k, False: 74.5k]
  ------------------
 1906|  1.84k|        goto done;
 1907|       |
 1908|       |    /*
 1909|       |     * Remove last segment from base
 1910|       |     */
 1911|  74.5k|    i = xmlStrlen(base);
 1912|   129k|    while ((i > 0) && !xmlIsPathSeparator(base[i-1], 1))
  ------------------
  |  Branch (1912:12): [True: 128k, False: 1.21k]
  |  Branch (1912:23): [True: 54.8k, False: 73.3k]
  ------------------
 1913|  54.8k|        i--;
 1914|       |
 1915|       |    /*
 1916|       |     * Concatenate base and ref
 1917|       |     */
 1918|  74.5k|    if (i > 0) {
  ------------------
  |  Branch (1918:9): [True: 73.3k, False: 1.21k]
  ------------------
 1919|  73.3k|        int refLen = xmlStrlen(ref);
 1920|       |
 1921|  73.3k|        result = xmlMalloc(i + refLen + 1);
 1922|  73.3k|        if (result == NULL)
  ------------------
  |  Branch (1922:13): [True: 24, False: 73.3k]
  ------------------
 1923|     24|            goto err_memory;
 1924|       |
 1925|  73.3k|        memcpy(result, base, i);
 1926|  73.3k|        memcpy(result + i, ref, refLen + 1);
 1927|  73.3k|    }
 1928|       |
 1929|       |    /*
 1930|       |     * Normalize
 1931|       |     */
 1932|  74.5k|    xmlNormalizePath((char *) result, 1);
 1933|       |
 1934|   699k|done:
 1935|   699k|    if (result == NULL) {
  ------------------
  |  Branch (1935:9): [True: 625k, False: 73.3k]
  ------------------
 1936|   625k|        result = ref;
 1937|   625k|        ref = NULL;
 1938|   625k|    }
 1939|       |
 1940|   699k|    if (fragment != NULL) {
  ------------------
  |  Branch (1940:9): [True: 621k, False: 77.1k]
  ------------------
 1941|   621k|        result = xmlStrcat(result, fragment);
 1942|   621k|        if (result == NULL)
  ------------------
  |  Branch (1942:13): [True: 12, False: 621k]
  ------------------
 1943|     12|            goto err_memory;
 1944|   621k|    }
 1945|       |
 1946|   699k|    *out = result;
 1947|   699k|    ret = 0;
 1948|       |
 1949|   699k|err_memory:
 1950|   699k|    xmlFree(tmp);
 1951|   699k|    xmlFree(ref);
 1952|   699k|    return(ret);
 1953|   699k|}
uri.c:xmlIsAbsolutePath:
 1837|  86.9k|xmlIsAbsolutePath(const xmlChar *path) {
 1838|  86.9k|    int c = path[0];
 1839|       |
 1840|  86.9k|    if (xmlIsPathSeparator(c, 1))
  ------------------
  |  Branch (1840:9): [True: 2.59k, False: 84.3k]
  ------------------
 1841|  2.59k|        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|  84.3k|    return(0);
 1851|  86.9k|}
uri.c:xmlParseUriOrPath:
 2344|  11.1k|xmlParseUriOrPath(const char *str, xmlURIPtr *out, int *drive) {
 2345|  11.1k|    xmlURIPtr uri;
 2346|  11.1k|    char *buf = NULL;
 2347|  11.1k|    int ret;
 2348|       |
 2349|  11.1k|    *out = NULL;
 2350|  11.1k|    *drive = 0;
 2351|       |
 2352|  11.1k|    uri = xmlCreateURI();
 2353|  11.1k|    if (uri == NULL) {
  ------------------
  |  Branch (2353:9): [True: 20, False: 11.1k]
  ------------------
 2354|     20|        ret = -1;
 2355|     20|	goto done;
 2356|     20|    }
 2357|       |
 2358|  11.1k|    if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  11.1k|#define BAD_CAST (xmlChar *)
  ------------------
                  if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  11.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2358:9): [True: 10.5k, False: 583]
  ------------------
 2359|  10.5k|        const char *path;
 2360|  10.5k|        size_t pathSize;
 2361|  10.5k|        int prependSlash = 0;
 2362|       |
 2363|  10.5k|        buf = xmlMemStrdup(str);
 2364|  10.5k|        if (buf == NULL) {
  ------------------
  |  Branch (2364:13): [True: 9, False: 10.5k]
  ------------------
 2365|      9|            ret = -1;
 2366|      9|            goto done;
 2367|      9|        }
 2368|  10.5k|        xmlNormalizePath(buf, /* isFile */ 1);
 2369|       |
 2370|  10.5k|        path = buf;
 2371|       |
 2372|  10.5k|        if (xmlIsAbsolutePath(BAD_CAST buf)) {
  ------------------
  |  |   34|  10.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2372:13): [True: 749, False: 9.76k]
  ------------------
 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|    749|        }
 2426|       |
 2427|  10.5k|        pathSize = strlen(path);
 2428|  10.5k|        uri->path = xmlMalloc(pathSize + prependSlash + 1);
 2429|  10.5k|        if (uri->path == NULL) {
  ------------------
  |  Branch (2429:13): [True: 13, False: 10.4k]
  ------------------
 2430|     13|            ret = -1;
 2431|     13|            goto done;
 2432|     13|        }
 2433|  10.4k|        if (prependSlash) {
  ------------------
  |  Branch (2433:13): [True: 0, False: 10.4k]
  ------------------
 2434|      0|            uri->path[0] = '/';
 2435|      0|            memcpy(uri->path + 1, path, pathSize + 1);
 2436|  10.4k|        } else {
 2437|  10.4k|            memcpy(uri->path, path, pathSize + 1);
 2438|  10.4k|        }
 2439|  10.4k|    } else {
 2440|    583|	ret = xmlParseURIReference(uri, str);
 2441|    583|	if (ret != 0)
  ------------------
  |  Branch (2441:6): [True: 434, False: 149]
  ------------------
 2442|    434|	    goto done;
 2443|       |
 2444|    149|        xmlNormalizePath(uri->path, /* isFile */ 0);
 2445|    149|    }
 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|  10.6k|    *out = uri;
 2456|  10.6k|    uri = NULL;
 2457|  10.6k|    ret = 0;
 2458|       |
 2459|  11.1k|done:
 2460|  11.1k|    xmlFreeURI(uri);
 2461|  11.1k|    xmlFree(buf);
 2462|       |
 2463|  11.1k|    return(ret);
 2464|  10.6k|}

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

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

xmlSerializeText:
  306|  1.71M|                 unsigned flags) {
  307|  1.71M|    const xmlChar *cur;
  308|  1.71M|    const signed char *tab;
  309|       |
  310|  1.71M|    if (string == NULL)
  ------------------
  |  Branch (310:9): [True: 0, False: 1.71M]
  ------------------
  311|      0|        return;
  312|       |
  313|  1.71M|#ifdef LIBXML_HTML_ENABLED
  314|  1.71M|    if (flags & XML_ESCAPE_HTML) {
  ------------------
  |  |   24|  1.71M|#define XML_ESCAPE_HTML             (1u << 2)
  ------------------
  |  Branch (314:9): [True: 0, False: 1.71M]
  ------------------
  315|      0|        if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|      0|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  ------------------
  316|      0|            tab = htmlEscapeTabAttr;
  317|      0|        else
  318|      0|            tab = htmlEscapeTab;
  319|      0|    }
  320|  1.71M|    else
  321|  1.71M|#endif
  322|  1.71M|    {
  323|  1.71M|        if (flags & XML_ESCAPE_QUOT)
  ------------------
  |  |   25|  1.71M|#define XML_ESCAPE_QUOT             (1u << 3)
  ------------------
  |  Branch (323:13): [True: 0, False: 1.71M]
  ------------------
  324|      0|            tab = xmlEscapeTabQuot;
  325|  1.71M|        else if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|  1.71M|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (325:18): [True: 1.08M, False: 630k]
  ------------------
  326|  1.08M|            tab = xmlEscapeTabAttr;
  327|   630k|        else
  328|   630k|            tab = xmlEscapeTab;
  329|  1.71M|    }
  330|       |
  331|  1.71M|    cur = string;
  332|       |
  333|  1.78M|    while (1) {
  ------------------
  |  Branch (333:12): [True: 1.78M, Folded]
  ------------------
  334|  1.78M|        const xmlChar *base;
  335|  1.78M|        int c;
  336|  1.78M|        int offset;
  337|       |
  338|  1.78M|        base = cur;
  339|  1.78M|        offset = -1;
  340|       |
  341|  79.8M|        while (1) {
  ------------------
  |  Branch (341:16): [True: 79.8M, Folded]
  ------------------
  342|  79.8M|            if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (342:17): [True: 0, False: 79.8M]
  ------------------
  343|      0|                break;
  344|       |
  345|  79.8M|            c = (unsigned char) *cur;
  346|       |
  347|  79.8M|            if (c < 0x80) {
  ------------------
  |  Branch (347:17): [True: 76.0M, False: 3.76M]
  ------------------
  348|  76.0M|                offset = tab[c];
  349|  76.0M|                if (offset >= 0)
  ------------------
  |  Branch (349:21): [True: 1.78M, False: 74.2M]
  ------------------
  350|  1.78M|                    break;
  351|  76.0M|            } else if (flags & XML_ESCAPE_NON_ASCII) {
  ------------------
  |  |   23|  3.76M|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  |  Branch (351:24): [True: 0, False: 3.76M]
  ------------------
  352|      0|                break;
  353|      0|            }
  354|       |
  355|  78.0M|            cur += 1;
  356|  78.0M|        }
  357|       |
  358|  1.78M|        if (cur > base)
  ------------------
  |  Branch (358:13): [True: 1.65M, False: 131k]
  ------------------
  359|  1.65M|            xmlOutputBufferWrite(buf, cur - base, (char *) base);
  360|       |
  361|  1.78M|        if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (361:13): [True: 0, False: 1.78M]
  ------------------
  362|      0|            break;
  363|       |
  364|  1.78M|        if (offset >= 0) {
  ------------------
  |  Branch (364:13): [True: 1.78M, False: 0]
  ------------------
  365|  1.78M|            if (c == 0)
  ------------------
  |  Branch (365:17): [True: 1.71M, False: 71.7k]
  ------------------
  366|  1.71M|                break;
  367|       |
  368|  71.7k|            xmlOutputBufferWrite(buf, xmlEscapeContent[offset],
  369|  71.7k|                                 &xmlEscapeContent[offset+1]);
  370|  71.7k|            cur += 1;
  371|  71.7k|        } else {
  372|      0|            char tempBuf[12];
  373|      0|            int tempSize;
  374|      0|            int val = 0, len = 4;
  375|       |
  376|      0|            val = xmlGetUTF8Char(cur, &len);
  377|      0|            if (val < 0) {
  ------------------
  |  Branch (377:17): [True: 0, False: 0]
  ------------------
  378|      0|                val = 0xFFFD;
  379|      0|                cur += 1;
  380|      0|            } else {
  381|      0|                if ((val == 0xFFFE) || (val == 0xFFFF))
  ------------------
  |  Branch (381:21): [True: 0, False: 0]
  |  Branch (381:40): [True: 0, False: 0]
  ------------------
  382|      0|                    val = 0xFFFD;
  383|      0|                cur += len;
  384|      0|            }
  385|       |
  386|      0|            tempSize = xmlSerializeHexCharRef(tempBuf, val);
  387|      0|            xmlOutputBufferWrite(buf, tempSize, tempBuf);
  388|      0|        }
  389|  1.78M|    }
  390|  1.71M|}
xmlAllocParserInputBuffer:
 1332|  35.6k|xmlAllocParserInputBuffer(xmlCharEncoding enc) {
 1333|  35.6k|    xmlParserInputBufferPtr ret;
 1334|       |
 1335|  35.6k|    ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer));
 1336|  35.6k|    if (ret == NULL) {
  ------------------
  |  Branch (1336:9): [True: 5, False: 35.6k]
  ------------------
 1337|      5|	return(NULL);
 1338|      5|    }
 1339|  35.6k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 1340|  35.6k|    ret->buffer = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  35.6k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1341|  35.6k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1341:9): [True: 3, False: 35.5k]
  ------------------
 1342|      3|        xmlFree(ret);
 1343|      3|	return(NULL);
 1344|      3|    }
 1345|  35.5k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1345:9): [True: 0, False: 35.5k]
  ------------------
 1346|      0|        if (xmlLookupCharEncodingHandler(enc, &ret->encoder) != XML_ERR_OK) {
  ------------------
  |  Branch (1346:13): [True: 0, False: 0]
  ------------------
 1347|       |            /* We can't handle errors properly here. */
 1348|      0|            xmlFreeParserInputBuffer(ret);
 1349|      0|            return(NULL);
 1350|      0|        }
 1351|      0|    }
 1352|  35.5k|    if (ret->encoder != NULL)
  ------------------
  |  Branch (1352:9): [True: 0, False: 35.5k]
  ------------------
 1353|      0|        ret->raw = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|      0|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1354|  35.5k|    else
 1355|  35.5k|        ret->raw = NULL;
 1356|  35.5k|    ret->readcallback = NULL;
 1357|  35.5k|    ret->closecallback = NULL;
 1358|  35.5k|    ret->context = NULL;
 1359|  35.5k|    ret->compressed = -1;
 1360|  35.5k|    ret->rawconsumed = 0;
 1361|       |
 1362|  35.5k|    return(ret);
 1363|  35.5k|}
xmlAllocOutputBuffer:
 1375|  30.6k|xmlAllocOutputBuffer(xmlCharEncodingHandler *encoder) {
 1376|  30.6k|    xmlOutputBufferPtr ret;
 1377|       |
 1378|  30.6k|    ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
 1379|  30.6k|    if (ret == NULL) {
  ------------------
  |  Branch (1379:9): [True: 34, False: 30.6k]
  ------------------
 1380|     34|	return(NULL);
 1381|     34|    }
 1382|  30.6k|    memset(ret, 0, sizeof(xmlOutputBuffer));
 1383|  30.6k|    ret->buffer = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|  30.6k|#define MINLEN 4000
  ------------------
 1384|  30.6k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1384:9): [True: 43, False: 30.5k]
  ------------------
 1385|     43|        xmlFree(ret);
 1386|     43|	return(NULL);
 1387|     43|    }
 1388|       |
 1389|  30.5k|    ret->encoder = encoder;
 1390|  30.5k|    if (encoder != NULL) {
  ------------------
  |  Branch (1390:9): [True: 0, False: 30.5k]
  ------------------
 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|  30.5k|        ret->conv = NULL;
 1404|  30.5k|    ret->writecallback = NULL;
 1405|  30.5k|    ret->closecallback = NULL;
 1406|  30.5k|    ret->context = NULL;
 1407|  30.5k|    ret->written = 0;
 1408|       |
 1409|  30.5k|    return(ret);
 1410|  30.5k|}
xmlFreeParserInputBuffer:
 1419|   338k|xmlFreeParserInputBuffer(xmlParserInputBuffer *in) {
 1420|   338k|    if (in == NULL) return;
  ------------------
  |  Branch (1420:9): [True: 2.97k, False: 335k]
  ------------------
 1421|       |
 1422|   335k|    if (in->raw) {
  ------------------
  |  Branch (1422:9): [True: 13.5k, False: 321k]
  ------------------
 1423|  13.5k|        xmlBufFree(in->raw);
 1424|  13.5k|	in->raw = NULL;
 1425|  13.5k|    }
 1426|   335k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1426:9): [True: 13.5k, False: 321k]
  ------------------
 1427|  13.5k|        xmlCharEncCloseFunc(in->encoder);
 1428|  13.5k|    }
 1429|   335k|    if (in->closecallback != NULL) {
  ------------------
  |  Branch (1429:9): [True: 0, False: 335k]
  ------------------
 1430|      0|	in->closecallback(in->context);
 1431|      0|    }
 1432|   335k|    if (in->buffer != NULL) {
  ------------------
  |  Branch (1432:9): [True: 335k, False: 0]
  ------------------
 1433|   335k|        xmlBufFree(in->buffer);
 1434|   335k|	in->buffer = NULL;
 1435|   335k|    }
 1436|       |
 1437|   335k|    xmlFree(in);
 1438|   335k|}
xmlOutputBufferClose:
 1451|  30.5k|{
 1452|  30.5k|    int ret;
 1453|       |
 1454|  30.5k|    if (out == NULL)
  ------------------
  |  Branch (1454:9): [True: 0, False: 30.5k]
  ------------------
 1455|      0|        return (-1);
 1456|       |
 1457|  30.5k|    if (out->writecallback != NULL)
  ------------------
  |  Branch (1457:9): [True: 0, False: 30.5k]
  ------------------
 1458|      0|        xmlOutputBufferFlush(out);
 1459|       |
 1460|  30.5k|    if (out->closecallback != NULL) {
  ------------------
  |  Branch (1460:9): [True: 0, False: 30.5k]
  ------------------
 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|  30.5k|    if (out->error != XML_ERR_OK)
  ------------------
  |  Branch (1472:9): [True: 19, False: 30.5k]
  ------------------
 1473|     19|        ret = -out->error;
 1474|  30.5k|    else
 1475|  30.5k|        ret = out->written;
 1476|       |
 1477|  30.5k|    if (out->conv) {
  ------------------
  |  Branch (1477:9): [True: 0, False: 30.5k]
  ------------------
 1478|      0|        xmlBufFree(out->conv);
 1479|      0|        out->conv = NULL;
 1480|      0|    }
 1481|  30.5k|    if (out->encoder != NULL) {
  ------------------
  |  Branch (1481:9): [True: 0, False: 30.5k]
  ------------------
 1482|      0|        xmlCharEncCloseFunc(out->encoder);
 1483|      0|    }
 1484|  30.5k|    if (out->buffer != NULL) {
  ------------------
  |  Branch (1484:9): [True: 30.5k, False: 0]
  ------------------
 1485|  30.5k|        xmlBufFree(out->buffer);
 1486|  30.5k|        out->buffer = NULL;
 1487|  30.5k|    }
 1488|       |
 1489|  30.5k|    xmlFree(out);
 1490|       |
 1491|  30.5k|    return(ret);
 1492|  30.5k|}
xmlNewInputBufferMemory:
 1940|   289k|                        xmlParserInputFlags flags, xmlCharEncoding enc) {
 1941|   289k|    xmlParserInputBufferPtr ret;
 1942|       |
 1943|   289k|    if ((flags & XML_INPUT_BUF_STATIC) &&
  ------------------
  |  Branch (1943:9): [True: 253k, False: 35.6k]
  ------------------
 1944|   253k|        ((flags & XML_INPUT_BUF_ZERO_TERMINATED) == 0)) {
  ------------------
  |  Branch (1944:9): [True: 0, False: 253k]
  ------------------
 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|   289k|    } else {
 1968|   289k|        ret = xmlMalloc(sizeof(*ret));
 1969|   289k|        if (ret == NULL)
  ------------------
  |  Branch (1969:13): [True: 21, False: 289k]
  ------------------
 1970|     21|            return(NULL);
 1971|   289k|        memset(ret, 0, sizeof(xmlParserInputBuffer));
 1972|   289k|        ret->compressed = -1;
 1973|       |
 1974|   289k|        ret->buffer = xmlBufCreateMem((const xmlChar *) mem, size,
 1975|   289k|                                      (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (1975:40): [True: 253k, False: 35.6k]
  ------------------
 1976|   289k|        if (ret->buffer == NULL) {
  ------------------
  |  Branch (1976:13): [True: 23, False: 289k]
  ------------------
 1977|     23|            xmlFree(ret);
 1978|     23|            return(NULL);
 1979|     23|        }
 1980|   289k|    }
 1981|       |
 1982|   289k|    return(ret);
 1983|   289k|}
xmlParserInputBufferCreateMem:
 2005|  35.6k|xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc) {
 2006|  35.6k|    if ((mem == NULL) || (size < 0))
  ------------------
  |  Branch (2006:9): [True: 0, False: 35.6k]
  |  Branch (2006:26): [True: 0, False: 35.6k]
  ------------------
 2007|      0|        return(NULL);
 2008|       |
 2009|  35.6k|    return(xmlNewInputBufferMemory(mem, size, 0, enc));
 2010|  35.6k|}
xmlNewInputBufferString:
 2049|  10.1k|xmlNewInputBufferString(const char *str, xmlParserInputFlags flags) {
 2050|  10.1k|    xmlParserInputBufferPtr ret;
 2051|       |
 2052|  10.1k|    ret = xmlMalloc(sizeof(*ret));
 2053|  10.1k|    if (ret == NULL)
  ------------------
  |  Branch (2053:9): [True: 5, False: 10.1k]
  ------------------
 2054|      5|	return(NULL);
 2055|  10.1k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 2056|  10.1k|    ret->compressed = -1;
 2057|       |
 2058|  10.1k|    ret->buffer = xmlBufCreateMem((const xmlChar *) str, strlen(str),
 2059|  10.1k|                                  (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (2059:36): [True: 10.1k, False: 0]
  ------------------
 2060|  10.1k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2060:9): [True: 3, False: 10.1k]
  ------------------
 2061|      3|        xmlFree(ret);
 2062|      3|	return(NULL);
 2063|      3|    }
 2064|       |
 2065|  10.1k|    return(ret);
 2066|  10.1k|}
xmlParserInputBufferPush:
 2231|   468k|	                 int len, const char *buf) {
 2232|   468k|    size_t nbchars = 0;
 2233|   468k|    int ret;
 2234|       |
 2235|   468k|    if (len < 0) return(0);
  ------------------
  |  Branch (2235:9): [True: 0, False: 468k]
  ------------------
 2236|   468k|    if ((in == NULL) || (in->error)) return(-1);
  ------------------
  |  Branch (2236:9): [True: 0, False: 468k]
  |  Branch (2236:25): [True: 221, False: 468k]
  ------------------
 2237|   468k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2237:9): [True: 34.9k, False: 433k]
  ------------------
 2238|       |        /*
 2239|       |	 * Store the data in the incoming raw buffer
 2240|       |	 */
 2241|  34.9k|        if (in->raw == NULL) {
  ------------------
  |  Branch (2241:13): [True: 0, False: 34.9k]
  ------------------
 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|  34.9k|	ret = xmlBufAdd(in->raw, (const xmlChar *) buf, len);
 2249|  34.9k|	if (ret != 0) {
  ------------------
  |  Branch (2249:6): [True: 0, False: 34.9k]
  ------------------
 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|  34.9k|        nbchars = SIZE_MAX;
 2258|  34.9k|	if (xmlCharEncInput(in, &nbchars, /* flush */ 0) !=
  ------------------
  |  Branch (2258:6): [True: 14, False: 34.9k]
  ------------------
 2259|  34.9k|            XML_ENC_ERR_SUCCESS)
 2260|     14|            return(-1);
 2261|  34.9k|        if (nbchars > INT_MAX)
  ------------------
  |  Branch (2261:13): [True: 0, False: 34.9k]
  ------------------
 2262|      0|            nbchars = INT_MAX;
 2263|   433k|    } else {
 2264|   433k|	nbchars = len;
 2265|   433k|        ret = xmlBufAdd(in->buffer, (xmlChar *) buf, nbchars);
 2266|   433k|	if (ret != 0) {
  ------------------
  |  Branch (2266:6): [True: 1, False: 433k]
  ------------------
 2267|      1|            in->error = XML_ERR_NO_MEMORY;
 2268|      1|	    return(-1);
 2269|      1|        }
 2270|   433k|    }
 2271|   468k|    return(nbchars);
 2272|   468k|}
xmlParserInputBufferGrow:
 2298|   485k|xmlParserInputBufferGrow(xmlParserInputBuffer *in, int len) {
 2299|   485k|    int res = 0;
 2300|       |
 2301|   485k|    if ((in == NULL) || (in->error))
  ------------------
  |  Branch (2301:9): [True: 0, False: 485k]
  |  Branch (2301:25): [True: 1.16k, False: 484k]
  ------------------
 2302|  1.16k|        return(-1);
 2303|       |
 2304|   484k|    if (len < MINLEN)
  ------------------
  |  |   52|   484k|#define MINLEN 4000
  ------------------
  |  Branch (2304:9): [True: 257k, False: 226k]
  ------------------
 2305|   257k|        len = MINLEN;
  ------------------
  |  |   52|   257k|#define MINLEN 4000
  ------------------
 2306|       |
 2307|       |    /*
 2308|       |     * Call the read method for this I/O type.
 2309|       |     */
 2310|   484k|    if (in->readcallback != NULL) {
  ------------------
  |  Branch (2310:9): [True: 0, False: 484k]
  ------------------
 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|   484k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2355:9): [True: 275k, False: 208k]
  ------------------
 2356|   275k|        size_t sizeOut;
 2357|       |
 2358|       |        /*
 2359|       |         * Don't convert whole buffer when reading from memory.
 2360|       |         */
 2361|   275k|        if (in->readcallback == NULL)
  ------------------
  |  Branch (2361:13): [True: 275k, False: 0]
  ------------------
 2362|   275k|            sizeOut = len;
 2363|      0|        else
 2364|      0|            sizeOut = SIZE_MAX;
 2365|       |
 2366|   275k|	if (xmlCharEncInput(in, &sizeOut, /* flush */ 0) !=
  ------------------
  |  Branch (2366:6): [True: 603, False: 275k]
  ------------------
 2367|   275k|            XML_ENC_ERR_SUCCESS)
 2368|    603|	    return(-1);
 2369|   275k|        res = sizeOut;
 2370|   275k|    }
 2371|   483k|    return(res);
 2372|   484k|}
xmlParserInputBufferRead:
 2385|  65.9k|xmlParserInputBufferRead(xmlParserInputBuffer *in, int len) {
 2386|  65.9k|    return(xmlParserInputBufferGrow(in, len));
 2387|  65.9k|}
xmlOutputBufferWrite:
 2403|  15.7M|xmlOutputBufferWrite(xmlOutputBuffer *out, int len, const char *data) {
 2404|  15.7M|    xmlBufPtr buf = NULL;
 2405|  15.7M|    size_t written = 0;
 2406|  15.7M|    int ret;
 2407|       |
 2408|  15.7M|    if ((out == NULL) || (out->error))
  ------------------
  |  Branch (2408:9): [True: 0, False: 15.7M]
  |  Branch (2408:26): [True: 6.62k, False: 15.7M]
  ------------------
 2409|  6.62k|        return(-1);
 2410|  15.7M|    if (len < 0)
  ------------------
  |  Branch (2410:9): [True: 0, False: 15.7M]
  ------------------
 2411|      0|        return(0);
 2412|       |
 2413|  15.7M|    ret = xmlBufAdd(out->buffer, (const xmlChar *) data, len);
 2414|  15.7M|    if (ret != 0) {
  ------------------
  |  Branch (2414:9): [True: 19, False: 15.7M]
  ------------------
 2415|     19|        out->error = XML_ERR_NO_MEMORY;
 2416|     19|        return(-1);
 2417|     19|    }
 2418|       |
 2419|       |    /*
 2420|       |     * first handle encoding stuff.
 2421|       |     */
 2422|  15.7M|    if (out->encoder != NULL) {
  ------------------
  |  Branch (2422:9): [True: 0, False: 15.7M]
  ------------------
 2423|       |        /*
 2424|       |         * Store the data in the incoming raw buffer
 2425|       |         */
 2426|      0|        if (out->conv == NULL) {
  ------------------
  |  Branch (2426:13): [True: 0, False: 0]
  ------------------
 2427|      0|            out->conv = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|      0|#define MINLEN 4000
  ------------------
 2428|      0|            if (out->conv == NULL) {
  ------------------
  |  Branch (2428:17): [True: 0, False: 0]
  ------------------
 2429|      0|                out->error = XML_ERR_NO_MEMORY;
 2430|      0|                return(-1);
 2431|      0|            }
 2432|      0|        }
 2433|       |
 2434|       |        /*
 2435|       |         * convert as much as possible to the parser reading buffer.
 2436|       |         */
 2437|      0|        if (xmlBufUse(out->buffer) < 256) {
  ------------------
  |  Branch (2437:13): [True: 0, False: 0]
  ------------------
 2438|      0|            ret = 0;
 2439|      0|        } else {
 2440|      0|            ret = xmlCharEncOutput(out, 0);
 2441|      0|            if (ret < 0)
  ------------------
  |  Branch (2441:17): [True: 0, False: 0]
  ------------------
 2442|      0|                return(-1);
 2443|      0|        }
 2444|       |
 2445|      0|        if (out->writecallback)
  ------------------
  |  Branch (2445:13): [True: 0, False: 0]
  ------------------
 2446|      0|            buf = out->conv;
 2447|      0|        else
 2448|      0|            written = ret;
 2449|  15.7M|    } else {
 2450|  15.7M|        if (out->writecallback)
  ------------------
  |  Branch (2450:13): [True: 0, False: 15.7M]
  ------------------
 2451|      0|            buf = out->buffer;
 2452|  15.7M|        else
 2453|  15.7M|            written = len;
 2454|  15.7M|    }
 2455|       |
 2456|  15.7M|    if ((buf != NULL) && (out->writecallback)) {
  ------------------
  |  Branch (2456:9): [True: 0, False: 15.7M]
  |  Branch (2456:26): [True: 0, False: 0]
  ------------------
 2457|       |        /*
 2458|       |         * second write the stuff to the I/O channel
 2459|       |         */
 2460|      0|        while (1) {
  ------------------
  |  Branch (2460:16): [True: 0, Folded]
  ------------------
 2461|      0|            size_t nbchars = xmlBufUse(buf);
 2462|       |
 2463|      0|            if (nbchars < MINLEN)
  ------------------
  |  |   52|      0|#define MINLEN 4000
  ------------------
  |  Branch (2463:17): [True: 0, False: 0]
  ------------------
 2464|      0|                break;
 2465|       |
 2466|      0|            if (nbchars >= INT_MAX) {
  ------------------
  |  Branch (2466:17): [True: 0, False: 0]
  ------------------
 2467|      0|                out->error = XML_ERR_INTERNAL_ERROR;
 2468|      0|                return(-1);
 2469|      0|            }
 2470|       |
 2471|      0|            ret = out->writecallback(out->context,
 2472|      0|                       (const char *)xmlBufContent(buf), nbchars);
 2473|      0|            if (ret < 0) {
  ------------------
  |  Branch (2473:17): [True: 0, False: 0]
  ------------------
 2474|      0|                out->error = (ret == -1) ? XML_IO_WRITE : -ret;
  ------------------
  |  Branch (2474:30): [True: 0, False: 0]
  ------------------
 2475|      0|                return(-1);
 2476|      0|            }
 2477|      0|            if ((ret == 0) || ((size_t) ret > nbchars)) {
  ------------------
  |  Branch (2477:17): [True: 0, False: 0]
  |  Branch (2477:31): [True: 0, False: 0]
  ------------------
 2478|      0|                out->error = XML_ERR_INTERNAL_ERROR;
 2479|      0|                return(-1);
 2480|      0|            }
 2481|       |
 2482|      0|            xmlBufShrink(buf, ret);
 2483|      0|            written += ret;
 2484|      0|            if (out->written > INT_MAX - ret)
  ------------------
  |  Branch (2484:17): [True: 0, False: 0]
  ------------------
 2485|      0|                out->written = INT_MAX;
 2486|      0|            else
 2487|      0|                out->written += ret;
 2488|      0|        }
 2489|      0|    }
 2490|       |
 2491|  15.7M|    return(written <= INT_MAX ? written : INT_MAX);
  ------------------
  |  Branch (2491:12): [True: 15.7M, False: 0]
  ------------------
 2492|  15.7M|}
xmlOutputBufferWriteString:
 2580|  4.14M|xmlOutputBufferWriteString(xmlOutputBuffer *out, const char *str) {
 2581|  4.14M|    int len;
 2582|       |
 2583|  4.14M|    if ((out == NULL) || (out->error)) return(-1);
  ------------------
  |  Branch (2583:9): [True: 0, False: 4.14M]
  |  Branch (2583:26): [True: 1.39k, False: 4.14M]
  ------------------
 2584|  4.14M|    if (str == NULL)
  ------------------
  |  Branch (2584:9): [True: 0, False: 4.14M]
  ------------------
 2585|      0|        return(-1);
 2586|  4.14M|    len = strlen(str);
 2587|       |
 2588|  4.14M|    if (len > 0)
  ------------------
  |  Branch (2588:9): [True: 4.14M, False: 1.04k]
  ------------------
 2589|  4.14M|	return(xmlOutputBufferWrite(out, len, str));
 2590|  1.04k|    return(len);
 2591|  4.14M|}
xmlOutputBufferWriteQuotedString:
 2609|  6.40k|                                 const xmlChar *string) {
 2610|  6.40k|    const xmlChar *cur, *base;
 2611|       |
 2612|  6.40k|    if ((buf == NULL) || (buf->error))
  ------------------
  |  Branch (2612:9): [True: 0, False: 6.40k]
  |  Branch (2612:26): [True: 0, False: 6.40k]
  ------------------
 2613|      0|        return;
 2614|       |
 2615|  6.40k|    if (xmlStrchr(string, '\"')) {
  ------------------
  |  Branch (2615:9): [True: 78, False: 6.32k]
  ------------------
 2616|     78|        if (xmlStrchr(string, '\'')) {
  ------------------
  |  Branch (2616:13): [True: 0, False: 78]
  ------------------
 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|     78|        else{
 2637|     78|	    xmlOutputBufferWrite(buf, 1, "'");
 2638|     78|            xmlOutputBufferWriteString(buf, (const char *) string);
 2639|     78|	    xmlOutputBufferWrite(buf, 1, "'");
 2640|     78|        }
 2641|  6.32k|    } else {
 2642|  6.32k|        xmlOutputBufferWrite(buf, 1, "\"");
 2643|  6.32k|        xmlOutputBufferWriteString(buf, (const char *) string);
 2644|  6.32k|        xmlOutputBufferWrite(buf, 1, "\"");
 2645|  6.32k|    }
 2646|  6.40k|}
xmlParserGetDirectory:
 2720|   156k|xmlParserGetDirectory(const char *filename) {
 2721|   156k|    char *ret = NULL;
 2722|   156k|    char dir[1024];
 2723|   156k|    char *cur;
 2724|       |
 2725|   156k|    if (filename == NULL) return(NULL);
  ------------------
  |  Branch (2725:9): [True: 0, False: 156k]
  ------------------
 2726|       |
 2727|       |#if defined(LIBXML_WINPATH_ENABLED)
 2728|       |#   define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\'))
 2729|       |#else
 2730|   156k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
 2731|   156k|#endif
 2732|       |
 2733|   156k|    strncpy(dir, filename, 1023);
 2734|   156k|    dir[1023] = 0;
 2735|   156k|    cur = &dir[strlen(dir)];
 2736|  1.11M|    while (cur > dir) {
  ------------------
  |  Branch (2736:12): [True: 968k, False: 148k]
  ------------------
 2737|   968k|         if (IS_XMLPGD_SEP(*cur)) break;
  ------------------
  |  | 2730|   968k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 8.00k, False: 960k]
  |  |  ------------------
  ------------------
 2738|   960k|	 cur --;
 2739|   960k|    }
 2740|   156k|    if (IS_XMLPGD_SEP(*cur)) {
  ------------------
  |  | 2730|   156k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 8.10k, False: 148k]
  |  |  ------------------
  ------------------
 2741|  8.10k|        if (cur == dir) dir[1] = 0;
  ------------------
  |  Branch (2741:13): [True: 101, False: 8.00k]
  ------------------
 2742|  8.00k|	else *cur = 0;
 2743|  8.10k|	ret = xmlMemStrdup(dir);
 2744|   148k|    } else {
 2745|   148k|        ret = xmlMemStrdup(".");
 2746|   148k|    }
 2747|   156k|    return(ret);
 2748|   156k|#undef IS_XMLPGD_SEP
 2749|   156k|}
xmlInitIOCallbacks:
 2790|      2|{
 2791|      2|    xmlInputCallbackNr = 1;
 2792|      2|    xmlInputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2793|       |
 2794|      2|#ifdef LIBXML_OUTPUT_ENABLED
 2795|      2|    xmlOutputCallbackNr = 1;
 2796|      2|    xmlOutputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2797|      2|#endif
 2798|      2|}

xmlInitMemoryInternal:
  368|      2|xmlInitMemoryInternal(void) {
  369|      2|    xmlInitMutex(&xmlMemMutex);
  370|      2|}
xmlMemSetup:
  415|      2|            xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc) {
  416|      2|    if (freeFunc == NULL)
  ------------------
  |  Branch (416:9): [True: 0, False: 2]
  ------------------
  417|      0|	return(-1);
  418|      2|    if (mallocFunc == NULL)
  ------------------
  |  Branch (418:9): [True: 0, False: 2]
  ------------------
  419|      0|	return(-1);
  420|      2|    if (reallocFunc == NULL)
  ------------------
  |  Branch (420:9): [True: 0, False: 2]
  ------------------
  421|      0|	return(-1);
  422|      2|    if (strdupFunc == NULL)
  ------------------
  |  Branch (422:9): [True: 0, False: 2]
  ------------------
  423|      0|	return(-1);
  424|      2|    xmlFree = freeFunc;
  425|      2|    xmlMalloc = mallocFunc;
  426|      2|    xmlMallocAtomic = mallocFunc;
  427|      2|    xmlRealloc = reallocFunc;
  428|      2|    xmlMemStrdup = strdupFunc;
  429|      2|    return(0);
  430|      2|}

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

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

xmlSaveSetIndentString:
  126|  32.3k|xmlSaveSetIndentString(xmlSaveCtxt *ctxt, const char *indent) {
  127|  32.3k|    size_t len;
  128|  32.3k|    int i;
  129|       |
  130|  32.3k|    if ((ctxt == NULL) || (indent == NULL))
  ------------------
  |  Branch (130:9): [True: 0, False: 32.3k]
  |  Branch (130:27): [True: 0, False: 32.3k]
  ------------------
  131|      0|        return(-1);
  132|       |
  133|  32.3k|    len = strlen(indent);
  134|  32.3k|    if ((len <= 0) || (len > MAX_INDENT))
  ------------------
  |  |   20|  32.3k|#define MAX_INDENT 60
  ------------------
  |  Branch (134:9): [True: 0, False: 32.3k]
  |  Branch (134:23): [True: 0, False: 32.3k]
  ------------------
  135|      0|        return(-1);
  136|       |
  137|  32.3k|    ctxt->indent_size = len;
  138|  32.3k|    ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
  ------------------
  |  |   20|  32.3k|#define MAX_INDENT 60
  ------------------
  139|  1.00M|    for (i = 0; i < ctxt->indent_nr; i++)
  ------------------
  |  Branch (139:17): [True: 970k, False: 32.3k]
  ------------------
  140|   970k|        memcpy(&ctxt->indent[i * ctxt->indent_size], indent, len);
  141|       |
  142|  32.3k|    return(0);
  143|  32.3k|}
xmlNodeDumpOutput:
 2334|  32.3k|{
 2335|  32.3k|    xmlSaveCtxt ctxt;
 2336|  32.3k|    int options;
 2337|  32.3k|#ifdef LIBXML_HTML_ENABLED
 2338|  32.3k|    xmlDtdPtr dtd;
 2339|  32.3k|    int is_xhtml = 0;
 2340|  32.3k|#endif
 2341|       |
 2342|  32.3k|    (void) doc;
 2343|       |
 2344|  32.3k|    xmlInitParser();
 2345|       |
 2346|  32.3k|    if ((buf == NULL) || (cur == NULL)) return;
  ------------------
  |  Branch (2346:9): [True: 0, False: 32.3k]
  |  Branch (2346:26): [True: 0, False: 32.3k]
  ------------------
 2347|       |
 2348|  32.3k|    if (level < 0)
  ------------------
  |  Branch (2348:9): [True: 0, False: 32.3k]
  ------------------
 2349|      0|        level = 0;
 2350|  32.3k|    else if (level > 100)
  ------------------
  |  Branch (2350:14): [True: 0, False: 32.3k]
  ------------------
 2351|      0|        level = 100;
 2352|       |
 2353|  32.3k|    if (encoding == NULL)
  ------------------
  |  Branch (2353:9): [True: 32.3k, False: 0]
  ------------------
 2354|  32.3k|        encoding = "UTF-8";
 2355|       |
 2356|  32.3k|    memset(&ctxt, 0, sizeof(ctxt));
 2357|  32.3k|    ctxt.buf = buf;
 2358|  32.3k|    ctxt.level = level;
 2359|  32.3k|    ctxt.encoding = (const xmlChar *) encoding;
 2360|       |
 2361|  32.3k|    options = XML_SAVE_AS_XML;
 2362|  32.3k|    if (format)
  ------------------
  |  Branch (2362:9): [True: 0, False: 32.3k]
  ------------------
 2363|      0|        options |= XML_SAVE_FORMAT;
 2364|  32.3k|    xmlSaveCtxtInit(&ctxt, options);
 2365|       |
 2366|  32.3k|#ifdef LIBXML_HTML_ENABLED
 2367|  32.3k|    dtd = xmlGetIntSubset(doc);
 2368|  32.3k|    if (dtd != NULL) {
  ------------------
  |  Branch (2368:9): [True: 22.2k, False: 10.0k]
  ------------------
 2369|  22.2k|	is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 2370|  22.2k|	if (is_xhtml < 0)
  ------------------
  |  Branch (2370:6): [True: 5.21k, False: 17.0k]
  ------------------
 2371|  5.21k|	    is_xhtml = 0;
 2372|  22.2k|    }
 2373|       |
 2374|  32.3k|    if (is_xhtml)
  ------------------
  |  Branch (2374:9): [True: 15.5k, False: 16.8k]
  ------------------
 2375|  15.5k|        xhtmlNodeDumpOutput(&ctxt, cur);
 2376|  16.8k|    else
 2377|  16.8k|#endif
 2378|  16.8k|        xmlNodeDumpOutputInternal(&ctxt, cur);
 2379|  32.3k|}
xmlsave.c:xmlNsDumpOutput:
  762|   783k|xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
  763|   783k|    unsigned escapeFlags = XML_ESCAPE_ATTR;
  ------------------
  |  |   22|   783k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  764|       |
  765|   783k|    if ((cur == NULL) || (buf == NULL)) return;
  ------------------
  |  Branch (765:9): [True: 0, False: 783k]
  |  Branch (765:26): [True: 0, False: 783k]
  ------------------
  766|       |
  767|   783k|    if ((ctxt == NULL) || (ctxt->encoding == NULL))
  ------------------
  |  Branch (767:9): [True: 0, False: 783k]
  |  Branch (767:27): [True: 0, False: 783k]
  ------------------
  768|      0|        escapeFlags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  769|       |
  770|   783k|    if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
  ------------------
  |  |  500|   783k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (770:9): [True: 783k, False: 0]
  |  Branch (770:47): [True: 780k, False: 3.93k]
  ------------------
  771|   780k|	if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
  ------------------
  |  |   34|   780k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (771:6): [True: 204, False: 779k]
  ------------------
  772|    204|	    return;
  773|       |
  774|   779k|	if (ctxt != NULL && ctxt->format == 2)
  ------------------
  |  Branch (774:6): [True: 779k, False: 0]
  |  Branch (774:22): [True: 0, False: 779k]
  ------------------
  775|      0|	    xmlOutputBufferWriteWSNonSig(ctxt, 2);
  776|   779k|	else
  777|   779k|	    xmlOutputBufferWrite(buf, 1, " ");
  778|       |
  779|       |        /* Within the context of an element attributes */
  780|   779k|	if (cur->prefix != NULL) {
  ------------------
  |  Branch (780:6): [True: 774k, False: 5.22k]
  ------------------
  781|   774k|	    xmlOutputBufferWrite(buf, 6, "xmlns:");
  782|   774k|	    xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
  783|   774k|	} else
  784|  5.22k|	    xmlOutputBufferWrite(buf, 5, "xmlns");
  785|   779k|        xmlOutputBufferWrite(buf, 2, "=\"");
  786|       |        xmlSerializeText(buf, cur->href, SIZE_MAX, escapeFlags);
  787|   779k|        xmlOutputBufferWrite(buf, 1, "\"");
  788|   779k|    }
  789|   783k|}
xmlsave.c:xmlSaveDocInternal:
 1226|  2.48k|                   const xmlChar *encoding) {
 1227|  2.48k|#ifdef LIBXML_HTML_ENABLED
 1228|  2.48k|    xmlDtdPtr dtd;
 1229|  2.48k|    int is_xhtml = 0;
 1230|  2.48k|#endif
 1231|  2.48k|    xmlOutputBufferPtr buf = ctxt->buf;
 1232|  2.48k|    int switched_encoding = 0;
 1233|       |
 1234|  2.48k|    xmlInitParser();
 1235|       |
 1236|  2.48k|    if ((cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1236:9): [True: 2.48k, False: 0]
  ------------------
 1237|  2.48k|        (cur->type != XML_DOCUMENT_NODE))
  ------------------
  |  Branch (1237:9): [True: 0, False: 2.48k]
  ------------------
 1238|      0|	 return(-1);
 1239|       |
 1240|  2.48k|    if (encoding == NULL)
  ------------------
  |  Branch (1240:9): [True: 0, False: 2.48k]
  ------------------
 1241|      0|	encoding = cur->encoding;
 1242|       |
 1243|  2.48k|    if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1243:10): [True: 0, False: 2.48k]
  ------------------
 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|  2.48k|        (ctxt->options & XML_SAVE_AS_HTML)) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 2.48k]
  ------------------
 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|  2.48k|    } else if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1267:16): [True: 2.48k, False: 0]
  ------------------
 1268|      0|               (ctxt->options & XML_SAVE_AS_XML) ||
  ------------------
  |  Branch (1268:16): [True: 0, False: 0]
  ------------------
 1269|  2.48k|               (ctxt->options & XML_SAVE_XHTML)) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|  2.48k|	if ((encoding != NULL) && (ctxt->encoding == NULL)) {
  ------------------
  |  Branch (1270:6): [True: 2.48k, False: 0]
  |  Branch (1270:28): [True: 0, False: 2.48k]
  ------------------
 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|  2.48k|	if ((ctxt->options & XML_SAVE_NO_DECL) == 0) {
  ------------------
  |  Branch (1279:6): [True: 2.48k, False: 0]
  ------------------
 1280|  2.48k|	    xmlOutputBufferWrite(buf, 15, "<?xml version=\"");
 1281|  2.48k|	    if (cur->version != NULL)
  ------------------
  |  Branch (1281:10): [True: 2.48k, False: 0]
  ------------------
 1282|  2.48k|		xmlOutputBufferWriteString(buf, (char *) cur->version);
 1283|      0|	    else
 1284|      0|		xmlOutputBufferWrite(buf, 3, "1.0");
 1285|  2.48k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1286|  2.48k|	    if (encoding != NULL) {
  ------------------
  |  Branch (1286:10): [True: 2.48k, False: 0]
  ------------------
 1287|  2.48k|		xmlOutputBufferWrite(buf, 11, " encoding=\"");
 1288|  2.48k|		xmlOutputBufferWriteString(buf, (char *) encoding);
 1289|  2.48k|	        xmlOutputBufferWrite(buf, 1, "\"");
 1290|  2.48k|	    }
 1291|  2.48k|	    switch (cur->standalone) {
  ------------------
  |  Branch (1291:14): [True: 144, False: 2.34k]
  ------------------
 1292|     77|		case 0:
  ------------------
  |  Branch (1292:3): [True: 77, False: 2.41k]
  ------------------
 1293|     77|		    xmlOutputBufferWrite(buf, 16, " standalone=\"no\"");
 1294|     77|		    break;
 1295|     67|		case 1:
  ------------------
  |  Branch (1295:3): [True: 67, False: 2.42k]
  ------------------
 1296|     67|		    xmlOutputBufferWrite(buf, 17, " standalone=\"yes\"");
 1297|     67|		    break;
 1298|  2.48k|	    }
 1299|  2.48k|	    xmlOutputBufferWrite(buf, 3, "?>\n");
 1300|  2.48k|	}
 1301|       |
 1302|  2.48k|#ifdef LIBXML_HTML_ENABLED
 1303|  2.48k|        if (ctxt->options & XML_SAVE_XHTML)
  ------------------
  |  Branch (1303:13): [True: 183, False: 2.30k]
  ------------------
 1304|    183|            is_xhtml = 1;
 1305|  2.48k|	if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) {
  ------------------
  |  Branch (1305:6): [True: 2.48k, False: 0]
  ------------------
 1306|  2.48k|	    dtd = xmlGetIntSubset(cur);
 1307|  2.48k|	    if (dtd != NULL) {
  ------------------
  |  Branch (1307:10): [True: 2.40k, False: 81]
  ------------------
 1308|  2.40k|		is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 1309|  2.40k|		if (is_xhtml < 0) is_xhtml = 0;
  ------------------
  |  Branch (1309:7): [True: 2.00k, False: 398]
  ------------------
 1310|  2.40k|	    }
 1311|  2.48k|	}
 1312|  2.48k|#endif
 1313|  2.48k|	if (cur->children != NULL) {
  ------------------
  |  Branch (1313:6): [True: 2.48k, False: 0]
  ------------------
 1314|  2.48k|	    xmlNodePtr child = cur->children;
 1315|       |
 1316|  7.43k|	    while (child != NULL) {
  ------------------
  |  Branch (1316:13): [True: 4.94k, False: 2.48k]
  ------------------
 1317|  4.94k|		ctxt->level = 0;
 1318|  4.94k|#ifdef LIBXML_HTML_ENABLED
 1319|  4.94k|		if (is_xhtml)
  ------------------
  |  Branch (1319:7): [True: 402, False: 4.54k]
  ------------------
 1320|    402|		    xhtmlNodeDumpOutput(ctxt, child);
 1321|  4.54k|		else
 1322|  4.54k|#endif
 1323|  4.54k|		    xmlNodeDumpOutputInternal(ctxt, child);
 1324|  4.94k|                if ((child->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1324:21): [True: 4.94k, False: 0]
  ------------------
 1325|  4.94k|                    (child->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1325:21): [True: 4.94k, False: 0]
  ------------------
 1326|  4.94k|                    xmlOutputBufferWrite(buf, 1, "\n");
 1327|  4.94k|		child = child->next;
 1328|  4.94k|	    }
 1329|  2.48k|	}
 1330|  2.48k|    }
 1331|       |
 1332|       |    /*
 1333|       |     * Restore the state of the saving context at the end of the document
 1334|       |     */
 1335|  2.48k|    if (switched_encoding) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 2.48k]
  ------------------
 1336|      0|	xmlSaveClearEncoding(ctxt);
 1337|      0|    }
 1338|       |
 1339|  2.48k|    return(0);
 1340|  2.48k|}
xmlsave.c:xhtmlNodeDumpOutput:
 1489|  15.9k|xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
 1490|  15.9k|    int format = ctxt->format, addmeta, oldoptions;
 1491|  15.9k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
 1492|  15.9k|    xmlChar *start, *end;
 1493|  15.9k|    xmlOutputBufferPtr buf = ctxt->buf;
 1494|       |
 1495|  15.9k|    if (cur == NULL) return;
  ------------------
  |  Branch (1495:9): [True: 0, False: 15.9k]
  ------------------
 1496|       |
 1497|  15.9k|    oldoptions = ctxt->options;
 1498|  15.9k|    ctxt->options |= XML_SAVE_XHTML;
 1499|       |
 1500|  15.9k|    root = cur;
 1501|  15.9k|    parent = cur->parent;
 1502|  43.8k|    while (1) {
  ------------------
  |  Branch (1502:12): [True: 43.8k, Folded]
  ------------------
 1503|  43.8k|        switch (cur->type) {
 1504|    183|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1504:9): [True: 183, False: 43.6k]
  ------------------
 1505|    183|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1505:9): [True: 0, False: 43.8k]
  ------------------
 1506|    183|            xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
 1507|    183|	    break;
 1508|       |
 1509|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1509:9): [True: 0, False: 43.8k]
  ------------------
 1510|      0|	    xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1511|      0|	    break;
 1512|       |
 1513|    183|        case XML_DTD_NODE:
  ------------------
  |  Branch (1513:9): [True: 183, False: 43.6k]
  ------------------
 1514|    183|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
 1515|    183|	    break;
 1516|       |
 1517|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1517:9): [True: 0, False: 43.8k]
  ------------------
 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: 43.8k]
  ------------------
 1527|      0|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
 1528|      0|	    break;
 1529|       |
 1530|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1530:9): [True: 0, False: 43.8k]
  ------------------
 1531|      0|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
 1532|      0|	    break;
 1533|       |
 1534|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1534:9): [True: 0, False: 43.8k]
  ------------------
 1535|      0|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1536|      0|	    break;
 1537|       |
 1538|  25.9k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1538:9): [True: 25.9k, False: 17.9k]
  ------------------
 1539|  25.9k|            addmeta = 0;
 1540|       |
 1541|  25.9k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1541:10): [True: 15.2k, False: 10.6k]
  |  Branch (1541:27): [True: 0, False: 15.2k]
  ------------------
 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|  25.9k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1549:17): [True: 0, False: 25.9k]
  |  Branch (1549:44): [True: 0, False: 0]
  ------------------
 1550|      0|                xhtmlNodeDumpOutput(ctxt, cur);
 1551|      0|                break;
 1552|      0|            }
 1553|       |
 1554|  25.9k|            xmlOutputBufferWrite(buf, 1, "<");
 1555|  25.9k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1555:17): [True: 2.68k, False: 23.2k]
  |  Branch (1555:38): [True: 476, False: 2.20k]
  ------------------
 1556|    476|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1557|    476|                xmlOutputBufferWrite(buf, 1, ":");
 1558|    476|            }
 1559|       |
 1560|  25.9k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1561|  25.9k|            if (cur->nsDef)
  ------------------
  |  Branch (1561:17): [True: 4.27k, False: 21.6k]
  ------------------
 1562|  4.27k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1563|  25.9k|            if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
  ------------------
  |  |   34|  25.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1563:18): [True: 1.18k, False: 24.7k]
  ------------------
 1564|  1.18k|                (cur->ns == NULL) && (cur->nsDef == NULL))) {
  ------------------
  |  Branch (1564:17): [True: 800, False: 385]
  |  Branch (1564:38): [True: 571, False: 229]
  ------------------
 1565|       |                /*
 1566|       |                 * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
 1567|       |                 */
 1568|    571|                xmlOutputBufferWriteString(buf,
 1569|    571|                        " xmlns=\"http://www.w3.org/1999/xhtml\"");
 1570|    571|            }
 1571|  25.9k|            if (cur->properties != NULL)
  ------------------
  |  Branch (1571:17): [True: 8.97k, False: 16.9k]
  ------------------
 1572|  8.97k|                xhtmlAttrListDumpOutput(ctxt, cur->properties);
 1573|       |
 1574|  25.9k|            if ((parent != NULL) &&
  ------------------
  |  Branch (1574:17): [True: 15.4k, False: 10.4k]
  ------------------
 1575|  15.4k|                (parent->parent == (xmlNodePtr) cur->doc) &&
  ------------------
  |  Branch (1575:17): [True: 66, False: 15.3k]
  ------------------
 1576|     66|                xmlStrEqual(cur->name, BAD_CAST"head") &&
  ------------------
  |  |   34|     66|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1576:17): [True: 0, False: 66]
  ------------------
 1577|      0|                xmlStrEqual(parent->name, BAD_CAST"html")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1577:17): [True: 0, False: 0]
  ------------------
 1578|       |
 1579|      0|                tmp = cur->children;
 1580|      0|                while (tmp != NULL) {
  ------------------
  |  Branch (1580:24): [True: 0, False: 0]
  ------------------
 1581|      0|                    if (xmlStrEqual(tmp->name, BAD_CAST"meta")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1581:25): [True: 0, False: 0]
  ------------------
 1582|      0|                        int res;
 1583|      0|                        xmlChar *httpequiv;
 1584|       |
 1585|      0|                        res = xmlNodeGetAttrValue(tmp, BAD_CAST "http-equiv",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1586|      0|                                                  NULL, &httpequiv);
 1587|      0|                        if (res < 0) {
  ------------------
  |  Branch (1587:29): [True: 0, False: 0]
  ------------------
 1588|      0|                            xmlSaveErrMemory(buf);
 1589|      0|                        } else if (res == 0) {
  ------------------
  |  Branch (1589:36): [True: 0, False: 0]
  ------------------
 1590|      0|                            if (xmlStrcasecmp(httpequiv,
  ------------------
  |  Branch (1590:33): [True: 0, False: 0]
  ------------------
 1591|      0|                                        BAD_CAST"Content-Type") == 0) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1592|      0|                                xmlFree(httpequiv);
 1593|      0|                                break;
 1594|      0|                            }
 1595|      0|                            xmlFree(httpequiv);
 1596|      0|                        }
 1597|      0|                    }
 1598|      0|                    tmp = tmp->next;
 1599|      0|                }
 1600|      0|                if (tmp == NULL)
  ------------------
  |  Branch (1600:21): [True: 0, False: 0]
  ------------------
 1601|      0|                    addmeta = 1;
 1602|      0|            }
 1603|       |
 1604|  25.9k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1604:17): [True: 15.3k, False: 10.5k]
  ------------------
 1605|  15.3k|                if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
  ------------------
  |  Branch (1605:22): [True: 13.6k, False: 1.75k]
  |  Branch (1605:43): [True: 1.48k, False: 276]
  ------------------
 1606|  15.0k|                    ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
  ------------------
  |  Branch (1606:22): [True: 2.89k, False: 12.2k]
  |  Branch (1606:50): [True: 2.89k, False: 0]
  ------------------
 1607|       |                    /*
 1608|       |                     * C.2. Empty Elements
 1609|       |                     */
 1610|  2.89k|                    xmlOutputBufferWrite(buf, 3, " />");
 1611|  12.4k|                } else {
 1612|  12.4k|                    if (addmeta == 1) {
  ------------------
  |  Branch (1612:25): [True: 0, False: 12.4k]
  ------------------
 1613|      0|                        xmlOutputBufferWrite(buf, 1, ">");
 1614|      0|                        if (ctxt->format == 1) {
  ------------------
  |  Branch (1614:29): [True: 0, False: 0]
  ------------------
 1615|      0|                            xmlOutputBufferWrite(buf, 1, "\n");
 1616|      0|                            xmlSaveWriteIndent(ctxt, 1);
 1617|      0|                        }
 1618|      0|                        xmlOutputBufferWriteString(buf,
 1619|      0|                                "<meta http-equiv=\"Content-Type\" "
 1620|      0|                                "content=\"text/html; charset=");
 1621|      0|                        if (ctxt->encoding) {
  ------------------
  |  Branch (1621:29): [True: 0, False: 0]
  ------------------
 1622|      0|                            xmlOutputBufferWriteString(buf,
 1623|      0|                                    (const char *)ctxt->encoding);
 1624|      0|                        } else {
 1625|      0|                            xmlOutputBufferWrite(buf, 5, "UTF-8");
 1626|      0|                        }
 1627|      0|                        xmlOutputBufferWrite(buf, 4, "\" />");
 1628|      0|                        if (ctxt->format == 1)
  ------------------
  |  Branch (1628:29): [True: 0, False: 0]
  ------------------
 1629|      0|                            xmlOutputBufferWrite(buf, 1, "\n");
 1630|  12.4k|                    } else {
 1631|  12.4k|                        xmlOutputBufferWrite(buf, 1, ">");
 1632|  12.4k|                    }
 1633|       |                    /*
 1634|       |                     * C.3. Element Minimization and Empty Element Content
 1635|       |                     */
 1636|  12.4k|                    xmlOutputBufferWrite(buf, 2, "</");
 1637|  12.4k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1637:25): [True: 1.75k, False: 10.7k]
  |  Branch (1637:46): [True: 276, False: 1.48k]
  ------------------
 1638|    276|                        xmlOutputBufferWriteString(buf,
 1639|    276|                                (const char *)cur->ns->prefix);
 1640|    276|                        xmlOutputBufferWrite(buf, 1, ":");
 1641|    276|                    }
 1642|  12.4k|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1643|  12.4k|                    xmlOutputBufferWrite(buf, 1, ">");
 1644|  12.4k|                }
 1645|  15.3k|            } else {
 1646|  10.5k|                xmlOutputBufferWrite(buf, 1, ">");
 1647|  10.5k|                if (addmeta == 1) {
  ------------------
  |  Branch (1647:21): [True: 0, False: 10.5k]
  ------------------
 1648|      0|                    if (ctxt->format == 1) {
  ------------------
  |  Branch (1648:25): [True: 0, False: 0]
  ------------------
 1649|      0|                        xmlOutputBufferWrite(buf, 1, "\n");
 1650|      0|                        xmlSaveWriteIndent(ctxt, 1);
 1651|      0|                    }
 1652|      0|                    xmlOutputBufferWriteString(buf,
 1653|      0|                            "<meta http-equiv=\"Content-Type\" "
 1654|      0|                            "content=\"text/html; charset=");
 1655|      0|                    if (ctxt->encoding) {
  ------------------
  |  Branch (1655:25): [True: 0, False: 0]
  ------------------
 1656|      0|                        xmlOutputBufferWriteString(buf,
 1657|      0|                                (const char *)ctxt->encoding);
 1658|      0|                    } else {
 1659|      0|                        xmlOutputBufferWrite(buf, 5, "UTF-8");
 1660|      0|                    }
 1661|      0|                    xmlOutputBufferWrite(buf, 4, "\" />");
 1662|      0|                }
 1663|       |
 1664|  10.5k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1664:21): [True: 0, False: 10.5k]
  ------------------
 1665|      0|                    tmp = cur->children;
 1666|      0|                    while (tmp != NULL) {
  ------------------
  |  Branch (1666:28): [True: 0, False: 0]
  ------------------
 1667|      0|                        if ((tmp->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1667:29): [True: 0, False: 0]
  ------------------
 1668|      0|                            (tmp->type == XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (1668:29): [True: 0, False: 0]
  ------------------
 1669|      0|                            unformattedNode = cur;
 1670|      0|                            ctxt->format = 0;
 1671|      0|                            break;
 1672|      0|                        }
 1673|      0|                        tmp = tmp->next;
 1674|      0|                    }
 1675|      0|                }
 1676|       |
 1677|  10.5k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1677:21): [True: 0, False: 10.5k]
  ------------------
 1678|  10.5k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1678:21): [True: 10.5k, False: 0]
  ------------------
 1679|  10.5k|                parent = cur;
 1680|  10.5k|                cur = cur->children;
 1681|  10.5k|                continue;
 1682|  10.5k|            }
 1683|       |
 1684|  15.3k|            break;
 1685|       |
 1686|  15.3k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1686:9): [True: 14.6k, False: 29.1k]
  ------------------
 1687|  14.6k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1687:10): [True: 0, False: 14.6k]
  ------------------
 1688|      0|                break;
 1689|  14.6k|	    if ((cur->name == xmlStringText) ||
  ------------------
  |  Branch (1689:10): [True: 14.6k, False: 0]
  ------------------
 1690|  14.6k|		(cur->name != xmlStringTextNoenc)) {
  ------------------
  |  Branch (1690:3): [True: 0, False: 0]
  ------------------
 1691|  14.6k|                if (ctxt->escape)
  ------------------
  |  Branch (1691:21): [True: 0, False: 14.6k]
  ------------------
 1692|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1693|      0|                                               ctxt->escape);
 1694|  14.6k|                else
 1695|  14.6k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1696|  14.6k|	    } else {
 1697|       |		/*
 1698|       |		 * Disable escaping, needed for XSLT
 1699|       |		 */
 1700|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1701|      0|	    }
 1702|  14.6k|	    break;
 1703|       |
 1704|    701|        case XML_PI_NODE:
  ------------------
  |  Branch (1704:9): [True: 701, False: 43.1k]
  ------------------
 1705|    701|            if (cur->content != NULL) {
  ------------------
  |  Branch (1705:17): [True: 370, False: 331]
  ------------------
 1706|    370|                xmlOutputBufferWrite(buf, 2, "<?");
 1707|    370|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1708|    370|                if (cur->content != NULL) {
  ------------------
  |  Branch (1708:21): [True: 370, False: 0]
  ------------------
 1709|    370|                    xmlOutputBufferWrite(buf, 1, " ");
 1710|    370|                    xmlOutputBufferWriteString(buf,
 1711|    370|                            (const char *)cur->content);
 1712|    370|                }
 1713|    370|                xmlOutputBufferWrite(buf, 2, "?>");
 1714|    370|            } else {
 1715|    331|                xmlOutputBufferWrite(buf, 2, "<?");
 1716|    331|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1717|    331|                xmlOutputBufferWrite(buf, 2, "?>");
 1718|    331|            }
 1719|    701|            break;
 1720|       |
 1721|    610|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1721:9): [True: 610, False: 43.2k]
  ------------------
 1722|    610|            if (cur->content != NULL) {
  ------------------
  |  Branch (1722:17): [True: 610, False: 0]
  ------------------
 1723|    610|                xmlOutputBufferWrite(buf, 4, "<!--");
 1724|    610|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1725|    610|                xmlOutputBufferWrite(buf, 3, "-->");
 1726|    610|            }
 1727|    610|            break;
 1728|       |
 1729|    605|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1729:9): [True: 605, False: 43.2k]
  ------------------
 1730|    605|            xmlOutputBufferWrite(buf, 1, "&");
 1731|    605|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1732|    605|            xmlOutputBufferWrite(buf, 1, ";");
 1733|    605|            break;
 1734|       |
 1735|    686|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1735:9): [True: 686, False: 43.1k]
  ------------------
 1736|    686|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1736:17): [True: 0, False: 686]
  |  Branch (1736:41): [True: 228, False: 458]
  ------------------
 1737|    228|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1738|    458|            } else {
 1739|    458|                start = end = cur->content;
 1740|  2.66k|                while (*end != '\0') {
  ------------------
  |  Branch (1740:24): [True: 2.20k, False: 458]
  ------------------
 1741|  2.20k|                    if (*end == ']' && *(end + 1) == ']' &&
  ------------------
  |  Branch (1741:25): [True: 606, False: 1.59k]
  |  Branch (1741:40): [True: 290, False: 316]
  ------------------
 1742|    290|                        *(end + 2) == '>') {
  ------------------
  |  Branch (1742:25): [True: 0, False: 290]
  ------------------
 1743|      0|                        end = end + 2;
 1744|      0|                        xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1745|      0|                        xmlOutputBufferWrite(buf, end - start,
 1746|      0|                                (const char *)start);
 1747|      0|                        xmlOutputBufferWrite(buf, 3, "]]>");
 1748|      0|                        start = end;
 1749|      0|                    }
 1750|  2.20k|                    end++;
 1751|  2.20k|                }
 1752|    458|                if (start != end) {
  ------------------
  |  Branch (1752:21): [True: 458, False: 0]
  ------------------
 1753|    458|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1754|    458|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1755|    458|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1756|    458|                }
 1757|    458|            }
 1758|    686|            break;
 1759|       |
 1760|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1760:9): [True: 0, False: 43.8k]
  ------------------
 1761|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1762|      0|	    break;
 1763|       |
 1764|    255|        default:
  ------------------
  |  Branch (1764:9): [True: 255, False: 43.5k]
  ------------------
 1765|    255|            break;
 1766|  43.8k|        }
 1767|       |
 1768|  43.8k|        while (1) {
  ------------------
  |  Branch (1768:16): [True: 43.8k, Folded]
  ------------------
 1769|  43.8k|            if (cur == root)
  ------------------
  |  Branch (1769:17): [True: 15.9k, False: 27.9k]
  ------------------
 1770|  15.9k|                return;
 1771|  27.9k|            if (ctxt->format == 1)
  ------------------
  |  Branch (1771:17): [True: 0, False: 27.9k]
  ------------------
 1772|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1773|  27.9k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1773:17): [True: 17.3k, False: 10.5k]
  ------------------
 1774|  17.3k|                cur = cur->next;
 1775|  17.3k|                break;
 1776|  17.3k|            }
 1777|       |
 1778|  10.5k|            cur = parent;
 1779|       |            /* cur->parent was validated when descending. */
 1780|  10.5k|            parent = cur->parent;
 1781|       |
 1782|  10.5k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1782:17): [True: 10.5k, False: 0]
  ------------------
 1783|  10.5k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1783:21): [True: 10.5k, False: 0]
  ------------------
 1784|  10.5k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1784:21): [True: 0, False: 10.5k]
  ------------------
 1785|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1786|       |
 1787|  10.5k|                xmlOutputBufferWrite(buf, 2, "</");
 1788|  10.5k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1788:21): [True: 925, False: 9.61k]
  |  Branch (1788:42): [True: 200, False: 725]
  ------------------
 1789|    200|                    xmlOutputBufferWriteString(buf,
 1790|    200|                            (const char *)cur->ns->prefix);
 1791|    200|                    xmlOutputBufferWrite(buf, 1, ":");
 1792|    200|                }
 1793|       |
 1794|  10.5k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1795|  10.5k|                xmlOutputBufferWrite(buf, 1, ">");
 1796|       |
 1797|  10.5k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1797:21): [True: 0, False: 10.5k]
  ------------------
 1798|      0|                    ctxt->format = format;
 1799|      0|                    unformattedNode = NULL;
 1800|      0|                }
 1801|  10.5k|            }
 1802|  10.5k|        }
 1803|  33.2k|    }
 1804|       |
 1805|      0|    ctxt->options = oldoptions;
 1806|      0|}
xmlsave.c:xmlDtdDumpOutput:
  827|  6.71k|xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
  828|  6.71k|    xmlOutputBufferPtr buf;
  829|  6.71k|    xmlNodePtr cur;
  830|  6.71k|    int format, level;
  831|       |
  832|  6.71k|    if (dtd == NULL) return;
  ------------------
  |  Branch (832:9): [True: 0, False: 6.71k]
  ------------------
  833|  6.71k|    if ((ctxt == NULL) || (ctxt->buf == NULL))
  ------------------
  |  Branch (833:9): [True: 0, False: 6.71k]
  |  Branch (833:27): [True: 0, False: 6.71k]
  ------------------
  834|      0|        return;
  835|  6.71k|    buf = ctxt->buf;
  836|  6.71k|    xmlOutputBufferWrite(buf, 10, "<!DOCTYPE ");
  837|  6.71k|    xmlOutputBufferWriteString(buf, (const char *)dtd->name);
  838|  6.71k|    if (dtd->ExternalID != NULL) {
  ------------------
  |  Branch (838:9): [True: 497, False: 6.21k]
  ------------------
  839|    497|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  840|    497|	xmlOutputBufferWriteQuotedString(buf, dtd->ExternalID);
  841|    497|	xmlOutputBufferWrite(buf, 1, " ");
  842|    497|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  843|  6.21k|    }  else if (dtd->SystemID != NULL) {
  ------------------
  |  Branch (843:17): [True: 469, False: 5.75k]
  ------------------
  844|    469|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  845|    469|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  846|    469|    }
  847|  6.71k|    if ((dtd->entities == NULL) && (dtd->elements == NULL) &&
  ------------------
  |  Branch (847:9): [True: 5.17k, False: 1.54k]
  |  Branch (847:36): [True: 1.25k, False: 3.91k]
  ------------------
  848|  1.25k|        (dtd->attributes == NULL) && (dtd->notations == NULL) &&
  ------------------
  |  Branch (848:9): [True: 1.25k, False: 0]
  |  Branch (848:38): [True: 1.12k, False: 138]
  ------------------
  849|  1.12k|	(dtd->pentities == NULL)) {
  ------------------
  |  Branch (849:2): [True: 1.03k, False: 81]
  ------------------
  850|  1.03k|	xmlOutputBufferWrite(buf, 1, ">");
  851|  1.03k|	return;
  852|  1.03k|    }
  853|  5.67k|    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|  5.67k|    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
  ------------------
  |  Branch (858:9): [True: 1.30k, False: 4.37k]
  |  Branch (858:38): [True: 598, False: 707]
  ------------------
  859|  1.30k|        (dtd->doc->intSubset == dtd))) {
  ------------------
  |  Branch (859:9): [True: 707, False: 0]
  ------------------
  860|  1.30k|        xmlBufDumpNotationTable(buf, (xmlNotationTablePtr) dtd->notations);
  861|  1.30k|    }
  862|  5.67k|    format = ctxt->format;
  863|  5.67k|    level = ctxt->level;
  864|  5.67k|    ctxt->format = 0;
  865|  5.67k|    ctxt->level = -1;
  866|  22.7k|    for (cur = dtd->children; cur != NULL; cur = cur->next) {
  ------------------
  |  Branch (866:31): [True: 17.0k, False: 5.67k]
  ------------------
  867|  17.0k|        xmlNodeDumpOutputInternal(ctxt, cur);
  868|  17.0k|    }
  869|  5.67k|    ctxt->format = format;
  870|  5.67k|    ctxt->level = level;
  871|  5.67k|    xmlOutputBufferWrite(buf, 2, "]>");
  872|  5.67k|}
xmlsave.c:xmlBufDumpElementDecl:
  417|  5.94k|xmlBufDumpElementDecl(xmlOutputBufferPtr buf, xmlElementPtr elem) {
  418|  5.94k|    xmlOutputBufferWrite(buf, 10, "<!ELEMENT ");
  419|  5.94k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (419:9): [True: 1.12k, False: 4.82k]
  ------------------
  420|  1.12k|        xmlOutputBufferWriteString(buf, (const char *) elem->prefix);
  421|  1.12k|        xmlOutputBufferWrite(buf, 1, ":");
  422|  1.12k|    }
  423|  5.94k|    xmlOutputBufferWriteString(buf, (const char *) elem->name);
  424|  5.94k|    xmlOutputBufferWrite(buf, 1, " ");
  425|       |
  426|  5.94k|    switch (elem->etype) {
  427|  1.63k|	case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (427:2): [True: 1.63k, False: 4.31k]
  ------------------
  428|  1.63k|	    xmlOutputBufferWrite(buf, 5, "EMPTY");
  429|  1.63k|	    break;
  430|     43|	case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (430:2): [True: 43, False: 5.90k]
  ------------------
  431|     43|	    xmlOutputBufferWrite(buf, 3, "ANY");
  432|     43|	    break;
  433|    640|	case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (433:2): [True: 640, False: 5.30k]
  ------------------
  434|  4.27k|	case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (434:2): [True: 3.63k, False: 2.31k]
  ------------------
  435|  4.27k|	    xmlBufDumpElementContent(buf, elem->content);
  436|  4.27k|	    break;
  437|      0|        default:
  ------------------
  |  Branch (437:9): [True: 0, False: 5.94k]
  ------------------
  438|       |            /* assert(0); */
  439|      0|            break;
  440|  5.94k|    }
  441|       |
  442|  5.94k|    xmlOutputBufferWrite(buf, 2, ">\n");
  443|  5.94k|}
xmlsave.c:xmlBufDumpElementContent:
  345|  4.27k|                         xmlElementContentPtr content) {
  346|  4.27k|    xmlElementContentPtr cur;
  347|       |
  348|  4.27k|    if (content == NULL) return;
  ------------------
  |  Branch (348:9): [True: 0, False: 4.27k]
  ------------------
  349|       |
  350|  4.27k|    xmlOutputBufferWrite(buf, 1, "(");
  351|  4.27k|    cur = content;
  352|       |
  353|   176k|    do {
  354|   176k|        if (cur == NULL) return;
  ------------------
  |  Branch (354:13): [True: 0, False: 176k]
  ------------------
  355|       |
  356|   176k|        switch (cur->type) {
  ------------------
  |  Branch (356:17): [True: 176k, False: 0]
  ------------------
  357|    640|            case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (357:13): [True: 640, False: 176k]
  ------------------
  358|    640|                xmlOutputBufferWrite(buf, 7, "#PCDATA");
  359|    640|                break;
  360|  89.9k|            case XML_ELEMENT_CONTENT_ELEMENT:
  ------------------
  |  Branch (360:13): [True: 89.9k, False: 86.9k]
  ------------------
  361|  89.9k|                if (cur->prefix != NULL) {
  ------------------
  |  Branch (361:21): [True: 6.07k, False: 83.8k]
  ------------------
  362|  6.07k|                    xmlOutputBufferWriteString(buf,
  363|  6.07k|                            (const char *) cur->prefix);
  364|  6.07k|                    xmlOutputBufferWrite(buf, 1, ":");
  365|  6.07k|                }
  366|  89.9k|                xmlOutputBufferWriteString(buf, (const char *) cur->name);
  367|  89.9k|                break;
  368|  41.7k|            case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (368:13): [True: 41.7k, False: 135k]
  ------------------
  369|  86.3k|            case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (369:13): [True: 44.5k, False: 132k]
  ------------------
  370|  86.3k|                if ((cur != content) &&
  ------------------
  |  Branch (370:21): [True: 84.7k, False: 1.63k]
  ------------------
  371|  84.7k|                    (cur->parent != NULL) &&
  ------------------
  |  Branch (371:21): [True: 84.7k, False: 0]
  ------------------
  372|  84.7k|                    ((cur->type != cur->parent->type) ||
  ------------------
  |  Branch (372:22): [True: 19.4k, False: 65.2k]
  ------------------
  373|  65.2k|                     (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (373:22): [True: 6.00k, False: 59.2k]
  ------------------
  374|  25.4k|                    xmlOutputBufferWrite(buf, 1, "(");
  375|  86.3k|                cur = cur->c1;
  376|  86.3k|                continue;
  377|   176k|        }
  378|       |
  379|   176k|        while (cur != content) {
  ------------------
  |  Branch (379:16): [True: 172k, False: 4.27k]
  ------------------
  380|   172k|            xmlElementContentPtr parent = cur->parent;
  381|       |
  382|   172k|            if (parent == NULL) return;
  ------------------
  |  Branch (382:17): [True: 0, False: 172k]
  ------------------
  383|       |
  384|   172k|            if (((cur->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (384:18): [True: 43.6k, False: 129k]
  ------------------
  385|   129k|                 (cur->type == XML_ELEMENT_CONTENT_SEQ)) &&
  ------------------
  |  Branch (385:18): [True: 41.0k, False: 87.9k]
  ------------------
  386|  84.7k|                ((cur->type != parent->type) ||
  ------------------
  |  Branch (386:18): [True: 19.4k, False: 65.2k]
  ------------------
  387|  65.2k|                 (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (387:18): [True: 6.00k, False: 59.2k]
  ------------------
  388|  25.4k|                xmlOutputBufferWrite(buf, 1, ")");
  389|   172k|            xmlBufDumpElementOccur(buf, cur);
  390|       |
  391|   172k|            if (cur == parent->c1) {
  ------------------
  |  Branch (391:17): [True: 86.3k, False: 86.3k]
  ------------------
  392|  86.3k|                if (parent->type == XML_ELEMENT_CONTENT_SEQ)
  ------------------
  |  Branch (392:21): [True: 41.7k, False: 44.5k]
  ------------------
  393|  41.7k|                    xmlOutputBufferWrite(buf, 3, " , ");
  394|  44.5k|                else if (parent->type == XML_ELEMENT_CONTENT_OR)
  ------------------
  |  Branch (394:26): [True: 44.5k, False: 0]
  ------------------
  395|  44.5k|                    xmlOutputBufferWrite(buf, 3, " | ");
  396|       |
  397|  86.3k|                cur = parent->c2;
  398|  86.3k|                break;
  399|  86.3k|            }
  400|       |
  401|  86.3k|            cur = parent;
  402|  86.3k|        }
  403|   176k|    } while (cur != content);
  ------------------
  |  Branch (403:14): [True: 172k, False: 4.27k]
  ------------------
  404|       |
  405|  4.27k|    xmlOutputBufferWrite(buf, 1, ")");
  406|  4.27k|    xmlBufDumpElementOccur(buf, content);
  407|  4.27k|}
xmlsave.c:xmlBufDumpElementOccur:
  321|   176k|xmlBufDumpElementOccur(xmlOutputBufferPtr buf, xmlElementContentPtr cur) {
  322|   176k|    switch (cur->ocur) {
  ------------------
  |  Branch (322:13): [True: 176k, False: 0]
  ------------------
  323|   133k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (323:9): [True: 133k, False: 42.9k]
  ------------------
  324|   133k|            break;
  325|  19.4k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (325:9): [True: 19.4k, False: 157k]
  ------------------
  326|  19.4k|            xmlOutputBufferWrite(buf, 1, "?");
  327|  19.4k|            break;
  328|  18.3k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (328:9): [True: 18.3k, False: 158k]
  ------------------
  329|  18.3k|            xmlOutputBufferWrite(buf, 1, "*");
  330|  18.3k|            break;
  331|  5.17k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (331:9): [True: 5.17k, False: 171k]
  ------------------
  332|  5.17k|            xmlOutputBufferWrite(buf, 1, "+");
  333|  5.17k|            break;
  334|   176k|    }
  335|   176k|}
xmlsave.c:xmlSaveWriteAttributeDecl:
  471|  7.77k|xmlSaveWriteAttributeDecl(xmlSaveCtxtPtr ctxt, xmlAttributePtr attr) {
  472|  7.77k|    xmlOutputBufferPtr buf = ctxt->buf;
  473|       |
  474|  7.77k|    xmlOutputBufferWrite(buf, 10, "<!ATTLIST ");
  475|  7.77k|    xmlOutputBufferWriteString(buf, (const char *) attr->elem);
  476|  7.77k|    xmlOutputBufferWrite(buf, 1, " ");
  477|  7.77k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (477:9): [True: 4.43k, False: 3.34k]
  ------------------
  478|  4.43k|	xmlOutputBufferWriteString(buf, (const char *) attr->prefix);
  479|  4.43k|	xmlOutputBufferWrite(buf, 1, ":");
  480|  4.43k|    }
  481|  7.77k|    xmlOutputBufferWriteString(buf, (const char *) attr->name);
  482|       |
  483|  7.77k|    switch (attr->atype) {
  484|  1.10k|	case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (484:2): [True: 1.10k, False: 6.67k]
  ------------------
  485|  1.10k|	    xmlOutputBufferWrite(buf, 6, " CDATA");
  486|  1.10k|	    break;
  487|    641|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (487:2): [True: 641, False: 7.13k]
  ------------------
  488|    641|	    xmlOutputBufferWrite(buf, 3, " ID");
  489|    641|	    break;
  490|    235|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (490:2): [True: 235, False: 7.54k]
  ------------------
  491|    235|	    xmlOutputBufferWrite(buf, 6, " IDREF");
  492|    235|	    break;
  493|    165|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (493:2): [True: 165, False: 7.61k]
  ------------------
  494|    165|	    xmlOutputBufferWrite(buf, 7, " IDREFS");
  495|    165|	    break;
  496|    136|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (496:2): [True: 136, False: 7.64k]
  ------------------
  497|    136|	    xmlOutputBufferWrite(buf, 7, " ENTITY");
  498|    136|	    break;
  499|    410|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (499:2): [True: 410, False: 7.36k]
  ------------------
  500|    410|	    xmlOutputBufferWrite(buf, 9, " ENTITIES");
  501|    410|	    break;
  502|    258|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (502:2): [True: 258, False: 7.52k]
  ------------------
  503|    258|	    xmlOutputBufferWrite(buf, 8, " NMTOKEN");
  504|    258|	    break;
  505|    259|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (505:2): [True: 259, False: 7.51k]
  ------------------
  506|    259|	    xmlOutputBufferWrite(buf, 9, " NMTOKENS");
  507|    259|	    break;
  508|  4.08k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (508:2): [True: 4.08k, False: 3.69k]
  ------------------
  509|  4.08k|	    xmlOutputBufferWrite(buf, 2, " (");
  510|  4.08k|	    xmlBufDumpEnumeration(buf, attr->tree);
  511|  4.08k|	    break;
  512|    483|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (512:2): [True: 483, False: 7.29k]
  ------------------
  513|    483|	    xmlOutputBufferWrite(buf, 11, " NOTATION (");
  514|    483|	    xmlBufDumpEnumeration(buf, attr->tree);
  515|    483|	    break;
  516|      0|	default:
  ------------------
  |  Branch (516:2): [True: 0, False: 7.77k]
  ------------------
  517|       |            /* assert(0); */
  518|      0|            break;
  519|  7.77k|    }
  520|       |
  521|  7.77k|    switch (attr->def) {
  522|  5.37k|	case XML_ATTRIBUTE_NONE:
  ------------------
  |  Branch (522:2): [True: 5.37k, False: 2.40k]
  ------------------
  523|  5.37k|	    break;
  524|    563|	case XML_ATTRIBUTE_REQUIRED:
  ------------------
  |  Branch (524:2): [True: 563, False: 7.21k]
  ------------------
  525|    563|	    xmlOutputBufferWrite(buf, 10, " #REQUIRED");
  526|    563|	    break;
  527|    780|	case XML_ATTRIBUTE_IMPLIED:
  ------------------
  |  Branch (527:2): [True: 780, False: 6.99k]
  ------------------
  528|    780|	    xmlOutputBufferWrite(buf, 9, " #IMPLIED");
  529|    780|	    break;
  530|  1.06k|	case XML_ATTRIBUTE_FIXED:
  ------------------
  |  Branch (530:2): [True: 1.06k, False: 6.71k]
  ------------------
  531|  1.06k|	    xmlOutputBufferWrite(buf, 7, " #FIXED");
  532|  1.06k|	    break;
  533|      0|	default:
  ------------------
  |  Branch (533:2): [True: 0, False: 7.77k]
  ------------------
  534|       |            /* assert(0); */
  535|      0|            break;
  536|  7.77k|    }
  537|       |
  538|  7.77k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (538:9): [True: 5.17k, False: 2.60k]
  ------------------
  539|  5.17k|        xmlOutputBufferWrite(buf, 2, " \"");
  540|  5.17k|        xmlSaveWriteText(ctxt, attr->defaultValue, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  5.17k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  541|  5.17k|        xmlOutputBufferWrite(buf, 1, "\"");
  542|  5.17k|    }
  543|       |
  544|  7.77k|    xmlOutputBufferWrite(buf, 2, ">\n");
  545|  7.77k|}
xmlsave.c:xmlBufDumpEnumeration:
  452|  4.56k|xmlBufDumpEnumeration(xmlOutputBufferPtr buf, xmlEnumerationPtr cur) {
  453|  10.5k|    while (cur != NULL) {
  ------------------
  |  Branch (453:12): [True: 5.96k, False: 4.56k]
  ------------------
  454|  5.96k|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  455|  5.96k|        if (cur->next != NULL)
  ------------------
  |  Branch (455:13): [True: 1.40k, False: 4.56k]
  ------------------
  456|  1.40k|            xmlOutputBufferWrite(buf, 3, " | ");
  457|       |
  458|  5.96k|        cur = cur->next;
  459|  5.96k|    }
  460|       |
  461|  4.56k|    xmlOutputBufferWrite(buf, 1, ")");
  462|  4.56k|}
xmlsave.c:xmlBufDumpEntityDecl:
  592|  3.33k|xmlBufDumpEntityDecl(xmlOutputBufferPtr buf, xmlEntityPtr ent) {
  593|  3.33k|    if ((ent->etype == XML_INTERNAL_PARAMETER_ENTITY) ||
  ------------------
  |  Branch (593:9): [True: 191, False: 3.14k]
  ------------------
  594|  3.14k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY))
  ------------------
  |  Branch (594:9): [True: 318, False: 2.82k]
  ------------------
  595|    509|        xmlOutputBufferWrite(buf, 11, "<!ENTITY % ");
  596|  2.82k|    else
  597|  2.82k|        xmlOutputBufferWrite(buf, 9, "<!ENTITY ");
  598|  3.33k|    xmlOutputBufferWriteString(buf, (const char *) ent->name);
  599|  3.33k|    xmlOutputBufferWrite(buf, 1, " ");
  600|       |
  601|  3.33k|    if ((ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
  ------------------
  |  Branch (601:9): [True: 759, False: 2.57k]
  ------------------
  602|  2.57k|        (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) ||
  ------------------
  |  Branch (602:9): [True: 395, False: 2.18k]
  ------------------
  603|  2.18k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (603:9): [True: 318, False: 1.86k]
  ------------------
  604|  1.47k|        if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (604:13): [True: 323, False: 1.14k]
  ------------------
  605|    323|             xmlOutputBufferWrite(buf, 7, "PUBLIC ");
  606|    323|             xmlOutputBufferWriteQuotedString(buf, ent->ExternalID);
  607|    323|             xmlOutputBufferWrite(buf, 1, " ");
  608|  1.14k|        } else {
  609|  1.14k|             xmlOutputBufferWrite(buf, 7, "SYSTEM ");
  610|  1.14k|        }
  611|  1.47k|        xmlOutputBufferWriteQuotedString(buf, ent->SystemID);
  612|  1.47k|    }
  613|       |
  614|  3.33k|    if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (614:9): [True: 395, False: 2.93k]
  ------------------
  615|    395|        if (ent->content != NULL) { /* Should be true ! */
  ------------------
  |  Branch (615:13): [True: 353, False: 42]
  ------------------
  616|    353|            xmlOutputBufferWrite(buf, 7, " NDATA ");
  617|    353|            if (ent->orig != NULL)
  ------------------
  |  Branch (617:17): [True: 74, False: 279]
  ------------------
  618|     74|                xmlOutputBufferWriteString(buf, (const char *) ent->orig);
  619|    279|            else
  620|    279|                xmlOutputBufferWriteString(buf, (const char *) ent->content);
  621|    353|        }
  622|    395|    }
  623|       |
  624|  3.33k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (624:9): [True: 1.67k, False: 1.66k]
  ------------------
  625|  1.86k|        (ent->etype == XML_INTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (625:9): [True: 191, False: 1.47k]
  ------------------
  626|       |        /*
  627|       |         * We could save the original quote character and avoid
  628|       |         * calling xmlOutputBufferWriteQuotedString here.
  629|       |         */
  630|  1.86k|        if (ent->orig != NULL)
  ------------------
  |  Branch (630:13): [True: 1.83k, False: 26]
  ------------------
  631|  1.83k|            xmlOutputBufferWriteQuotedString(buf, ent->orig);
  632|     26|        else
  633|     26|            xmlBufDumpEntityContent(buf, ent->content);
  634|  1.86k|    }
  635|       |
  636|  3.33k|    xmlOutputBufferWrite(buf, 2, ">\n");
  637|  3.33k|}
xmlsave.c:xmlBufDumpEntityContent:
  555|     26|xmlBufDumpEntityContent(xmlOutputBufferPtr buf, const xmlChar *content) {
  556|     26|    const char * base, *cur;
  557|       |
  558|     26|    if (content == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 26]
  ------------------
  559|      0|        return;
  560|       |
  561|     26|    xmlOutputBufferWrite(buf, 1, "\"");
  562|     26|    base = cur = (const char *) content;
  563|    349|    while (*cur != 0) {
  ------------------
  |  Branch (563:12): [True: 323, False: 26]
  ------------------
  564|    323|        if (*cur == '"') {
  ------------------
  |  Branch (564:13): [True: 0, False: 323]
  ------------------
  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|    323|        } else if (*cur == '%') {
  ------------------
  |  Branch (570:20): [True: 0, False: 323]
  ------------------
  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|    323|        } else {
  577|    323|            cur++;
  578|    323|        }
  579|    323|    }
  580|     26|    if (base != cur)
  ------------------
  |  Branch (580:9): [True: 26, False: 0]
  ------------------
  581|     26|        xmlOutputBufferWrite(buf, cur - base, base);
  582|     26|    xmlOutputBufferWrite(buf, 1, "\"");
  583|     26|}
xmlsave.c:xmlNsListDumpOutputCtxt:
  799|   774k|xmlNsListDumpOutputCtxt(xmlSaveCtxtPtr ctxt, xmlNsPtr cur) {
  800|  1.55M|    while (cur != NULL) {
  ------------------
  |  Branch (800:12): [True: 783k, False: 774k]
  ------------------
  801|   783k|        xmlNsDumpOutput(ctxt->buf, cur, ctxt);
  802|   783k|	cur = cur->next;
  803|   783k|    }
  804|   774k|}
xmlsave.c:xhtmlAttrListDumpOutput:
 1421|  8.97k|xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
 1422|  8.97k|    xmlAttrPtr xml_lang = NULL;
 1423|  8.97k|    xmlAttrPtr lang = NULL;
 1424|  8.97k|    xmlAttrPtr name = NULL;
 1425|  8.97k|    xmlAttrPtr id = NULL;
 1426|  8.97k|    xmlNodePtr parent;
 1427|  8.97k|    xmlOutputBufferPtr buf;
 1428|       |
 1429|  8.97k|    if (cur == NULL) return;
  ------------------
  |  Branch (1429:9): [True: 0, False: 8.97k]
  ------------------
 1430|  8.97k|    buf = ctxt->buf;
 1431|  8.97k|    parent = cur->parent;
 1432|  30.4k|    while (cur != NULL) {
  ------------------
  |  Branch (1432:12): [True: 21.5k, False: 8.97k]
  ------------------
 1433|  21.5k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
  ------------------
  |  |   34|  20.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1433:6): [True: 20.2k, False: 1.28k]
  |  Branch (1433:27): [True: 477, False: 19.7k]
  ------------------
 1434|    477|	    id = cur;
 1435|  21.0k|	else
 1436|  21.0k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
  ------------------
  |  |   34|  19.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1436:6): [True: 19.7k, False: 1.28k]
  |  Branch (1436:27): [True: 2.79k, False: 16.9k]
  ------------------
 1437|  2.79k|	    name = cur;
 1438|  18.2k|	else
 1439|  18.2k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
  ------------------
  |  |   34|  16.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1439:6): [True: 16.9k, False: 1.28k]
  |  Branch (1439:27): [True: 797, False: 16.1k]
  ------------------
 1440|    797|	    lang = cur;
 1441|  17.4k|	else
 1442|  17.4k|	if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
  ------------------
  |  |   34|  1.28k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1442:6): [True: 1.28k, False: 16.1k]
  |  Branch (1442:27): [True: 877, False: 409]
  ------------------
 1443|    877|	    (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
  ------------------
  |  |   34|    877|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1443:6): [True: 660, False: 217]
  ------------------
 1444|    660|	    xml_lang = cur;
 1445|  21.5k|        xmlAttrDumpOutput(ctxt, cur);
 1446|  21.5k|	cur = cur->next;
 1447|  21.5k|    }
 1448|       |    /*
 1449|       |     * C.8
 1450|       |     */
 1451|  8.97k|    if ((name != NULL) && (id == NULL)) {
  ------------------
  |  Branch (1451:9): [True: 2.79k, False: 6.18k]
  |  Branch (1451:27): [True: 2.57k, False: 216]
  ------------------
 1452|  2.57k|	if ((parent != NULL) && (parent->name != NULL) &&
  ------------------
  |  Branch (1452:6): [True: 2.57k, False: 0]
  |  Branch (1452:26): [True: 2.57k, False: 0]
  ------------------
 1453|  2.57k|	    ((xmlStrEqual(parent->name, BAD_CAST "a")) ||
  ------------------
  |  |   34|  2.57k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1453:7): [True: 497, False: 2.08k]
  ------------------
 1454|  2.08k|	     (xmlStrEqual(parent->name, BAD_CAST "p")) ||
  ------------------
  |  |   34|  2.08k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1454:7): [True: 134, False: 1.94k]
  ------------------
 1455|  1.94k|	     (xmlStrEqual(parent->name, BAD_CAST "div")) ||
  ------------------
  |  |   34|  1.94k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1455:7): [True: 261, False: 1.68k]
  ------------------
 1456|  1.68k|	     (xmlStrEqual(parent->name, BAD_CAST "img")) ||
  ------------------
  |  |   34|  1.68k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1456:7): [True: 216, False: 1.47k]
  ------------------
 1457|  1.47k|	     (xmlStrEqual(parent->name, BAD_CAST "map")) ||
  ------------------
  |  |   34|  1.47k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1457:7): [True: 67, False: 1.40k]
  ------------------
 1458|  1.40k|	     (xmlStrEqual(parent->name, BAD_CAST "applet")) ||
  ------------------
  |  |   34|  1.40k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1458:7): [True: 217, False: 1.18k]
  ------------------
 1459|  1.18k|	     (xmlStrEqual(parent->name, BAD_CAST "form")) ||
  ------------------
  |  |   34|  1.18k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1459:7): [True: 482, False: 705]
  ------------------
 1460|    705|	     (xmlStrEqual(parent->name, BAD_CAST "frame")) ||
  ------------------
  |  |   34|    705|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1460:7): [True: 270, False: 435]
  ------------------
 1461|  2.34k|	     (xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
  ------------------
  |  |   34|    435|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1461:7): [True: 202, False: 233]
  ------------------
 1462|  2.34k|	    xmlOutputBufferWrite(buf, 5, " id=\"");
 1463|  2.34k|            xmlSaveWriteAttrContent(ctxt, name);
 1464|  2.34k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1465|  2.34k|	}
 1466|  2.57k|    }
 1467|       |    /*
 1468|       |     * C.7.
 1469|       |     */
 1470|  8.97k|    if ((lang != NULL) && (xml_lang == NULL)) {
  ------------------
  |  Branch (1470:9): [True: 769, False: 8.20k]
  |  Branch (1470:27): [True: 442, False: 327]
  ------------------
 1471|    442|	xmlOutputBufferWrite(buf, 11, " xml:lang=\"");
 1472|    442|        xmlSaveWriteAttrContent(ctxt, lang);
 1473|    442|	xmlOutputBufferWrite(buf, 1, "\"");
 1474|    442|    } else
 1475|  8.53k|    if ((xml_lang != NULL) && (lang == NULL)) {
  ------------------
  |  Branch (1475:9): [True: 660, False: 7.87k]
  |  Branch (1475:31): [True: 333, False: 327]
  ------------------
 1476|    333|	xmlOutputBufferWrite(buf, 7, " lang=\"");
 1477|    333|        xmlSaveWriteAttrContent(ctxt, xml_lang);
 1478|    333|	xmlOutputBufferWrite(buf, 1, "\"");
 1479|    333|    }
 1480|  8.97k|}
xmlsave.c:xmlSaveWriteAttrContent:
  241|   374k|{
  242|   374k|    xmlNodePtr children;
  243|   374k|    xmlOutputBufferPtr buf = ctxt->buf;
  244|       |
  245|   374k|    children = attr->children;
  246|   672k|    while (children != NULL) {
  ------------------
  |  Branch (246:12): [True: 298k, False: 374k]
  ------------------
  247|   298k|        switch (children->type) {
  248|   297k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (248:13): [True: 297k, False: 426]
  ------------------
  249|   297k|	        xmlSaveWriteText(ctxt, children->content, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|   297k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  250|   297k|		break;
  251|    426|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (251:13): [True: 426, False: 297k]
  ------------------
  252|    426|                xmlOutputBufferWrite(buf, 1, "&");
  253|    426|                xmlOutputBufferWriteString(buf, (const char *) children->name);
  254|    426|                xmlOutputBufferWrite(buf, 1, ";");
  255|    426|                break;
  256|      0|            default:
  ------------------
  |  Branch (256:13): [True: 0, False: 298k]
  ------------------
  257|       |                /* should not happen unless we have a badly built tree */
  258|      0|                break;
  259|   298k|        }
  260|   298k|        children = children->next;
  261|   298k|    }
  262|   374k|}
xmlsave.c:xhtmlIsEmpty:
 1356|  15.0k|xhtmlIsEmpty(xmlNodePtr node) {
 1357|  15.0k|    if (node == NULL)
  ------------------
  |  Branch (1357:9): [True: 0, False: 15.0k]
  ------------------
 1358|      0|	return(-1);
 1359|  15.0k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1359:9): [True: 0, False: 15.0k]
  ------------------
 1360|      0|	return(0);
 1361|  15.0k|    if ((node->ns != NULL) && (!xmlStrEqual(node->ns->href, XHTML_NS_NAME)))
  ------------------
  |  |   33|  1.48k|#define XHTML_NS_NAME BAD_CAST "http://www.w3.org/1999/xhtml"
  |  |  ------------------
  |  |  |  |   34|  1.48k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (1361:9): [True: 1.48k, False: 13.6k]
  |  Branch (1361:31): [True: 1.26k, False: 211]
  ------------------
 1362|  1.26k|	return(0);
 1363|  13.8k|    if (node->children != NULL)
  ------------------
  |  Branch (1363:9): [True: 0, False: 13.8k]
  ------------------
 1364|      0|	return(0);
 1365|  13.8k|    switch (node->name ? node->name[0] : 0) {
  ------------------
  |  Branch (1365:13): [True: 13.8k, False: 0]
  |  Branch (1365:13): [True: 9.31k, False: 4.51k]
  ------------------
 1366|  2.57k|	case 'a':
  ------------------
  |  Branch (1366:2): [True: 2.57k, False: 11.2k]
  ------------------
 1367|  2.57k|	    if (xmlStrEqual(node->name, BAD_CAST "area"))
  ------------------
  |  |   34|  2.57k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1367:10): [True: 203, False: 2.37k]
  ------------------
 1368|    203|		return(1);
 1369|  2.37k|	    return(0);
 1370|    686|	case 'b':
  ------------------
  |  Branch (1370:2): [True: 686, False: 13.1k]
  ------------------
 1371|    686|	    if (xmlStrEqual(node->name, BAD_CAST "br"))
  ------------------
  |  |   34|    686|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1371:10): [True: 77, False: 609]
  ------------------
 1372|     77|		return(1);
 1373|    609|	    if (xmlStrEqual(node->name, BAD_CAST "base"))
  ------------------
  |  |   34|    609|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1373:10): [True: 125, False: 484]
  ------------------
 1374|    125|		return(1);
 1375|    484|	    if (xmlStrEqual(node->name, BAD_CAST "basefont"))
  ------------------
  |  |   34|    484|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1375:10): [True: 76, False: 408]
  ------------------
 1376|     76|		return(1);
 1377|    408|	    return(0);
 1378|    575|	case 'c':
  ------------------
  |  Branch (1378:2): [True: 575, False: 13.2k]
  ------------------
 1379|    575|	    if (xmlStrEqual(node->name, BAD_CAST "col"))
  ------------------
  |  |   34|    575|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1379:10): [True: 219, False: 356]
  ------------------
 1380|    219|		return(1);
 1381|    356|	    return(0);
 1382|  1.04k|	case 'f':
  ------------------
  |  Branch (1382:2): [True: 1.04k, False: 12.7k]
  ------------------
 1383|  1.04k|	    if (xmlStrEqual(node->name, BAD_CAST "frame"))
  ------------------
  |  |   34|  1.04k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1383:10): [True: 340, False: 703]
  ------------------
 1384|    340|		return(1);
 1385|    703|	    return(0);
 1386|    830|	case 'h':
  ------------------
  |  Branch (1386:2): [True: 830, False: 12.9k]
  ------------------
 1387|    830|	    if (xmlStrEqual(node->name, BAD_CAST "hr"))
  ------------------
  |  |   34|    830|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1387:10): [True: 212, False: 618]
  ------------------
 1388|    212|		return(1);
 1389|    618|	    return(0);
 1390|  1.54k|	case 'i':
  ------------------
  |  Branch (1390:2): [True: 1.54k, False: 12.2k]
  ------------------
 1391|  1.54k|	    if (xmlStrEqual(node->name, BAD_CAST "img"))
  ------------------
  |  |   34|  1.54k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1391:10): [True: 579, False: 965]
  ------------------
 1392|    579|		return(1);
 1393|    965|	    if (xmlStrEqual(node->name, BAD_CAST "input"))
  ------------------
  |  |   34|    965|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1393:10): [True: 283, False: 682]
  ------------------
 1394|    283|		return(1);
 1395|    682|	    if (xmlStrEqual(node->name, BAD_CAST "isindex"))
  ------------------
  |  |   34|    682|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1395:10): [True: 293, False: 389]
  ------------------
 1396|    293|		return(1);
 1397|    389|	    return(0);
 1398|    554|	case 'l':
  ------------------
  |  Branch (1398:2): [True: 554, False: 13.2k]
  ------------------
 1399|    554|	    if (xmlStrEqual(node->name, BAD_CAST "link"))
  ------------------
  |  |   34|    554|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1399:10): [True: 209, False: 345]
  ------------------
 1400|    209|		return(1);
 1401|    345|	    return(0);
 1402|    747|	case 'm':
  ------------------
  |  Branch (1402:2): [True: 747, False: 13.0k]
  ------------------
 1403|    747|	    if (xmlStrEqual(node->name, BAD_CAST "meta"))
  ------------------
  |  |   34|    747|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1403:10): [True: 76, False: 671]
  ------------------
 1404|     76|		return(1);
 1405|    671|	    return(0);
 1406|    753|	case 'p':
  ------------------
  |  Branch (1406:2): [True: 753, False: 13.0k]
  ------------------
 1407|    753|	    if (xmlStrEqual(node->name, BAD_CAST "param"))
  ------------------
  |  |   34|    753|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1407:10): [True: 202, False: 551]
  ------------------
 1408|    202|		return(1);
 1409|    551|	    return(0);
 1410|  13.8k|    }
 1411|  4.51k|    return(0);
 1412|  13.8k|}
xmlsave.c:xmlSaveWriteText:
  226|   933k|xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
  227|   933k|    if (ctxt->encoding == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 933k]
  ------------------
  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|   933k|}
xmlsave.c:xmlAttrDumpOutput:
  881|   371k|xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
  882|   371k|    xmlOutputBufferPtr buf;
  883|       |
  884|   371k|    if (cur == NULL) return;
  ------------------
  |  Branch (884:9): [True: 0, False: 371k]
  ------------------
  885|   371k|    buf = ctxt->buf;
  886|   371k|    if (buf == NULL) return;
  ------------------
  |  Branch (886:9): [True: 0, False: 371k]
  ------------------
  887|   371k|    if (ctxt->format == 2)
  ------------------
  |  Branch (887:9): [True: 0, False: 371k]
  ------------------
  888|      0|        xmlOutputBufferWriteWSNonSig(ctxt, 2);
  889|   371k|    else
  890|   371k|        xmlOutputBufferWrite(buf, 1, " ");
  891|   371k|    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (891:9): [True: 171k, False: 199k]
  |  Branch (891:30): [True: 171k, False: 445]
  ------------------
  892|   171k|        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
  893|   171k|	xmlOutputBufferWrite(buf, 1, ":");
  894|   171k|    }
  895|   371k|    xmlOutputBufferWriteString(buf, (const char *)cur->name);
  896|   371k|    xmlOutputBufferWrite(buf, 2, "=\"");
  897|   371k|#ifdef LIBXML_HTML_ENABLED
  898|   371k|    if ((ctxt->options & XML_SAVE_XHTML) &&
  ------------------
  |  Branch (898:9): [True: 21.5k, False: 349k]
  ------------------
  899|  21.5k|        (cur->ns == NULL) &&
  ------------------
  |  Branch (899:9): [True: 20.2k, False: 1.28k]
  ------------------
  900|  20.2k|        ((cur->children == NULL) ||
  ------------------
  |  Branch (900:10): [True: 6.37k, False: 13.8k]
  ------------------
  901|  13.8k|         (cur->children->content == NULL) ||
  ------------------
  |  Branch (901:10): [True: 0, False: 13.8k]
  ------------------
  902|  13.8k|         (cur->children->content[0] == 0)) &&
  ------------------
  |  Branch (902:10): [True: 10.0k, False: 3.83k]
  ------------------
  903|  16.4k|        (htmlIsBooleanAttr(cur->name))) {
  ------------------
  |  Branch (903:9): [True: 201, False: 16.2k]
  ------------------
  904|    201|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  905|    201|    } else
  906|   370k|#endif
  907|   370k|    {
  908|   370k|        xmlSaveWriteAttrContent(ctxt, cur);
  909|   370k|    }
  910|   371k|    xmlOutputBufferWrite(buf, 1, "\"");
  911|   371k|}
xmlsave.c:xmlNodeDumpOutputInternal:
  961|  38.4k|xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  962|  38.4k|    int format = ctxt->format;
  963|  38.4k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
  964|  38.4k|    xmlAttrPtr attr;
  965|  38.4k|    xmlChar *start, *end;
  966|  38.4k|    xmlOutputBufferPtr buf;
  967|       |
  968|  38.4k|    if (cur == NULL) return;
  ------------------
  |  Branch (968:9): [True: 0, False: 38.4k]
  ------------------
  969|  38.4k|    buf = ctxt->buf;
  970|       |
  971|  38.4k|    root = cur;
  972|  38.4k|    parent = cur->parent;
  973|  2.63M|    while (1) {
  ------------------
  |  Branch (973:12): [True: 2.63M, Folded]
  ------------------
  974|  2.63M|        switch (cur->type) {
  975|  2.30k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (975:9): [True: 2.30k, False: 2.63M]
  ------------------
  976|  2.30k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (976:9): [True: 0, False: 2.63M]
  ------------------
  977|  2.30k|	    xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
  978|  2.30k|	    break;
  979|       |
  980|  6.53k|        case XML_DTD_NODE:
  ------------------
  |  Branch (980:9): [True: 6.53k, False: 2.62M]
  ------------------
  981|  6.53k|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
  982|  6.53k|            break;
  983|       |
  984|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (984:9): [True: 0, False: 2.63M]
  ------------------
  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.94k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (993:9): [True: 5.94k, False: 2.62M]
  ------------------
  994|  5.94k|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
  995|  5.94k|            break;
  996|       |
  997|  7.77k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (997:9): [True: 7.77k, False: 2.62M]
  ------------------
  998|  7.77k|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
  999|  7.77k|            break;
 1000|       |
 1001|  3.33k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1001:9): [True: 3.33k, False: 2.63M]
  ------------------
 1002|  3.33k|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1003|  3.33k|            break;
 1004|       |
 1005|  1.38M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1005:9): [True: 1.38M, False: 1.24M]
  ------------------
 1006|  1.38M|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1006:10): [True: 1.38M, False: 6.45k]
  |  Branch (1006:27): [True: 0, False: 1.38M]
  ------------------
 1007|      0|                xmlSaveWriteIndent(ctxt, 0);
 1008|       |
 1009|       |            /*
 1010|       |             * Some users like lxml are known to pass nodes with a corrupted
 1011|       |             * tree structure. Fall back to a recursive call to handle this
 1012|       |             * case.
 1013|       |             */
 1014|  1.38M|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 1.38M]
  |  Branch (1014:44): [True: 0, False: 0]
  ------------------
 1015|      0|                xmlNodeDumpOutputInternal(ctxt, cur);
 1016|      0|                break;
 1017|      0|            }
 1018|       |
 1019|  1.38M|            xmlOutputBufferWrite(buf, 1, "<");
 1020|  1.38M|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1020:17): [True: 179k, False: 1.20M]
  |  Branch (1020:38): [True: 175k, False: 4.34k]
  ------------------
 1021|   175k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1022|   175k|                xmlOutputBufferWrite(buf, 1, ":");
 1023|   175k|            }
 1024|  1.38M|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1025|  1.38M|            if (cur->nsDef)
  ------------------
  |  Branch (1025:17): [True: 770k, False: 618k]
  ------------------
 1026|   770k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1027|  1.73M|            for (attr = cur->properties; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (1027:42): [True: 349k, False: 1.38M]
  ------------------
 1028|   349k|                xmlAttrDumpOutput(ctxt, attr);
 1029|       |
 1030|  1.38M|            if (cur->children == NULL) {
  ------------------
  |  Branch (1030:17): [True: 339k, False: 1.04M]
  ------------------
 1031|   339k|                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
  ------------------
  |  Branch (1031:21): [True: 339k, False: 0]
  ------------------
 1032|   339k|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1032:25): [True: 0, False: 339k]
  ------------------
 1033|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1034|   339k|                    xmlOutputBufferWrite(buf, 2, "/>");
 1035|   339k|                } else {
 1036|      0|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1036:25): [True: 0, False: 0]
  ------------------
 1037|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1038|      0|                    xmlOutputBufferWrite(buf, 3, "></");
 1039|      0|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1039:25): [True: 0, False: 0]
  |  Branch (1039:46): [True: 0, False: 0]
  ------------------
 1040|      0|                        xmlOutputBufferWriteString(buf,
 1041|      0|                                (const char *)cur->ns->prefix);
 1042|      0|                        xmlOutputBufferWrite(buf, 1, ":");
 1043|      0|                    }
 1044|      0|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1045|      0|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1045:25): [True: 0, False: 0]
  ------------------
 1046|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1047|      0|                    xmlOutputBufferWrite(buf, 1, ">");
 1048|      0|                }
 1049|  1.04M|            } else {
 1050|  1.04M|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1050:21): [True: 0, False: 1.04M]
  ------------------
 1051|      0|                    tmp = cur->children;
 1052|      0|                    while (tmp != NULL) {
  ------------------
  |  Branch (1052:28): [True: 0, False: 0]
  ------------------
 1053|      0|                        if ((tmp->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1053:29): [True: 0, False: 0]
  ------------------
 1054|      0|                            (tmp->type == XML_CDATA_SECTION_NODE) ||
  ------------------
  |  Branch (1054:29): [True: 0, False: 0]
  ------------------
 1055|      0|                            (tmp->type == XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (1055:29): [True: 0, False: 0]
  ------------------
 1056|      0|                            ctxt->format = 0;
 1057|      0|                            unformattedNode = cur;
 1058|      0|                            break;
 1059|      0|                        }
 1060|      0|                        tmp = tmp->next;
 1061|      0|                    }
 1062|      0|                }
 1063|  1.04M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1063:21): [True: 0, False: 1.04M]
  ------------------
 1064|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1065|  1.04M|                xmlOutputBufferWrite(buf, 1, ">");
 1066|  1.04M|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1066:21): [True: 0, False: 1.04M]
  ------------------
 1067|  1.04M|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1067:21): [True: 1.04M, False: 0]
  ------------------
 1068|  1.04M|                parent = cur;
 1069|  1.04M|                cur = cur->children;
 1070|  1.04M|                continue;
 1071|  1.04M|            }
 1072|       |
 1073|   339k|            break;
 1074|       |
 1075|   616k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1075:9): [True: 616k, False: 2.01M]
  ------------------
 1076|   616k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1076:10): [True: 228, False: 615k]
  ------------------
 1077|    228|                break;
 1078|   615k|	    if (cur->name != xmlStringTextNoenc) {
  ------------------
  |  Branch (1078:10): [True: 615k, False: 0]
  ------------------
 1079|   615k|                if (ctxt->escape)
  ------------------
  |  Branch (1079:21): [True: 0, False: 615k]
  ------------------
 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|   615k|                else
 1087|   615k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1088|   615k|	    } else {
 1089|       |		/*
 1090|       |		 * Disable escaping, needed for XSLT
 1091|       |		 */
 1092|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1093|      0|	    }
 1094|   615k|	    break;
 1095|       |
 1096|    948|        case XML_PI_NODE:
  ------------------
  |  Branch (1096:9): [True: 948, False: 2.63M]
  ------------------
 1097|    948|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1097:10): [True: 313, False: 635]
  |  Branch (1097:27): [True: 0, False: 313]
  ------------------
 1098|      0|                xmlSaveWriteIndent(ctxt, 0);
 1099|       |
 1100|    948|            if (cur->content != NULL) {
  ------------------
  |  Branch (1100:17): [True: 278, False: 670]
  ------------------
 1101|    278|                xmlOutputBufferWrite(buf, 2, "<?");
 1102|    278|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1103|    278|                if (cur->content != NULL) {
  ------------------
  |  Branch (1103:21): [True: 278, False: 0]
  ------------------
 1104|    278|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1104:25): [True: 0, False: 278]
  ------------------
 1105|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1106|    278|                    else
 1107|    278|                        xmlOutputBufferWrite(buf, 1, " ");
 1108|    278|                    xmlOutputBufferWriteString(buf,
 1109|    278|                            (const char *)cur->content);
 1110|    278|                }
 1111|    278|                xmlOutputBufferWrite(buf, 2, "?>");
 1112|    670|            } else {
 1113|    670|                xmlOutputBufferWrite(buf, 2, "<?");
 1114|    670|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1115|    670|                if (ctxt->format == 2)
  ------------------
  |  Branch (1115:21): [True: 0, False: 670]
  ------------------
 1116|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1117|    670|                xmlOutputBufferWrite(buf, 2, "?>");
 1118|    670|            }
 1119|    948|            break;
 1120|       |
 1121|    769|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1121:9): [True: 769, False: 2.63M]
  ------------------
 1122|    769|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1122:10): [True: 469, False: 300]
  |  Branch (1122:27): [True: 0, False: 469]
  ------------------
 1123|      0|                xmlSaveWriteIndent(ctxt, 0);
 1124|       |
 1125|    769|            if (cur->content != NULL) {
  ------------------
  |  Branch (1125:17): [True: 769, False: 0]
  ------------------
 1126|    769|                xmlOutputBufferWrite(buf, 4, "<!--");
 1127|    769|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1128|    769|                xmlOutputBufferWrite(buf, 3, "-->");
 1129|    769|            }
 1130|    769|            break;
 1131|       |
 1132|  2.07k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1132:9): [True: 2.07k, False: 2.63M]
  ------------------
 1133|  2.07k|            xmlOutputBufferWrite(buf, 1, "&");
 1134|  2.07k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1135|  2.07k|            xmlOutputBufferWrite(buf, 1, ";");
 1136|  2.07k|            break;
 1137|       |
 1138|    768|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1138:9): [True: 768, False: 2.63M]
  ------------------
 1139|    768|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1139:17): [True: 0, False: 768]
  |  Branch (1139:41): [True: 276, False: 492]
  ------------------
 1140|    276|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1141|    492|            } else {
 1142|    492|                start = end = cur->content;
 1143|  2.25k|                while (*end != '\0') {
  ------------------
  |  Branch (1143:24): [True: 1.76k, False: 492]
  ------------------
 1144|  1.76k|                    if ((*end == ']') && (*(end + 1) == ']') &&
  ------------------
  |  Branch (1144:25): [True: 470, False: 1.29k]
  |  Branch (1144:42): [True: 231, False: 239]
  ------------------
 1145|    231|                        (*(end + 2) == '>')) {
  ------------------
  |  Branch (1145:25): [True: 0, False: 231]
  ------------------
 1146|      0|                        end = end + 2;
 1147|      0|                        xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1148|      0|                        xmlOutputBufferWrite(buf, end - start,
 1149|      0|                                (const char *)start);
 1150|      0|                        xmlOutputBufferWrite(buf, 3, "]]>");
 1151|      0|                        start = end;
 1152|      0|                    }
 1153|  1.76k|                    end++;
 1154|  1.76k|                }
 1155|    492|                if (start != end) {
  ------------------
  |  Branch (1155:21): [True: 492, False: 0]
  ------------------
 1156|    492|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1157|    492|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1158|    492|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1159|    492|                }
 1160|    492|            }
 1161|    768|            break;
 1162|       |
 1163|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1163:9): [True: 0, False: 2.63M]
  ------------------
 1164|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1165|      0|            break;
 1166|       |
 1167|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1167:9): [True: 0, False: 2.63M]
  ------------------
 1168|      0|            xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1169|      0|            break;
 1170|       |
 1171|   599k|        default:
  ------------------
  |  Branch (1171:9): [True: 599k, False: 2.03M]
  ------------------
 1172|   599k|            break;
 1173|  2.63M|        }
 1174|       |
 1175|  2.63M|        while (1) {
  ------------------
  |  Branch (1175:16): [True: 2.63M, Folded]
  ------------------
 1176|  2.63M|            if (cur == root)
  ------------------
  |  Branch (1176:17): [True: 38.4k, False: 2.59M]
  ------------------
 1177|  38.4k|                return;
 1178|  2.59M|            if ((ctxt->format == 1) &&
  ------------------
  |  Branch (1178:17): [True: 0, False: 2.59M]
  ------------------
 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|  2.59M|            if (cur->next != NULL) {
  ------------------
  |  Branch (1182:17): [True: 1.54M, False: 1.04M]
  ------------------
 1183|  1.54M|                cur = cur->next;
 1184|  1.54M|                break;
 1185|  1.54M|            }
 1186|       |
 1187|  1.04M|            cur = parent;
 1188|       |            /* cur->parent was validated when descending. */
 1189|  1.04M|            parent = cur->parent;
 1190|       |
 1191|  1.04M|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1191:17): [True: 1.04M, False: 0]
  ------------------
 1192|  1.04M|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1192:21): [True: 1.04M, False: 0]
  ------------------
 1193|  1.04M|                if (ctxt->format == 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 1.04M]
  ------------------
 1194|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1195|       |
 1196|  1.04M|                xmlOutputBufferWrite(buf, 2, "</");
 1197|  1.04M|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1197:21): [True: 10.0k, False: 1.03M]
  |  Branch (1197:42): [True: 6.77k, False: 3.29k]
  ------------------
 1198|  6.77k|                    xmlOutputBufferWriteString(buf,
 1199|  6.77k|                            (const char *)cur->ns->prefix);
 1200|  6.77k|                    xmlOutputBufferWrite(buf, 1, ":");
 1201|  6.77k|                }
 1202|       |
 1203|  1.04M|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1204|  1.04M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1204:21): [True: 0, False: 1.04M]
  ------------------
 1205|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1206|  1.04M|                xmlOutputBufferWrite(buf, 1, ">");
 1207|       |
 1208|  1.04M|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1208:21): [True: 0, False: 1.04M]
  ------------------
 1209|      0|                    ctxt->format = format;
 1210|       |                    unformattedNode = NULL;
 1211|      0|                }
 1212|  1.04M|            }
 1213|  1.04M|        }
 1214|  1.58M|    }
 1215|  38.4k|}
xmlsave.c:xmlBufDumpNotationDecl:
  271|  1.30k|xmlBufDumpNotationDecl(xmlOutputBufferPtr buf, xmlNotationPtr nota) {
  272|  1.30k|    xmlOutputBufferWrite(buf, 11, "<!NOTATION ");
  273|  1.30k|    xmlOutputBufferWriteString(buf, (const char *) nota->name);
  274|       |
  275|  1.30k|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (275:9): [True: 1.03k, False: 275]
  ------------------
  276|  1.03k|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  277|  1.03k|	xmlOutputBufferWriteQuotedString(buf, nota->PublicID);
  278|  1.03k|	if (nota->SystemID != NULL) {
  ------------------
  |  Branch (278:6): [True: 3, False: 1.03k]
  ------------------
  279|      3|	    xmlOutputBufferWrite(buf, 1, " ");
  280|      3|	    xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  281|      3|	}
  282|  1.03k|    } else {
  283|    275|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  284|    275|	xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  285|    275|    }
  286|       |
  287|  1.30k|    xmlOutputBufferWrite(buf, 3, " >\n");
  288|  1.30k|}
xmlsave.c:xmlBufDumpNotationTable:
  310|  1.30k|xmlBufDumpNotationTable(xmlOutputBufferPtr buf, xmlNotationTablePtr table) {
  311|  1.30k|    xmlHashScan(table, xmlBufDumpNotationDeclScan, buf);
  312|  1.30k|}
xmlsave.c:xmlBufDumpNotationDeclScan:
  299|  1.30k|                           const xmlChar *name ATTRIBUTE_UNUSED) {
  300|  1.30k|    xmlBufDumpNotationDecl((xmlOutputBufferPtr) buf, (xmlNotationPtr) nota);
  301|  1.30k|}
xmlsave.c:xmlSaveCtxtInit:
  153|  32.3k|{
  154|  32.3k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (154:9): [True: 0, False: 32.3k]
  ------------------
  155|       |
  156|  32.3k|    xmlSaveSetIndentString(ctxt, xmlTreeIndentString);
  ------------------
  |  | 1364|  32.3k|    #define xmlTreeIndentString (*__xmlTreeIndentString())
  ------------------
  157|       |
  158|  32.3k|    if (options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (158:9): [True: 0, False: 32.3k]
  ------------------
  159|      0|        ctxt->format = 1;
  160|  32.3k|    else if (options & XML_SAVE_WSNONSIG)
  ------------------
  |  Branch (160:14): [True: 0, False: 32.3k]
  ------------------
  161|      0|        ctxt->format = 2;
  162|       |
  163|  32.3k|    if (((options & XML_SAVE_EMPTY) == 0) &&
  ------------------
  |  Branch (163:9): [True: 32.3k, False: 0]
  ------------------
  164|  32.3k|        (xmlSaveNoEmptyTags))
  ------------------
  |  | 1372|  32.3k|    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
  ------------------
  |  Branch (164:9): [True: 0, False: 32.3k]
  ------------------
  165|      0|	options |= XML_SAVE_NO_EMPTY;
  166|       |
  167|  32.3k|    ctxt->options = options;
  168|  32.3k|}

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

xmlStrndup:
   50|  23.7M|xmlStrndup(const xmlChar *cur, int len) {
   51|  23.7M|    xmlChar *ret;
   52|       |
   53|  23.7M|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (53:9): [True: 0, False: 23.7M]
  |  Branch (53:26): [True: 0, False: 23.7M]
  ------------------
   54|  23.7M|    ret = xmlMalloc((size_t) len + 1);
   55|  23.7M|    if (ret == NULL) {
  ------------------
  |  Branch (55:9): [True: 2.70k, False: 23.7M]
  ------------------
   56|  2.70k|        return(NULL);
   57|  2.70k|    }
   58|  23.7M|    memcpy(ret, cur, len);
   59|  23.7M|    ret[len] = 0;
   60|  23.7M|    return(ret);
   61|  23.7M|}
xmlStrdup:
   72|  18.9M|xmlStrdup(const xmlChar *cur) {
   73|  18.9M|    const xmlChar *p = cur;
   74|       |
   75|  18.9M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (75:9): [True: 19, False: 18.9M]
  ------------------
   76|   807M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (76:12): [True: 789M, False: 18.9M]
  ------------------
   77|  18.9M|    return(xmlStrndup(cur, p - cur));
   78|  18.9M|}
xmlCharStrndup:
   89|   678k|xmlCharStrndup(const char *cur, int len) {
   90|   678k|    int i;
   91|   678k|    xmlChar *ret;
   92|       |
   93|   678k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (93:9): [True: 0, False: 678k]
  |  Branch (93:26): [True: 0, False: 678k]
  ------------------
   94|   678k|    ret = xmlMalloc((size_t) len + 1);
   95|   678k|    if (ret == NULL) {
  ------------------
  |  Branch (95:9): [True: 146, False: 678k]
  ------------------
   96|    146|        return(NULL);
   97|    146|    }
   98|  79.7M|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (98:16): [True: 79.0M, False: 678k]
  ------------------
   99|       |        /* Explicit sign change */
  100|  79.0M|        ret[i] = (xmlChar) cur[i];
  101|  79.0M|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (101:13): [True: 0, False: 79.0M]
  ------------------
  102|  79.0M|    }
  103|   678k|    ret[len] = 0;
  104|   678k|    return(ret);
  105|   678k|}
xmlCharStrdup:
  115|   678k|xmlCharStrdup(const char *cur) {
  116|   678k|    const char *p = cur;
  117|       |
  118|   678k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (118:9): [True: 0, False: 678k]
  ------------------
  119|  79.7M|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (119:12): [True: 79.0M, False: 678k]
  ------------------
  120|   678k|    return(xmlCharStrndup(cur, p - cur));
  121|   678k|}
xmlStrcmp:
  132|  2.65k|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  133|  2.65k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (133:9): [True: 2.56k, False: 88]
  ------------------
  134|     88|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (134:9): [True: 88, 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|  34.2M|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  158|  34.2M|    if (str1 == str2) return(1);
  ------------------
  |  Branch (158:9): [True: 1.14M, False: 33.1M]
  ------------------
  159|  33.1M|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (159:9): [True: 4.31M, False: 28.8M]
  ------------------
  160|  28.8M|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (160:9): [True: 2.84M, False: 25.9M]
  ------------------
  161|  25.9M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  162|  25.9M|    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|  28.8M|}
xmlStrQEqual:
  181|  51.4k|xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
  182|  51.4k|    if (pref == NULL) return(xmlStrEqual(name, str));
  ------------------
  |  Branch (182:9): [True: 12.3k, False: 39.1k]
  ------------------
  183|  39.1k|    if (name == NULL) return(0);
  ------------------
  |  Branch (183:9): [True: 0, False: 39.1k]
  ------------------
  184|  39.1k|    if (str == NULL) return(0);
  ------------------
  |  Branch (184:9): [True: 0, False: 39.1k]
  ------------------
  185|       |
  186|   237k|    do {
  187|   237k|        if (*pref++ != *str) return(0);
  ------------------
  |  Branch (187:13): [True: 0, False: 237k]
  ------------------
  188|   237k|    } while ((*str++) && (*pref));
  ------------------
  |  Branch (188:14): [True: 237k, False: 0]
  |  Branch (188:26): [True: 198k, False: 39.1k]
  ------------------
  189|  39.1k|    if (*str++ != ':') return(0);
  ------------------
  |  Branch (189:9): [True: 0, False: 39.1k]
  ------------------
  190|   346k|    do {
  191|   346k|        if (*name++ != *str) return(0);
  ------------------
  |  Branch (191:13): [True: 0, False: 346k]
  ------------------
  192|   346k|    } while (*str++);
  ------------------
  |  Branch (192:14): [True: 307k, False: 39.1k]
  ------------------
  193|  39.1k|    return(1);
  194|  39.1k|}
xmlStrncmp:
  206|  21.9M|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  207|  21.9M|    if (len <= 0) return(0);
  ------------------
  |  Branch (207:9): [True: 15, False: 21.9M]
  ------------------
  208|  21.9M|    if (str1 == str2) return(0);
  ------------------
  |  Branch (208:9): [True: 0, False: 21.9M]
  ------------------
  209|  21.9M|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (209:9): [True: 1, False: 21.9M]
  ------------------
  210|  21.9M|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (210:9): [True: 0, False: 21.9M]
  ------------------
  211|  21.9M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  212|  21.9M|    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|  21.9M|}
xmlStrcasecmp:
  266|  80.3k|xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
  267|  80.3k|    register int tmp;
  268|       |
  269|  80.3k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (269:9): [True: 0, False: 80.3k]
  ------------------
  270|  80.3k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (270:9): [True: 0, False: 80.3k]
  ------------------
  271|  80.3k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (271:9): [True: 0, False: 80.3k]
  ------------------
  272|   199k|    do {
  273|   199k|        tmp = casemap[*str1++] - casemap[*str2];
  274|   199k|        if (tmp != 0) return(tmp);
  ------------------
  |  Branch (274:13): [True: 76.3k, False: 122k]
  ------------------
  275|   199k|    } while (*str2++ != 0);
  ------------------
  |  Branch (275:14): [True: 118k, False: 3.98k]
  ------------------
  276|  3.98k|    return 0;
  277|  80.3k|}
xmlStrchr:
  312|  85.1M|xmlStrchr(const xmlChar *str, xmlChar val) {
  313|  85.1M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (313:9): [True: 0, False: 85.1M]
  ------------------
  314|   357M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (314:12): [True: 273M, False: 84.4M]
  ------------------
  315|   273M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (315:13): [True: 752k, False: 272M]
  ------------------
  316|   272M|        str++;
  317|   272M|    }
  318|  84.4M|    return(NULL);
  319|  85.1M|}
xmlStrstr:
  330|   806k|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  331|   806k|    int n;
  332|       |
  333|   806k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (333:9): [True: 0, False: 806k]
  ------------------
  334|   806k|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (334:9): [True: 0, False: 806k]
  ------------------
  335|   806k|    n = xmlStrlen(val);
  336|       |
  337|   806k|    if (n == 0) return(str);
  ------------------
  |  Branch (337:9): [True: 0, False: 806k]
  ------------------
  338|  2.81M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (338:12): [True: 2.03M, False: 781k]
  ------------------
  339|  2.03M|        if (*str == *val) {
  ------------------
  |  Branch (339:13): [True: 31.6k, False: 2.00M]
  ------------------
  340|  31.6k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (340:17): [True: 24.8k, False: 6.78k]
  ------------------
  341|  31.6k|        }
  342|  2.01M|        str++;
  343|  2.01M|    }
  344|   781k|    return(NULL);
  345|   806k|}
xmlStrlen:
  405|  3.20M|xmlStrlen(const xmlChar *str) {
  406|  3.20M|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (406:18): [True: 3.20M, False: 1.87k]
  ------------------
  407|  3.20M|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (407:12): [True: 0, False: 3.20M]
  ------------------
  408|  3.20M|}
xmlStrncat:
  423|   623k|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  424|   623k|    int size;
  425|   623k|    xmlChar *ret;
  426|       |
  427|   623k|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (427:9): [True: 0, False: 623k]
  |  Branch (427:26): [True: 358, False: 623k]
  ------------------
  428|    358|        return(cur);
  429|       |
  430|   623k|    if (len < 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 623k]
  ------------------
  431|      0|        if (cur != NULL)
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            xmlFree(cur);
  433|      0|        return(NULL);
  434|      0|    }
  435|       |
  436|   623k|    if (cur == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 623k]
  ------------------
  437|      0|        return(xmlStrndup(add, len));
  438|       |
  439|   623k|    size = xmlStrlen(cur);
  440|   623k|    if ((size < 0) || (size > INT_MAX - len)) {
  ------------------
  |  Branch (440:9): [True: 0, False: 623k]
  |  Branch (440:23): [True: 0, False: 623k]
  ------------------
  441|      0|        xmlFree(cur);
  442|      0|        return(NULL);
  443|      0|    }
  444|   623k|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  445|   623k|    if (ret == NULL) {
  ------------------
  |  Branch (445:9): [True: 15, False: 623k]
  ------------------
  446|     15|        xmlFree(cur);
  447|     15|        return(NULL);
  448|     15|    }
  449|   623k|    memcpy(&ret[size], add, len);
  450|   623k|    ret[size + len] = 0;
  451|   623k|    return(ret);
  452|   623k|}
xmlStrncatNew:
  465|     26|xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
  466|     26|    int size;
  467|     26|    xmlChar *ret;
  468|       |
  469|     26|    if (len < 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 26]
  ------------------
  470|      0|        len = xmlStrlen(str2);
  471|      0|        if (len < 0)
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            return(NULL);
  473|      0|    }
  474|     26|    if (str1 == NULL)
  ------------------
  |  Branch (474:9): [True: 26, False: 0]
  ------------------
  475|     26|        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|   623k|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  503|   623k|    const xmlChar *p = add;
  504|       |
  505|   623k|    if (add == NULL) return(cur);
  ------------------
  |  Branch (505:9): [True: 3, False: 623k]
  ------------------
  506|   623k|    if (cur == NULL)
  ------------------
  |  Branch (506:9): [True: 2, False: 623k]
  ------------------
  507|      2|        return(xmlStrdup(add));
  508|       |
  509|  13.0M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (509:12): [True: 12.4M, False: 623k]
  ------------------
  510|   623k|    return(xmlStrncat(cur, add, p - add));
  511|   623k|}
xmlStrVASPrintf:
  573|  1.21M|xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
  574|  1.21M|    char empty[1];
  575|  1.21M|    va_list copy;
  576|  1.21M|    xmlChar *buf;
  577|  1.21M|    int res, size;
  578|  1.21M|    int truncated = 0;
  579|       |
  580|  1.21M|    if (out == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 1.21M]
  ------------------
  581|      0|        return(1);
  582|  1.21M|    *out = NULL;
  583|  1.21M|    if (msg == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 1.21M]
  ------------------
  584|      0|        return(1);
  585|  1.21M|    if (maxSize < 32)
  ------------------
  |  Branch (585:9): [True: 0, False: 1.21M]
  ------------------
  586|      0|        maxSize = 32;
  587|       |
  588|  1.21M|    va_copy(copy, ap);
  589|  1.21M|    res = vsnprintf(empty, 1, msg, copy);
  590|  1.21M|    va_end(copy);
  591|       |
  592|  1.21M|    if (res > 0) {
  ------------------
  |  Branch (592:9): [True: 1.21M, False: 0]
  ------------------
  593|       |        /* snprintf seems to work according to C99. */
  594|       |
  595|  1.21M|        if (res < maxSize) {
  ------------------
  |  Branch (595:13): [True: 1.21M, False: 288]
  ------------------
  596|  1.21M|            size = res + 1;
  597|  1.21M|        } else {
  598|    288|            size = maxSize;
  599|    288|            truncated = 1;
  600|    288|        }
  601|  1.21M|        buf = xmlMalloc(size);
  602|  1.21M|        if (buf == NULL)
  ------------------
  |  Branch (602:13): [True: 1.41k, False: 1.21M]
  ------------------
  603|  1.41k|            return(-1);
  604|  1.21M|        if (vsnprintf((char *) buf, size, msg, ap) < 0) {
  ------------------
  |  Branch (604:13): [True: 0, False: 1.21M]
  ------------------
  605|      0|            xmlFree(buf);
  606|      0|            return(1);
  607|      0|        }
  608|  1.21M|    } 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.21M|    if (truncated != 0) {
  ------------------
  |  Branch (658:9): [True: 288, False: 1.21M]
  ------------------
  659|    288|        int i = size - 1;
  660|       |
  661|    434|        while (i > 0) {
  ------------------
  |  Branch (661:16): [True: 434, False: 0]
  ------------------
  662|       |            /* Break after ASCII */
  663|    434|            if (buf[i-1] < 0x80)
  ------------------
  |  Branch (663:17): [True: 165, False: 269]
  ------------------
  664|    165|                break;
  665|    269|            i -= 1;
  666|       |            /* Break before non-ASCII */
  667|    269|            if (buf[i] >= 0xc0)
  ------------------
  |  Branch (667:17): [True: 123, False: 146]
  ------------------
  668|    123|                break;
  669|    269|        }
  670|       |
  671|    288|        buf[i] = 0;
  672|    288|    }
  673|       |
  674|  1.21M|    *out = (xmlChar *) buf;
  675|  1.21M|    return(truncated);
  676|  1.21M|}
xmlUTF8Strlen:
  770|  10.4k|xmlUTF8Strlen(const xmlChar *utf) {
  771|  10.4k|    size_t ret = 0;
  772|       |
  773|  10.4k|    if (utf == NULL)
  ------------------
  |  Branch (773:9): [True: 3, False: 10.4k]
  ------------------
  774|      3|        return(-1);
  775|       |
  776|  1.08M|    while (*utf != 0) {
  ------------------
  |  Branch (776:12): [True: 1.07M, False: 10.4k]
  ------------------
  777|  1.07M|        if (utf[0] & 0x80) {
  ------------------
  |  Branch (777:13): [True: 10.9k, False: 1.06M]
  ------------------
  778|  10.9k|            if ((utf[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (778:17): [True: 0, False: 10.9k]
  ------------------
  779|      0|                return(-1);
  780|  10.9k|            if ((utf[0] & 0xe0) == 0xe0) {
  ------------------
  |  Branch (780:17): [True: 2.85k, False: 8.04k]
  ------------------
  781|  2.85k|                if ((utf[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (781:21): [True: 0, False: 2.85k]
  ------------------
  782|      0|                    return(-1);
  783|  2.85k|                if ((utf[0] & 0xf0) == 0xf0) {
  ------------------
  |  Branch (783:21): [True: 622, False: 2.23k]
  ------------------
  784|    622|                    if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (784:25): [True: 0, False: 622]
  |  Branch (784:52): [True: 0, False: 622]
  ------------------
  785|      0|                        return(-1);
  786|    622|                    utf += 4;
  787|  2.23k|                } else {
  788|  2.23k|                    utf += 3;
  789|  2.23k|                }
  790|  8.04k|            } else {
  791|  8.04k|                utf += 2;
  792|  8.04k|            }
  793|  1.06M|        } else {
  794|  1.06M|            utf++;
  795|  1.06M|        }
  796|  1.07M|        ret++;
  797|  1.07M|    }
  798|  10.4k|    return(ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (798:12): [True: 0, False: 10.4k]
  ------------------
  799|  10.4k|}
xmlGetUTF8Char:
  812|  24.0M|xmlGetUTF8Char(const unsigned char *utf, int *len) {
  813|  24.0M|    unsigned int c;
  814|       |
  815|  24.0M|    if (utf == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 24.0M]
  ------------------
  816|      0|        goto error;
  817|  24.0M|    if (len == NULL)
  ------------------
  |  Branch (817:9): [True: 0, False: 24.0M]
  ------------------
  818|      0|        goto error;
  819|       |
  820|  24.0M|    c = utf[0];
  821|  24.0M|    if (c < 0x80) {
  ------------------
  |  Branch (821:9): [True: 15.9M, False: 8.11M]
  ------------------
  822|  15.9M|        if (*len < 1)
  ------------------
  |  Branch (822:13): [True: 0, False: 15.9M]
  ------------------
  823|      0|            goto error;
  824|       |        /* 1-byte code */
  825|  15.9M|        *len = 1;
  826|  15.9M|    } else {
  827|  8.11M|        if ((*len < 2) || ((utf[1] & 0xc0) != 0x80))
  ------------------
  |  Branch (827:13): [True: 301, False: 8.11M]
  |  Branch (827:27): [True: 76.5k, False: 8.03M]
  ------------------
  828|  76.8k|            goto error;
  829|  8.03M|        if (c < 0xe0) {
  ------------------
  |  Branch (829:13): [True: 148k, False: 7.88M]
  ------------------
  830|   148k|            if (c < 0xc2)
  ------------------
  |  Branch (830:17): [True: 61.5k, False: 86.5k]
  ------------------
  831|  61.5k|                goto error;
  832|       |            /* 2-byte code */
  833|  86.5k|            *len = 2;
  834|  86.5k|            c = (c & 0x1f) << 6;
  835|  86.5k|            c |= utf[1] & 0x3f;
  836|  7.88M|        } else {
  837|  7.88M|            if ((*len < 3) || ((utf[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (837:17): [True: 72, False: 7.88M]
  |  Branch (837:31): [True: 315, False: 7.88M]
  ------------------
  838|    387|                goto error;
  839|  7.88M|            if (c < 0xf0) {
  ------------------
  |  Branch (839:17): [True: 7.88M, False: 4.20k]
  ------------------
  840|       |                /* 3-byte code */
  841|  7.88M|                *len = 3;
  842|  7.88M|                c = (c & 0xf) << 12;
  843|  7.88M|                c |= (utf[1] & 0x3f) << 6;
  844|  7.88M|                c |= utf[2] & 0x3f;
  845|  7.88M|                if ((c < 0x800) || ((c >= 0xd800) && (c < 0xe000)))
  ------------------
  |  Branch (845:21): [True: 260, False: 7.88M]
  |  Branch (845:37): [True: 2.08M, False: 5.80M]
  |  Branch (845:54): [True: 220, False: 2.08M]
  ------------------
  846|    480|                    goto error;
  847|  7.88M|            } else {
  848|  4.20k|                if ((*len < 4) || ((utf[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (848:21): [True: 72, False: 4.13k]
  |  Branch (848:35): [True: 279, False: 3.85k]
  ------------------
  849|    351|                    goto error;
  850|  3.85k|                *len = 4;
  851|       |                /* 4-byte code */
  852|  3.85k|                c = (c & 0x7) << 18;
  853|  3.85k|                c |= (utf[1] & 0x3f) << 12;
  854|  3.85k|                c |= (utf[2] & 0x3f) << 6;
  855|  3.85k|                c |= utf[3] & 0x3f;
  856|  3.85k|                if ((c < 0x10000) || (c >= 0x110000))
  ------------------
  |  Branch (856:21): [True: 373, False: 3.47k]
  |  Branch (856:38): [True: 360, False: 3.11k]
  ------------------
  857|    733|                    goto error;
  858|  3.85k|            }
  859|  7.88M|        }
  860|  8.03M|    }
  861|  23.9M|    return(c);
  862|       |
  863|   140k|error:
  864|   140k|    if (len != NULL)
  ------------------
  |  Branch (864:9): [True: 140k, False: 0]
  ------------------
  865|   140k|	*len = 0;
  866|   140k|    return(-1);
  867|  24.0M|}
xmlUTF8Strsize:
  933|   171k|xmlUTF8Strsize(const xmlChar *utf, int len) {
  934|   171k|    const xmlChar *ptr=utf;
  935|   171k|    int ch;
  936|   171k|    size_t ret;
  937|       |
  938|   171k|    if (utf == NULL)
  ------------------
  |  Branch (938:9): [True: 0, False: 171k]
  ------------------
  939|      0|        return(0);
  940|       |
  941|   171k|    if (len <= 0)
  ------------------
  |  Branch (941:9): [True: 0, False: 171k]
  ------------------
  942|      0|        return(0);
  943|       |
  944|   348k|    while ( len-- > 0) {
  ------------------
  |  Branch (944:13): [True: 178k, False: 170k]
  ------------------
  945|   178k|        if ( !*ptr )
  ------------------
  |  Branch (945:14): [True: 932, False: 177k]
  ------------------
  946|    932|            break;
  947|   177k|        ch = *ptr++;
  948|   177k|        if ((ch & 0x80))
  ------------------
  |  Branch (948:13): [True: 211, False: 177k]
  ------------------
  949|    422|            while ((ch<<=1) & 0x80 ) {
  ------------------
  |  Branch (949:20): [True: 211, False: 211]
  ------------------
  950|    211|		if (*ptr == 0) break;
  ------------------
  |  Branch (950:7): [True: 0, False: 211]
  ------------------
  951|    211|                ptr++;
  952|    211|	    }
  953|   177k|    }
  954|   171k|    ret = ptr - utf;
  955|   171k|    return (ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (955:13): [True: 0, False: 171k]
  ------------------
  956|   171k|}
xmlUTF8Strndup:
  967|  1.19k|xmlUTF8Strndup(const xmlChar *utf, int len) {
  968|  1.19k|    xmlChar *ret;
  969|  1.19k|    int i;
  970|       |
  971|  1.19k|    if ((utf == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (971:9): [True: 0, False: 1.19k]
  |  Branch (971:26): [True: 0, False: 1.19k]
  ------------------
  972|  1.19k|    i = xmlUTF8Strsize(utf, len);
  973|  1.19k|    ret = xmlMalloc((size_t) i + 1);
  974|  1.19k|    if (ret == NULL) {
  ------------------
  |  Branch (974:9): [True: 2, False: 1.19k]
  ------------------
  975|      2|        return(NULL);
  976|      2|    }
  977|  1.19k|    memcpy(ret, utf, i);
  978|  1.19k|    ret[i] = 0;
  979|  1.19k|    return(ret);
  980|  1.19k|}
xmlUTF8Strpos:
  991|  24.1k|xmlUTF8Strpos(const xmlChar *utf, int pos) {
  992|  24.1k|    int ch;
  993|       |
  994|  24.1k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (994:9): [True: 0, False: 24.1k]
  ------------------
  995|  24.1k|    if (pos < 0)
  ------------------
  |  Branch (995:9): [True: 0, False: 24.1k]
  ------------------
  996|      0|        return(NULL);
  997|  4.15M|    while (pos--) {
  ------------------
  |  Branch (997:12): [True: 4.13M, False: 24.1k]
  ------------------
  998|  4.13M|        ch = *utf++;
  999|  4.13M|        if (ch == 0)
  ------------------
  |  Branch (999:13): [True: 0, False: 4.13M]
  ------------------
 1000|      0|            return(NULL);
 1001|  4.13M|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (1001:14): [True: 15.9k, False: 4.11M]
  ------------------
 1002|       |            /* if not simple ascii, verify proper format */
 1003|  15.9k|            if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1003:18): [True: 0, False: 15.9k]
  ------------------
 1004|      0|                return(NULL);
 1005|       |            /* then skip over remaining bytes for this char */
 1006|  47.1k|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1006:21): [True: 31.1k, False: 15.9k]
  ------------------
 1007|  31.1k|                if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1007:22): [True: 0, False: 31.1k]
  ------------------
 1008|      0|                    return(NULL);
 1009|  15.9k|        }
 1010|  4.13M|    }
 1011|  24.1k|    return((xmlChar *)utf);
 1012|  24.1k|}
xmlUTF8Strloc:
 1023|  87.2k|xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
 1024|  87.2k|    size_t i;
 1025|  87.2k|    int size;
 1026|  87.2k|    int ch;
 1027|       |
 1028|  87.2k|    if (utf==NULL || utfchar==NULL) return -1;
  ------------------
  |  Branch (1028:9): [True: 0, False: 87.2k]
  |  Branch (1028:22): [True: 0, False: 87.2k]
  ------------------
 1029|  87.2k|    size = xmlUTF8Strsize(utfchar, 1);
 1030|  19.6M|        for(i=0; (ch=*utf) != 0; i++) {
  ------------------
  |  Branch (1030:18): [True: 19.5M, False: 58.6k]
  ------------------
 1031|  19.5M|            if (xmlStrncmp(utf, utfchar, size)==0)
  ------------------
  |  Branch (1031:17): [True: 28.5k, False: 19.5M]
  ------------------
 1032|  28.5k|                return(i > INT_MAX ? 0 : i);
  ------------------
  |  Branch (1032:24): [True: 0, False: 28.5k]
  ------------------
 1033|  19.5M|            utf++;
 1034|  19.5M|            if ( ch & 0x80 ) {
  ------------------
  |  Branch (1034:18): [True: 145k, False: 19.4M]
  ------------------
 1035|       |                /* if not simple ascii, verify proper format */
 1036|   145k|                if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1036:22): [True: 0, False: 145k]
  ------------------
 1037|      0|                    return(-1);
 1038|       |                /* then skip over remaining bytes for this char */
 1039|   369k|                while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1039:25): [True: 223k, False: 145k]
  ------------------
 1040|   223k|                    if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1040:26): [True: 0, False: 223k]
  ------------------
 1041|      0|                        return(-1);
 1042|   145k|            }
 1043|  19.5M|        }
 1044|       |
 1045|  58.6k|    return(-1);
 1046|  87.2k|}
xmlUTF8Strsub:
 1060|  1.19k|xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
 1061|  1.19k|    int i;
 1062|  1.19k|    int ch;
 1063|       |
 1064|  1.19k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1064:9): [True: 0, False: 1.19k]
  ------------------
 1065|  1.19k|    if (start < 0) return(NULL);
  ------------------
  |  Branch (1065:9): [True: 0, False: 1.19k]
  ------------------
 1066|  1.19k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1066:9): [True: 0, False: 1.19k]
  ------------------
 1067|       |
 1068|       |    /*
 1069|       |     * Skip over any leading chars
 1070|       |     */
 1071|  2.36k|    for (i = 0; i < start; i++) {
  ------------------
  |  Branch (1071:17): [True: 1.16k, False: 1.19k]
  ------------------
 1072|  1.16k|        ch = *utf++;
 1073|  1.16k|        if (ch == 0)
  ------------------
  |  Branch (1073:13): [True: 0, False: 1.16k]
  ------------------
 1074|      0|            return(NULL);
 1075|       |        /* skip over remaining bytes for this char */
 1076|  1.16k|        if (ch & 0x80) {
  ------------------
  |  Branch (1076:13): [True: 0, False: 1.16k]
  ------------------
 1077|      0|            ch <<= 1;
 1078|      0|            while (ch & 0x80) {
  ------------------
  |  Branch (1078:20): [True: 0, False: 0]
  ------------------
 1079|      0|                if (*utf++ == 0)
  ------------------
  |  Branch (1079:21): [True: 0, False: 0]
  ------------------
 1080|      0|                    return(NULL);
 1081|      0|                ch <<= 1;
 1082|      0|            }
 1083|      0|        }
 1084|  1.16k|    }
 1085|       |
 1086|  1.19k|    return(xmlUTF8Strndup(utf, len));
 1087|  1.19k|}

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|   488k|xmlXPathIsNaN(double val) {
  251|   488k|#ifdef isnan
  252|   488k|    return isnan(val);
  253|       |#else
  254|       |    return !(val == val);
  255|       |#endif
  256|   488k|}
xmlXPathIsInf:
  265|   327k|xmlXPathIsInf(double val) {
  266|   327k|#ifdef isinf
  267|   327k|    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
  ------------------
  |  Branch (267:12): [True: 13.0k, False: 314k]
  |  Branch (267:26): [True: 5.91k, False: 7.08k]
  ------------------
  268|       |#else
  269|       |    if (val >= xmlXPathPINF)
  270|       |        return 1;
  271|       |    if (val <= -xmlXPathPINF)
  272|       |        return -1;
  273|       |    return 0;
  274|       |#endif
  275|   327k|}
xmlXPathErrMemory:
  677|  3.12k|{
  678|  3.12k|    if (ctxt == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 3.12k]
  ------------------
  679|      0|        return;
  680|  3.12k|    xmlRaiseMemoryError(ctxt->error, NULL, ctxt->userData, XML_FROM_XPATH,
  681|  3.12k|                        &ctxt->lastError);
  682|  3.12k|}
xmlXPathPErrMemory:
  691|  2.98k|{
  692|  2.98k|    if (ctxt == NULL)
  ------------------
  |  Branch (692:9): [True: 0, False: 2.98k]
  ------------------
  693|      0|        return;
  694|  2.98k|    ctxt->error = XPATH_MEMORY_ERROR;
  695|  2.98k|    xmlXPathErrMemory(ctxt->context);
  696|  2.98k|}
xmlXPathErr:
  777|  7.34k|xmlXPathErr(xmlXPathParserContext *ctxt, int code) {
  778|  7.34k|    xmlXPathErrFmt(ctxt, code, "%s\n", xmlXPathErrorMessages[code]);
  779|  7.34k|}
xmlXPathFreeCompExpr:
  971|  10.1k|{
  972|  10.1k|    xmlXPathStepOpPtr op;
  973|  10.1k|    int i;
  974|       |
  975|  10.1k|    if (comp == NULL)
  ------------------
  |  Branch (975:9): [True: 0, False: 10.1k]
  ------------------
  976|      0|        return;
  977|  10.1k|    if (comp->dict == NULL) {
  ------------------
  |  Branch (977:9): [True: 10.1k, False: 0]
  ------------------
  978|  2.04M|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (978:14): [True: 2.03M, False: 10.1k]
  ------------------
  979|  2.03M|	    op = &comp->steps[i];
  980|  2.03M|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (980:10): [True: 51.0k, False: 1.98M]
  ------------------
  981|  51.0k|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (981:7): [True: 37.4k, False: 13.6k]
  ------------------
  982|  37.4k|		    xmlXPathFreeObject(op->value4);
  983|  13.6k|		else
  984|  13.6k|		    xmlFree(op->value4);
  985|  51.0k|	    }
  986|  2.03M|	    if (op->value5 != NULL)
  ------------------
  |  Branch (986:10): [True: 72.3k, False: 1.96M]
  ------------------
  987|  72.3k|		xmlFree(op->value5);
  988|  2.03M|	}
  989|  10.1k|    } else {
  990|      0|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (990:14): [True: 0, False: 0]
  ------------------
  991|      0|	    op = &comp->steps[i];
  992|      0|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (992:10): [True: 0, False: 0]
  ------------------
  993|      0|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (993:7): [True: 0, False: 0]
  ------------------
  994|      0|		    xmlXPathFreeObject(op->value4);
  995|      0|	    }
  996|      0|	}
  997|      0|        xmlDictFree(comp->dict);
  998|      0|    }
  999|  10.1k|    if (comp->steps != NULL) {
  ------------------
  |  Branch (999:9): [True: 10.1k, False: 0]
  ------------------
 1000|  10.1k|        xmlFree(comp->steps);
 1001|  10.1k|    }
 1002|       |#ifdef XPATH_STREAMING
 1003|       |    if (comp->stream != NULL) {
 1004|       |        xmlFreePatternList(comp->stream);
 1005|       |    }
 1006|       |#endif
 1007|  10.1k|    if (comp->expr != NULL) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 10.1k]
  ------------------
 1008|      0|        xmlFree(comp->expr);
 1009|      0|    }
 1010|       |
 1011|  10.1k|    xmlFree(comp);
 1012|  10.1k|}
xmlXPathValuePop:
 1979|  3.58M|{
 1980|  3.58M|    xmlXPathObjectPtr ret;
 1981|       |
 1982|  3.58M|    if ((ctxt == NULL) || (ctxt->valueNr <= 0))
  ------------------
  |  Branch (1982:9): [True: 0, False: 3.58M]
  |  Branch (1982:27): [True: 9.34k, False: 3.57M]
  ------------------
 1983|  9.34k|        return (NULL);
 1984|       |
 1985|  3.57M|    ctxt->valueNr--;
 1986|  3.57M|    if (ctxt->valueNr > 0)
  ------------------
  |  Branch (1986:9): [True: 2.98M, False: 591k]
  ------------------
 1987|  2.98M|        ctxt->value = ctxt->valueTab[ctxt->valueNr - 1];
 1988|   591k|    else
 1989|   591k|        ctxt->value = NULL;
 1990|  3.57M|    ret = ctxt->valueTab[ctxt->valueNr];
 1991|       |    ctxt->valueTab[ctxt->valueNr] = NULL;
 1992|  3.57M|    return (ret);
 1993|  3.58M|}
xmlXPathValuePush:
 2007|  3.58M|{
 2008|  3.58M|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2008:9): [True: 0, False: 3.58M]
  ------------------
 2009|  3.58M|    if (value == NULL) {
  ------------------
  |  Branch (2009:9): [True: 929, False: 3.58M]
  ------------------
 2010|       |        /*
 2011|       |         * A NULL value typically indicates that a memory allocation failed.
 2012|       |         */
 2013|    929|        xmlXPathPErrMemory(ctxt);
 2014|    929|        return(-1);
 2015|    929|    }
 2016|  3.58M|    if (ctxt->valueNr >= ctxt->valueMax) {
  ------------------
  |  Branch (2016:9): [True: 351, False: 3.58M]
  ------------------
 2017|    351|        xmlXPathObjectPtr *tmp;
 2018|    351|        int newSize;
 2019|       |
 2020|    351|        newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]),
 2021|    351|                                  10, XPATH_MAX_STACK_DEPTH);
  ------------------
  |  |   96|    351|#define XPATH_MAX_STACK_DEPTH 1000000
  ------------------
 2022|    351|        if (newSize < 0) {
  ------------------
  |  Branch (2022:13): [True: 0, False: 351]
  ------------------
 2023|      0|            xmlXPathPErrMemory(ctxt);
 2024|      0|            xmlXPathFreeObject(value);
 2025|      0|            return (-1);
 2026|      0|        }
 2027|    351|        tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0]));
 2028|    351|        if (tmp == NULL) {
  ------------------
  |  Branch (2028:13): [True: 4, False: 347]
  ------------------
 2029|      4|            xmlXPathPErrMemory(ctxt);
 2030|      4|            xmlXPathFreeObject(value);
 2031|      4|            return (-1);
 2032|      4|        }
 2033|    347|	ctxt->valueTab = tmp;
 2034|    347|        ctxt->valueMax = newSize;
 2035|    347|    }
 2036|  3.58M|    ctxt->valueTab[ctxt->valueNr] = value;
 2037|  3.58M|    ctxt->value = value;
 2038|  3.58M|    return (ctxt->valueNr++);
 2039|  3.58M|}
xmlXPathNodeSetSort:
 2552|  37.1k|xmlXPathNodeSetSort(xmlNodeSet *set) {
 2553|       |#ifndef WITH_TIM_SORT
 2554|       |    int i, j, incr, len;
 2555|       |    xmlNodePtr tmp;
 2556|       |#endif
 2557|       |
 2558|  37.1k|    if (set == NULL)
  ------------------
  |  Branch (2558:9): [True: 0, False: 37.1k]
  ------------------
 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|  37.1k|    libxml_domnode_tim_sort(set->nodeTab, set->nodeNr);
 2590|  37.1k|#endif /* WITH_TIM_SORT */
 2591|  37.1k|}
xmlXPathNodeSetFreeNs:
 2647|   141k|xmlXPathNodeSetFreeNs(xmlNs *ns) {
 2648|   141k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2648:9): [True: 0, False: 141k]
  |  Branch (2648:25): [True: 0, False: 141k]
  ------------------
 2649|      0|	return;
 2650|       |
 2651|   141k|    if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2651:9): [True: 141k, False: 0]
  |  Branch (2651:31): [True: 141k, False: 0]
  ------------------
 2652|   141k|	if (ns->href != NULL)
  ------------------
  |  Branch (2652:6): [True: 86.8k, False: 54.5k]
  ------------------
 2653|  86.8k|	    xmlFree((xmlChar *)ns->href);
 2654|   141k|	if (ns->prefix != NULL)
  ------------------
  |  Branch (2654:6): [True: 118k, False: 23.3k]
  ------------------
 2655|   118k|	    xmlFree((xmlChar *)ns->prefix);
 2656|   141k|	xmlFree(ns);
 2657|   141k|    }
 2658|   141k|}
xmlXPathNodeSetCreate:
 2667|  2.08M|xmlXPathNodeSetCreate(xmlNode *val) {
 2668|  2.08M|    xmlNodeSetPtr ret;
 2669|       |
 2670|  2.08M|    ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
 2671|  2.08M|    if (ret == NULL)
  ------------------
  |  Branch (2671:9): [True: 265, False: 2.08M]
  ------------------
 2672|    265|	return(NULL);
 2673|  2.08M|    memset(ret, 0 , sizeof(xmlNodeSet));
 2674|  2.08M|    if (val != NULL) {
  ------------------
  |  Branch (2674:9): [True: 1.08M, False: 994k]
  ------------------
 2675|  1.08M|        ret->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
  ------------------
  |  | 2593|  1.08M|#define XML_NODESET_DEFAULT	10
  ------------------
 2676|  1.08M|					     sizeof(xmlNodePtr));
 2677|  1.08M|	if (ret->nodeTab == NULL) {
  ------------------
  |  Branch (2677:6): [True: 126, False: 1.08M]
  ------------------
 2678|    126|	    xmlFree(ret);
 2679|    126|	    return(NULL);
 2680|    126|	}
 2681|  1.08M|	memset(ret->nodeTab, 0 ,
 2682|  1.08M|	       XML_NODESET_DEFAULT * sizeof(xmlNodePtr));
  ------------------
  |  | 2593|  1.08M|#define XML_NODESET_DEFAULT	10
  ------------------
 2683|  1.08M|        ret->nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  1.08M|#define XML_NODESET_DEFAULT	10
  ------------------
 2684|  1.08M|	if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2684:6): [True: 47.1k, False: 1.04M]
  ------------------
 2685|  47.1k|	    xmlNsPtr ns = (xmlNsPtr) val;
 2686|  47.1k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2687|       |
 2688|  47.1k|            if (nsNode == NULL) {
  ------------------
  |  Branch (2688:17): [True: 7, False: 47.1k]
  ------------------
 2689|      7|                xmlXPathFreeNodeSet(ret);
 2690|      7|                return(NULL);
 2691|      7|            }
 2692|  47.1k|	    ret->nodeTab[ret->nodeNr++] = nsNode;
 2693|  47.1k|	} else
 2694|  1.04M|	    ret->nodeTab[ret->nodeNr++] = val;
 2695|  1.08M|    }
 2696|  2.08M|    return(ret);
 2697|  2.08M|}
xmlXPathNodeSetAddNs:
 2761|  73.6k|xmlXPathNodeSetAddNs(xmlNodeSet *cur, xmlNode *node, xmlNs *ns) {
 2762|  73.6k|    int i;
 2763|  73.6k|    xmlNodePtr nsNode;
 2764|       |
 2765|  73.6k|    if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
  ------------------
  |  Branch (2765:9): [True: 0, False: 73.6k]
  |  Branch (2765:26): [True: 0, False: 73.6k]
  |  Branch (2765:42): [True: 0, False: 73.6k]
  ------------------
 2766|  73.6k|        (ns->type != XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2766:9): [True: 0, False: 73.6k]
  ------------------
 2767|  73.6k|	(node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (2767:2): [True: 0, False: 73.6k]
  ------------------
 2768|      0|	return(-1);
 2769|       |
 2770|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2771|       |    /*
 2772|       |     * prevent duplicates
 2773|       |     */
 2774|   126k|    for (i = 0;i < cur->nodeNr;i++) {
  ------------------
  |  Branch (2774:16): [True: 53.3k, False: 73.6k]
  ------------------
 2775|  53.3k|        if ((cur->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (2775:13): [True: 53.3k, False: 0]
  ------------------
 2776|  53.3k|	    (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2776:6): [True: 53.3k, False: 0]
  ------------------
 2777|  53.3k|	    (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
  ------------------
  |  Branch (2777:6): [True: 53.3k, False: 0]
  ------------------
 2778|  53.3k|	    (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix)))
  ------------------
  |  Branch (2778:6): [True: 0, False: 53.3k]
  ------------------
 2779|      0|	    return(0);
 2780|  53.3k|    }
 2781|       |
 2782|       |    /*
 2783|       |     * grow the nodeTab if needed
 2784|       |     */
 2785|  73.6k|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2785:9): [True: 3.93k, False: 69.6k]
  ------------------
 2786|  3.93k|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2786:13): [True: 6, False: 3.93k]
  ------------------
 2787|      6|            return(-1);
 2788|  3.93k|    }
 2789|  73.6k|    nsNode = xmlXPathNodeSetDupNs(node, ns);
 2790|  73.6k|    if(nsNode == NULL)
  ------------------
  |  Branch (2790:8): [True: 29, False: 73.5k]
  ------------------
 2791|     29|        return(-1);
 2792|  73.5k|    cur->nodeTab[cur->nodeNr++] = nsNode;
 2793|  73.5k|    return(0);
 2794|  73.6k|}
xmlXPathNodeSetAdd:
 2804|  1.10k|xmlXPathNodeSetAdd(xmlNodeSet *cur, xmlNode *val) {
 2805|  1.10k|    int i;
 2806|       |
 2807|  1.10k|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2807:9): [True: 0, False: 1.10k]
  |  Branch (2807:26): [True: 0, False: 1.10k]
  ------------------
 2808|       |
 2809|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2810|       |    /*
 2811|       |     * prevent duplicates
 2812|       |     */
 2813|  1.10k|    for (i = 0;i < cur->nodeNr;i++)
  ------------------
  |  Branch (2813:16): [True: 484, False: 624]
  ------------------
 2814|    484|        if (cur->nodeTab[i] == val) return(0);
  ------------------
  |  Branch (2814:13): [True: 484, False: 0]
  ------------------
 2815|       |
 2816|       |    /*
 2817|       |     * grow the nodeTab if needed
 2818|       |     */
 2819|    624|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2819:9): [True: 624, False: 0]
  ------------------
 2820|    624|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2820:13): [True: 1, False: 623]
  ------------------
 2821|      1|            return(-1);
 2822|    624|    }
 2823|       |
 2824|    623|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2824:9): [True: 0, False: 623]
  ------------------
 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|    623|	cur->nodeTab[cur->nodeNr++] = val;
 2833|    623|    return(0);
 2834|    623|}
xmlXPathNodeSetAddUnique:
 2845|  4.43M|xmlXPathNodeSetAddUnique(xmlNodeSet *cur, xmlNode *val) {
 2846|  4.43M|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2846:9): [True: 0, False: 4.43M]
  |  Branch (2846:26): [True: 0, False: 4.43M]
  ------------------
 2847|       |
 2848|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2849|       |    /*
 2850|       |     * grow the nodeTab if needed
 2851|       |     */
 2852|  4.43M|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2852:9): [True: 1.11M, False: 3.32M]
  ------------------
 2853|  1.11M|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2853:13): [True: 144, False: 1.11M]
  ------------------
 2854|    144|            return(-1);
 2855|  1.11M|    }
 2856|       |
 2857|  4.43M|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2857:9): [True: 19.7k, False: 4.42M]
  ------------------
 2858|  19.7k|	xmlNsPtr ns = (xmlNsPtr) val;
 2859|  19.7k|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2860|       |
 2861|  19.7k|        if (nsNode == NULL)
  ------------------
  |  Branch (2861:13): [True: 8, False: 19.7k]
  ------------------
 2862|      8|            return(-1);
 2863|  19.7k|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2864|  19.7k|    } else
 2865|  4.42M|	cur->nodeTab[cur->nodeNr++] = val;
 2866|  4.43M|    return(0);
 2867|  4.43M|}
xmlXPathNodeSetMerge:
 2880|  54.8k|xmlXPathNodeSetMerge(xmlNodeSet *val1, xmlNodeSet *val2) {
 2881|  54.8k|    int i, j, initNr, skip;
 2882|  54.8k|    xmlNodePtr n1, n2;
 2883|       |
 2884|  54.8k|    if (val1 == NULL) {
  ------------------
  |  Branch (2884:9): [True: 3, False: 54.8k]
  ------------------
 2885|      3|	val1 = xmlXPathNodeSetCreate(NULL);
 2886|      3|        if (val1 == NULL)
  ------------------
  |  Branch (2886:13): [True: 0, False: 3]
  ------------------
 2887|      0|            return (NULL);
 2888|      3|    }
 2889|  54.8k|    if (val2 == NULL)
  ------------------
  |  Branch (2889:9): [True: 27, False: 54.8k]
  ------------------
 2890|     27|        return(val1);
 2891|       |
 2892|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2893|  54.8k|    initNr = val1->nodeNr;
 2894|       |
 2895|   671k|    for (i = 0;i < val2->nodeNr;i++) {
  ------------------
  |  Branch (2895:16): [True: 616k, False: 54.7k]
  ------------------
 2896|   616k|	n2 = val2->nodeTab[i];
 2897|       |	/*
 2898|       |	 * check against duplicates
 2899|       |	 */
 2900|   616k|	skip = 0;
 2901|  11.0M|	for (j = 0; j < initNr; j++) {
  ------------------
  |  Branch (2901:14): [True: 10.4M, False: 548k]
  ------------------
 2902|  10.4M|	    n1 = val1->nodeTab[j];
 2903|  10.4M|	    if (n1 == n2) {
  ------------------
  |  Branch (2903:10): [True: 68.2k, False: 10.4M]
  ------------------
 2904|  68.2k|		skip = 1;
 2905|  68.2k|		break;
 2906|  10.4M|	    } else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2906:17): [True: 266, False: 10.4M]
  ------------------
 2907|    266|		       (n2->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2907:10): [True: 0, False: 266]
  ------------------
 2908|      0|		if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2908:7): [True: 0, False: 0]
  ------------------
 2909|      0|		    (xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2909:7): [True: 0, False: 0]
  ------------------
 2910|      0|			((xmlNsPtr) n2)->prefix)))
 2911|      0|		{
 2912|      0|		    skip = 1;
 2913|      0|		    break;
 2914|      0|		}
 2915|      0|	    }
 2916|  10.4M|	}
 2917|   616k|	if (skip)
  ------------------
  |  Branch (2917:6): [True: 68.2k, False: 548k]
  ------------------
 2918|  68.2k|	    continue;
 2919|       |
 2920|       |	/*
 2921|       |	 * grow the nodeTab if needed
 2922|       |	 */
 2923|   548k|        if (val1->nodeNr >= val1->nodeMax) {
  ------------------
  |  Branch (2923:13): [True: 58.4k, False: 490k]
  ------------------
 2924|  58.4k|            if (xmlXPathNodeSetGrow(val1) < 0)
  ------------------
  |  Branch (2924:17): [True: 22, False: 58.3k]
  ------------------
 2925|     22|                goto error;
 2926|  58.4k|        }
 2927|   548k|	if (n2->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2927:6): [True: 994, False: 547k]
  ------------------
 2928|    994|	    xmlNsPtr ns = (xmlNsPtr) n2;
 2929|    994|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2930|       |
 2931|    994|            if (nsNode == NULL)
  ------------------
  |  Branch (2931:17): [True: 18, False: 976]
  ------------------
 2932|     18|                goto error;
 2933|    976|	    val1->nodeTab[val1->nodeNr++] = nsNode;
 2934|    976|	} else
 2935|   547k|	    val1->nodeTab[val1->nodeNr++] = n2;
 2936|   548k|    }
 2937|       |
 2938|  54.7k|    return(val1);
 2939|       |
 2940|     40|error:
 2941|     40|    xmlXPathFreeNodeSet(val1);
 2942|       |    return(NULL);
 2943|  54.8k|}
xmlXPathFreeNodeSet:
 3101|  2.08M|xmlXPathFreeNodeSet(xmlNodeSet *obj) {
 3102|  2.08M|    if (obj == NULL) return;
  ------------------
  |  Branch (3102:9): [True: 27, False: 2.08M]
  ------------------
 3103|  2.08M|    if (obj->nodeTab != NULL) {
  ------------------
  |  Branch (3103:9): [True: 1.41M, False: 666k]
  ------------------
 3104|  1.41M|	int i;
 3105|       |
 3106|       |	/* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3107|  7.11M|	for (i = 0;i < obj->nodeNr;i++)
  ------------------
  |  Branch (3107:13): [True: 5.70M, False: 1.41M]
  ------------------
 3108|  5.70M|	    if ((obj->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (3108:10): [True: 5.70M, False: 0]
  ------------------
 3109|  5.70M|		(obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3109:3): [True: 125k, False: 5.57M]
  ------------------
 3110|   125k|		xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
 3111|  1.41M|	xmlFree(obj->nodeTab);
 3112|  1.41M|    }
 3113|  2.08M|    xmlFree(obj);
 3114|  2.08M|}
xmlXPathNewNodeSet:
 3191|  1.09M|xmlXPathNewNodeSet(xmlNode *val) {
 3192|  1.09M|    xmlXPathObjectPtr ret;
 3193|       |
 3194|  1.09M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3195|  1.09M|    if (ret == NULL)
  ------------------
  |  Branch (3195:9): [True: 146, False: 1.09M]
  ------------------
 3196|    146|	return(NULL);
 3197|  1.09M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3198|  1.09M|    ret->type = XPATH_NODESET;
 3199|  1.09M|    ret->boolval = 0;
 3200|  1.09M|    ret->nodesetval = xmlXPathNodeSetCreate(val);
 3201|  1.09M|    if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (3201:9): [True: 269, False: 1.09M]
  ------------------
 3202|    269|        xmlFree(ret);
 3203|    269|        return(NULL);
 3204|    269|    }
 3205|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3206|  1.09M|    return(ret);
 3207|  1.09M|}
xmlXPathWrapNodeSet:
 3267|   969k|xmlXPathWrapNodeSet(xmlNodeSet *val) {
 3268|   969k|    xmlXPathObjectPtr ret;
 3269|       |
 3270|   969k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3271|   969k|    if (ret == NULL) {
  ------------------
  |  Branch (3271:9): [True: 186, False: 969k]
  ------------------
 3272|    186|        xmlXPathFreeNodeSet(val);
 3273|    186|	return(NULL);
 3274|    186|    }
 3275|   969k|    memset(ret, 0 , sizeof(xmlXPathObject));
 3276|   969k|    ret->type = XPATH_NODESET;
 3277|   969k|    ret->nodesetval = val;
 3278|   969k|    return(ret);
 3279|   969k|}
xmlXPathFunctionLookup:
 3743|  5.87k|xmlXPathFunctionLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3744|       |    return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
 3745|  5.87k|}
xmlXPathFunctionLookupNS:
 3758|  5.89k|			 const xmlChar *ns_uri) {
 3759|  5.89k|    xmlXPathFunction ret;
 3760|  5.89k|    void *payload;
 3761|       |
 3762|  5.89k|    if (ctxt == NULL)
  ------------------
  |  Branch (3762:9): [True: 0, False: 5.89k]
  ------------------
 3763|      0|	return(NULL);
 3764|  5.89k|    if (name == NULL)
  ------------------
  |  Branch (3764:9): [True: 0, False: 5.89k]
  ------------------
 3765|      0|	return(NULL);
 3766|       |
 3767|  5.89k|    if (ns_uri == NULL) {
  ------------------
  |  Branch (3767:9): [True: 5.87k, False: 18]
  ------------------
 3768|  5.87k|        int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
  ------------------
  |  |  168|  5.87k|#define SF_HASH_SIZE 64
  ------------------
 3769|       |
 3770|  8.22k|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (3770:16): [True: 7.75k, False: 467]
  ------------------
 3771|  7.75k|            int funcIndex = xmlXPathSFHash[bucketIndex];
 3772|       |
 3773|  7.75k|            if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
  ------------------
  |  Branch (3773:17): [True: 5.40k, False: 2.35k]
  ------------------
 3774|  7.75k|                       (char *) name) == 0)
 3775|  5.40k|                return(xmlXPathStandardFunctions[funcIndex].func);
 3776|       |
 3777|  2.35k|            bucketIndex += 1;
 3778|  2.35k|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|  2.35k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (3778:17): [True: 0, False: 2.35k]
  ------------------
 3779|      0|                bucketIndex = 0;
 3780|  2.35k|        }
 3781|  5.87k|    }
 3782|       |
 3783|    485|    if (ctxt->funcLookupFunc != NULL) {
  ------------------
  |  Branch (3783:9): [True: 0, False: 485]
  ------------------
 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|    485|    if (ctxt->funcHash == NULL)
  ------------------
  |  Branch (3792:9): [True: 485, False: 0]
  ------------------
 3793|    485|	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|    485|}
xmlXPathRegisteredFuncsCleanup:
 3807|  6.19k|xmlXPathRegisteredFuncsCleanup(xmlXPathContext *ctxt) {
 3808|  6.19k|    if (ctxt == NULL)
  ------------------
  |  Branch (3808:9): [True: 0, False: 6.19k]
  ------------------
 3809|      0|	return;
 3810|       |
 3811|  6.19k|    xmlHashFree(ctxt->funcHash, NULL);
 3812|       |    ctxt->funcHash = NULL;
 3813|  6.19k|}
xmlXPathVariableLookup:
 3891|     27|xmlXPathVariableLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3892|     27|    if (ctxt == NULL)
  ------------------
  |  Branch (3892:9): [True: 0, False: 27]
  ------------------
 3893|      0|	return(NULL);
 3894|       |
 3895|     27|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3895:9): [True: 0, False: 27]
  ------------------
 3896|      0|	xmlXPathObjectPtr ret;
 3897|       |
 3898|      0|	ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc)
 3899|      0|	        (ctxt->varLookupData, name, NULL);
 3900|      0|	return(ret);
 3901|      0|    }
 3902|     27|    return(xmlXPathVariableLookupNS(ctxt, name, NULL));
 3903|     27|}
xmlXPathVariableLookupNS:
 3916|     38|			 const xmlChar *ns_uri) {
 3917|     38|    if (ctxt == NULL)
  ------------------
  |  Branch (3917:9): [True: 0, False: 38]
  ------------------
 3918|      0|	return(NULL);
 3919|       |
 3920|     38|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3920:9): [True: 0, False: 38]
  ------------------
 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|     38|    if (ctxt->varHash == NULL)
  ------------------
  |  Branch (3928:9): [True: 38, False: 0]
  ------------------
 3929|     38|	return(NULL);
 3930|      0|    if (name == NULL)
  ------------------
  |  Branch (3930:9): [True: 0, False: 0]
  ------------------
 3931|      0|	return(NULL);
 3932|       |
 3933|      0|    return(xmlXPathObjectCopy(xmlHashLookup2(ctxt->varHash, name, ns_uri)));
 3934|      0|}
xmlXPathRegisteredVariablesCleanup:
 3942|  6.19k|xmlXPathRegisteredVariablesCleanup(xmlXPathContext *ctxt) {
 3943|  6.19k|    if (ctxt == NULL)
  ------------------
  |  Branch (3943:9): [True: 0, False: 6.19k]
  ------------------
 3944|      0|	return;
 3945|       |
 3946|  6.19k|    xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry);
 3947|       |    ctxt->varHash = NULL;
 3948|  6.19k|}
xmlXPathRegisterNs:
 3961|    477|			   const xmlChar *ns_uri) {
 3962|    477|    xmlChar *copy;
 3963|       |
 3964|    477|    if (ctxt == NULL)
  ------------------
  |  Branch (3964:9): [True: 0, False: 477]
  ------------------
 3965|      0|	return(-1);
 3966|    477|    if (prefix == NULL)
  ------------------
  |  Branch (3966:9): [True: 0, False: 477]
  ------------------
 3967|      0|	return(-1);
 3968|    477|    if (prefix[0] == 0)
  ------------------
  |  Branch (3968:9): [True: 0, False: 477]
  ------------------
 3969|      0|	return(-1);
 3970|       |
 3971|    477|    if (ctxt->nsHash == NULL)
  ------------------
  |  Branch (3971:9): [True: 36, False: 441]
  ------------------
 3972|     36|	ctxt->nsHash = xmlHashCreate(10);
 3973|    477|    if (ctxt->nsHash == NULL) {
  ------------------
  |  Branch (3973:9): [True: 2, False: 475]
  ------------------
 3974|      2|        xmlXPathErrMemory(ctxt);
 3975|      2|	return(-1);
 3976|      2|    }
 3977|    475|    if (ns_uri == NULL)
  ------------------
  |  Branch (3977:9): [True: 0, False: 475]
  ------------------
 3978|      0|        return(xmlHashRemoveEntry(ctxt->nsHash, prefix,
 3979|      0|	                          xmlHashDefaultDeallocator));
 3980|       |
 3981|    475|    copy = xmlStrdup(ns_uri);
 3982|    475|    if (copy == NULL) {
  ------------------
  |  Branch (3982:9): [True: 3, False: 472]
  ------------------
 3983|      3|        xmlXPathErrMemory(ctxt);
 3984|      3|        return(-1);
 3985|      3|    }
 3986|    472|    if (xmlHashUpdateEntry(ctxt->nsHash, prefix, copy,
  ------------------
  |  Branch (3986:9): [True: 2, False: 470]
  ------------------
 3987|    472|                           xmlHashDefaultDeallocator) < 0) {
 3988|      2|        xmlXPathErrMemory(ctxt);
 3989|      2|        xmlFree(copy);
 3990|      2|        return(-1);
 3991|      2|    }
 3992|       |
 3993|    470|    return(0);
 3994|    472|}
xmlXPathNsLookup:
 4005|  8.91k|xmlXPathNsLookup(xmlXPathContext *ctxt, const xmlChar *prefix) {
 4006|  8.91k|    if (ctxt == NULL)
  ------------------
  |  Branch (4006:9): [True: 0, False: 8.91k]
  ------------------
 4007|      0|	return(NULL);
 4008|  8.91k|    if (prefix == NULL)
  ------------------
  |  Branch (4008:9): [True: 0, False: 8.91k]
  ------------------
 4009|      0|	return(NULL);
 4010|       |
 4011|  8.91k|    if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
  ------------------
  |  Branch (4011:9): [True: 8.66k, False: 246]
  ------------------
 4012|  8.66k|	return(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  8.66k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4013|       |
 4014|    246|    if (ctxt->namespaces != NULL) {
  ------------------
  |  Branch (4014:9): [True: 0, False: 246]
  ------------------
 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|    246|    return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
 4025|    246|}
xmlXPathRegisteredNsCleanup:
 4033|  6.19k|xmlXPathRegisteredNsCleanup(xmlXPathContext *ctxt) {
 4034|  6.19k|    if (ctxt == NULL)
  ------------------
  |  Branch (4034:9): [True: 0, False: 6.19k]
  ------------------
 4035|      0|	return;
 4036|       |
 4037|  6.19k|    xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator);
 4038|       |    ctxt->nsHash = NULL;
 4039|  6.19k|}
xmlXPathNewFloat:
 4056|   356k|xmlXPathNewFloat(double val) {
 4057|   356k|    xmlXPathObjectPtr ret;
 4058|       |
 4059|   356k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4060|   356k|    if (ret == NULL)
  ------------------
  |  Branch (4060:9): [True: 132, False: 356k]
  ------------------
 4061|    132|	return(NULL);
 4062|   356k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4063|   356k|    ret->type = XPATH_NUMBER;
 4064|   356k|    ret->floatval = val;
 4065|   356k|    return(ret);
 4066|   356k|}
xmlXPathNewBoolean:
 4075|   521k|xmlXPathNewBoolean(int val) {
 4076|   521k|    xmlXPathObjectPtr ret;
 4077|       |
 4078|   521k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4079|   521k|    if (ret == NULL)
  ------------------
  |  Branch (4079:9): [True: 82, False: 521k]
  ------------------
 4080|     82|	return(NULL);
 4081|   521k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4082|   521k|    ret->type = XPATH_BOOLEAN;
 4083|   521k|    ret->boolval = (val != 0);
 4084|   521k|    return(ret);
 4085|   521k|}
xmlXPathNewString:
 4094|   119k|xmlXPathNewString(const xmlChar *val) {
 4095|   119k|    xmlXPathObjectPtr ret;
 4096|       |
 4097|   119k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4098|   119k|    if (ret == NULL)
  ------------------
  |  Branch (4098:9): [True: 23, False: 119k]
  ------------------
 4099|     23|	return(NULL);
 4100|   119k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4101|   119k|    ret->type = XPATH_STRING;
 4102|   119k|    if (val == NULL)
  ------------------
  |  Branch (4102:9): [True: 2, False: 119k]
  ------------------
 4103|      2|        val = BAD_CAST "";
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 4104|   119k|    ret->stringval = xmlStrdup(val);
 4105|   119k|    if (ret->stringval == NULL) {
  ------------------
  |  Branch (4105:9): [True: 26, False: 119k]
  ------------------
 4106|     26|        xmlFree(ret);
 4107|     26|        return(NULL);
 4108|     26|    }
 4109|   119k|    return(ret);
 4110|   119k|}
xmlXPathWrapString:
 4121|  43.2k|xmlXPathWrapString (xmlChar *val) {
 4122|  43.2k|    xmlXPathObjectPtr ret;
 4123|       |
 4124|  43.2k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4125|  43.2k|    if (ret == NULL) {
  ------------------
  |  Branch (4125:9): [True: 35, False: 43.2k]
  ------------------
 4126|     35|        xmlFree(val);
 4127|     35|	return(NULL);
 4128|     35|    }
 4129|  43.2k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4130|  43.2k|    ret->type = XPATH_STRING;
 4131|  43.2k|    ret->stringval = val;
 4132|  43.2k|    return(ret);
 4133|  43.2k|}
xmlXPathObjectCopy:
 4183|   287k|xmlXPathObjectCopy(xmlXPathObject *val) {
 4184|   287k|    xmlXPathObjectPtr ret;
 4185|       |
 4186|   287k|    if (val == NULL)
  ------------------
  |  Branch (4186:9): [True: 0, False: 287k]
  ------------------
 4187|      0|	return(NULL);
 4188|       |
 4189|   287k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4190|   287k|    if (ret == NULL)
  ------------------
  |  Branch (4190:9): [True: 64, False: 287k]
  ------------------
 4191|     64|	return(NULL);
 4192|   287k|    memcpy(ret, val , sizeof(xmlXPathObject));
 4193|   287k|    switch (val->type) {
 4194|      0|	case XPATH_BOOLEAN:
  ------------------
  |  Branch (4194:2): [True: 0, False: 287k]
  ------------------
 4195|   263k|	case XPATH_NUMBER:
  ------------------
  |  Branch (4195:2): [True: 263k, False: 23.2k]
  ------------------
 4196|   263k|	    break;
 4197|  23.2k|	case XPATH_STRING:
  ------------------
  |  Branch (4197:2): [True: 23.2k, False: 263k]
  ------------------
 4198|  23.2k|	    ret->stringval = xmlStrdup(val->stringval);
 4199|  23.2k|            if (ret->stringval == NULL) {
  ------------------
  |  Branch (4199:17): [True: 6, False: 23.2k]
  ------------------
 4200|      6|                xmlFree(ret);
 4201|      6|                return(NULL);
 4202|      6|            }
 4203|  23.2k|	    break;
 4204|  23.2k|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4204:2): [True: 0, False: 287k]
  ------------------
 4205|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (4205:2): [True: 0, False: 287k]
  ------------------
 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: 287k]
  ------------------
 4215|      0|	    ret->user = val->user;
 4216|      0|	    break;
 4217|      0|        default:
  ------------------
  |  Branch (4217:9): [True: 0, False: 287k]
  ------------------
 4218|      0|            xmlFree(ret);
 4219|      0|            ret = NULL;
 4220|      0|	    break;
 4221|   287k|    }
 4222|   287k|    return(ret);
 4223|   287k|}
xmlXPathFreeObject:
 4231|  3.38M|xmlXPathFreeObject(xmlXPathObject *obj) {
 4232|  3.38M|    if (obj == NULL) return;
  ------------------
  |  Branch (4232:9): [True: 0, False: 3.38M]
  ------------------
 4233|  3.38M|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (4233:9): [True: 2.06M, False: 1.32M]
  |  Branch (4233:41): [True: 0, False: 1.32M]
  ------------------
 4234|  2.06M|        if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4234:13): [True: 2.06M, False: 56]
  ------------------
 4235|  2.06M|            xmlXPathFreeNodeSet(obj->nodesetval);
 4236|  2.06M|    } else if (obj->type == XPATH_STRING) {
  ------------------
  |  Branch (4236:16): [True: 185k, False: 1.14M]
  ------------------
 4237|   185k|	if (obj->stringval != NULL)
  ------------------
  |  Branch (4237:6): [True: 185k, False: 21]
  ------------------
 4238|   185k|	    xmlFree(obj->stringval);
 4239|   185k|    }
 4240|  3.38M|    xmlFree(obj);
 4241|  3.38M|}
xmlXPathCastBooleanToString:
 4354|  3.72k|xmlXPathCastBooleanToString (int val) {
 4355|  3.72k|    xmlChar *ret;
 4356|  3.72k|    if (val)
  ------------------
  |  Branch (4356:9): [True: 1.02k, False: 2.69k]
  ------------------
 4357|  1.02k|	ret = xmlStrdup((const xmlChar *) "true");
 4358|  2.69k|    else
 4359|  2.69k|	ret = xmlStrdup((const xmlChar *) "false");
 4360|  3.72k|    return(ret);
 4361|  3.72k|}
xmlXPathCastNumberToString:
 4370|  15.2k|xmlXPathCastNumberToString (double val) {
 4371|  15.2k|    xmlChar *ret;
 4372|  15.2k|    switch (xmlXPathIsInf(val)) {
 4373|    211|    case 1:
  ------------------
  |  Branch (4373:5): [True: 211, False: 15.0k]
  ------------------
 4374|    211|	ret = xmlStrdup((const xmlChar *) "Infinity");
 4375|    211|	break;
 4376|    555|    case -1:
  ------------------
  |  Branch (4376:5): [True: 555, False: 14.6k]
  ------------------
 4377|    555|	ret = xmlStrdup((const xmlChar *) "-Infinity");
 4378|    555|	break;
 4379|  14.4k|    default:
  ------------------
  |  Branch (4379:5): [True: 14.4k, False: 766]
  ------------------
 4380|  14.4k|	if (xmlXPathIsNaN(val)) {
  ------------------
  |  Branch (4380:6): [True: 1.59k, False: 12.8k]
  ------------------
 4381|  1.59k|	    ret = xmlStrdup((const xmlChar *) "NaN");
 4382|  12.8k|	} else if (val == 0) {
  ------------------
  |  Branch (4382:13): [True: 871, False: 12.0k]
  ------------------
 4383|       |            /* Omit sign for negative zero. */
 4384|    871|	    ret = xmlStrdup((const xmlChar *) "0");
 4385|  12.0k|	} else {
 4386|       |	    /* could be improved */
 4387|  12.0k|	    char buf[100];
 4388|  12.0k|	    xmlXPathFormatNumber(val, buf, 99);
 4389|  12.0k|	    buf[99] = 0;
 4390|  12.0k|	    ret = xmlStrdup((const xmlChar *) buf);
 4391|  12.0k|	}
 4392|  15.2k|    }
 4393|  15.2k|    return(ret);
 4394|  15.2k|}
xmlXPathCastNodeToString:
 4403|   350k|xmlXPathCastNodeToString (xmlNode *node) {
 4404|   350k|    return(xmlNodeGetContent(node));
 4405|   350k|}
xmlXPathCastNodeSetToString:
 4414|   392k|xmlXPathCastNodeSetToString (xmlNodeSet *ns) {
 4415|   392k|    if ((ns == NULL) || (ns->nodeNr == 0) || (ns->nodeTab == NULL))
  ------------------
  |  Branch (4415:9): [True: 0, False: 392k]
  |  Branch (4415:25): [True: 274k, False: 118k]
  |  Branch (4415:46): [True: 0, False: 118k]
  ------------------
 4416|   274k|	return(xmlStrdup((const xmlChar *) ""));
 4417|       |
 4418|   118k|    if (ns->nodeNr > 1)
  ------------------
  |  Branch (4418:9): [True: 29.1k, False: 88.9k]
  ------------------
 4419|  29.1k|	xmlXPathNodeSetSort(ns);
 4420|   118k|    return(xmlXPathCastNodeToString(ns->nodeTab[0]));
 4421|   392k|}
xmlXPathCastToString:
 4431|  40.4k|xmlXPathCastToString(xmlXPathObject *val) {
 4432|  40.4k|    xmlChar *ret = NULL;
 4433|       |
 4434|  40.4k|    if (val == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 40.4k]
  ------------------
 4435|      0|	return(xmlStrdup((const xmlChar *) ""));
 4436|  40.4k|    switch (val->type) {
  ------------------
  |  Branch (4436:13): [True: 40.4k, False: 0]
  ------------------
 4437|      0|	case XPATH_UNDEFINED:
  ------------------
  |  Branch (4437:2): [True: 0, False: 40.4k]
  ------------------
 4438|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4439|      0|	    break;
 4440|  21.0k|        case XPATH_NODESET:
  ------------------
  |  Branch (4440:9): [True: 21.0k, False: 19.3k]
  ------------------
 4441|  21.0k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4441:9): [True: 0, False: 40.4k]
  ------------------
 4442|  21.0k|	    ret = xmlXPathCastNodeSetToString(val->nodesetval);
 4443|  21.0k|	    break;
 4444|    419|	case XPATH_STRING:
  ------------------
  |  Branch (4444:2): [True: 419, False: 40.0k]
  ------------------
 4445|    419|	    return(xmlStrdup(val->stringval));
 4446|  3.72k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (4446:9): [True: 3.72k, False: 36.7k]
  ------------------
 4447|  3.72k|	    ret = xmlXPathCastBooleanToString(val->boolval);
 4448|  3.72k|	    break;
 4449|  15.2k|	case XPATH_NUMBER: {
  ------------------
  |  Branch (4449:2): [True: 15.2k, False: 25.2k]
  ------------------
 4450|  15.2k|	    ret = xmlXPathCastNumberToString(val->floatval);
 4451|  15.2k|	    break;
 4452|  21.0k|	}
 4453|      0|	case XPATH_USERS:
  ------------------
  |  Branch (4453:2): [True: 0, False: 40.4k]
  ------------------
 4454|       |	    /* TODO */
 4455|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4456|      0|	    break;
 4457|  40.4k|    }
 4458|  40.0k|    return(ret);
 4459|  40.4k|}
xmlXPathCastBooleanToNumber:
 4507|  24.1k|xmlXPathCastBooleanToNumber(int val) {
 4508|  24.1k|    if (val)
  ------------------
  |  Branch (4508:9): [True: 2.97k, False: 21.1k]
  ------------------
 4509|  2.97k|	return(1.0);
 4510|  21.1k|    return(0.0);
 4511|  24.1k|}
xmlXPathCastStringToNumber:
 4520|   614k|xmlXPathCastStringToNumber(const xmlChar * val) {
 4521|   614k|    return(xmlXPathStringEvalNumber(val));
 4522|   614k|}
xmlXPathCastNumberToBoolean:
 4617|  48.5k|xmlXPathCastNumberToBoolean (double val) {
 4618|  48.5k|     if (xmlXPathIsNaN(val) || (val == 0.0))
  ------------------
  |  Branch (4618:10): [True: 37.5k, False: 10.9k]
  |  Branch (4618:32): [True: 1.63k, False: 9.34k]
  ------------------
 4619|  39.1k|	 return(0);
 4620|  9.34k|     return(1);
 4621|  48.5k|}
xmlXPathCastStringToBoolean:
 4630|     52|xmlXPathCastStringToBoolean (const xmlChar *val) {
 4631|     52|    if ((val == NULL) || (xmlStrlen(val) == 0))
  ------------------
  |  Branch (4631:9): [True: 0, False: 52]
  |  Branch (4631:26): [True: 18, False: 34]
  ------------------
 4632|     18|	return(0);
 4633|     34|    return(1);
 4634|     52|}
xmlXPathCastNodeSetToBoolean:
 4643|  7.41k|xmlXPathCastNodeSetToBoolean (xmlNodeSet *ns) {
 4644|  7.41k|    if ((ns == NULL) || (ns->nodeNr == 0))
  ------------------
  |  Branch (4644:9): [True: 0, False: 7.41k]
  |  Branch (4644:25): [True: 6.17k, False: 1.23k]
  ------------------
 4645|  6.17k|	return(0);
 4646|  1.23k|    return(1);
 4647|  7.41k|}
xmlXPathCastToBoolean:
 4656|  9.91k|xmlXPathCastToBoolean (xmlXPathObject *val) {
 4657|  9.91k|    int ret = 0;
 4658|       |
 4659|  9.91k|    if (val == NULL)
  ------------------
  |  Branch (4659:9): [True: 0, False: 9.91k]
  ------------------
 4660|      0|	return(0);
 4661|  9.91k|    switch (val->type) {
  ------------------
  |  Branch (4661:13): [True: 9.91k, False: 0]
  ------------------
 4662|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (4662:5): [True: 0, False: 9.91k]
  ------------------
 4663|      0|	ret = 0;
 4664|      0|	break;
 4665|  7.41k|    case XPATH_NODESET:
  ------------------
  |  Branch (4665:5): [True: 7.41k, False: 2.49k]
  ------------------
 4666|  7.41k|    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4666:5): [True: 0, False: 9.91k]
  ------------------
 4667|  7.41k|	ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
 4668|  7.41k|	break;
 4669|     52|    case XPATH_STRING:
  ------------------
  |  Branch (4669:5): [True: 52, False: 9.85k]
  ------------------
 4670|     52|	ret = xmlXPathCastStringToBoolean(val->stringval);
 4671|     52|	break;
 4672|  2.44k|    case XPATH_NUMBER:
  ------------------
  |  Branch (4672:5): [True: 2.44k, False: 7.46k]
  ------------------
 4673|  2.44k|	ret = xmlXPathCastNumberToBoolean(val->floatval);
 4674|  2.44k|	break;
 4675|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4675:5): [True: 0, False: 9.91k]
  ------------------
 4676|      0|	ret = val->boolval;
 4677|      0|	break;
 4678|      0|    case XPATH_USERS:
  ------------------
  |  Branch (4678:5): [True: 0, False: 9.91k]
  ------------------
 4679|       |	/* TODO */
 4680|      0|	ret = 0;
 4681|      0|	break;
 4682|  9.91k|    }
 4683|  9.91k|    return(ret);
 4684|  9.91k|}
xmlXPathNewContext:
 4720|  6.21k|xmlXPathNewContext(xmlDoc *doc) {
 4721|  6.21k|    xmlXPathContextPtr ret;
 4722|       |
 4723|  6.21k|    ret = (xmlXPathContextPtr) xmlMalloc(sizeof(xmlXPathContext));
 4724|  6.21k|    if (ret == NULL)
  ------------------
  |  Branch (4724:9): [True: 19, False: 6.19k]
  ------------------
 4725|     19|	return(NULL);
 4726|  6.19k|    memset(ret, 0 , sizeof(xmlXPathContext));
 4727|  6.19k|    ret->doc = doc;
 4728|  6.19k|    ret->node = NULL;
 4729|       |
 4730|  6.19k|    ret->varHash = NULL;
 4731|       |
 4732|  6.19k|    ret->nb_types = 0;
 4733|  6.19k|    ret->max_types = 0;
 4734|  6.19k|    ret->types = NULL;
 4735|       |
 4736|  6.19k|    ret->nb_axis = 0;
 4737|  6.19k|    ret->max_axis = 0;
 4738|  6.19k|    ret->axis = NULL;
 4739|       |
 4740|  6.19k|    ret->nsHash = NULL;
 4741|  6.19k|    ret->user = NULL;
 4742|       |
 4743|  6.19k|    ret->contextSize = -1;
 4744|  6.19k|    ret->proximityPosition = -1;
 4745|       |
 4746|       |#ifdef XP_DEFAULT_CACHE_ON
 4747|       |    if (xmlXPathContextSetCache(ret, 1, -1, 0) == -1) {
 4748|       |	xmlXPathFreeContext(ret);
 4749|       |	return(NULL);
 4750|       |    }
 4751|       |#endif
 4752|       |
 4753|  6.19k|    return(ret);
 4754|  6.21k|}
xmlXPathFreeContext:
 4762|  6.19k|xmlXPathFreeContext(xmlXPathContext *ctxt) {
 4763|  6.19k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (4763:9): [True: 0, False: 6.19k]
  ------------------
 4764|       |
 4765|  6.19k|    if (ctxt->cache != NULL)
  ------------------
  |  Branch (4765:9): [True: 0, False: 6.19k]
  ------------------
 4766|      0|	xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
 4767|  6.19k|    xmlXPathRegisteredNsCleanup(ctxt);
 4768|  6.19k|    xmlXPathRegisteredFuncsCleanup(ctxt);
 4769|  6.19k|    xmlXPathRegisteredVariablesCleanup(ctxt);
 4770|  6.19k|    xmlResetError(&ctxt->lastError);
 4771|  6.19k|    xmlFree(ctxt);
 4772|  6.19k|}
xmlXPathSetErrorHandler:
 4785|  6.19k|                        xmlStructuredErrorFunc handler, void *data) {
 4786|  6.19k|    if (ctxt == NULL)
  ------------------
  |  Branch (4786:9): [True: 0, False: 6.19k]
  ------------------
 4787|      0|        return;
 4788|       |
 4789|  6.19k|    ctxt->error = handler;
 4790|  6.19k|    ctxt->userData = data;
 4791|  6.19k|}
xmlXPathNewParserContext:
 4807|  10.1k|xmlXPathNewParserContext(const xmlChar *str, xmlXPathContext *ctxt) {
 4808|  10.1k|    xmlXPathParserContextPtr ret;
 4809|       |
 4810|  10.1k|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4811|  10.1k|    if (ret == NULL) {
  ------------------
  |  Branch (4811:9): [True: 26, False: 10.1k]
  ------------------
 4812|     26|        xmlXPathErrMemory(ctxt);
 4813|     26|	return(NULL);
 4814|     26|    }
 4815|  10.1k|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4816|  10.1k|    ret->cur = ret->base = str;
 4817|  10.1k|    ret->context = ctxt;
 4818|       |
 4819|  10.1k|    ret->comp = xmlXPathNewCompExpr();
 4820|  10.1k|    if (ret->comp == NULL) {
  ------------------
  |  Branch (4820:9): [True: 43, False: 10.1k]
  ------------------
 4821|     43|        xmlXPathErrMemory(ctxt);
 4822|     43|	xmlFree(ret->valueTab);
 4823|     43|	xmlFree(ret);
 4824|     43|	return(NULL);
 4825|     43|    }
 4826|  10.1k|    if ((ctxt != NULL) && (ctxt->dict != NULL)) {
  ------------------
  |  Branch (4826:9): [True: 10.1k, False: 0]
  |  Branch (4826:27): [True: 0, False: 10.1k]
  ------------------
 4827|      0|        ret->comp->dict = ctxt->dict;
 4828|      0|	xmlDictReference(ret->comp->dict);
 4829|      0|    }
 4830|       |
 4831|  10.1k|    return(ret);
 4832|  10.1k|}
xmlXPathFreeParserContext:
 4879|  10.1k|xmlXPathFreeParserContext(xmlXPathParserContext *ctxt) {
 4880|  10.1k|    int i;
 4881|       |
 4882|  10.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (4882:9): [True: 0, False: 10.1k]
  ------------------
 4883|      0|        return;
 4884|       |
 4885|  10.1k|    if (ctxt->valueTab != NULL) {
  ------------------
  |  Branch (4885:9): [True: 10.0k, False: 35]
  ------------------
 4886|  18.3k|        for (i = 0; i < ctxt->valueNr; i++) {
  ------------------
  |  Branch (4886:21): [True: 8.24k, False: 10.0k]
  ------------------
 4887|  8.24k|            if (ctxt->context)
  ------------------
  |  Branch (4887:17): [True: 8.24k, False: 0]
  ------------------
 4888|  8.24k|                xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]);
 4889|      0|            else
 4890|      0|                xmlXPathFreeObject(ctxt->valueTab[i]);
 4891|  8.24k|        }
 4892|  10.0k|        xmlFree(ctxt->valueTab);
 4893|  10.0k|    }
 4894|  10.1k|    if (ctxt->comp != NULL) {
  ------------------
  |  Branch (4894:9): [True: 10.1k, False: 0]
  ------------------
 4895|       |#ifdef XPATH_STREAMING
 4896|       |	if (ctxt->comp->stream != NULL) {
 4897|       |	    xmlFreePatternList(ctxt->comp->stream);
 4898|       |	    ctxt->comp->stream = NULL;
 4899|       |	}
 4900|       |#endif
 4901|  10.1k|	xmlXPathFreeCompExpr(ctxt->comp);
 4902|  10.1k|    }
 4903|  10.1k|    xmlFree(ctxt);
 4904|  10.1k|}
xmlXPathEqualValues:
 5702|   342k|xmlXPathEqualValues(xmlXPathParserContext *ctxt) {
 5703|   342k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5704|   342k|    int ret = 0;
 5705|       |
 5706|   342k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5706:9): [True: 0, False: 342k]
  |  Branch (5706:27): [True: 0, False: 342k]
  ------------------
 5707|   342k|    arg2 = xmlXPathValuePop(ctxt);
 5708|   342k|    arg1 = xmlXPathValuePop(ctxt);
 5709|   342k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5709:9): [True: 0, False: 342k]
  |  Branch (5709:27): [True: 0, False: 342k]
  ------------------
 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|   342k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5717:9): [True: 0, False: 342k]
  ------------------
 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|   342k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5725:9): [True: 110k, False: 231k]
  |  Branch (5725:42): [True: 0, False: 231k]
  ------------------
 5726|   231k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5726:7): [True: 28.8k, False: 202k]
  |  Branch (5726:40): [True: 0, False: 202k]
  ------------------
 5727|       |	/*
 5728|       |	 *Hack it to assure arg1 is the nodeset
 5729|       |	 */
 5730|   139k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5730:6): [True: 86.0k, False: 53.2k]
  |  Branch (5730:39): [True: 86.0k, False: 0]
  ------------------
 5731|  86.0k|		argtmp = arg2;
 5732|  86.0k|		arg2 = arg1;
 5733|  86.0k|		arg1 = argtmp;
 5734|  86.0k|	}
 5735|   139k|	switch (arg2->type) {
  ------------------
  |  Branch (5735:10): [True: 139k, False: 0]
  ------------------
 5736|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5736:6): [True: 0, False: 139k]
  ------------------
 5737|      0|		break;
 5738|  24.4k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5738:6): [True: 24.4k, False: 114k]
  ------------------
 5739|  24.4k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5739:6): [True: 0, False: 139k]
  ------------------
 5740|  24.4k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 0);
 5741|  24.4k|		break;
 5742|  72.8k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5742:6): [True: 72.8k, False: 66.4k]
  ------------------
 5743|  72.8k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5743:7): [True: 0, False: 72.8k]
  ------------------
 5744|  72.8k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5744:5): [True: 44.0k, False: 28.8k]
  ------------------
 5745|  28.8k|		else
 5746|  28.8k|		    ret = 1;
 5747|  72.8k|		ret = (ret == arg2->boolval);
 5748|  72.8k|		break;
 5749|  32.8k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5749:6): [True: 32.8k, False: 106k]
  ------------------
 5750|  32.8k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 0);
 5751|  32.8k|		break;
 5752|  9.12k|	    case XPATH_STRING:
  ------------------
  |  Branch (5752:6): [True: 9.12k, False: 130k]
  ------------------
 5753|  9.12k|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5754|  9.12k|                                                 arg2->stringval, 0);
 5755|  9.12k|		break;
 5756|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5756:6): [True: 0, False: 139k]
  ------------------
 5757|       |		/* TODO */
 5758|      0|		break;
 5759|   139k|	}
 5760|   139k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5761|   139k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5762|   139k|	return(ret);
 5763|   139k|    }
 5764|       |
 5765|   202k|    return (xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5766|   342k|}
xmlXPathNotEqualValues:
 5775|  4.57k|xmlXPathNotEqualValues(xmlXPathParserContext *ctxt) {
 5776|  4.57k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5777|  4.57k|    int ret = 0;
 5778|       |
 5779|  4.57k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5779:9): [True: 0, False: 4.57k]
  |  Branch (5779:27): [True: 0, False: 4.57k]
  ------------------
 5780|  4.57k|    arg2 = xmlXPathValuePop(ctxt);
 5781|  4.57k|    arg1 = xmlXPathValuePop(ctxt);
 5782|  4.57k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5782:9): [True: 0, False: 4.57k]
  |  Branch (5782:27): [True: 0, False: 4.57k]
  ------------------
 5783|      0|	if (arg1 != NULL)
  ------------------
  |  Branch (5783:6): [True: 0, False: 0]
  ------------------
 5784|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5785|      0|	else
 5786|      0|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5787|      0|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5788|      0|    }
 5789|       |
 5790|  4.57k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 4.57k]
  ------------------
 5791|      0|	xmlXPathReleaseObject(ctxt->context, arg1);
 5792|      0|        return(0);
 5793|      0|    }
 5794|       |
 5795|       |    /*
 5796|       |     *If either argument is a nodeset, it's a 'special case'
 5797|       |     */
 5798|  4.57k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5798:9): [True: 2.48k, False: 2.08k]
  |  Branch (5798:42): [True: 0, False: 2.08k]
  ------------------
 5799|  3.67k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5799:7): [True: 1.18k, False: 904]
  |  Branch (5799:40): [True: 0, False: 904]
  ------------------
 5800|       |	/*
 5801|       |	 *Hack it to assure arg1 is the nodeset
 5802|       |	 */
 5803|  3.67k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5803:6): [True: 1.67k, False: 2.00k]
  |  Branch (5803:39): [True: 1.67k, False: 0]
  ------------------
 5804|  1.67k|		argtmp = arg2;
 5805|  1.67k|		arg2 = arg1;
 5806|  1.67k|		arg1 = argtmp;
 5807|  1.67k|	}
 5808|  3.67k|	switch (arg2->type) {
  ------------------
  |  Branch (5808:10): [True: 3.67k, False: 0]
  ------------------
 5809|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5809:6): [True: 0, False: 3.67k]
  ------------------
 5810|      0|		break;
 5811|    815|	    case XPATH_NODESET:
  ------------------
  |  Branch (5811:6): [True: 815, False: 2.85k]
  ------------------
 5812|    815|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5812:6): [True: 0, False: 3.67k]
  ------------------
 5813|    815|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 1);
 5814|    815|		break;
 5815|  1.02k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5815:6): [True: 1.02k, False: 2.64k]
  ------------------
 5816|  1.02k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5816:7): [True: 0, False: 1.02k]
  ------------------
 5817|  1.02k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5817:5): [True: 629, False: 399]
  ------------------
 5818|    399|		else
 5819|    399|		    ret = 1;
 5820|  1.02k|		ret = (ret != arg2->boolval);
 5821|  1.02k|		break;
 5822|  1.00k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5822:6): [True: 1.00k, False: 2.67k]
  ------------------
 5823|  1.00k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 1);
 5824|  1.00k|		break;
 5825|    830|	    case XPATH_STRING:
  ------------------
  |  Branch (5825:6): [True: 830, False: 2.84k]
  ------------------
 5826|    830|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5827|    830|                                                 arg2->stringval, 1);
 5828|    830|		break;
 5829|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5829:6): [True: 0, False: 3.67k]
  ------------------
 5830|       |		/* TODO */
 5831|      0|		break;
 5832|  3.67k|	}
 5833|  3.67k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5834|  3.67k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5835|  3.67k|	return(ret);
 5836|  3.67k|    }
 5837|       |
 5838|    904|    return (!xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5839|  4.57k|}
xmlXPathCompareValues:
 5864|   218k|xmlXPathCompareValues(xmlXPathParserContext *ctxt, int inf, int strict) {
 5865|   218k|    int ret = 0, arg1i = 0, arg2i = 0;
 5866|   218k|    xmlXPathObjectPtr arg1, arg2;
 5867|       |
 5868|   218k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5868:9): [True: 0, False: 218k]
  |  Branch (5868:27): [True: 0, False: 218k]
  ------------------
 5869|   218k|    arg2 = xmlXPathValuePop(ctxt);
 5870|   218k|    arg1 = xmlXPathValuePop(ctxt);
 5871|   218k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5871:9): [True: 9, False: 218k]
  |  Branch (5871:27): [True: 0, False: 218k]
  ------------------
 5872|      9|	if (arg1 != NULL)
  ------------------
  |  Branch (5872:6): [True: 0, False: 9]
  ------------------
 5873|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5874|      9|	else
 5875|      9|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5876|      9|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      9|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5877|      0|    }
 5878|       |
 5879|   218k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5879:9): [True: 130k, False: 87.9k]
  |  Branch (5879:42): [True: 0, False: 87.9k]
  ------------------
 5880|   147k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5880:7): [True: 16.3k, False: 71.5k]
  |  Branch (5880:40): [True: 0, False: 71.5k]
  ------------------
 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|   147k|	if (((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE)) &&
  ------------------
  |  Branch (5886:7): [True: 130k, False: 16.3k]
  |  Branch (5886:40): [True: 0, False: 16.3k]
  ------------------
 5887|   130k|	  ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE))){
  ------------------
  |  Branch (5887:5): [True: 82.7k, False: 47.8k]
  |  Branch (5887:38): [True: 0, False: 47.8k]
  ------------------
 5888|  82.7k|	    ret = xmlXPathCompareNodeSets(ctxt, inf, strict, arg1, arg2);
 5889|  82.7k|	} else {
 5890|  64.2k|	    if ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5890:10): [True: 16.3k, False: 47.8k]
  |  Branch (5890:43): [True: 0, False: 47.8k]
  ------------------
 5891|  16.3k|		ret = xmlXPathCompareNodeSetValue(ctxt, inf, strict,
 5892|  16.3k|			                          arg1, arg2);
 5893|  47.8k|	    } else {
 5894|  47.8k|		ret = xmlXPathCompareNodeSetValue(ctxt, !inf, strict,
 5895|  47.8k|			                          arg2, arg1);
 5896|  47.8k|	    }
 5897|  64.2k|	}
 5898|   147k|	return(ret);
 5899|   147k|    }
 5900|       |
 5901|  71.5k|    if (arg1->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5901:9): [True: 12.7k, False: 58.8k]
  ------------------
 5902|  12.7k|	xmlXPathValuePush(ctxt, arg1);
 5903|  12.7k|	xmlXPathNumberFunction(ctxt, 1);
 5904|  12.7k|	arg1 = xmlXPathValuePop(ctxt);
 5905|  12.7k|    }
 5906|  71.5k|    if (arg2->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5906:9): [True: 7.96k, False: 63.5k]
  ------------------
 5907|  7.96k|	xmlXPathValuePush(ctxt, arg2);
 5908|  7.96k|	xmlXPathNumberFunction(ctxt, 1);
 5909|  7.96k|	arg2 = xmlXPathValuePop(ctxt);
 5910|  7.96k|    }
 5911|  71.5k|    if (ctxt->error)
  ------------------
  |  Branch (5911:9): [True: 341, False: 71.2k]
  ------------------
 5912|    341|        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|  71.2k|    if (xmlXPathIsNaN(arg1->floatval) || xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5918:9): [True: 51.5k, False: 19.6k]
  |  Branch (5918:42): [True: 1.39k, False: 18.2k]
  ------------------
 5919|  52.9k|	ret=0;
 5920|  52.9k|    } else {
 5921|  18.2k|	arg1i=xmlXPathIsInf(arg1->floatval);
 5922|  18.2k|	arg2i=xmlXPathIsInf(arg2->floatval);
 5923|  18.2k|	if (inf && strict) {
  ------------------
  |  Branch (5923:6): [True: 11.8k, False: 6.39k]
  |  Branch (5923:13): [True: 8.95k, False: 2.89k]
  ------------------
 5924|  8.95k|	    if ((arg1i == -1 && arg2i != -1) ||
  ------------------
  |  Branch (5924:11): [True: 566, False: 8.38k]
  |  Branch (5924:26): [True: 315, False: 251]
  ------------------
 5925|  8.63k|		(arg2i == 1 && arg1i != 1)) {
  ------------------
  |  Branch (5925:4): [True: 712, False: 7.92k]
  |  Branch (5925:18): [True: 149, False: 563]
  ------------------
 5926|    464|		ret = 1;
 5927|  8.49k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5927:17): [True: 7.47k, False: 1.01k]
  |  Branch (5927:31): [True: 6.96k, False: 511]
  ------------------
 5928|  6.96k|		ret = (arg1->floatval < arg2->floatval);
 5929|  6.96k|	    } else {
 5930|  1.53k|		ret = 0;
 5931|  1.53k|	    }
 5932|  8.95k|	}
 5933|  9.29k|	else if (inf && !strict) {
  ------------------
  |  Branch (5933:11): [True: 2.89k, False: 6.39k]
  |  Branch (5933:18): [True: 2.89k, False: 0]
  ------------------
 5934|  2.89k|	    if (arg1i == -1 || arg2i == 1) {
  ------------------
  |  Branch (5934:10): [True: 96, False: 2.80k]
  |  Branch (5934:25): [True: 209, False: 2.59k]
  ------------------
 5935|    305|		ret = 1;
 5936|  2.59k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5936:17): [True: 2.06k, False: 529]
  |  Branch (5936:31): [True: 717, False: 1.34k]
  ------------------
 5937|    717|		ret = (arg1->floatval <= arg2->floatval);
 5938|  1.87k|	    } else {
 5939|  1.87k|		ret = 0;
 5940|  1.87k|	    }
 5941|  2.89k|	}
 5942|  6.39k|	else if (!inf && strict) {
  ------------------
  |  Branch (5942:11): [True: 6.39k, False: 0]
  |  Branch (5942:19): [True: 4.59k, False: 1.80k]
  ------------------
 5943|  4.59k|	    if ((arg1i == 1 && arg2i != 1) ||
  ------------------
  |  Branch (5943:11): [True: 923, False: 3.66k]
  |  Branch (5943:25): [True: 274, False: 649]
  ------------------
 5944|  4.31k|		(arg2i == -1 && arg1i != -1)) {
  ------------------
  |  Branch (5944:4): [True: 509, False: 3.80k]
  |  Branch (5944:19): [True: 375, False: 134]
  ------------------
 5945|    649|		ret = 1;
 5946|  3.94k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5946:17): [True: 2.95k, False: 993]
  |  Branch (5946:31): [True: 2.37k, False: 574]
  ------------------
 5947|  2.37k|		ret = (arg1->floatval > arg2->floatval);
 5948|  2.37k|	    } else {
 5949|  1.56k|		ret = 0;
 5950|  1.56k|	    }
 5951|  4.59k|	}
 5952|  1.80k|	else if (!inf && !strict) {
  ------------------
  |  Branch (5952:11): [True: 1.80k, False: 0]
  |  Branch (5952:19): [True: 1.80k, False: 0]
  ------------------
 5953|  1.80k|	    if (arg1i == 1 || arg2i == -1) {
  ------------------
  |  Branch (5953:10): [True: 197, False: 1.60k]
  |  Branch (5953:24): [True: 426, False: 1.17k]
  ------------------
 5954|    623|		ret = 1;
 5955|  1.17k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5955:17): [True: 925, False: 252]
  |  Branch (5955:31): [True: 675, False: 250]
  ------------------
 5956|    675|		ret = (arg1->floatval >= arg2->floatval);
 5957|    675|	    } else {
 5958|    502|		ret = 0;
 5959|    502|	    }
 5960|  1.80k|	}
 5961|  18.2k|    }
 5962|  71.5k|error:
 5963|  71.5k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5964|  71.5k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5965|  71.5k|    return(ret);
 5966|  71.2k|}
xmlXPathValueFlipSign:
 5976|  88.5k|xmlXPathValueFlipSign(xmlXPathParserContext *ctxt) {
 5977|  88.5k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return;
  ------------------
  |  Branch (5977:9): [True: 0, False: 88.5k]
  |  Branch (5977:27): [True: 0, False: 88.5k]
  ------------------
 5978|  88.5k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  88.5k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 88.5k, False: 0]
  |  |  |  Branch (297:34): [True: 61.4k, False: 27.1k]
  |  |  ------------------
  |  |  298|  88.5k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 5979|  88.5k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  88.5k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 6, False: 88.5k]
  |  |  |  Branch (261:34): [True: 9, False: 88.5k]
  |  |  ------------------
  |  |  262|  88.5k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     15|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 5980|  88.5k|    ctxt->value->floatval = -ctxt->value->floatval;
 5981|  88.5k|}
xmlXPathAddValues:
 5991|  70.1k|xmlXPathAddValues(xmlXPathParserContext *ctxt) {
 5992|  70.1k|    xmlXPathObjectPtr arg;
 5993|  70.1k|    double val;
 5994|       |
 5995|  70.1k|    arg = xmlXPathValuePop(ctxt);
 5996|  70.1k|    if (arg == NULL)
  ------------------
  |  Branch (5996:9): [True: 0, False: 70.1k]
  ------------------
 5997|  70.1k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 5998|  70.1k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 5999|  70.1k|    xmlXPathReleaseObject(ctxt->context, arg);
 6000|  70.1k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  70.1k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 70.1k, False: 0]
  |  |  |  Branch (297:34): [True: 59.1k, False: 10.9k]
  |  |  ------------------
  |  |  298|  70.1k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6001|  70.1k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  70.1k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 4, False: 70.1k]
  |  |  |  Branch (261:34): [True: 2, False: 70.1k]
  |  |  ------------------
  |  |  262|  70.1k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6002|  70.1k|    ctxt->value->floatval += val;
 6003|  70.1k|}
xmlXPathSubValues:
 6013|  44.1k|xmlXPathSubValues(xmlXPathParserContext *ctxt) {
 6014|  44.1k|    xmlXPathObjectPtr arg;
 6015|  44.1k|    double val;
 6016|       |
 6017|  44.1k|    arg = xmlXPathValuePop(ctxt);
 6018|  44.1k|    if (arg == NULL)
  ------------------
  |  Branch (6018:9): [True: 0, False: 44.1k]
  ------------------
 6019|  44.1k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6020|  44.1k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6021|  44.1k|    xmlXPathReleaseObject(ctxt->context, arg);
 6022|  44.1k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  44.1k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 44.1k, False: 0]
  |  |  |  Branch (297:34): [True: 15.7k, False: 28.4k]
  |  |  ------------------
  |  |  298|  44.1k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6023|  44.1k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  44.1k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 2, False: 44.1k]
  |  |  |  Branch (261:34): [True: 7, False: 44.1k]
  |  |  ------------------
  |  |  262|  44.1k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6024|  44.1k|    ctxt->value->floatval -= val;
 6025|  44.1k|}
xmlXPathMultValues:
 6035|   122k|xmlXPathMultValues(xmlXPathParserContext *ctxt) {
 6036|   122k|    xmlXPathObjectPtr arg;
 6037|   122k|    double val;
 6038|       |
 6039|   122k|    arg = xmlXPathValuePop(ctxt);
 6040|   122k|    if (arg == NULL)
  ------------------
  |  Branch (6040:9): [True: 0, False: 122k]
  ------------------
 6041|   122k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6042|   122k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6043|   122k|    xmlXPathReleaseObject(ctxt->context, arg);
 6044|   122k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   122k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 122k, False: 0]
  |  |  |  Branch (297:34): [True: 42.9k, False: 79.4k]
  |  |  ------------------
  |  |  298|   122k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6045|   122k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   122k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 7, False: 122k]
  |  |  |  Branch (261:34): [True: 2, False: 122k]
  |  |  ------------------
  |  |  262|   122k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6046|   122k|    ctxt->value->floatval *= val;
 6047|   122k|}
xmlXPathDivValues:
 6058|  2.91k|xmlXPathDivValues(xmlXPathParserContext *ctxt) {
 6059|  2.91k|    xmlXPathObjectPtr arg;
 6060|  2.91k|    double val;
 6061|       |
 6062|  2.91k|    arg = xmlXPathValuePop(ctxt);
 6063|  2.91k|    if (arg == NULL)
  ------------------
  |  Branch (6063:9): [True: 0, False: 2.91k]
  ------------------
 6064|  2.91k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6065|  2.91k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6066|  2.91k|    xmlXPathReleaseObject(ctxt->context, arg);
 6067|  2.91k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  2.91k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 2.91k, False: 0]
  |  |  |  Branch (297:34): [True: 1.53k, False: 1.38k]
  |  |  ------------------
  |  |  298|  2.91k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6068|  2.91k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  2.91k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 2.91k]
  |  |  |  Branch (261:34): [True: 1, False: 2.91k]
  |  |  ------------------
  |  |  262|  2.91k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6069|  2.91k|    ctxt->value->floatval /= val;
 6070|  2.91k|}
xmlXPathModValues:
 6080|    898|xmlXPathModValues(xmlXPathParserContext *ctxt) {
 6081|    898|    xmlXPathObjectPtr arg;
 6082|    898|    double arg1, arg2;
 6083|       |
 6084|    898|    arg = xmlXPathValuePop(ctxt);
 6085|    898|    if (arg == NULL)
  ------------------
  |  Branch (6085:9): [True: 0, False: 898]
  ------------------
 6086|    898|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6087|    898|    arg2 = xmlXPathCastToNumberInternal(ctxt, arg);
 6088|    898|    xmlXPathReleaseObject(ctxt->context, arg);
 6089|    898|    CAST_TO_NUMBER;
  ------------------
  |  |  297|    898|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 898, False: 0]
  |  |  |  Branch (297:34): [True: 403, False: 495]
  |  |  ------------------
  |  |  298|    898|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6090|    898|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|    898|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 897]
  |  |  |  Branch (261:34): [True: 1, False: 896]
  |  |  ------------------
  |  |  262|    898|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6091|    896|    arg1 = ctxt->value->floatval;
 6092|    896|    if (arg2 == 0)
  ------------------
  |  Branch (6092:9): [True: 20, False: 876]
  ------------------
 6093|     20|	ctxt->value->floatval = xmlXPathNAN;
 6094|    876|    else {
 6095|    876|	ctxt->value->floatval = fmod(arg1, arg2);
 6096|    876|    }
 6097|    896|}
xmlXPathNextSelf:
 6138|    618|xmlXPathNextSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6139|    618|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6139:9): [True: 0, False: 618]
  |  Branch (6139:27): [True: 0, False: 618]
  ------------------
 6140|    618|    if (cur == NULL)
  ------------------
  |  Branch (6140:9): [True: 309, False: 309]
  ------------------
 6141|    309|        return(ctxt->context->node);
 6142|    309|    return(NULL);
 6143|    618|}
xmlXPathNextChild:
 6154|   191k|xmlXPathNextChild(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6155|   191k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6155:9): [True: 0, False: 191k]
  |  Branch (6155:27): [True: 0, False: 191k]
  ------------------
 6156|   191k|    if (cur == NULL) {
  ------------------
  |  Branch (6156:9): [True: 85.6k, False: 106k]
  ------------------
 6157|  85.6k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6157:6): [True: 0, False: 85.6k]
  ------------------
 6158|  85.6k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6158:10): [True: 85.6k, False: 0]
  ------------------
 6159|  20.5k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6159:13): [True: 20.5k, False: 65.1k]
  ------------------
 6160|  60.4k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6160:13): [True: 39.9k, False: 45.7k]
  ------------------
 6161|  72.1k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6161:13): [True: 11.7k, False: 73.9k]
  ------------------
 6162|  72.1k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6162:13): [True: 0, False: 85.6k]
  ------------------
 6163|  72.1k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6163:13): [True: 0, False: 85.6k]
  ------------------
 6164|  73.3k|            case XML_PI_NODE:
  ------------------
  |  Branch (6164:13): [True: 1.14k, False: 84.5k]
  ------------------
 6165|  85.1k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6165:13): [True: 11.8k, False: 73.8k]
  ------------------
 6166|  85.1k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6166:13): [True: 0, False: 85.6k]
  ------------------
 6167|  85.1k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6167:13): [True: 0, False: 85.6k]
  ------------------
 6168|  85.1k|		return(ctxt->context->node->children);
 6169|    476|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6169:13): [True: 476, False: 85.2k]
  ------------------
 6170|    476|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6170:13): [True: 0, False: 85.6k]
  ------------------
 6171|    476|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6171:13): [True: 0, False: 85.6k]
  ------------------
 6172|    476|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6172:13): [True: 0, False: 85.6k]
  ------------------
 6173|    476|		return(((xmlDocPtr) ctxt->context->node)->children);
 6174|      0|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6174:6): [True: 0, False: 85.6k]
  ------------------
 6175|      0|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6175:6): [True: 0, False: 85.6k]
  ------------------
 6176|      0|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6176:6): [True: 0, False: 85.6k]
  ------------------
 6177|     22|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (6177:13): [True: 22, False: 85.6k]
  ------------------
 6178|     22|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (6178:6): [True: 0, False: 85.6k]
  ------------------
 6179|     22|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6179:6): [True: 0, False: 85.6k]
  ------------------
 6180|     22|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6180:6): [True: 0, False: 85.6k]
  ------------------
 6181|     22|		return(NULL);
 6182|  85.6k|	}
 6183|      0|	return(NULL);
 6184|  85.6k|    }
 6185|   106k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (6185:9): [True: 0, False: 106k]
  ------------------
 6186|   106k|        (cur->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (6186:9): [True: 0, False: 106k]
  ------------------
 6187|      0|	return(NULL);
 6188|   106k|    return(cur->next);
 6189|   106k|}
xmlXPathNextDescendant:
 6271|  4.44M|xmlXPathNextDescendant(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6272|  4.44M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6272:9): [True: 0, False: 4.44M]
  |  Branch (6272:27): [True: 0, False: 4.44M]
  ------------------
 6273|  4.44M|    if (cur == NULL) {
  ------------------
  |  Branch (6273:9): [True: 100k, False: 4.34M]
  ------------------
 6274|   100k|	if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6274:6): [True: 0, False: 100k]
  ------------------
 6275|      0|	    return(NULL);
 6276|   100k|	if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6276:6): [True: 247, False: 100k]
  ------------------
 6277|   100k|	    (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6277:6): [True: 299, False: 100k]
  ------------------
 6278|    546|	    return(NULL);
 6279|       |
 6280|   100k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6280:13): [True: 43.5k, False: 56.8k]
  ------------------
 6281|  43.5k|	    return(ctxt->context->doc->children);
 6282|  56.8k|        return(ctxt->context->node->children);
 6283|   100k|    }
 6284|       |
 6285|  4.34M|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (6285:9): [True: 0, False: 4.34M]
  ------------------
 6286|      0|        return(NULL);
 6287|  4.34M|    if (cur->children != NULL) {
  ------------------
  |  Branch (6287:9): [True: 1.27M, False: 3.07M]
  ------------------
 6288|       |	/*
 6289|       |	 * Do not descend on entities declarations
 6290|       |	 */
 6291|  1.27M|	if (cur->children->type != XML_ENTITY_DECL) {
  ------------------
  |  Branch (6291:6): [True: 1.26M, False: 2.18k]
  ------------------
 6292|  1.26M|	    cur = cur->children;
 6293|       |	    /*
 6294|       |	     * Skip DTDs
 6295|       |	     */
 6296|  1.26M|	    if (cur->type != XML_DTD_NODE)
  ------------------
  |  Branch (6296:10): [True: 1.26M, False: 1.51k]
  ------------------
 6297|  1.26M|		return(cur);
 6298|  1.26M|	}
 6299|  1.27M|    }
 6300|       |
 6301|  3.07M|    if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6301:9): [True: 6.71k, False: 3.07M]
  ------------------
 6302|       |
 6303|  3.07M|    while (cur->next != NULL) {
  ------------------
  |  Branch (6303:12): [True: 2.55M, False: 518k]
  ------------------
 6304|  2.55M|	cur = cur->next;
 6305|  2.55M|	if ((cur->type != XML_ENTITY_DECL) &&
  ------------------
  |  Branch (6305:6): [True: 2.55M, False: 2.11k]
  ------------------
 6306|  2.55M|	    (cur->type != XML_DTD_NODE))
  ------------------
  |  Branch (6306:6): [True: 2.55M, False: 856]
  ------------------
 6307|  2.55M|	    return(cur);
 6308|  2.55M|    }
 6309|       |
 6310|  1.30M|    do {
 6311|  1.30M|        cur = cur->parent;
 6312|  1.30M|	if (cur == NULL) break;
  ------------------
  |  Branch (6312:6): [True: 0, False: 1.30M]
  ------------------
 6313|  1.30M|	if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6313:6): [True: 129k, False: 1.17M]
  ------------------
 6314|  1.17M|	if (cur->next != NULL) {
  ------------------
  |  Branch (6314:6): [True: 388k, False: 785k]
  ------------------
 6315|   388k|	    cur = cur->next;
 6316|   388k|	    return(cur);
 6317|   388k|	}
 6318|  1.17M|    } while (cur != NULL);
  ------------------
  |  Branch (6318:14): [True: 785k, False: 0]
  ------------------
 6319|      0|    return(cur);
 6320|   518k|}
xmlXPathNextDescendantOrSelf:
 6334|  3.06M|xmlXPathNextDescendantOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6335|  3.06M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6335:9): [True: 0, False: 3.06M]
  |  Branch (6335:27): [True: 0, False: 3.06M]
  ------------------
 6336|  3.06M|    if (cur == NULL)
  ------------------
  |  Branch (6336:9): [True: 120k, False: 2.94M]
  ------------------
 6337|   120k|        return(ctxt->context->node);
 6338|       |
 6339|  2.94M|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6339:9): [True: 0, False: 2.94M]
  ------------------
 6340|      0|        return(NULL);
 6341|  2.94M|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6341:9): [True: 886, False: 2.94M]
  ------------------
 6342|  2.94M|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6342:9): [True: 19.7k, False: 2.92M]
  ------------------
 6343|  20.6k|        return(NULL);
 6344|       |
 6345|  2.92M|    return(xmlXPathNextDescendant(ctxt, cur));
 6346|  2.94M|}
xmlXPathNextParent:
 6357|   197k|xmlXPathNextParent(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6358|   197k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6358:9): [True: 0, False: 197k]
  |  Branch (6358:27): [True: 0, False: 197k]
  ------------------
 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|   197k|    if (cur == NULL) {
  ------------------
  |  Branch (6364:9): [True: 101k, False: 95.2k]
  ------------------
 6365|   101k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6365:6): [True: 0, False: 101k]
  ------------------
 6366|   101k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6366:10): [True: 101k, False: 0]
  ------------------
 6367|  68.3k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6367:13): [True: 68.3k, False: 33.5k]
  ------------------
 6368|  91.1k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6368:13): [True: 22.8k, False: 79.0k]
  ------------------
 6369|  92.0k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6369:13): [True: 875, False: 101k]
  ------------------
 6370|  92.0k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6370:13): [True: 0, False: 101k]
  ------------------
 6371|  92.0k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6371:13): [True: 0, False: 101k]
  ------------------
 6372|  93.1k|            case XML_PI_NODE:
  ------------------
  |  Branch (6372:13): [True: 1.06k, False: 100k]
  ------------------
 6373|  94.8k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6373:13): [True: 1.75k, False: 100k]
  ------------------
 6374|  94.8k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6374:13): [True: 0, False: 101k]
  ------------------
 6375|  94.8k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6375:13): [True: 0, False: 101k]
  ------------------
 6376|  94.8k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6376:6): [True: 0, False: 101k]
  ------------------
 6377|  94.8k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6377:6): [True: 0, False: 101k]
  ------------------
 6378|  94.8k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6378:6): [True: 0, False: 101k]
  ------------------
 6379|  94.8k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6379:6): [True: 0, False: 101k]
  ------------------
 6380|  94.8k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6380:6): [True: 0, False: 101k]
  ------------------
 6381|  94.8k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6381:7): [True: 0, False: 94.8k]
  ------------------
 6382|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6383|  94.8k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6383:7): [True: 89.6k, False: 5.19k]
  ------------------
 6384|  89.6k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6384:8): [True: 0, False: 89.6k]
  ------------------
 6385|  89.6k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6385:8): [True: 0, False: 89.6k]
  ------------------
 6386|  89.6k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  89.6k|#define BAD_CAST (xmlChar *)
  ------------------
 6387|      0|		    return(NULL);
 6388|  94.8k|		return(ctxt->context->node->parent);
 6389|  1.20k|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6389:13): [True: 1.20k, False: 100k]
  ------------------
 6390|  1.20k|		xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
 6391|       |
 6392|  1.20k|		return(att->parent);
 6393|  94.8k|	    }
 6394|  5.70k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6394:13): [True: 5.70k, False: 96.1k]
  ------------------
 6395|  5.70k|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6395:13): [True: 0, False: 101k]
  ------------------
 6396|  5.70k|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6396:13): [True: 0, False: 101k]
  ------------------
 6397|  5.70k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6397:13): [True: 0, False: 101k]
  ------------------
 6398|  5.70k|                return(NULL);
 6399|     86|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6399:6): [True: 86, False: 101k]
  ------------------
 6400|     86|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6401|       |
 6402|     86|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6402:7): [True: 86, False: 0]
  ------------------
 6403|     86|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6403:7): [True: 86, False: 0]
  ------------------
 6404|     86|		    return((xmlNodePtr) ns->next);
 6405|      0|                return(NULL);
 6406|     86|	    }
 6407|   101k|	}
 6408|   101k|    }
 6409|  95.2k|    return(NULL);
 6410|   197k|}
xmlXPathNextAncestor:
 6425|   138k|xmlXPathNextAncestor(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6426|   138k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6426:9): [True: 0, False: 138k]
  |  Branch (6426:27): [True: 0, False: 138k]
  ------------------
 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|   138k|    if (cur == NULL) {
  ------------------
  |  Branch (6432:9): [True: 24.2k, False: 113k]
  ------------------
 6433|  24.2k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6433:6): [True: 0, False: 24.2k]
  ------------------
 6434|  24.2k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6434:10): [True: 24.2k, False: 0]
  ------------------
 6435|  21.3k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6435:13): [True: 21.3k, False: 2.96k]
  ------------------
 6436|  22.9k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6436:13): [True: 1.60k, False: 22.6k]
  ------------------
 6437|  23.0k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6437:13): [True: 74, False: 24.2k]
  ------------------
 6438|  23.0k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6438:13): [True: 0, False: 24.2k]
  ------------------
 6439|  23.0k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6439:13): [True: 0, False: 24.2k]
  ------------------
 6440|  23.5k|            case XML_PI_NODE:
  ------------------
  |  Branch (6440:13): [True: 519, False: 23.7k]
  ------------------
 6441|  23.7k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6441:13): [True: 237, False: 24.0k]
  ------------------
 6442|  23.7k|	    case XML_DTD_NODE:
  ------------------
  |  Branch (6442:6): [True: 0, False: 24.2k]
  ------------------
 6443|  23.7k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6443:6): [True: 0, False: 24.2k]
  ------------------
 6444|  23.7k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6444:6): [True: 0, False: 24.2k]
  ------------------
 6445|  23.7k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6445:6): [True: 0, False: 24.2k]
  ------------------
 6446|  23.7k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6446:13): [True: 0, False: 24.2k]
  ------------------
 6447|  23.7k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6447:6): [True: 0, False: 24.2k]
  ------------------
 6448|  23.7k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6448:6): [True: 0, False: 24.2k]
  ------------------
 6449|  23.7k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6449:7): [True: 0, False: 23.7k]
  ------------------
 6450|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6451|  23.7k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6451:7): [True: 22.7k, False: 979]
  ------------------
 6452|  22.7k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6452:8): [True: 0, False: 22.7k]
  ------------------
 6453|  22.7k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6453:8): [True: 0, False: 22.7k]
  ------------------
 6454|  22.7k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  22.7k|#define BAD_CAST (xmlChar *)
  ------------------
 6455|      0|		    return(NULL);
 6456|  23.7k|		return(ctxt->context->node->parent);
 6457|     25|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6457:13): [True: 25, False: 24.2k]
  ------------------
 6458|     25|		xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node;
 6459|       |
 6460|     25|		return(tmp->parent);
 6461|  23.7k|	    }
 6462|    502|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6462:13): [True: 502, False: 23.7k]
  ------------------
 6463|    502|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6463:13): [True: 0, False: 24.2k]
  ------------------
 6464|    502|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6464:13): [True: 0, False: 24.2k]
  ------------------
 6465|    502|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6465:13): [True: 0, False: 24.2k]
  ------------------
 6466|    502|                return(NULL);
 6467|      0|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6467:6): [True: 0, False: 24.2k]
  ------------------
 6468|      0|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6469|       |
 6470|      0|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6470:7): [True: 0, False: 0]
  ------------------
 6471|      0|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6471:7): [True: 0, False: 0]
  ------------------
 6472|      0|		    return((xmlNodePtr) ns->next);
 6473|       |		/* Bad, how did that namespace end up here ? */
 6474|      0|                return(NULL);
 6475|      0|	    }
 6476|  24.2k|	}
 6477|      0|	return(NULL);
 6478|  24.2k|    }
 6479|   113k|    if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6479:9): [True: 7.60k, False: 106k]
  ------------------
 6480|  7.60k|	return((xmlNodePtr) ctxt->context->doc);
 6481|   106k|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6481:9): [True: 30.6k, False: 75.7k]
  ------------------
 6482|  30.6k|	return(NULL);
 6483|  75.7k|    switch (cur->type) {
  ------------------
  |  Branch (6483:13): [True: 75.7k, False: 0]
  ------------------
 6484|  72.1k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6484:2): [True: 72.1k, False: 3.66k]
  ------------------
 6485|  75.1k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6485:2): [True: 3.07k, False: 72.6k]
  ------------------
 6486|  75.4k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6486:2): [True: 297, False: 75.4k]
  ------------------
 6487|  75.4k|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6487:2): [True: 0, False: 75.7k]
  ------------------
 6488|  75.4k|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6488:2): [True: 0, False: 75.7k]
  ------------------
 6489|  75.6k|	case XML_PI_NODE:
  ------------------
  |  Branch (6489:2): [True: 218, False: 75.5k]
  ------------------
 6490|  75.7k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6490:2): [True: 36, False: 75.7k]
  ------------------
 6491|  75.7k|	case XML_NOTATION_NODE:
  ------------------
  |  Branch (6491:2): [True: 0, False: 75.7k]
  ------------------
 6492|  75.7k|	case XML_DTD_NODE:
  ------------------
  |  Branch (6492:2): [True: 0, False: 75.7k]
  ------------------
 6493|  75.7k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6493:9): [True: 0, False: 75.7k]
  ------------------
 6494|  75.7k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6494:9): [True: 0, False: 75.7k]
  ------------------
 6495|  75.7k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (6495:9): [True: 0, False: 75.7k]
  ------------------
 6496|  75.7k|	case XML_XINCLUDE_START:
  ------------------
  |  Branch (6496:2): [True: 0, False: 75.7k]
  ------------------
 6497|  75.7k|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6497:2): [True: 0, False: 75.7k]
  ------------------
 6498|  75.7k|	    if (cur->parent == NULL)
  ------------------
  |  Branch (6498:10): [True: 0, False: 75.7k]
  ------------------
 6499|      0|		return(NULL);
 6500|  75.7k|	    if ((cur->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6500:10): [True: 53.7k, False: 21.9k]
  ------------------
 6501|  53.7k|		((cur->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6501:4): [True: 0, False: 53.7k]
  ------------------
 6502|  53.7k|		 (xmlStrEqual(cur->parent->name,
  ------------------
  |  Branch (6502:4): [True: 0, False: 53.7k]
  ------------------
 6503|  53.7k|			      BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  53.7k|#define BAD_CAST (xmlChar *)
  ------------------
 6504|      0|		return(NULL);
 6505|  75.7k|	    return(cur->parent);
 6506|     36|	case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6506:2): [True: 36, False: 75.7k]
  ------------------
 6507|     36|	    xmlAttrPtr att = (xmlAttrPtr) cur;
 6508|       |
 6509|     36|	    return(att->parent);
 6510|  75.7k|	}
 6511|      0|	case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6511:2): [True: 0, False: 75.7k]
  ------------------
 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: 75.7k]
  ------------------
 6521|      0|	case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6521:2): [True: 0, False: 75.7k]
  ------------------
 6522|      0|	case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6522:2): [True: 0, False: 75.7k]
  ------------------
 6523|      0|	case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6523:2): [True: 0, False: 75.7k]
  ------------------
 6524|      0|	    return(NULL);
 6525|  75.7k|    }
 6526|      0|    return(NULL);
 6527|  75.7k|}
xmlXPathNextAncestorOrSelf:
 6541|  39.1k|xmlXPathNextAncestorOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6542|  39.1k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6542:9): [True: 0, False: 39.1k]
  |  Branch (6542:27): [True: 0, False: 39.1k]
  ------------------
 6543|  39.1k|    if (cur == NULL)
  ------------------
  |  Branch (6543:9): [True: 6.83k, False: 32.2k]
  ------------------
 6544|  6.83k|        return(ctxt->context->node);
 6545|  32.2k|    return(xmlXPathNextAncestor(ctxt, cur));
 6546|  39.1k|}
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|  31.0k|xmlXPathNextFollowing(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6623|  31.0k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6623:9): [True: 0, False: 31.0k]
  |  Branch (6623:27): [True: 0, False: 31.0k]
  ------------------
 6624|  31.0k|    if ((cur != NULL) && (cur->type  != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (6624:9): [True: 29.8k, False: 1.24k]
  |  Branch (6624:26): [True: 29.8k, False: 0]
  ------------------
 6625|  29.8k|        (cur->type != XML_NAMESPACE_DECL) && (cur->children != NULL))
  ------------------
  |  Branch (6625:9): [True: 29.8k, False: 0]
  |  Branch (6625:46): [True: 3.54k, False: 26.2k]
  ------------------
 6626|  3.54k|        return(cur->children);
 6627|       |
 6628|  27.5k|    if (cur == NULL) {
  ------------------
  |  Branch (6628:9): [True: 1.24k, False: 26.2k]
  ------------------
 6629|  1.24k|        cur = ctxt->context->node;
 6630|  1.24k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6630:13): [True: 41, False: 1.19k]
  ------------------
 6631|     41|            cur = cur->parent;
 6632|  1.19k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6632:20): [True: 0, False: 1.19k]
  ------------------
 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.24k|    }
 6641|       |
 6642|       |    /* ERROR */
 6643|  27.5k|    if (cur == NULL)
  ------------------
  |  Branch (6643:9): [True: 0, False: 27.5k]
  ------------------
 6644|      0|        return(NULL);
 6645|       |
 6646|  27.5k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6646:9): [True: 182, False: 27.3k]
  ------------------
 6647|    182|        return(NULL);
 6648|       |
 6649|  27.3k|    if (cur->next != NULL)
  ------------------
  |  Branch (6649:9): [True: 22.7k, False: 4.60k]
  ------------------
 6650|  22.7k|        return(cur->next);
 6651|       |
 6652|  5.59k|    do {
 6653|  5.59k|        cur = cur->parent;
 6654|  5.59k|        if (cur == NULL)
  ------------------
  |  Branch (6654:13): [True: 0, False: 5.59k]
  ------------------
 6655|      0|            break;
 6656|  5.59k|        if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6656:13): [True: 1.05k, False: 4.54k]
  ------------------
 6657|  1.05k|            return(NULL);
 6658|  4.54k|        if (cur->next != NULL && cur->type != XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6658:13): [True: 3.54k, False: 998]
  |  Branch (6658:34): [True: 3.54k, False: 0]
  ------------------
 6659|  3.54k|            return(cur->next);
 6660|  4.54k|    } while (cur != NULL);
  ------------------
  |  Branch (6660:14): [True: 998, False: 0]
  ------------------
 6661|       |
 6662|      0|    return(cur);
 6663|  4.60k|}
xmlXPathNextNamespace:
 6814|   116k|xmlXPathNextNamespace(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6815|   116k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6815:9): [True: 0, False: 116k]
  |  Branch (6815:27): [True: 0, False: 116k]
  ------------------
 6816|   116k|    if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
  ------------------
  |  Branch (6816:9): [True: 9.97k, False: 106k]
  ------------------
 6817|   106k|    if (cur == NULL) {
  ------------------
  |  Branch (6817:9): [True: 33.6k, False: 73.0k]
  ------------------
 6818|  33.6k|        if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6818:13): [True: 2.65k, False: 31.0k]
  ------------------
 6819|  2.65k|	    xmlFree(ctxt->context->tmpNsList);
 6820|  33.6k|	ctxt->context->tmpNsNr = 0;
 6821|  33.6k|        if (xmlGetNsListSafe(ctxt->context->doc, ctxt->context->node,
  ------------------
  |  Branch (6821:13): [True: 5, False: 33.6k]
  ------------------
 6822|  33.6k|                             &ctxt->context->tmpNsList) < 0) {
 6823|      5|            xmlXPathPErrMemory(ctxt);
 6824|      5|            return(NULL);
 6825|      5|        }
 6826|  33.6k|        if (ctxt->context->tmpNsList != NULL) {
  ------------------
  |  Branch (6826:13): [True: 32.5k, False: 1.07k]
  ------------------
 6827|  77.3k|            while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) {
  ------------------
  |  Branch (6827:20): [True: 44.7k, False: 32.5k]
  ------------------
 6828|  44.7k|                ctxt->context->tmpNsNr++;
 6829|  44.7k|            }
 6830|  32.5k|        }
 6831|  33.6k|	return((xmlNodePtr) xmlXPathXMLNamespace);
 6832|  33.6k|    }
 6833|  73.0k|    if (ctxt->context->tmpNsNr > 0) {
  ------------------
  |  Branch (6833:9): [True: 42.2k, False: 30.7k]
  ------------------
 6834|  42.2k|	return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr];
 6835|  42.2k|    } else {
 6836|  30.7k|	if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6836:6): [True: 29.7k, False: 1.00k]
  ------------------
 6837|  29.7k|	    xmlFree(ctxt->context->tmpNsList);
 6838|  30.7k|	ctxt->context->tmpNsList = NULL;
 6839|       |	return(NULL);
 6840|  30.7k|    }
 6841|  73.0k|}
xmlXPathNextAttribute:
 6852|   226k|xmlXPathNextAttribute(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6853|   226k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6853:9): [True: 0, False: 226k]
  |  Branch (6853:27): [True: 0, False: 226k]
  ------------------
 6854|   226k|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6854:9): [True: 0, False: 226k]
  ------------------
 6855|      0|	return(NULL);
 6856|   226k|    if (ctxt->context->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (6856:9): [True: 45.2k, False: 181k]
  ------------------
 6857|  45.2k|	return(NULL);
 6858|   181k|    if (cur == NULL) {
  ------------------
  |  Branch (6858:9): [True: 169k, False: 11.9k]
  ------------------
 6859|   169k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6859:13): [True: 0, False: 169k]
  ------------------
 6860|      0|	    return(NULL);
 6861|   169k|        return((xmlNodePtr)ctxt->context->node->properties);
 6862|   169k|    }
 6863|  11.9k|    return((xmlNodePtr)cur->next);
 6864|   181k|}
xmlXPathRoot:
 6887|   322k|xmlXPathRoot(xmlXPathParserContext *ctxt) {
 6888|   322k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (6888:9): [True: 0, False: 322k]
  |  Branch (6888:27): [True: 0, False: 322k]
  ------------------
 6889|      0|	return;
 6890|   322k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 6891|   322k|                                            (xmlNodePtr) ctxt->context->doc));
 6892|   322k|}
xmlXPathLastFunction:
 6911|    267|xmlXPathLastFunction(xmlXPathParserContext *ctxt, int nargs) {
 6912|    799|    CHECK_ARITY(0);
  ------------------
  |  |  280|    267|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 267]
  |  |  ------------------
  |  |  281|    267|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 266]
  |  |  ------------------
  |  |  282|    267|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    266|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 266]
  |  |  ------------------
  |  |  284|    266|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6913|    799|    if (ctxt->context->contextSize >= 0) {
  ------------------
  |  Branch (6913:9): [True: 266, False: 0]
  ------------------
 6914|    266|	xmlXPathValuePush(ctxt,
 6915|    266|	    xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize));
 6916|    266|    } else {
 6917|      0|	XP_ERROR(XPATH_INVALID_CTXT_SIZE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6918|      0|    }
 6919|    799|}
xmlXPathPositionFunction:
 6932|    424|xmlXPathPositionFunction(xmlXPathParserContext *ctxt, int nargs) {
 6933|  1.27k|    CHECK_ARITY(0);
  ------------------
  |  |  280|    424|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 424]
  |  |  ------------------
  |  |  281|    424|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 423]
  |  |  ------------------
  |  |  282|    424|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    423|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 423]
  |  |  ------------------
  |  |  284|    423|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6934|  1.27k|    if (ctxt->context->proximityPosition >= 0) {
  ------------------
  |  Branch (6934:9): [True: 423, False: 0]
  ------------------
 6935|    423|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6936|    423|            (double) ctxt->context->proximityPosition));
 6937|    423|    } else {
 6938|      0|	XP_ERROR(XPATH_INVALID_CTXT_POSITION);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6939|      0|    }
 6940|  1.27k|}
xmlXPathCountFunction:
 6950|     60|xmlXPathCountFunction(xmlXPathParserContext *ctxt, int nargs) {
 6951|     60|    xmlXPathObjectPtr cur;
 6952|       |
 6953|    170|    CHECK_ARITY(1);
  ------------------
  |  |  280|     60|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 60]
  |  |  ------------------
  |  |  281|     60|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 55]
  |  |  ------------------
  |  |  282|     60|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     55|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 55]
  |  |  ------------------
  |  |  284|     55|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6954|    170|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (6954:9): [True: 0, False: 55]
  ------------------
 6955|     55|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (6955:3): [True: 3, False: 52]
  ------------------
 6956|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (6956:3): [True: 3, False: 0]
  ------------------
 6957|     52|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6958|     52|    cur = xmlXPathValuePop(ctxt);
 6959|       |
 6960|     52|    if ((cur == NULL) || (cur->nodesetval == NULL))
  ------------------
  |  Branch (6960:9): [True: 0, False: 52]
  |  Branch (6960:26): [True: 0, False: 52]
  ------------------
 6961|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 6962|     52|    else
 6963|     52|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6964|     52|	    (double) cur->nodesetval->nodeNr));
 6965|     52|    xmlXPathReleaseObject(ctxt->context, cur);
 6966|     52|}
xmlXPathIdFunction:
 7047|  7.91k|xmlXPathIdFunction(xmlXPathParserContext *ctxt, int nargs) {
 7048|  7.91k|    xmlChar *tokens;
 7049|  7.91k|    xmlNodeSetPtr ret;
 7050|  7.91k|    xmlXPathObjectPtr obj;
 7051|       |
 7052|  23.7k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  7.91k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 7.91k]
  |  |  ------------------
  |  |  281|  7.91k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 7.90k]
  |  |  ------------------
  |  |  282|  7.91k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  7.90k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 4, False: 7.90k]
  |  |  ------------------
  |  |  284|  7.90k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7053|  23.7k|    obj = xmlXPathValuePop(ctxt);
 7054|  23.7k|    if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7054:9): [True: 0, False: 7.90k]
  ------------------
 7055|  7.90k|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (7055:9): [True: 2.46k, False: 5.43k]
  |  Branch (7055:41): [True: 0, False: 5.43k]
  ------------------
 7056|  2.46k|	xmlNodeSetPtr ns;
 7057|  2.46k|	int i;
 7058|       |
 7059|  2.46k|	ret = xmlXPathNodeSetCreate(NULL);
 7060|  2.46k|        if (ret == NULL)
  ------------------
  |  Branch (7060:13): [True: 2, False: 2.46k]
  ------------------
 7061|      2|            xmlXPathPErrMemory(ctxt);
 7062|       |
 7063|  2.46k|	if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (7063:6): [True: 2.46k, False: 0]
  ------------------
 7064|  6.22k|	    for (i = 0; i < obj->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (7064:18): [True: 3.75k, False: 2.46k]
  ------------------
 7065|  3.75k|		tokens =
 7066|  3.75k|		    xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
 7067|  3.75k|                if (tokens == NULL)
  ------------------
  |  Branch (7067:21): [True: 10, False: 3.74k]
  ------------------
 7068|     10|                    xmlXPathPErrMemory(ctxt);
 7069|  3.75k|		ns = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7070|  3.75k|                if (ns == NULL)
  ------------------
  |  Branch (7070:21): [True: 27, False: 3.72k]
  ------------------
 7071|     27|                    xmlXPathPErrMemory(ctxt);
 7072|  3.75k|		ret = xmlXPathNodeSetMerge(ret, ns);
 7073|  3.75k|                if (ret == NULL)
  ------------------
  |  Branch (7073:21): [True: 1, False: 3.75k]
  ------------------
 7074|      1|                    xmlXPathPErrMemory(ctxt);
 7075|  3.75k|		xmlXPathFreeNodeSet(ns);
 7076|  3.75k|		if (tokens != NULL)
  ------------------
  |  Branch (7076:7): [True: 3.74k, False: 10]
  ------------------
 7077|  3.74k|		    xmlFree(tokens);
 7078|  3.75k|	    }
 7079|  2.46k|	}
 7080|  2.46k|	xmlXPathReleaseObject(ctxt->context, obj);
 7081|  2.46k|	xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7082|  2.46k|	return;
 7083|  2.46k|    }
 7084|  5.43k|    tokens = xmlXPathCastToString(obj);
 7085|  5.43k|    if (tokens == NULL)
  ------------------
  |  Branch (7085:9): [True: 6, False: 5.42k]
  ------------------
 7086|      6|        xmlXPathPErrMemory(ctxt);
 7087|  5.43k|    xmlXPathReleaseObject(ctxt->context, obj);
 7088|  5.43k|    ret = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7089|  5.43k|    if (ret == NULL)
  ------------------
  |  Branch (7089:9): [True: 16, False: 5.41k]
  ------------------
 7090|     16|        xmlXPathPErrMemory(ctxt);
 7091|  5.43k|    xmlFree(tokens);
 7092|  5.43k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7093|  5.43k|}
xmlXPathLocalNameFunction:
 7108|  1.75k|xmlXPathLocalNameFunction(xmlXPathParserContext *ctxt, int nargs) {
 7109|  1.75k|    xmlXPathObjectPtr cur;
 7110|       |
 7111|  1.75k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7111:9): [True: 0, False: 1.75k]
  ------------------
 7112|       |
 7113|  1.75k|    if (nargs == 0) {
  ------------------
  |  Branch (7113:9): [True: 0, False: 1.75k]
  ------------------
 7114|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7115|      0|	nargs = 1;
 7116|      0|    }
 7117|       |
 7118|  5.27k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  1.75k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 1.75k]
  |  |  ------------------
  |  |  281|  1.75k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 1.75k]
  |  |  ------------------
  |  |  282|  1.75k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  1.75k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 2, False: 1.75k]
  |  |  ------------------
  |  |  284|  1.75k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7119|  5.27k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7119:9): [True: 0, False: 1.75k]
  ------------------
 7120|  1.75k|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7120:3): [True: 1, False: 1.75k]
  ------------------
 7121|      1|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7121:3): [True: 1, False: 0]
  ------------------
 7122|  1.75k|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7123|  1.75k|    cur = xmlXPathValuePop(ctxt);
 7124|       |
 7125|  1.75k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7125:9): [True: 0, False: 1.75k]
  |  Branch (7125:38): [True: 1, False: 1.75k]
  ------------------
 7126|      1|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7127|  1.75k|    } else {
 7128|  1.75k|	int i = 0; /* Should be first in document order !!!!! */
 7129|  1.75k|	switch (cur->nodesetval->nodeTab[i]->type) {
 7130|      1|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7130:2): [True: 1, False: 1.75k]
  ------------------
 7131|      1|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7131:2): [True: 0, False: 1.75k]
  ------------------
 7132|      1|	case XML_PI_NODE:
  ------------------
  |  Branch (7132:2): [True: 0, False: 1.75k]
  ------------------
 7133|      1|	    if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7133:10): [True: 0, False: 1]
  ------------------
 7134|      0|		xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7135|      1|	    else
 7136|      1|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7137|      1|			cur->nodesetval->nodeTab[i]->name));
 7138|      1|	    break;
 7139|      0|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (7139:2): [True: 0, False: 1.75k]
  ------------------
 7140|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7141|      0|			((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix));
 7142|      0|	    break;
 7143|  1.75k|	default:
  ------------------
  |  Branch (7143:2): [True: 1.75k, False: 1]
  ------------------
 7144|  1.75k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7145|  1.75k|	}
 7146|  1.75k|    }
 7147|  1.75k|    xmlXPathReleaseObject(ctxt->context, cur);
 7148|  1.75k|}
xmlXPathStringFunction:
 7312|  35.1k|xmlXPathStringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7313|  35.1k|    xmlXPathObjectPtr cur;
 7314|  35.1k|    xmlChar *stringval;
 7315|       |
 7316|  35.1k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7316:9): [True: 0, False: 35.1k]
  ------------------
 7317|  35.1k|    if (nargs == 0) {
  ------------------
  |  Branch (7317:9): [True: 82, False: 35.0k]
  ------------------
 7318|     82|        stringval = xmlXPathCastNodeToString(ctxt->context->node);
 7319|     82|        if (stringval == NULL)
  ------------------
  |  Branch (7319:13): [True: 1, False: 81]
  ------------------
 7320|      1|            xmlXPathPErrMemory(ctxt);
 7321|     82|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval));
 7322|     82|	return;
 7323|     82|    }
 7324|       |
 7325|   140k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  35.0k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 35.0k]
  |  |  ------------------
  |  |  281|  35.0k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 35.0k]
  |  |  ------------------
  |  |  282|  35.0k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  35.0k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 35.0k]
  |  |  ------------------
  |  |  284|  35.0k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7326|   140k|    cur = xmlXPathValuePop(ctxt);
 7327|   140k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7327:9): [True: 0, False: 35.0k]
  ------------------
 7328|  35.0k|    if (cur->type != XPATH_STRING) {
  ------------------
  |  Branch (7328:9): [True: 35.0k, False: 14]
  ------------------
 7329|  35.0k|        stringval = xmlXPathCastToString(cur);
 7330|  35.0k|        if (stringval == NULL)
  ------------------
  |  Branch (7330:13): [True: 18, False: 35.0k]
  ------------------
 7331|     18|            xmlXPathPErrMemory(ctxt);
 7332|  35.0k|        xmlXPathReleaseObject(ctxt->context, cur);
 7333|  35.0k|        cur = xmlXPathCacheWrapString(ctxt, stringval);
 7334|  35.0k|    }
 7335|  35.0k|    xmlXPathValuePush(ctxt, cur);
 7336|  35.0k|}
xmlXPathStringLengthFunction:
 7350|    120|xmlXPathStringLengthFunction(xmlXPathParserContext *ctxt, int nargs) {
 7351|    120|    xmlXPathObjectPtr cur;
 7352|       |
 7353|    120|    if (nargs == 0) {
  ------------------
  |  Branch (7353:9): [True: 12, False: 108]
  ------------------
 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|    426|    CHECK_ARITY(1);
  ------------------
  |  |  280|    108|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 108]
  |  |  ------------------
  |  |  281|    108|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 105]
  |  |  ------------------
  |  |  282|    108|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    105|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 105]
  |  |  ------------------
  |  |  284|    105|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7371|    426|    CAST_TO_STRING;
  ------------------
  |  |  290|    105|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 105, False: 0]
  |  |  |  Branch (290:34): [True: 95, False: 10]
  |  |  ------------------
  |  |  291|    105|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7372|    426|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    105|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 104]
  |  |  |  Branch (261:34): [True: 1, False: 103]
  |  |  ------------------
  |  |  262|    105|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7373|    103|    cur = xmlXPathValuePop(ctxt);
 7374|    103|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7375|    103|	xmlUTF8Strlen(cur->stringval)));
 7376|    103|    xmlXPathReleaseObject(ctxt->context, cur);
 7377|    103|}
xmlXPathConcatFunction:
 7388|    481|xmlXPathConcatFunction(xmlXPathParserContext *ctxt, int nargs) {
 7389|    481|    xmlXPathObjectPtr cur, newobj;
 7390|    481|    xmlChar *tmp;
 7391|       |
 7392|    481|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7392:9): [True: 0, False: 481]
  ------------------
 7393|    481|    if (nargs < 2) {
  ------------------
  |  Branch (7393:9): [True: 5, False: 476]
  ------------------
 7394|      5|	CHECK_ARITY(2);
  ------------------
  |  |  280|      5|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5]
  |  |  ------------------
  |  |  281|      5|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 0]
  |  |  ------------------
  |  |  282|      5|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { 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|      5|    }
 7396|       |
 7397|    476|    CAST_TO_STRING;
  ------------------
  |  |  290|    476|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 476, False: 0]
  |  |  |  Branch (290:34): [True: 398, False: 78]
  |  |  ------------------
  |  |  291|    476|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7398|    476|    cur = xmlXPathValuePop(ctxt);
 7399|    476|    if ((cur == NULL) || (cur->type != XPATH_STRING)) {
  ------------------
  |  Branch (7399:9): [True: 0, False: 476]
  |  Branch (7399:26): [True: 2, False: 474]
  ------------------
 7400|      2|	xmlXPathReleaseObject(ctxt->context, cur);
 7401|      2|	return;
 7402|      2|    }
 7403|    474|    nargs--;
 7404|       |
 7405|  1.94k|    while (nargs > 0) {
  ------------------
  |  Branch (7405:12): [True: 1.47k, False: 470]
  ------------------
 7406|  1.47k|	CAST_TO_STRING;
  ------------------
  |  |  290|  1.47k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 1.47k, False: 0]
  |  |  |  Branch (290:34): [True: 1.46k, False: 10]
  |  |  ------------------
  |  |  291|  1.47k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7407|  1.47k|	newobj = xmlXPathValuePop(ctxt);
 7408|  1.47k|	if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
  ------------------
  |  Branch (7408:6): [True: 1, False: 1.47k]
  |  Branch (7408:26): [True: 3, False: 1.46k]
  ------------------
 7409|      4|	    xmlXPathReleaseObject(ctxt->context, newobj);
 7410|      4|	    xmlXPathReleaseObject(ctxt->context, cur);
 7411|      4|	    XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7412|      0|	}
 7413|  1.46k|	tmp = xmlStrcat(newobj->stringval, cur->stringval);
 7414|  1.46k|        if (tmp == NULL)
  ------------------
  |  Branch (7414:13): [True: 3, False: 1.46k]
  ------------------
 7415|      3|            xmlXPathPErrMemory(ctxt);
 7416|  1.46k|	newobj->stringval = cur->stringval;
 7417|  1.46k|	cur->stringval = tmp;
 7418|  1.46k|	xmlXPathReleaseObject(ctxt->context, newobj);
 7419|  1.46k|	nargs--;
 7420|  1.46k|    }
 7421|    470|    xmlXPathValuePush(ctxt, cur);
 7422|    470|}
xmlXPathStartsWithFunction:
 7467|    118|xmlXPathStartsWithFunction(xmlXPathParserContext *ctxt, int nargs) {
 7468|    118|    xmlXPathObjectPtr hay, needle;
 7469|    118|    int n;
 7470|       |
 7471|    346|    CHECK_ARITY(2);
  ------------------
  |  |  280|    118|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 118]
  |  |  ------------------
  |  |  281|    118|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 114]
  |  |  ------------------
  |  |  282|    118|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    114|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 114]
  |  |  ------------------
  |  |  284|    114|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7472|    346|    CAST_TO_STRING;
  ------------------
  |  |  290|    114|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 114, False: 0]
  |  |  |  Branch (290:34): [True: 35, False: 79]
  |  |  ------------------
  |  |  291|    114|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7473|    346|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    114|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 114]
  |  |  |  Branch (261:34): [True: 1, False: 113]
  |  |  ------------------
  |  |  262|    114|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7474|    113|    needle = xmlXPathValuePop(ctxt);
 7475|    113|    CAST_TO_STRING;
  ------------------
  |  |  290|    113|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 113, False: 0]
  |  |  |  Branch (290:34): [True: 113, False: 0]
  |  |  ------------------
  |  |  291|    113|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7476|    113|    hay = xmlXPathValuePop(ctxt);
 7477|       |
 7478|    113|    if ((hay == NULL) || (hay->type != XPATH_STRING)) {
  ------------------
  |  Branch (7478:9): [True: 0, False: 113]
  |  Branch (7478:26): [True: 1, False: 112]
  ------------------
 7479|      1|	xmlXPathReleaseObject(ctxt->context, hay);
 7480|      1|	xmlXPathReleaseObject(ctxt->context, needle);
 7481|      1|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7482|      0|    }
 7483|    112|    n = xmlStrlen(needle->stringval);
 7484|    112|    if (xmlStrncmp(hay->stringval, needle->stringval, n))
  ------------------
  |  Branch (7484:9): [True: 96, False: 16]
  ------------------
 7485|     96|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7486|     16|    else
 7487|     16|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7488|    112|    xmlXPathReleaseObject(ctxt->context, hay);
 7489|    112|    xmlXPathReleaseObject(ctxt->context, needle);
 7490|    112|}
xmlXPathSubstringFunction:
 7520|  3.08k|xmlXPathSubstringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7521|  3.08k|    xmlXPathObjectPtr str, start, len;
 7522|  3.08k|    double le=0, in;
 7523|  3.08k|    int i = 1, j = INT_MAX;
 7524|       |
 7525|  3.08k|    if (nargs < 2) {
  ------------------
  |  Branch (7525:9): [True: 6, False: 3.08k]
  ------------------
 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|  3.08k|    if (nargs > 3) {
  ------------------
  |  Branch (7528:9): [True: 5, False: 3.07k]
  ------------------
 7529|      5|	CHECK_ARITY(3);
  ------------------
  |  |  280|      5|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5]
  |  |  ------------------
  |  |  281|      5|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 0]
  |  |  ------------------
  |  |  282|      5|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { 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|      5|    }
 7531|       |    /*
 7532|       |     * take care of possible last (position) argument
 7533|       |    */
 7534|  3.07k|    if (nargs == 3) {
  ------------------
  |  Branch (7534:9): [True: 1.64k, False: 1.43k]
  ------------------
 7535|  1.64k|	CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.64k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.64k, False: 0]
  |  |  |  Branch (297:34): [True: 414, False: 1.23k]
  |  |  ------------------
  |  |  298|  1.64k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7536|  1.64k|	CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.64k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 1.64k]
  |  |  |  Branch (261:34): [True: 1, False: 1.64k]
  |  |  ------------------
  |  |  262|  1.64k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7537|  1.64k|	len = xmlXPathValuePop(ctxt);
 7538|  1.64k|	le = len->floatval;
 7539|  1.64k|	xmlXPathReleaseObject(ctxt->context, len);
 7540|  1.64k|    }
 7541|       |
 7542|  3.07k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  3.07k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 3.07k, False: 0]
  |  |  |  Branch (297:34): [True: 406, False: 2.66k]
  |  |  ------------------
  |  |  298|  3.07k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7543|  3.07k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  3.07k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 3.07k]
  |  |  |  Branch (261:34): [True: 1, False: 3.07k]
  |  |  ------------------
  |  |  262|  3.07k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7544|  3.07k|    start = xmlXPathValuePop(ctxt);
 7545|  3.07k|    in = start->floatval;
 7546|  3.07k|    xmlXPathReleaseObject(ctxt->context, start);
 7547|  3.07k|    CAST_TO_STRING;
  ------------------
  |  |  290|  3.07k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 3.07k, False: 1]
  |  |  |  Branch (290:34): [True: 3.07k, False: 1]
  |  |  ------------------
  |  |  291|  3.07k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7548|  3.07k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  3.07k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 3.07k]
  |  |  |  Branch (261:34): [True: 4, False: 3.06k]
  |  |  ------------------
  |  |  262|  3.07k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7549|  3.06k|    str = xmlXPathValuePop(ctxt);
 7550|       |
 7551|  3.06k|    if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7551:9): [True: 543, False: 2.52k]
  ------------------
 7552|    543|        i = INT_MAX;
 7553|  2.52k|    } else if (in >= 1.0) {
  ------------------
  |  Branch (7553:16): [True: 1.88k, False: 637]
  ------------------
 7554|  1.88k|        i = (int)in;
 7555|  1.88k|        if (in - floor(in) >= 0.5)
  ------------------
  |  Branch (7555:13): [True: 567, False: 1.32k]
  ------------------
 7556|    567|            i += 1;
 7557|  1.88k|    }
 7558|       |
 7559|  3.06k|    if (nargs == 3) {
  ------------------
  |  Branch (7559:9): [True: 1.64k, False: 1.42k]
  ------------------
 7560|  1.64k|        double rin, rle, end;
 7561|       |
 7562|  1.64k|        rin = floor(in);
 7563|  1.64k|        if (in - rin >= 0.5)
  ------------------
  |  Branch (7563:13): [True: 442, False: 1.19k]
  ------------------
 7564|    442|            rin += 1.0;
 7565|       |
 7566|  1.64k|        rle = floor(le);
 7567|  1.64k|        if (le - rle >= 0.5)
  ------------------
  |  Branch (7567:13): [True: 681, False: 960]
  ------------------
 7568|    681|            rle += 1.0;
 7569|       |
 7570|  1.64k|        end = rin + rle;
 7571|  1.64k|        if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7571:13): [True: 658, False: 983]
  ------------------
 7572|    658|            j = 1;
 7573|    983|        } else if (end < INT_MAX) {
  ------------------
  |  Branch (7573:20): [True: 699, False: 284]
  ------------------
 7574|    699|            j = (int)end;
 7575|    699|        }
 7576|  1.64k|    }
 7577|       |
 7578|  3.06k|    i -= 1;
 7579|  3.06k|    j -= 1;
 7580|       |
 7581|  3.06k|    if ((i < j) && (i < xmlUTF8Strlen(str->stringval))) {
  ------------------
  |  Branch (7581:9): [True: 2.24k, False: 826]
  |  Branch (7581:20): [True: 1.19k, False: 1.04k]
  ------------------
 7582|  1.19k|        xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i);
 7583|  1.19k|        if (ret == NULL)
  ------------------
  |  Branch (7583:13): [True: 2, False: 1.19k]
  ------------------
 7584|      2|            xmlXPathPErrMemory(ctxt);
 7585|  1.19k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret));
 7586|  1.19k|	xmlFree(ret);
 7587|  1.87k|    } else {
 7588|  1.87k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7589|  1.87k|    }
 7590|       |
 7591|  3.06k|    xmlXPathReleaseObject(ctxt->context, str);
 7592|  3.06k|}
xmlXPathTranslateFunction:
 7762|  8.14k|xmlXPathTranslateFunction(xmlXPathParserContext *ctxt, int nargs) {
 7763|  8.14k|    xmlXPathObjectPtr str = NULL;
 7764|  8.14k|    xmlXPathObjectPtr from = NULL;
 7765|  8.14k|    xmlXPathObjectPtr to = NULL;
 7766|  8.14k|    xmlBufPtr target;
 7767|  8.14k|    int offset, max;
 7768|  8.14k|    int ch;
 7769|  8.14k|    const xmlChar *point;
 7770|  8.14k|    xmlChar *cptr, *content;
 7771|       |
 7772|  24.4k|    CHECK_ARITY(3);
  ------------------
  |  |  280|  8.14k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 8.14k]
  |  |  ------------------
  |  |  281|  8.14k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 6, False: 8.13k]
  |  |  ------------------
  |  |  282|  8.14k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  8.13k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 8.13k]
  |  |  ------------------
  |  |  284|  8.13k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7773|       |
 7774|  24.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  8.13k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 8.13k, False: 0]
  |  |  |  Branch (290:34): [True: 8.13k, False: 0]
  |  |  ------------------
  |  |  291|  8.13k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7775|  24.4k|    to = xmlXPathValuePop(ctxt);
 7776|  24.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  8.13k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 8.13k, False: 0]
  |  |  |  Branch (290:34): [True: 8.13k, False: 0]
  |  |  ------------------
  |  |  291|  8.13k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7777|  24.4k|    from = xmlXPathValuePop(ctxt);
 7778|  24.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  8.13k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 8.13k, False: 4]
  |  |  |  Branch (290:34): [True: 8.13k, False: 1]
  |  |  ------------------
  |  |  291|  8.13k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7779|  24.4k|    str = xmlXPathValuePop(ctxt);
 7780|  24.4k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7780:9): [True: 21, False: 8.11k]
  ------------------
 7781|     21|        goto error;
 7782|       |
 7783|       |    /*
 7784|       |     * Account for quadratic runtime
 7785|       |     */
 7786|  8.11k|    if (ctxt->context->opLimit != 0) {
  ------------------
  |  Branch (7786:9): [True: 8.11k, False: 0]
  ------------------
 7787|  8.11k|        unsigned long f1 = xmlStrlen(from->stringval);
 7788|  8.11k|        unsigned long f2 = xmlStrlen(str->stringval);
 7789|       |
 7790|  8.11k|        if ((f1 > 0) && (f2 > 0)) {
  ------------------
  |  Branch (7790:13): [True: 7.42k, False: 691]
  |  Branch (7790:25): [True: 7.15k, False: 272]
  ------------------
 7791|  7.15k|            unsigned long p;
 7792|       |
 7793|  7.15k|            f1 = f1 / 10 + 1;
 7794|  7.15k|            f2 = f2 / 10 + 1;
 7795|  7.15k|            p = f1 > ULONG_MAX / f2 ? ULONG_MAX : f1 * f2;
  ------------------
  |  Branch (7795:17): [True: 0, False: 7.15k]
  ------------------
 7796|  7.15k|            if (xmlXPathCheckOpLimit(ctxt, p) < 0)
  ------------------
  |  Branch (7796:17): [True: 3, False: 7.15k]
  ------------------
 7797|      3|                goto error;
 7798|  7.15k|        }
 7799|  8.11k|    }
 7800|       |
 7801|  8.11k|    target = xmlBufCreate(50);
 7802|  8.11k|    if (target == NULL) {
  ------------------
  |  Branch (7802:9): [True: 11, False: 8.10k]
  ------------------
 7803|     11|        xmlXPathPErrMemory(ctxt);
 7804|     11|        goto error;
 7805|     11|    }
 7806|       |
 7807|  8.10k|    max = xmlUTF8Strlen(to->stringval);
 7808|  95.3k|    for (cptr = str->stringval; (ch=*cptr); ) {
  ------------------
  |  Branch (7808:33): [True: 87.2k, False: 8.10k]
  ------------------
 7809|  87.2k|        offset = xmlUTF8Strloc(from->stringval, cptr);
 7810|  87.2k|        if (offset >= 0) {
  ------------------
  |  Branch (7810:13): [True: 28.5k, False: 58.6k]
  ------------------
 7811|  28.5k|            if (offset < max) {
  ------------------
  |  Branch (7811:17): [True: 24.1k, False: 4.44k]
  ------------------
 7812|  24.1k|                point = xmlUTF8Strpos(to->stringval, offset);
 7813|  24.1k|                if (point)
  ------------------
  |  Branch (7813:21): [True: 24.1k, False: 0]
  ------------------
 7814|  24.1k|                    xmlBufAdd(target, point, xmlUTF8Strsize(point, 1));
 7815|  24.1k|            }
 7816|  28.5k|        } else
 7817|  58.6k|            xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1));
 7818|       |
 7819|       |        /* Step to next character in input */
 7820|  87.2k|        cptr++;
 7821|  87.2k|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (7821:14): [True: 0, False: 87.2k]
  ------------------
 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|  87.2k|    }
 7837|       |
 7838|  8.10k|    content = xmlBufDetach(target);
 7839|  8.10k|    if (content == NULL)
  ------------------
  |  Branch (7839:9): [True: 0, False: 8.10k]
  ------------------
 7840|      0|        xmlXPathPErrMemory(ctxt);
 7841|  8.10k|    else
 7842|  8.10k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
 7843|  8.10k|    xmlBufFree(target);
 7844|  8.13k|error:
 7845|  8.13k|    xmlXPathReleaseObject(ctxt->context, str);
 7846|  8.13k|    xmlXPathReleaseObject(ctxt->context, from);
 7847|  8.13k|    xmlXPathReleaseObject(ctxt->context, to);
 7848|  8.13k|}
xmlXPathBooleanFunction:
 7863|  11.5k|xmlXPathBooleanFunction(xmlXPathParserContext *ctxt, int nargs) {
 7864|  11.5k|    xmlXPathObjectPtr cur;
 7865|       |
 7866|  34.6k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  11.5k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 11.5k]
  |  |  ------------------
  |  |  281|  11.5k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 11.5k]
  |  |  ------------------
  |  |  282|  11.5k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  11.5k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 11.5k]
  |  |  ------------------
  |  |  284|  11.5k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7867|  34.6k|    cur = xmlXPathValuePop(ctxt);
 7868|  34.6k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7868:9): [True: 0, False: 11.5k]
  ------------------
 7869|  11.5k|    if (cur->type != XPATH_BOOLEAN) {
  ------------------
  |  Branch (7869:9): [True: 9.91k, False: 1.63k]
  ------------------
 7870|  9.91k|        int boolval = xmlXPathCastToBoolean(cur);
 7871|       |
 7872|  9.91k|        xmlXPathReleaseObject(ctxt->context, cur);
 7873|  9.91k|        cur = xmlXPathCacheNewBoolean(ctxt, boolval);
 7874|  9.91k|    }
 7875|  11.5k|    xmlXPathValuePush(ctxt, cur);
 7876|  11.5k|}
xmlXPathNotFunction:
 7888|      8|xmlXPathNotFunction(xmlXPathParserContext *ctxt, int nargs) {
 7889|     22|    CHECK_ARITY(1);
  ------------------
  |  |  280|      8|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 8]
  |  |  ------------------
  |  |  281|      8|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 7]
  |  |  ------------------
  |  |  282|      8|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      7|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 7]
  |  |  ------------------
  |  |  284|      7|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7890|     22|    CAST_TO_BOOLEAN;
  ------------------
  |  |  304|      7|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN))	\
  |  |  ------------------
  |  |  |  Branch (304:9): [True: 7, False: 0]
  |  |  |  Branch (304:34): [True: 4, False: 3]
  |  |  ------------------
  |  |  305|      7|        xmlXPathBooleanFunction(ctxt, 1);
  ------------------
 7891|     22|    CHECK_TYPE(XPATH_BOOLEAN);
  ------------------
  |  |  261|      7|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 7]
  |  |  |  Branch (261:34): [True: 1, False: 6]
  |  |  ------------------
  |  |  262|      7|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7892|      6|    ctxt->value->boolval = ! ctxt->value->boolval;
 7893|      6|}
xmlXPathTrueFunction:
 7903|     17|xmlXPathTrueFunction(xmlXPathParserContext *ctxt, int nargs) {
 7904|     45|    CHECK_ARITY(0);
  ------------------
  |  |  280|     17|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 17]
  |  |  ------------------
  |  |  281|     17|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 14]
  |  |  ------------------
  |  |  282|     17|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     14|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 14]
  |  |  ------------------
  |  |  284|     14|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7905|     45|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7906|     45|}
xmlXPathFalseFunction:
 7916|     21|xmlXPathFalseFunction(xmlXPathParserContext *ctxt, int nargs) {
 7917|     61|    CHECK_ARITY(0);
  ------------------
  |  |  280|     21|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 21]
  |  |  ------------------
  |  |  281|     21|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 20]
  |  |  ------------------
  |  |  282|     21|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     20|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 20]
  |  |  ------------------
  |  |  284|     20|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7918|     61|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7919|     61|}
xmlXPathLangFunction:
 7942|  5.40k|xmlXPathLangFunction(xmlXPathParserContext *ctxt, int nargs) {
 7943|  5.40k|    xmlXPathObjectPtr val;
 7944|  5.40k|    xmlNodePtr cur;
 7945|  5.40k|    xmlChar *theLang = NULL;
 7946|  5.40k|    const xmlChar *lang;
 7947|  5.40k|    int ret = 0;
 7948|  5.40k|    int i;
 7949|       |
 7950|  16.1k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  5.40k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.40k]
  |  |  ------------------
  |  |  281|  5.40k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 5.39k]
  |  |  ------------------
  |  |  282|  5.40k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.39k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 5.39k]
  |  |  ------------------
  |  |  284|  5.39k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7951|  16.1k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.39k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.39k, False: 0]
  |  |  |  Branch (290:34): [True: 5.39k, False: 5]
  |  |  ------------------
  |  |  291|  5.39k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7952|  16.1k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  5.39k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 5.39k]
  |  |  |  Branch (261:34): [True: 1, False: 5.39k]
  |  |  ------------------
  |  |  262|  5.39k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7953|  5.39k|    val = xmlXPathValuePop(ctxt);
 7954|  5.39k|    lang = val->stringval;
 7955|  5.39k|    cur = ctxt->context->node;
 7956|  51.5k|    while (cur != NULL) {
  ------------------
  |  Branch (7956:12): [True: 46.1k, False: 5.39k]
  ------------------
 7957|  46.1k|        if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  46.1k|#define BAD_CAST (xmlChar *)
  ------------------
                      if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  46.1k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (7957:13): [True: 0, False: 46.1k]
  ------------------
 7958|  46.1k|                                &theLang) < 0)
 7959|      0|            xmlXPathPErrMemory(ctxt);
 7960|  46.1k|        if (theLang != NULL)
  ------------------
  |  Branch (7960:13): [True: 0, False: 46.1k]
  ------------------
 7961|      0|            break;
 7962|  46.1k|        cur = cur->parent;
 7963|  46.1k|    }
 7964|  5.39k|    if ((theLang != NULL) && (lang != NULL)) {
  ------------------
  |  Branch (7964:9): [True: 0, False: 5.39k]
  |  Branch (7964:30): [True: 0, False: 0]
  ------------------
 7965|      0|        for (i = 0;lang[i] != 0;i++)
  ------------------
  |  Branch (7965:20): [True: 0, False: 0]
  ------------------
 7966|      0|            if (toupper(lang[i]) != toupper(theLang[i]))
  ------------------
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:17): [Folded, False: 0]
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:37): [True: 0, False: 0]
  |  Branch (7966:37): [True: 0, False: 0]
  |  Branch (7966:37): [Folded, False: 0]
  ------------------
 7967|      0|                goto not_equal;
 7968|      0|        if ((theLang[i] == 0) || (theLang[i] == '-'))
  ------------------
  |  Branch (7968:13): [True: 0, False: 0]
  |  Branch (7968:34): [True: 0, False: 0]
  ------------------
 7969|      0|            ret = 1;
 7970|      0|    }
 7971|  5.39k|not_equal:
 7972|  5.39k|    if (theLang != NULL)
  ------------------
  |  Branch (7972:9): [True: 0, False: 5.39k]
  ------------------
 7973|      0|	xmlFree((void *)theLang);
 7974|       |
 7975|  5.39k|    xmlXPathReleaseObject(ctxt->context, val);
 7976|  5.39k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
 7977|  5.39k|}
xmlXPathNumberFunction:
 7987|   319k|xmlXPathNumberFunction(xmlXPathParserContext *ctxt, int nargs) {
 7988|   319k|    xmlXPathObjectPtr cur;
 7989|   319k|    double res;
 7990|       |
 7991|   319k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7991:9): [True: 0, False: 319k]
  ------------------
 7992|   319k|    if (nargs == 0) {
  ------------------
  |  Branch (7992:9): [True: 0, False: 319k]
  ------------------
 7993|      0|	if (ctxt->context->node == NULL) {
  ------------------
  |  Branch (7993:6): [True: 0, False: 0]
  ------------------
 7994|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 7995|      0|	} else {
 7996|      0|	    xmlChar* content = xmlNodeGetContent(ctxt->context->node);
 7997|      0|            if (content == NULL)
  ------------------
  |  Branch (7997:17): [True: 0, False: 0]
  ------------------
 7998|      0|                xmlXPathPErrMemory(ctxt);
 7999|       |
 8000|      0|	    res = xmlXPathStringEvalNumber(content);
 8001|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8002|      0|	    xmlFree(content);
 8003|      0|	}
 8004|      0|	return;
 8005|      0|    }
 8006|       |
 8007|  1.27M|    CHECK_ARITY(1);
  ------------------
  |  |  280|   319k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 319k]
  |  |  ------------------
  |  |  281|   319k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 319k]
  |  |  ------------------
  |  |  282|   319k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|   319k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 9, False: 319k]
  |  |  ------------------
  |  |  284|   319k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8008|  1.27M|    cur = xmlXPathValuePop(ctxt);
 8009|  1.27M|    if (cur->type != XPATH_NUMBER) {
  ------------------
  |  Branch (8009:9): [True: 319k, False: 4]
  ------------------
 8010|   319k|        double floatval;
 8011|       |
 8012|   319k|        floatval = xmlXPathCastToNumberInternal(ctxt, cur);
 8013|   319k|        xmlXPathReleaseObject(ctxt->context, cur);
 8014|   319k|        cur = xmlXPathCacheNewFloat(ctxt, floatval);
 8015|   319k|    }
 8016|  1.27M|    xmlXPathValuePush(ctxt, cur);
 8017|  1.27M|}
xmlXPathSumFunction:
 8029|     33|xmlXPathSumFunction(xmlXPathParserContext *ctxt, int nargs) {
 8030|     33|    xmlXPathObjectPtr cur;
 8031|     33|    int i;
 8032|     33|    double res = 0.0;
 8033|       |
 8034|     93|    CHECK_ARITY(1);
  ------------------
  |  |  280|     33|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 33]
  |  |  ------------------
  |  |  281|     33|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 30]
  |  |  ------------------
  |  |  282|     33|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     30|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 30]
  |  |  ------------------
  |  |  284|     30|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8035|     93|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (8035:9): [True: 0, False: 30]
  ------------------
 8036|     30|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (8036:3): [True: 3, False: 27]
  ------------------
 8037|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (8037:3): [True: 3, False: 0]
  ------------------
 8038|     27|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8039|     27|    cur = xmlXPathValuePop(ctxt);
 8040|       |
 8041|     27|    if ((cur->nodesetval != NULL) && (cur->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (8041:9): [True: 27, False: 0]
  |  Branch (8041:38): [True: 9, False: 18]
  ------------------
 8042|     33|	for (i = 0; i < cur->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (8042:14): [True: 24, False: 9]
  ------------------
 8043|     24|	    res += xmlXPathNodeToNumberInternal(ctxt,
 8044|     24|                                                cur->nodesetval->nodeTab[i]);
 8045|     24|	}
 8046|      9|    }
 8047|     27|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8048|     27|    xmlXPathReleaseObject(ctxt->context, cur);
 8049|     27|}
xmlXPathFloorFunction:
 8061|     37|xmlXPathFloorFunction(xmlXPathParserContext *ctxt, int nargs) {
 8062|    103|    CHECK_ARITY(1);
  ------------------
  |  |  280|     37|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 37]
  |  |  ------------------
  |  |  281|     37|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 33]
  |  |  ------------------
  |  |  282|     37|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     33|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 33]
  |  |  ------------------
  |  |  284|     33|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8063|    103|    CAST_TO_NUMBER;
  ------------------
  |  |  297|     33|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 33, False: 0]
  |  |  |  Branch (297:34): [True: 18, False: 15]
  |  |  ------------------
  |  |  298|     33|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 8064|    103|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|     33|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 33]
  |  |  |  Branch (261:34): [True: 1, False: 32]
  |  |  ------------------
  |  |  262|     33|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8065|       |
 8066|     32|    ctxt->value->floatval = floor(ctxt->value->floatval);
 8067|     32|}
xmlXPathParseNCName:
 8147|  94.5k|xmlXPathParseNCName(xmlXPathParserContext *ctxt) {
 8148|  94.5k|    const xmlChar *end;
 8149|  94.5k|    xmlChar *ret;
 8150|       |
 8151|  94.5k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8151:9): [True: 0, False: 94.5k]
  |  Branch (8151:27): [True: 0, False: 94.5k]
  ------------------
 8152|       |
 8153|  94.5k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|  94.5k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|  94.5k|#define XML_SCAN_NC         1
  ------------------
 8154|  94.5k|    if (end == NULL) {
  ------------------
  |  Branch (8154:9): [True: 1, False: 94.5k]
  ------------------
 8155|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8156|      0|    }
 8157|  94.5k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8157:9): [True: 4.42k, False: 90.0k]
  ------------------
 8158|  4.42k|        return(NULL);
 8159|       |
 8160|  90.0k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8161|  90.0k|    if (ret == NULL)
  ------------------
  |  Branch (8161:9): [True: 65, False: 90.0k]
  ------------------
 8162|     65|        xmlXPathPErrMemory(ctxt);
 8163|  90.0k|    ctxt->cur = end;
 8164|  90.0k|    return(ret);
 8165|  94.5k|}
xmlXPathParseName:
 8199|  14.8k|xmlXPathParseName(xmlXPathParserContext *ctxt) {
 8200|  14.8k|    const xmlChar *end;
 8201|  14.8k|    xmlChar *ret;
 8202|       |
 8203|  14.8k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8203:9): [True: 0, False: 14.8k]
  |  Branch (8203:27): [True: 0, False: 14.8k]
  ------------------
 8204|       |
 8205|  14.8k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  14.8k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8206|  14.8k|    if (end == NULL) {
  ------------------
  |  Branch (8206:9): [True: 1, False: 14.8k]
  ------------------
 8207|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8208|      0|    }
 8209|  14.8k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8209:9): [True: 2.63k, False: 12.1k]
  ------------------
 8210|  2.63k|        return(NULL);
 8211|       |
 8212|  12.1k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8213|  12.1k|    if (ret == NULL)
  ------------------
  |  Branch (8213:9): [True: 38, False: 12.1k]
  ------------------
 8214|     38|        xmlXPathPErrMemory(ctxt);
 8215|  12.1k|    ctxt->cur = end;
 8216|  12.1k|    return(ret);
 8217|  14.8k|}
xmlXPathStringEvalNumber:
 8236|   614k|xmlXPathStringEvalNumber(const xmlChar *str) {
 8237|   614k|    const xmlChar *cur = str;
 8238|   614k|    double ret;
 8239|   614k|    int ok = 0;
 8240|   614k|    int isneg = 0;
 8241|   614k|    int exponent = 0;
 8242|   614k|    int is_exponent_negative = 0;
 8243|   614k|#ifdef __GNUC__
 8244|   614k|    unsigned long tmp = 0;
 8245|   614k|    double temp;
 8246|   614k|#endif
 8247|   614k|    if (cur == NULL) return(0);
  ------------------
  |  Branch (8247:9): [True: 0, False: 614k]
  ------------------
 8248|   614k|    while (IS_BLANK_CH(*cur)) cur++;
 8249|   614k|    if (*cur == '-') {
  ------------------
  |  Branch (8249:9): [True: 73.7k, False: 540k]
  ------------------
 8250|  73.7k|	isneg = 1;
 8251|  73.7k|	cur++;
 8252|  73.7k|    }
 8253|   614k|    if ((*cur != '.') && ((*cur < '0') || (*cur > '9'))) {
  ------------------
  |  Branch (8253:9): [True: 537k, False: 76.5k]
  |  Branch (8253:27): [True: 470k, False: 67.5k]
  |  Branch (8253:43): [True: 44.6k, False: 22.9k]
  ------------------
 8254|   514k|        return(xmlXPathNAN);
 8255|   514k|    }
 8256|       |
 8257|  99.4k|#ifdef __GNUC__
 8258|       |    /*
 8259|       |     * tmp/temp is a workaround against a gcc compiler bug
 8260|       |     * http://veillard.com/gcc.bug
 8261|       |     */
 8262|  99.4k|    ret = 0;
 8263|   198k|    while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8263:12): [True: 103k, False: 94.7k]
  |  Branch (8263:29): [True: 99.2k, False: 4.76k]
  ------------------
 8264|  99.2k|	ret = ret * 10;
 8265|  99.2k|	tmp = (*cur - '0');
 8266|  99.2k|	ok = 1;
 8267|  99.2k|	cur++;
 8268|  99.2k|	temp = (double) tmp;
 8269|  99.2k|	ret = ret + temp;
 8270|  99.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|  99.4k|    if (*cur == '.') {
  ------------------
  |  Branch (8280:9): [True: 80.1k, False: 19.3k]
  ------------------
 8281|  80.1k|	int v, frac = 0, max;
 8282|  80.1k|	double fraction = 0;
 8283|       |
 8284|  80.1k|        cur++;
 8285|  80.1k|	if (((*cur < '0') || (*cur > '9')) && (!ok)) {
  ------------------
  |  Branch (8285:7): [True: 6.92k, False: 73.2k]
  |  Branch (8285:23): [True: 9.98k, False: 63.2k]
  |  Branch (8285:40): [True: 16.5k, False: 360]
  ------------------
 8286|  16.5k|	    return(xmlXPathNAN);
 8287|  16.5k|	}
 8288|   100k|        while (*cur == '0') {
  ------------------
  |  Branch (8288:16): [True: 36.4k, False: 63.5k]
  ------------------
 8289|  36.4k|	    frac = frac + 1;
 8290|  36.4k|	    cur++;
 8291|  36.4k|        }
 8292|  63.5k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  63.5k|#define MAX_FRAC 20
  ------------------
 8293|   167k|	while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) {
  ------------------
  |  Branch (8293:10): [True: 138k, False: 28.8k]
  |  Branch (8293:27): [True: 104k, False: 34.5k]
  |  Branch (8293:45): [True: 103k, False: 224]
  ------------------
 8294|   103k|	    v = (*cur - '0');
 8295|   103k|	    fraction = fraction * 10 + v;
 8296|   103k|	    frac = frac + 1;
 8297|   103k|	    cur++;
 8298|   103k|	}
 8299|  63.5k|	fraction /= pow(10.0, frac);
 8300|  63.5k|	ret = ret + fraction;
 8301|  71.1k|	while ((*cur >= '0') && (*cur <= '9'))
  ------------------
  |  Branch (8301:9): [True: 42.3k, False: 28.8k]
  |  Branch (8301:26): [True: 7.59k, False: 34.7k]
  ------------------
 8302|  7.59k|	    cur++;
 8303|  63.5k|    }
 8304|  82.9k|    if ((*cur == 'e') || (*cur == 'E')) {
  ------------------
  |  Branch (8304:9): [True: 3.26k, False: 79.6k]
  |  Branch (8304:26): [True: 17.6k, False: 61.9k]
  ------------------
 8305|  20.9k|      cur++;
 8306|  20.9k|      if (*cur == '-') {
  ------------------
  |  Branch (8306:11): [True: 9.54k, False: 11.4k]
  ------------------
 8307|  9.54k|	is_exponent_negative = 1;
 8308|  9.54k|	cur++;
 8309|  11.4k|      } else if (*cur == '+') {
  ------------------
  |  Branch (8309:18): [True: 4.55k, False: 6.85k]
  ------------------
 8310|  4.55k|        cur++;
 8311|  4.55k|      }
 8312|   105k|      while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8312:14): [True: 86.9k, False: 18.9k]
  |  Branch (8312:31): [True: 84.8k, False: 2.03k]
  ------------------
 8313|  84.8k|        if (exponent < 1000000)
  ------------------
  |  Branch (8313:13): [True: 83.5k, False: 1.31k]
  ------------------
 8314|  83.5k|	  exponent = exponent * 10 + (*cur - '0');
 8315|  84.8k|	cur++;
 8316|  84.8k|      }
 8317|  20.9k|    }
 8318|  84.5k|    while (IS_BLANK_CH(*cur)) cur++;
 8319|  82.9k|    if (*cur != 0) return(xmlXPathNAN);
  ------------------
  |  Branch (8319:9): [True: 42.3k, False: 40.6k]
  ------------------
 8320|  40.6k|    if (isneg) ret = -ret;
  ------------------
  |  Branch (8320:9): [True: 27.9k, False: 12.7k]
  ------------------
 8321|  40.6k|    if (is_exponent_negative) exponent = -exponent;
  ------------------
  |  Branch (8321:9): [True: 9.45k, False: 31.1k]
  ------------------
 8322|  40.6k|    ret *= pow(10.0, (double)exponent);
 8323|  40.6k|    return(ret);
 8324|  82.9k|}
xmlXPathIsNodeType:
 8548|  11.7k|xmlXPathIsNodeType(const xmlChar *name) {
 8549|  11.7k|    if (name == NULL)
  ------------------
  |  Branch (8549:9): [True: 0, False: 11.7k]
  ------------------
 8550|      0|	return(0);
 8551|       |
 8552|  11.7k|    if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|  11.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8552:9): [True: 36, False: 11.7k]
  ------------------
 8553|     36|	return(1);
 8554|  11.7k|    if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|  11.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8554:9): [True: 43, False: 11.6k]
  ------------------
 8555|     43|	return(1);
 8556|  11.6k|    if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|  11.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8556:9): [True: 16, False: 11.6k]
  ------------------
 8557|     16|	return(1);
 8558|  11.6k|    if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|  11.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8558:9): [True: 132, False: 11.5k]
  ------------------
 8559|    132|	return(1);
 8560|  11.5k|    return(0);
 8561|  11.6k|}
xmlXPathEvaluatePredicateResult:
11626|   240k|                                xmlXPathObject *res) {
11627|   240k|    if ((ctxt == NULL) || (res == NULL)) return(0);
  ------------------
  |  Branch (11627:9): [True: 0, False: 240k]
  |  Branch (11627:27): [True: 0, False: 240k]
  ------------------
11628|   240k|    switch (res->type) {
11629|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (11629:9): [True: 0, False: 240k]
  ------------------
11630|      0|	    return(res->boolval);
11631|  61.7k|        case XPATH_NUMBER:
  ------------------
  |  Branch (11631:9): [True: 61.7k, False: 178k]
  ------------------
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|  61.7k|	    return(res->floatval == ctxt->context->proximityPosition);
11637|      0|#endif
11638|   172k|        case XPATH_NODESET:
  ------------------
  |  Branch (11638:9): [True: 172k, False: 68.1k]
  ------------------
11639|   172k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (11639:9): [True: 0, False: 240k]
  ------------------
11640|   172k|	    if (res->nodesetval == NULL)
  ------------------
  |  Branch (11640:10): [True: 0, False: 172k]
  ------------------
11641|      0|		return(0);
11642|   172k|	    return(res->nodesetval->nodeNr != 0);
11643|  6.40k|        case XPATH_STRING:
  ------------------
  |  Branch (11643:9): [True: 6.40k, False: 234k]
  ------------------
11644|  6.40k|	    return((res->stringval != NULL) && (res->stringval[0] != 0));
  ------------------
  |  Branch (11644:13): [True: 6.40k, False: 0]
  |  Branch (11644:41): [True: 5.24k, False: 1.16k]
  ------------------
11645|      0|        default:
  ------------------
  |  Branch (11645:9): [True: 0, False: 240k]
  ------------------
11646|      0|	    break;
11647|   240k|    }
11648|      0|    return(0);
11649|   240k|}
xmlXPathEvalExpr:
12002|  9.24k|xmlXPathEvalExpr(xmlXPathParserContext *ctxt) {
12003|       |#ifdef XPATH_STREAMING
12004|       |    xmlXPathCompExprPtr comp;
12005|       |#endif
12006|  9.24k|    int oldDepth = 0;
12007|       |
12008|  9.24k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (12008:9): [True: 0, False: 9.24k]
  |  Branch (12008:27): [True: 0, False: 9.24k]
  ------------------
12009|      0|        return;
12010|  9.24k|    if (ctxt->context->lastError.code != 0)
  ------------------
  |  Branch (12010:9): [True: 68, False: 9.17k]
  ------------------
12011|     68|        return;
12012|       |
12013|       |#ifdef XPATH_STREAMING
12014|       |    comp = xmlXPathTryStreamCompile(ctxt->context, ctxt->base);
12015|       |    if ((comp == NULL) &&
12016|       |        (ctxt->context->lastError.code == XML_ERR_NO_MEMORY)) {
12017|       |        xmlXPathPErrMemory(ctxt);
12018|       |        return;
12019|       |    }
12020|       |    if (comp != NULL) {
12021|       |        if (ctxt->comp != NULL)
12022|       |	    xmlXPathFreeCompExpr(ctxt->comp);
12023|       |        ctxt->comp = comp;
12024|       |    } else
12025|       |#endif
12026|  9.17k|    {
12027|  9.17k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12027:13): [True: 9.17k, False: 0]
  ------------------
12028|  9.17k|            oldDepth = ctxt->context->depth;
12029|  9.17k|	xmlXPathCompileExpr(ctxt, 1);
12030|  9.17k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12030:13): [True: 9.17k, False: 0]
  ------------------
12031|  9.17k|            ctxt->context->depth = oldDepth;
12032|  9.17k|        CHECK_ERROR;
  ------------------
  |  |  230|  9.17k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.81k, False: 7.35k]
  |  |  ------------------
  ------------------
12033|       |
12034|       |        /* Check for trailing characters. */
12035|  7.35k|        if (*ctxt->cur != 0)
  ------------------
  |  Branch (12035:13): [True: 348, False: 7.01k]
  ------------------
12036|  7.01k|            XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    348|    { xmlXPathErr(ctxt, X); return; }
  ------------------
12037|       |
12038|  7.01k|	if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) {
  ------------------
  |  Branch (12038:6): [True: 6.98k, False: 30]
  |  Branch (12038:34): [True: 6.98k, False: 0]
  ------------------
12039|  6.98k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12039:17): [True: 6.98k, False: 0]
  ------------------
12040|  6.98k|                oldDepth = ctxt->context->depth;
12041|  6.98k|	    xmlXPathOptimizeExpression(ctxt,
12042|  6.98k|		&ctxt->comp->steps[ctxt->comp->last]);
12043|  6.98k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12043:17): [True: 6.98k, False: 0]
  ------------------
12044|  6.98k|                ctxt->context->depth = oldDepth;
12045|  6.98k|        }
12046|  7.01k|    }
12047|       |
12048|      0|    xmlXPathRunEval(ctxt, 0);
12049|  7.01k|}
xpath.c:xmlXPathNameFunction:
 7223|  5.61k|{
 7224|  5.61k|    xmlXPathObjectPtr cur;
 7225|       |
 7226|  5.61k|    if (nargs == 0) {
  ------------------
  |  Branch (7226:9): [True: 2.95k, False: 2.66k]
  ------------------
 7227|  2.95k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7228|  2.95k|        nargs = 1;
 7229|  2.95k|    }
 7230|       |
 7231|  16.8k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  5.61k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.61k]
  |  |  ------------------
  |  |  281|  5.61k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 5.61k]
  |  |  ------------------
  |  |  282|  5.61k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.61k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 1, False: 5.61k]
  |  |  ------------------
  |  |  284|  5.61k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7232|  16.8k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7232:9): [True: 0, False: 5.61k]
  ------------------
 7233|  5.61k|        ((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7233:10): [True: 2, False: 5.61k]
  ------------------
 7234|      2|         (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7234:10): [True: 2, False: 0]
  ------------------
 7235|  5.61k|        XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7236|  5.61k|    cur = xmlXPathValuePop(ctxt);
 7237|       |
 7238|  5.61k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7238:9): [True: 0, False: 5.61k]
  |  Branch (7238:38): [True: 1.71k, False: 3.89k]
  ------------------
 7239|  1.71k|        xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7240|  3.89k|    } else {
 7241|  3.89k|        int i = 0;              /* Should be first in document order !!!!! */
 7242|       |
 7243|  3.89k|        switch (cur->nodesetval->nodeTab[i]->type) {
 7244|  2.13k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7244:13): [True: 2.13k, False: 1.75k]
  ------------------
 7245|  2.13k|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7245:13): [True: 0, False: 3.89k]
  ------------------
 7246|  2.13k|		if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7246:7): [True: 0, False: 2.13k]
  ------------------
 7247|      0|		    xmlXPathValuePush(ctxt,
 7248|      0|			xmlXPathCacheNewCString(ctxt, ""));
 7249|  2.13k|		else if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
  ------------------
  |  Branch (7249:12): [True: 1.66k, False: 476]
  ------------------
 7250|  2.11k|                         (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) {
  ------------------
  |  Branch (7250:26): [True: 448, False: 28]
  ------------------
 7251|  2.11k|		    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7252|  2.11k|			    cur->nodesetval->nodeTab[i]->name));
 7253|  2.11k|		} else {
 7254|     28|		    xmlChar *fullname;
 7255|       |
 7256|     28|		    fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
 7257|     28|				     cur->nodesetval->nodeTab[i]->ns->prefix,
 7258|     28|				     NULL, 0);
 7259|     28|		    if (fullname == cur->nodesetval->nodeTab[i]->name)
  ------------------
  |  Branch (7259:11): [True: 0, False: 28]
  ------------------
 7260|      0|			fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
 7261|     28|		    if (fullname == NULL)
  ------------------
  |  Branch (7261:11): [True: 1, False: 27]
  ------------------
 7262|      1|                        xmlXPathPErrMemory(ctxt);
 7263|     28|		    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname));
 7264|     28|                }
 7265|  2.13k|                break;
 7266|  1.75k|            default:
  ------------------
  |  Branch (7266:13): [True: 1.75k, False: 2.13k]
  ------------------
 7267|  1.75k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 7268|  1.75k|		    cur->nodesetval->nodeTab[i]));
 7269|  1.75k|                xmlXPathLocalNameFunction(ctxt, 1);
 7270|  3.89k|        }
 7271|  3.89k|    }
 7272|  5.61k|    xmlXPathReleaseObject(ctxt->context, cur);
 7273|  5.61k|}
xpath.c:xmlXPathSFComputeHash:
  186|  5.92k|xmlXPathSFComputeHash(const xmlChar *name) {
  187|  5.92k|    unsigned hashValue = 5381;
  188|  5.92k|    const xmlChar *ptr;
  189|       |
  190|  36.3k|    for (ptr = name; *ptr; ptr++)
  ------------------
  |  Branch (190:22): [True: 30.3k, False: 5.92k]
  ------------------
  191|  30.3k|        hashValue = hashValue * 33 + *ptr;
  192|       |
  193|  5.92k|    return(hashValue);
  194|  5.92k|}
xpath.c:wrap_cmp:
  606|  3.26M|    {
  607|  3.26M|        int res = xmlXPathCmpNodesExt(x, y);
  608|  3.26M|        return res == -2 ? res : -res;
  ------------------
  |  Branch (608:16): [True: 0, False: 3.26M]
  ------------------
  609|  3.26M|    }
xpath.c:xmlXPathCmpNodesExt:
  309|  3.26M|xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
  310|  3.26M|    int depth1, depth2;
  311|  3.26M|    int misc = 0, precedence1 = 0, precedence2 = 0;
  312|  3.26M|    xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
  313|  3.26M|    xmlNodePtr cur, root;
  314|  3.26M|    XML_INTPTR_T l1, l2;
  ------------------
  |  |   52|  3.26M|  #define XML_INTPTR_T intptr_t
  ------------------
  315|       |
  316|  3.26M|    if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (316:9): [True: 0, False: 3.26M]
  |  Branch (316:28): [True: 0, False: 3.26M]
  ------------------
  317|      0|	return(-2);
  318|       |
  319|  3.26M|    if (node1 == node2)
  ------------------
  |  Branch (319:9): [True: 0, False: 3.26M]
  ------------------
  320|      0|	return(0);
  321|       |
  322|       |    /*
  323|       |     * a couple of optimizations which will avoid computations in most cases
  324|       |     */
  325|  3.26M|    switch (node1->type) {
  326|  2.60M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (326:2): [True: 2.60M, False: 666k]
  ------------------
  327|  2.60M|	    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (327:10): [True: 2.08M, False: 521k]
  ------------------
  328|  2.08M|		if ((0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  2.08M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  2.08M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 0, False: 2.08M]
  ------------------
  329|      0|		    (0 > XML_NODE_SORT_VALUE(node2)) &&
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (329:7): [True: 0, False: 0]
  ------------------
  330|      0|		    (node1->doc == node2->doc))
  ------------------
  |  Branch (330:7): [True: 0, False: 0]
  ------------------
  331|      0|		{
  332|      0|		    l1 = -XML_NODE_SORT_VALUE(node1);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  333|      0|		    l2 = -XML_NODE_SORT_VALUE(node2);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  334|      0|		    if (l1 < l2)
  ------------------
  |  Branch (334:11): [True: 0, False: 0]
  ------------------
  335|      0|			return(1);
  336|      0|		    if (l1 > l2)
  ------------------
  |  Branch (336:11): [True: 0, False: 0]
  ------------------
  337|      0|			return(-1);
  338|      0|		} else
  339|  2.08M|		    goto turtle_comparison;
  340|  2.08M|	    }
  341|   521k|	    break;
  342|   521k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (342:2): [True: 6.98k, False: 3.26M]
  ------------------
  343|  6.98k|	    precedence1 = 1; /* element is owner */
  344|  6.98k|	    miscNode1 = node1;
  345|  6.98k|	    node1 = node1->parent;
  346|  6.98k|	    misc = 1;
  347|  6.98k|	    break;
  348|   561k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (348:2): [True: 561k, False: 2.70M]
  ------------------
  349|   574k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (349:2): [True: 12.5k, False: 3.25M]
  ------------------
  350|   576k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (350:2): [True: 2.59k, False: 3.26M]
  ------------------
  351|   601k|	case XML_PI_NODE: {
  ------------------
  |  Branch (351:2): [True: 24.5k, False: 3.24M]
  ------------------
  352|   601k|	    miscNode1 = node1;
  353|       |	    /*
  354|       |	    * Find nearest element node.
  355|       |	    */
  356|   601k|	    if (node1->prev != NULL) {
  ------------------
  |  Branch (356:10): [True: 194k, False: 406k]
  ------------------
  357|  2.47M|		do {
  358|  2.47M|		    node1 = node1->prev;
  359|  2.47M|		    if (node1->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (359:11): [True: 189k, False: 2.28M]
  ------------------
  360|   189k|			precedence1 = 3; /* element in prev-sibl axis */
  361|   189k|			break;
  362|   189k|		    }
  363|  2.28M|		    if (node1->prev == NULL) {
  ------------------
  |  Branch (363:11): [True: 4.67k, False: 2.28M]
  ------------------
  364|  4.67k|			precedence1 = 2; /* element is parent */
  365|       |			/*
  366|       |			* URGENT TODO: Are there any cases, where the
  367|       |			* parent of such a node is not an element node?
  368|       |			*/
  369|  4.67k|			node1 = node1->parent;
  370|  4.67k|			break;
  371|  4.67k|		    }
  372|  2.28M|		} while (1);
  ------------------
  |  Branch (372:12): [True: 2.28M, Folded]
  ------------------
  373|   406k|	    } else {
  374|   406k|		precedence1 = 2; /* element is parent */
  375|   406k|		node1 = node1->parent;
  376|   406k|	    }
  377|   601k|	    if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (377:10): [True: 0, False: 601k]
  |  Branch (377:29): [True: 680, False: 600k]
  ------------------
  378|   601k|		(0 <= XML_NODE_SORT_VALUE(node1))) {
  ------------------
  |  |  295|   600k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   600k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (378:3): [True: 600k, False: 0]
  ------------------
  379|       |		/*
  380|       |		* Fallback for whatever case.
  381|       |		*/
  382|   601k|		node1 = miscNode1;
  383|   601k|		precedence1 = 0;
  384|   601k|	    } else
  385|      0|		misc = 1;
  386|   601k|	}
  387|   601k|	    break;
  388|  34.9k|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (388:2): [True: 34.9k, False: 3.23M]
  ------------------
  389|       |	    /*
  390|       |	    * TODO: why do we return 1 for namespace nodes?
  391|       |	    */
  392|  34.9k|	    return(1);
  393|  23.6k|	default:
  ------------------
  |  Branch (393:2): [True: 23.6k, False: 3.24M]
  ------------------
  394|  23.6k|	    break;
  395|  3.26M|    }
  396|  1.15M|    switch (node2->type) {
  397|   438k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (397:2): [True: 438k, False: 714k]
  ------------------
  398|   438k|	    break;
  399|  12.2k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (399:2): [True: 12.2k, False: 1.14M]
  ------------------
  400|  12.2k|	    precedence2 = 1; /* element is owner */
  401|  12.2k|	    miscNode2 = node2;
  402|  12.2k|	    node2 = node2->parent;
  403|  12.2k|	    misc = 1;
  404|  12.2k|	    break;
  405|   581k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (405:2): [True: 581k, False: 571k]
  ------------------
  406|   593k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (406:2): [True: 12.5k, False: 1.14M]
  ------------------
  407|   596k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (407:2): [True: 2.57k, False: 1.15M]
  ------------------
  408|   621k|	case XML_PI_NODE: {
  ------------------
  |  Branch (408:2): [True: 24.7k, False: 1.12M]
  ------------------
  409|   621k|	    miscNode2 = node2;
  410|   621k|	    if (node2->prev != NULL) {
  ------------------
  |  Branch (410:10): [True: 211k, False: 409k]
  ------------------
  411|  2.49M|		do {
  412|  2.49M|		    node2 = node2->prev;
  413|  2.49M|		    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (413:11): [True: 206k, False: 2.28M]
  ------------------
  414|   206k|			precedence2 = 3; /* element in prev-sibl axis */
  415|   206k|			break;
  416|   206k|		    }
  417|  2.28M|		    if (node2->prev == NULL) {
  ------------------
  |  Branch (417:11): [True: 4.96k, False: 2.28M]
  ------------------
  418|  4.96k|			precedence2 = 2; /* element is parent */
  419|  4.96k|			node2 = node2->parent;
  420|  4.96k|			break;
  421|  4.96k|		    }
  422|  2.28M|		} while (1);
  ------------------
  |  Branch (422:12): [True: 2.28M, Folded]
  ------------------
  423|   409k|	    } else {
  424|   409k|		precedence2 = 2; /* element is parent */
  425|   409k|		node2 = node2->parent;
  426|   409k|	    }
  427|   621k|	    if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (427:10): [True: 0, False: 621k]
  |  Branch (427:29): [True: 580, False: 620k]
  ------------------
  428|   620k|		(0 <= XML_NODE_SORT_VALUE(node2)))
  ------------------
  |  |  295|   620k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   620k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (428:3): [True: 620k, False: 0]
  ------------------
  429|   621k|	    {
  430|   621k|		node2 = miscNode2;
  431|   621k|		precedence2 = 0;
  432|   621k|	    } else
  433|      0|		misc = 1;
  434|   621k|	}
  435|   621k|	    break;
  436|    313|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (436:2): [True: 313, False: 1.15M]
  ------------------
  437|    313|	    return(1);
  438|  81.0k|	default:
  ------------------
  |  Branch (438:2): [True: 81.0k, False: 1.07M]
  ------------------
  439|  81.0k|	    break;
  440|  1.15M|    }
  441|  1.15M|    if (misc) {
  ------------------
  |  Branch (441:9): [True: 17.1k, False: 1.13M]
  ------------------
  442|  17.1k|	if (node1 == node2) {
  ------------------
  |  Branch (442:6): [True: 2.27k, False: 14.8k]
  ------------------
  443|  2.27k|	    if (precedence1 == precedence2) {
  ------------------
  |  Branch (443:10): [True: 948, False: 1.32k]
  ------------------
  444|       |		/*
  445|       |		* The ugly case; but normally there aren't many
  446|       |		* adjacent non-element nodes around.
  447|       |		*/
  448|    948|		cur = miscNode2->prev;
  449|  1.05k|		while (cur != NULL) {
  ------------------
  |  Branch (449:10): [True: 518, False: 540]
  ------------------
  450|    518|		    if (cur == miscNode1)
  ------------------
  |  Branch (450:11): [True: 408, False: 110]
  ------------------
  451|    408|			return(1);
  452|    110|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (452:11): [True: 0, False: 110]
  ------------------
  453|      0|			return(-1);
  454|    110|		    cur = cur->prev;
  455|    110|		}
  456|    540|		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: 599, False: 725]
  ------------------
  464|    599|		    return(1);
  465|    725|		else
  466|    725|		    return(-1);
  467|  1.32k|	    }
  468|  2.27k|	}
  469|       |	/*
  470|       |	* Special case: One of the helper-elements is contained by the other.
  471|       |	* <foo>
  472|       |	*   <node2>
  473|       |	*     <node1>Text-1(precedence1 == 2)</node1>
  474|       |	*   </node2>
  475|       |	*   Text-6(precedence2 == 3)
  476|       |	* </foo>
  477|       |	*/
  478|  14.8k|	if ((precedence2 == 3) && (precedence1 > 1)) {
  ------------------
  |  Branch (478:6): [True: 0, False: 14.8k]
  |  Branch (478:28): [True: 0, False: 0]
  ------------------
  479|      0|	    cur = node1->parent;
  480|      0|	    while (cur) {
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|		if (cur == node2)
  ------------------
  |  Branch (481:7): [True: 0, False: 0]
  ------------------
  482|      0|		    return(1);
  483|      0|		cur = cur->parent;
  484|      0|	    }
  485|      0|	}
  486|  14.8k|	if ((precedence1 == 3) && (precedence2 > 1)) {
  ------------------
  |  Branch (486:6): [True: 0, False: 14.8k]
  |  Branch (486:28): [True: 0, False: 0]
  ------------------
  487|      0|	    cur = node2->parent;
  488|      0|	    while (cur) {
  ------------------
  |  Branch (488:13): [True: 0, False: 0]
  ------------------
  489|      0|		if (cur == node1)
  ------------------
  |  Branch (489:7): [True: 0, False: 0]
  ------------------
  490|      0|		    return(-1);
  491|      0|		cur = cur->parent;
  492|      0|	    }
  493|      0|	}
  494|  14.8k|    }
  495|       |
  496|       |    /*
  497|       |     * Speedup using document order if available.
  498|       |     */
  499|  1.15M|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (499:9): [True: 525k, False: 624k]
  ------------------
  500|   525k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (500:2): [True: 12.6k, False: 513k]
  ------------------
  501|  12.6k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  12.6k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  12.6k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (501:2): [True: 0, False: 12.6k]
  ------------------
  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.23M|turtle_comparison:
  514|       |
  515|  3.23M|    if (node1 == node2->prev)
  ------------------
  |  Branch (515:9): [True: 932k, False: 2.29M]
  ------------------
  516|   932k|	return(1);
  517|  2.29M|    if (node1 == node2->next)
  ------------------
  |  Branch (517:9): [True: 41.9k, False: 2.25M]
  ------------------
  518|  41.9k|	return(-1);
  519|       |    /*
  520|       |     * compute depth to root
  521|       |     */
  522|  57.8M|    for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (522:35): [True: 56.2M, False: 1.58M]
  ------------------
  523|  56.2M|	if (cur->parent == node1)
  ------------------
  |  Branch (523:6): [True: 667k, False: 55.6M]
  ------------------
  524|   667k|	    return(1);
  525|  55.6M|	depth2++;
  526|  55.6M|    }
  527|  1.58M|    root = cur;
  528|  51.2M|    for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (528:35): [True: 50.0M, False: 1.22M]
  ------------------
  529|  50.0M|	if (cur->parent == node2)
  ------------------
  |  Branch (529:6): [True: 360k, False: 49.6M]
  ------------------
  530|   360k|	    return(-1);
  531|  49.6M|	depth1++;
  532|  49.6M|    }
  533|       |    /*
  534|       |     * Distinct document (or distinct entities :-( ) case.
  535|       |     */
  536|  1.22M|    if (root != cur) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1.22M]
  ------------------
  537|      0|	return(-2);
  538|      0|    }
  539|       |    /*
  540|       |     * get the nearest common ancestor.
  541|       |     */
  542|  4.44M|    while (depth1 > depth2) {
  ------------------
  |  Branch (542:12): [True: 3.21M, False: 1.22M]
  ------------------
  543|  3.21M|	depth1--;
  544|  3.21M|	node1 = node1->parent;
  545|  3.21M|    }
  546|  7.80M|    while (depth2 > depth1) {
  ------------------
  |  Branch (546:12): [True: 6.57M, False: 1.22M]
  ------------------
  547|  6.57M|	depth2--;
  548|  6.57M|	node2 = node2->parent;
  549|  6.57M|    }
  550|  2.60M|    while (node1->parent != node2->parent) {
  ------------------
  |  Branch (550:12): [True: 1.37M, False: 1.22M]
  ------------------
  551|  1.37M|	node1 = node1->parent;
  552|  1.37M|	node2 = node2->parent;
  553|       |	/* should not happen but just in case ... */
  554|  1.37M|	if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (554:6): [True: 0, False: 1.37M]
  |  Branch (554:25): [True: 0, False: 1.37M]
  ------------------
  555|      0|	    return(-2);
  556|  1.37M|    }
  557|       |    /*
  558|       |     * Find who's first.
  559|       |     */
  560|  1.22M|    if (node1 == node2->prev)
  ------------------
  |  Branch (560:9): [True: 340k, False: 887k]
  ------------------
  561|   340k|	return(1);
  562|   887k|    if (node1 == node2->next)
  ------------------
  |  Branch (562:9): [True: 406k, False: 481k]
  ------------------
  563|   406k|	return(-1);
  564|       |    /*
  565|       |     * Speedup using document order if available.
  566|       |     */
  567|   481k|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (567:9): [True: 477k, False: 4.83k]
  ------------------
  568|   477k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (568:2): [True: 469k, False: 7.50k]
  ------------------
  569|   469k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|   469k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   469k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (569:2): [True: 0, False: 469k]
  ------------------
  570|      0|	(0 > XML_NODE_SORT_VALUE(node2)) &&
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (570:2): [True: 0, False: 0]
  ------------------
  571|      0|	(node1->doc == node2->doc)) {
  ------------------
  |  Branch (571:2): [True: 0, False: 0]
  ------------------
  572|       |
  573|      0|	l1 = -XML_NODE_SORT_VALUE(node1);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  574|      0|	l2 = -XML_NODE_SORT_VALUE(node2);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  575|      0|	if (l1 < l2)
  ------------------
  |  Branch (575:6): [True: 0, False: 0]
  ------------------
  576|      0|	    return(1);
  577|      0|	if (l1 > l2)
  ------------------
  |  Branch (577:6): [True: 0, False: 0]
  ------------------
  578|      0|	    return(-1);
  579|      0|    }
  580|       |
  581|  3.71M|    for (cur = node1->next;cur != NULL;cur = cur->next)
  ------------------
  |  Branch (581:28): [True: 3.50M, False: 204k]
  ------------------
  582|  3.50M|	if (cur == node2)
  ------------------
  |  Branch (582:6): [True: 277k, False: 3.22M]
  ------------------
  583|   277k|	    return(1);
  584|   204k|    return(-1); /* assume there is no sibling list corruption */
  585|   481k|}
xpath.c:xmlXPathErrFmt:
  707|  8.11k|xmlXPathErrFmt(xmlXPathParserContext *ctxt, int code, const char *fmt, ...) {
  708|  8.11k|    va_list ap;
  709|  8.11k|    xmlStructuredErrorFunc schannel = NULL;
  710|  8.11k|    xmlGenericErrorFunc channel = NULL;
  711|  8.11k|    void *data = NULL;
  712|  8.11k|    xmlNodePtr node = NULL;
  713|  8.11k|    int res;
  714|       |
  715|  8.11k|    if (ctxt == NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 8.11k]
  ------------------
  716|      0|        return;
  717|  8.11k|    if ((code < 0) || (code > MAXERRNO))
  ------------------
  |  |  668|  8.11k|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|  8.11k|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  |  Branch (717:9): [True: 0, False: 8.11k]
  |  Branch (717:23): [True: 0, False: 8.11k]
  ------------------
  718|      0|	code = MAXERRNO;
  ------------------
  |  |  668|      0|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|      0|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  719|       |    /* Only report the first error */
  720|  8.11k|    if (ctxt->error != 0)
  ------------------
  |  Branch (720:9): [True: 3.51k, False: 4.60k]
  ------------------
  721|  3.51k|        return;
  722|       |
  723|  4.60k|    ctxt->error = code;
  724|       |
  725|  4.60k|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (725:9): [True: 4.60k, False: 0]
  ------------------
  726|  4.60k|        xmlErrorPtr err = &ctxt->context->lastError;
  727|       |
  728|       |        /* Don't overwrite memory error. */
  729|  4.60k|        if (err->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (729:13): [True: 0, False: 4.60k]
  ------------------
  730|      0|            return;
  731|       |
  732|       |        /* cleanup current last error */
  733|  4.60k|        xmlResetError(err);
  734|       |
  735|  4.60k|        err->domain = XML_FROM_XPATH;
  736|  4.60k|        err->code = code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK;
  737|  4.60k|        err->level = XML_ERR_ERROR;
  738|  4.60k|        if (ctxt->base != NULL) {
  ------------------
  |  Branch (738:13): [True: 4.60k, False: 0]
  ------------------
  739|  4.60k|            err->str1 = (char *) xmlStrdup(ctxt->base);
  740|  4.60k|            if (err->str1 == NULL) {
  ------------------
  |  Branch (740:17): [True: 32, False: 4.57k]
  ------------------
  741|     32|                xmlXPathPErrMemory(ctxt);
  742|     32|                return;
  743|     32|            }
  744|  4.60k|        }
  745|  4.57k|        err->int1 = ctxt->cur - ctxt->base;
  746|  4.57k|        err->node = ctxt->context->debugNode;
  747|       |
  748|  4.57k|        schannel = ctxt->context->error;
  749|  4.57k|        data = ctxt->context->userData;
  750|  4.57k|        node = ctxt->context->debugNode;
  751|  4.57k|    }
  752|       |
  753|  4.57k|    if (schannel == NULL) {
  ------------------
  |  Branch (753:9): [True: 0, False: 4.57k]
  ------------------
  754|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  755|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  756|      0|    }
  757|       |
  758|  4.57k|    va_start(ap, fmt);
  759|  4.57k|    res = xmlVRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
  760|  4.57k|                         code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
  761|  4.57k|                         XML_ERR_ERROR, NULL, 0,
  762|  4.57k|                         (const char *) ctxt->base, NULL, NULL,
  763|  4.57k|                         ctxt->cur - ctxt->base, 0,
  764|  4.57k|                         fmt, ap);
  765|  4.57k|    va_end(ap);
  766|  4.57k|    if (res < 0)
  ------------------
  |  Branch (766:9): [True: 46, False: 4.52k]
  ------------------
  767|     46|        xmlXPathPErrMemory(ctxt);
  768|  4.57k|}
xpath.c:xmlXPathCastToNumberInternal:
 1931|   560k|                             xmlXPathObjectPtr val) {
 1932|   560k|    double ret = 0.0;
 1933|       |
 1934|   560k|    if (val == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 560k]
  ------------------
 1935|      0|	return(xmlXPathNAN);
 1936|   560k|    switch (val->type) {
  ------------------
  |  Branch (1936:13): [True: 560k, False: 0]
  ------------------
 1937|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1937:5): [True: 0, False: 560k]
  ------------------
 1938|      0|	ret = xmlXPathNAN;
 1939|      0|	break;
 1940|   371k|    case XPATH_NODESET:
  ------------------
  |  Branch (1940:5): [True: 371k, False: 189k]
  ------------------
 1941|   371k|    case XPATH_XSLT_TREE: {
  ------------------
  |  Branch (1941:5): [True: 0, False: 560k]
  ------------------
 1942|   371k|        xmlChar *str;
 1943|       |
 1944|   371k|	str = xmlXPathCastNodeSetToString(val->nodesetval);
 1945|   371k|        if (str == NULL) {
  ------------------
  |  Branch (1945:13): [True: 62, False: 371k]
  ------------------
 1946|     62|            xmlXPathPErrMemory(ctxt);
 1947|     62|            ret = xmlXPathNAN;
 1948|   371k|        } else {
 1949|   371k|	    ret = xmlXPathCastStringToNumber(str);
 1950|   371k|            xmlFree(str);
 1951|   371k|        }
 1952|   371k|	break;
 1953|   371k|    }
 1954|   123k|    case XPATH_STRING:
  ------------------
  |  Branch (1954:5): [True: 123k, False: 437k]
  ------------------
 1955|   123k|	ret = xmlXPathCastStringToNumber(val->stringval);
 1956|   123k|	break;
 1957|  41.9k|    case XPATH_NUMBER:
  ------------------
  |  Branch (1957:5): [True: 41.9k, False: 518k]
  ------------------
 1958|  41.9k|	ret = val->floatval;
 1959|  41.9k|	break;
 1960|  24.1k|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1960:5): [True: 24.1k, False: 536k]
  ------------------
 1961|  24.1k|	ret = xmlXPathCastBooleanToNumber(val->boolval);
 1962|  24.1k|	break;
 1963|      0|    case XPATH_USERS:
  ------------------
  |  Branch (1963:5): [True: 0, False: 560k]
  ------------------
 1964|       |	/* TODO */
 1965|      0|	ret = xmlXPathNAN;
 1966|      0|	break;
 1967|   560k|    }
 1968|   560k|    return(ret);
 1969|   560k|}
xpath.c:xmlXPathNodeSetDupNs:
 2604|   141k|xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
 2605|   141k|    xmlNsPtr cur;
 2606|       |
 2607|   141k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2607:9): [True: 0, False: 141k]
  |  Branch (2607:25): [True: 0, False: 141k]
  ------------------
 2608|      0|	return(NULL);
 2609|   141k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2609:9): [True: 0, False: 141k]
  |  Branch (2609:27): [True: 0, False: 141k]
  ------------------
 2610|      0|	return((xmlNodePtr) ns);
 2611|       |
 2612|       |    /*
 2613|       |     * Allocate a new Namespace and fill the fields.
 2614|       |     */
 2615|   141k|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 2616|   141k|    if (cur == NULL)
  ------------------
  |  Branch (2616:9): [True: 25, False: 141k]
  ------------------
 2617|     25|	return(NULL);
 2618|   141k|    memset(cur, 0, sizeof(xmlNs));
 2619|   141k|    cur->type = XML_NAMESPACE_DECL;
 2620|   141k|    if (ns->href != NULL) {
  ------------------
  |  Branch (2620:9): [True: 86.8k, False: 54.5k]
  ------------------
 2621|  86.8k|	cur->href = xmlStrdup(ns->href);
 2622|  86.8k|        if (cur->href == NULL) {
  ------------------
  |  Branch (2622:13): [True: 19, False: 86.8k]
  ------------------
 2623|     19|            xmlFree(cur);
 2624|     19|            return(NULL);
 2625|     19|        }
 2626|  86.8k|    }
 2627|   141k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (2627:9): [True: 118k, False: 23.3k]
  ------------------
 2628|   118k|	cur->prefix = xmlStrdup(ns->prefix);
 2629|   118k|        if (cur->prefix == NULL) {
  ------------------
  |  Branch (2629:13): [True: 18, False: 118k]
  ------------------
 2630|     18|            xmlFree((xmlChar *) cur->href);
 2631|     18|            xmlFree(cur);
 2632|     18|            return(NULL);
 2633|     18|        }
 2634|   118k|    }
 2635|   141k|    cur->next = (xmlNsPtr) node;
 2636|   141k|    return((xmlNodePtr) cur);
 2637|   141k|}
xpath.c:xmlXPathNodeSetGrow:
 2735|  1.22M|xmlXPathNodeSetGrow(xmlNodeSetPtr cur) {
 2736|  1.22M|    xmlNodePtr *temp;
 2737|  1.22M|    int newSize;
 2738|       |
 2739|  1.22M|    newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]),
 2740|  1.22M|                              XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  | 2593|  1.22M|#define XML_NODESET_DEFAULT	10
  ------------------
                                            XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  |  105|  1.22M|#define XPATH_MAX_NODESET_LENGTH 10000000
  ------------------
 2741|  1.22M|    if (newSize < 0)
  ------------------
  |  Branch (2741:9): [True: 0, False: 1.22M]
  ------------------
 2742|      0|        return(-1);
 2743|  1.22M|    temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0]));
 2744|  1.22M|    if (temp == NULL)
  ------------------
  |  Branch (2744:9): [True: 259, False: 1.22M]
  ------------------
 2745|    259|        return(-1);
 2746|  1.22M|    cur->nodeMax = newSize;
 2747|  1.22M|    cur->nodeTab = temp;
 2748|       |
 2749|  1.22M|    return(0);
 2750|  1.22M|}
xpath.c:xmlXPathReleaseObject:
 4257|  3.17M|{
 4258|  3.17M|    if (obj == NULL)
  ------------------
  |  Branch (4258:9): [True: 18, False: 3.17M]
  ------------------
 4259|     18|	return;
 4260|  3.17M|    if ((ctxt == NULL) || (ctxt->cache == NULL)) {
  ------------------
  |  Branch (4260:9): [True: 0, False: 3.17M]
  |  Branch (4260:27): [True: 3.17M, False: 0]
  ------------------
 4261|  3.17M|	 xmlXPathFreeObject(obj);
 4262|  3.17M|    } 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.17M|}
xpath.c:xmlXPathFormatNumber:
 2229|  12.0k|{
 2230|  12.0k|    switch (xmlXPathIsInf(number)) {
 2231|      0|    case 1:
  ------------------
  |  Branch (2231:5): [True: 0, False: 12.0k]
  ------------------
 2232|      0|	if (buffersize > (int)sizeof("Infinity"))
  ------------------
  |  Branch (2232:6): [True: 0, False: 0]
  ------------------
 2233|      0|	    snprintf(buffer, buffersize, "Infinity");
 2234|      0|	break;
 2235|      0|    case -1:
  ------------------
  |  Branch (2235:5): [True: 0, False: 12.0k]
  ------------------
 2236|      0|	if (buffersize > (int)sizeof("-Infinity"))
  ------------------
  |  Branch (2236:6): [True: 0, False: 0]
  ------------------
 2237|      0|	    snprintf(buffer, buffersize, "-Infinity");
 2238|      0|	break;
 2239|  12.0k|    default:
  ------------------
  |  Branch (2239:5): [True: 12.0k, False: 0]
  ------------------
 2240|  12.0k|	if (xmlXPathIsNaN(number)) {
  ------------------
  |  Branch (2240:6): [True: 0, False: 12.0k]
  ------------------
 2241|      0|	    if (buffersize > (int)sizeof("NaN"))
  ------------------
  |  Branch (2241:10): [True: 0, False: 0]
  ------------------
 2242|      0|		snprintf(buffer, buffersize, "NaN");
 2243|  12.0k|	} else if (number == 0) {
  ------------------
  |  Branch (2243:13): [True: 0, False: 12.0k]
  ------------------
 2244|       |            /* Omit sign for negative zero. */
 2245|      0|	    snprintf(buffer, buffersize, "0");
 2246|  12.0k|	} else if ((number > INT_MIN) && (number < INT_MAX) &&
  ------------------
  |  Branch (2246:13): [True: 7.86k, False: 4.14k]
  |  Branch (2246:35): [True: 5.65k, False: 2.21k]
  ------------------
 2247|  5.65k|                   (number == (int) number)) {
  ------------------
  |  Branch (2247:20): [True: 3.66k, False: 1.99k]
  ------------------
 2248|  3.66k|	    char work[30];
 2249|  3.66k|	    char *ptr, *cur;
 2250|  3.66k|	    int value = (int) number;
 2251|       |
 2252|  3.66k|            ptr = &buffer[0];
 2253|  3.66k|	    if (value == 0) {
  ------------------
  |  Branch (2253:10): [True: 0, False: 3.66k]
  ------------------
 2254|      0|		*ptr++ = '0';
 2255|  3.66k|	    } else {
 2256|  3.66k|		snprintf(work, 29, "%d", value);
 2257|  3.66k|		cur = &work[0];
 2258|  23.9k|		while ((*cur) && (ptr - buffer < buffersize)) {
  ------------------
  |  Branch (2258:10): [True: 20.2k, False: 3.66k]
  |  Branch (2258:20): [True: 20.2k, False: 0]
  ------------------
 2259|  20.2k|		    *ptr++ = *cur++;
 2260|  20.2k|		}
 2261|  3.66k|	    }
 2262|  3.66k|	    if (ptr - buffer < buffersize) {
  ------------------
  |  Branch (2262:10): [True: 3.66k, False: 0]
  ------------------
 2263|  3.66k|		*ptr = 0;
 2264|  3.66k|	    } else if (buffersize > 0) {
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|		ptr--;
 2266|      0|		*ptr = 0;
 2267|      0|	    }
 2268|  8.34k|	} else {
 2269|       |	    /*
 2270|       |	      For the dimension of work,
 2271|       |	          DBL_DIG is number of significant digits
 2272|       |		  EXPONENT is only needed for "scientific notation"
 2273|       |	          3 is sign, decimal point, and terminating zero
 2274|       |		  LOWER_DOUBLE_EXP is max number of leading zeroes in fraction
 2275|       |	      Note that this dimension is slightly (a few characters)
 2276|       |	      larger than actually necessary.
 2277|       |	    */
 2278|  8.34k|	    char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
 2279|  8.34k|	    int integer_place, fraction_place;
 2280|  8.34k|	    char *ptr;
 2281|  8.34k|	    char *after_fraction;
 2282|  8.34k|	    double absolute_value;
 2283|  8.34k|	    int size;
 2284|       |
 2285|  8.34k|	    absolute_value = fabs(number);
 2286|       |
 2287|       |	    /*
 2288|       |	     * First choose format - scientific or regular floating point.
 2289|       |	     * In either case, result is in work, and after_fraction points
 2290|       |	     * just past the fractional part.
 2291|       |	    */
 2292|  8.34k|	    if ( ((absolute_value > UPPER_DOUBLE) ||
  ------------------
  |  | 2212|  8.34k|#define UPPER_DOUBLE 1E9
  ------------------
  |  Branch (2292:12): [True: 6.50k, False: 1.83k]
  ------------------
 2293|  1.83k|		  (absolute_value < LOWER_DOUBLE)) &&
  ------------------
  |  | 2213|  1.83k|#define LOWER_DOUBLE 1E-5
  ------------------
  |  Branch (2293:5): [True: 68, False: 1.77k]
  ------------------
 2294|  6.57k|		 (absolute_value != 0.0) ) {
  ------------------
  |  Branch (2294:4): [True: 6.57k, False: 0]
  ------------------
 2295|       |		/* Use scientific notation */
 2296|  6.57k|		integer_place = DBL_DIG + EXPONENT_DIGITS + 1;
  ------------------
  |  | 2218|  6.57k|#define EXPONENT_DIGITS (3 + 2)
  ------------------
 2297|  6.57k|		fraction_place = DBL_DIG - 1;
 2298|  6.57k|		size = snprintf(work, sizeof(work),"%*.*e",
 2299|  6.57k|			 integer_place, fraction_place, number);
 2300|  32.9k|		while ((size > 0) && (work[size] != 'e')) size--;
  ------------------
  |  Branch (2300:10): [True: 32.9k, False: 0]
  |  Branch (2300:24): [True: 26.3k, False: 6.57k]
  ------------------
 2301|       |
 2302|  6.57k|	    }
 2303|  1.77k|	    else {
 2304|       |		/* Use regular notation */
 2305|  1.77k|		if (absolute_value > 0.0) {
  ------------------
  |  Branch (2305:7): [True: 1.77k, False: 0]
  ------------------
 2306|  1.77k|		    integer_place = (int)log10(absolute_value);
 2307|  1.77k|		    if (integer_place > 0)
  ------------------
  |  Branch (2307:11): [True: 1.67k, False: 95]
  ------------------
 2308|  1.67k|		        fraction_place = DBL_DIG - integer_place - 1;
 2309|     95|		    else
 2310|     95|		        fraction_place = DBL_DIG - integer_place;
 2311|  1.77k|		} else {
 2312|      0|		    fraction_place = 1;
 2313|      0|		}
 2314|  1.77k|		size = snprintf(work, sizeof(work), "%0.*f",
 2315|  1.77k|				fraction_place, number);
 2316|  1.77k|	    }
 2317|       |
 2318|       |	    /* Remove leading spaces sometimes inserted by snprintf */
 2319|  10.6k|	    while (work[0] == ' ') {
  ------------------
  |  Branch (2319:13): [True: 2.33k, False: 8.34k]
  ------------------
 2320|  49.1k|	        for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
  ------------------
  |  Branch (2320:30): [True: 46.7k, False: 2.33k]
  ------------------
 2321|  2.33k|		size--;
 2322|  2.33k|	    }
 2323|       |
 2324|       |	    /* Remove fractional trailing zeroes */
 2325|  8.34k|	    after_fraction = work + size;
 2326|  8.34k|	    ptr = after_fraction;
 2327|  34.8k|	    while (*(--ptr) == '0')
  ------------------
  |  Branch (2327:13): [True: 26.5k, False: 8.34k]
  ------------------
 2328|  26.5k|		;
 2329|  8.34k|	    if (*ptr != '.')
  ------------------
  |  Branch (2329:10): [True: 6.57k, False: 1.77k]
  ------------------
 2330|  6.57k|	        ptr++;
 2331|  34.6k|	    while ((*ptr++ = *after_fraction++) != 0);
  ------------------
  |  Branch (2331:13): [True: 26.3k, False: 8.34k]
  ------------------
 2332|       |
 2333|       |	    /* Finally copy result back to caller */
 2334|  8.34k|	    size = strlen(work) + 1;
 2335|  8.34k|	    if (size > buffersize) {
  ------------------
  |  Branch (2335:10): [True: 0, False: 8.34k]
  ------------------
 2336|      0|		work[buffersize - 1] = 0;
 2337|      0|		size = buffersize;
 2338|      0|	    }
 2339|  8.34k|	    memmove(buffer, work, size);
 2340|  8.34k|	}
 2341|  12.0k|	break;
 2342|  12.0k|    }
 2343|  12.0k|}
xpath.c:xmlXPathNodeToNumberInternal:
 4532|   120k|xmlXPathNodeToNumberInternal(xmlXPathParserContextPtr ctxt, xmlNodePtr node) {
 4533|   120k|    xmlChar *strval;
 4534|   120k|    double ret;
 4535|       |
 4536|   120k|    if (node == NULL)
  ------------------
  |  Branch (4536:9): [True: 0, False: 120k]
  ------------------
 4537|      0|	return(xmlXPathNAN);
 4538|   120k|    strval = xmlXPathCastNodeToString(node);
 4539|   120k|    if (strval == NULL) {
  ------------------
  |  Branch (4539:9): [True: 10, False: 120k]
  ------------------
 4540|     10|        xmlXPathPErrMemory(ctxt);
 4541|     10|	return(xmlXPathNAN);
 4542|     10|    }
 4543|   120k|    ret = xmlXPathCastStringToNumber(strval);
 4544|   120k|    xmlFree(strval);
 4545|       |
 4546|   120k|    return(ret);
 4547|   120k|}
xpath.c:xmlXPathNewCompExpr:
  940|  10.1k|xmlXPathNewCompExpr(void) {
  941|  10.1k|    xmlXPathCompExprPtr cur;
  942|       |
  943|  10.1k|    cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
  944|  10.1k|    if (cur == NULL)
  ------------------
  |  Branch (944:9): [True: 27, False: 10.1k]
  ------------------
  945|     27|	return(NULL);
  946|  10.1k|    memset(cur, 0, sizeof(xmlXPathCompExpr));
  947|  10.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  948|  10.1k|    cur->maxStep = 1;
  949|       |#else
  950|       |    cur->maxStep = 10;
  951|       |#endif
  952|  10.1k|    cur->nbStep = 0;
  953|  10.1k|    cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
  954|  10.1k|	                                   sizeof(xmlXPathStepOp));
  955|  10.1k|    if (cur->steps == NULL) {
  ------------------
  |  Branch (955:9): [True: 16, False: 10.1k]
  ------------------
  956|     16|	xmlFree(cur);
  957|     16|	return(NULL);
  958|     16|    }
  959|  10.1k|    memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
  960|  10.1k|    cur->last = -1;
  961|  10.1k|    return(cur);
  962|  10.1k|}
xpath.c:xmlXPathEqualNodeSets:
 5433|  25.2k|                      xmlXPathObjectPtr arg2, int neq) {
 5434|  25.2k|    int i, j;
 5435|  25.2k|    unsigned int *hashs1;
 5436|  25.2k|    unsigned int *hashs2;
 5437|  25.2k|    xmlChar **values1;
 5438|  25.2k|    xmlChar **values2;
 5439|  25.2k|    int ret = 0;
 5440|  25.2k|    xmlNodeSetPtr ns1;
 5441|  25.2k|    xmlNodeSetPtr ns2;
 5442|       |
 5443|  25.2k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5443:9): [True: 0, False: 25.2k]
  ------------------
 5444|  25.2k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5444:3): [True: 0, False: 25.2k]
  |  Branch (5444:36): [True: 0, False: 0]
  ------------------
 5445|      0|        return(0);
 5446|  25.2k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5446:9): [True: 0, False: 25.2k]
  ------------------
 5447|  25.2k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5447:3): [True: 0, False: 25.2k]
  |  Branch (5447:36): [True: 0, False: 0]
  ------------------
 5448|      0|        return(0);
 5449|       |
 5450|  25.2k|    ns1 = arg1->nodesetval;
 5451|  25.2k|    ns2 = arg2->nodesetval;
 5452|       |
 5453|  25.2k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0))
  ------------------
  |  Branch (5453:9): [True: 0, False: 25.2k]
  |  Branch (5453:26): [True: 14.7k, False: 10.5k]
  ------------------
 5454|  14.7k|	return(0);
 5455|  10.5k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0))
  ------------------
  |  Branch (5455:9): [True: 0, False: 10.5k]
  |  Branch (5455:26): [True: 675, False: 9.88k]
  ------------------
 5456|    675|	return(0);
 5457|       |
 5458|       |    /*
 5459|       |     * for equal, check if there is a node pertaining to both sets
 5460|       |     */
 5461|  9.88k|    if (neq == 0)
  ------------------
  |  Branch (5461:9): [True: 9.36k, False: 523]
  ------------------
 5462|  19.7k|	for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5462:13): [True: 10.8k, False: 8.94k]
  ------------------
 5463|  43.3k|	    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5463:17): [True: 32.9k, False: 10.4k]
  ------------------
 5464|  32.9k|		if (ns1->nodeTab[i] == ns2->nodeTab[j])
  ------------------
  |  Branch (5464:7): [True: 416, False: 32.5k]
  ------------------
 5465|    416|		    return(1);
 5466|       |
 5467|  9.46k|    values1 = (xmlChar **) xmlMalloc(ns1->nodeNr * sizeof(xmlChar *));
 5468|  9.46k|    if (values1 == NULL) {
  ------------------
  |  Branch (5468:9): [True: 4, False: 9.46k]
  ------------------
 5469|      4|        xmlXPathPErrMemory(ctxt);
 5470|      4|	return(0);
 5471|      4|    }
 5472|  9.46k|    hashs1 = (unsigned int *) xmlMalloc(ns1->nodeNr * sizeof(unsigned int));
 5473|  9.46k|    if (hashs1 == NULL) {
  ------------------
  |  Branch (5473:9): [True: 2, False: 9.46k]
  ------------------
 5474|      2|        xmlXPathPErrMemory(ctxt);
 5475|      2|	xmlFree(values1);
 5476|      2|	return(0);
 5477|      2|    }
 5478|  9.46k|    memset(values1, 0, ns1->nodeNr * sizeof(xmlChar *));
 5479|  9.46k|    values2 = (xmlChar **) xmlMalloc(ns2->nodeNr * sizeof(xmlChar *));
 5480|  9.46k|    if (values2 == NULL) {
  ------------------
  |  Branch (5480:9): [True: 3, False: 9.45k]
  ------------------
 5481|      3|        xmlXPathPErrMemory(ctxt);
 5482|      3|	xmlFree(hashs1);
 5483|      3|	xmlFree(values1);
 5484|      3|	return(0);
 5485|      3|    }
 5486|  9.45k|    hashs2 = (unsigned int *) xmlMalloc(ns2->nodeNr * sizeof(unsigned int));
 5487|  9.45k|    if (hashs2 == NULL) {
  ------------------
  |  Branch (5487:9): [True: 2, False: 9.45k]
  ------------------
 5488|      2|        xmlXPathPErrMemory(ctxt);
 5489|      2|	xmlFree(hashs1);
 5490|      2|	xmlFree(values1);
 5491|      2|	xmlFree(values2);
 5492|      2|	return(0);
 5493|      2|    }
 5494|  9.45k|    memset(values2, 0, ns2->nodeNr * sizeof(xmlChar *));
 5495|  19.3k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5495:16): [True: 10.7k, False: 8.50k]
  ------------------
 5496|  10.7k|	hashs1[i] = xmlXPathNodeValHash(ns1->nodeTab[i]);
 5497|  42.0k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5497:13): [True: 32.1k, False: 9.84k]
  ------------------
 5498|  32.1k|	    if (i == 0)
  ------------------
  |  Branch (5498:10): [True: 30.3k, False: 1.83k]
  ------------------
 5499|  30.3k|		hashs2[j] = xmlXPathNodeValHash(ns2->nodeTab[j]);
 5500|  32.1k|	    if (hashs1[i] != hashs2[j]) {
  ------------------
  |  Branch (5500:10): [True: 29.9k, False: 2.17k]
  ------------------
 5501|  29.9k|		if (neq) {
  ------------------
  |  Branch (5501:7): [True: 261, False: 29.7k]
  ------------------
 5502|    261|		    ret = 1;
 5503|    261|		    break;
 5504|    261|		}
 5505|  29.9k|	    }
 5506|  2.17k|	    else {
 5507|  2.17k|		if (values1[i] == NULL) {
  ------------------
  |  Branch (5507:7): [True: 1.62k, False: 558]
  ------------------
 5508|  1.62k|		    values1[i] = xmlNodeGetContent(ns1->nodeTab[i]);
 5509|  1.62k|                    if (values1[i] == NULL)
  ------------------
  |  Branch (5509:25): [True: 6, False: 1.61k]
  ------------------
 5510|      6|                        xmlXPathPErrMemory(ctxt);
 5511|  1.62k|                }
 5512|  2.17k|		if (values2[j] == NULL) {
  ------------------
  |  Branch (5512:7): [True: 1.30k, False: 876]
  ------------------
 5513|  1.30k|		    values2[j] = xmlNodeGetContent(ns2->nodeTab[j]);
 5514|  1.30k|                    if (values2[j] == NULL)
  ------------------
  |  Branch (5514:25): [True: 3, False: 1.30k]
  ------------------
 5515|      3|                        xmlXPathPErrMemory(ctxt);
 5516|  1.30k|                }
 5517|  2.17k|		ret = xmlStrEqual(values1[i], values2[j]) ^ neq;
 5518|  2.17k|		if (ret)
  ------------------
  |  Branch (5518:7): [True: 691, False: 1.48k]
  ------------------
 5519|    691|		    break;
 5520|  2.17k|	    }
 5521|  32.1k|	}
 5522|  10.7k|	if (ret)
  ------------------
  |  Branch (5522:6): [True: 952, False: 9.84k]
  ------------------
 5523|    952|	    break;
 5524|  10.7k|    }
 5525|  21.1k|    for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5525:16): [True: 11.6k, False: 9.45k]
  ------------------
 5526|  11.6k|	if (values1[i] != NULL)
  ------------------
  |  Branch (5526:6): [True: 1.61k, False: 10.0k]
  ------------------
 5527|  1.61k|	    xmlFree(values1[i]);
 5528|  40.1k|    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5528:16): [True: 30.7k, False: 9.45k]
  ------------------
 5529|  30.7k|	if (values2[j] != NULL)
  ------------------
  |  Branch (5529:6): [True: 1.30k, False: 29.4k]
  ------------------
 5530|  1.30k|	    xmlFree(values2[j]);
 5531|  9.45k|    xmlFree(values1);
 5532|  9.45k|    xmlFree(values2);
 5533|  9.45k|    xmlFree(hashs1);
 5534|  9.45k|    xmlFree(hashs2);
 5535|  9.45k|    return(ret);
 5536|  9.45k|}
xpath.c:xmlXPathNodeValHash:
 4920|  52.1k|xmlXPathNodeValHash(xmlNodePtr node) {
 4921|  52.1k|    int len = 2;
 4922|  52.1k|    const xmlChar * string = NULL;
 4923|  52.1k|    xmlNodePtr tmp = NULL;
 4924|  52.1k|    unsigned int ret = 0;
 4925|       |
 4926|  52.1k|    if (node == NULL)
  ------------------
  |  Branch (4926:9): [True: 0, False: 52.1k]
  ------------------
 4927|      0|	return(0);
 4928|       |
 4929|  52.1k|    if (node->type == XML_DOCUMENT_NODE) {
  ------------------
  |  Branch (4929:9): [True: 9.61k, False: 42.5k]
  ------------------
 4930|  9.61k|	tmp = xmlDocGetRootElement((xmlDocPtr) node);
 4931|  9.61k|	if (tmp == NULL)
  ------------------
  |  Branch (4931:6): [True: 0, False: 9.61k]
  ------------------
 4932|      0|	    node = node->children;
 4933|  9.61k|	else
 4934|  9.61k|	    node = tmp;
 4935|       |
 4936|  9.61k|	if (node == NULL)
  ------------------
  |  Branch (4936:6): [True: 0, False: 9.61k]
  ------------------
 4937|      0|	    return(0);
 4938|  9.61k|    }
 4939|       |
 4940|  52.1k|    switch (node->type) {
 4941|    670|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (4941:2): [True: 670, False: 51.4k]
  ------------------
 4942|  2.08k|	case XML_PI_NODE:
  ------------------
  |  Branch (4942:2): [True: 1.41k, False: 50.7k]
  ------------------
 4943|  2.28k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4943:2): [True: 206, False: 51.9k]
  ------------------
 4944|  8.56k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (4944:2): [True: 6.27k, False: 45.8k]
  ------------------
 4945|  8.56k|	    string = node->content;
 4946|  8.56k|	    if (string == NULL)
  ------------------
  |  Branch (4946:10): [True: 1.41k, False: 7.15k]
  ------------------
 4947|  1.41k|		return(0);
 4948|  7.15k|	    if (string[0] == 0)
  ------------------
  |  Branch (4948:10): [True: 35, False: 7.11k]
  ------------------
 4949|     35|		return(0);
 4950|  7.11k|	    return(string[0] + (string[1] << 8));
 4951|     35|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4951:2): [True: 35, False: 52.1k]
  ------------------
 4952|     35|	    string = ((xmlNsPtr)node)->href;
 4953|     35|	    if (string == NULL)
  ------------------
  |  Branch (4953:10): [True: 13, False: 22]
  ------------------
 4954|     13|		return(0);
 4955|     22|	    if (string[0] == 0)
  ------------------
  |  Branch (4955:10): [True: 0, False: 22]
  ------------------
 4956|      0|		return(0);
 4957|     22|	    return(string[0] + (string[1] << 8));
 4958|    688|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4958:2): [True: 688, False: 51.4k]
  ------------------
 4959|    688|	    tmp = ((xmlAttrPtr) node)->children;
 4960|    688|	    break;
 4961|  42.8k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4961:2): [True: 42.8k, False: 9.28k]
  ------------------
 4962|  42.8k|	    tmp = node->children;
 4963|  42.8k|	    break;
 4964|      0|	default:
  ------------------
  |  Branch (4964:2): [True: 0, False: 52.1k]
  ------------------
 4965|      0|	    return(0);
 4966|  52.1k|    }
 4967|   169k|    while (tmp != NULL) {
  ------------------
  |  Branch (4967:12): [True: 145k, False: 24.5k]
  ------------------
 4968|   145k|	switch (tmp->type) {
 4969|  6.13k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4969:6): [True: 6.13k, False: 139k]
  ------------------
 4970|  30.2k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (4970:6): [True: 24.1k, False: 121k]
  ------------------
 4971|  30.2k|		string = tmp->content;
 4972|  30.2k|		break;
 4973|   114k|	    default:
  ------------------
  |  Branch (4973:6): [True: 114k, False: 30.2k]
  ------------------
 4974|   114k|                string = NULL;
 4975|   114k|		break;
 4976|   145k|	}
 4977|   145k|	if ((string != NULL) && (string[0] != 0)) {
  ------------------
  |  Branch (4977:6): [True: 30.2k, False: 114k]
  |  Branch (4977:26): [True: 30.1k, False: 150]
  ------------------
 4978|  30.1k|	    if (len == 1) {
  ------------------
  |  Branch (4978:10): [True: 9.50k, False: 20.6k]
  ------------------
 4979|  9.50k|		return(ret + (string[0] << 8));
 4980|  9.50k|	    }
 4981|  20.6k|	    if (string[1] == 0) {
  ------------------
  |  Branch (4981:10): [True: 11.1k, False: 9.48k]
  ------------------
 4982|  11.1k|		len = 1;
 4983|  11.1k|		ret = string[0];
 4984|  11.1k|	    } else {
 4985|  9.48k|		return(string[0] + (string[1] << 8));
 4986|  9.48k|	    }
 4987|  20.6k|	}
 4988|       |	/*
 4989|       |	 * Skip to next node
 4990|       |	 */
 4991|   126k|        if ((tmp->children != NULL) &&
  ------------------
  |  Branch (4991:13): [True: 57.3k, False: 68.8k]
  ------------------
 4992|  57.3k|            (tmp->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (4992:13): [True: 57.3k, False: 0]
  ------------------
 4993|  57.3k|            (tmp->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4993:13): [True: 57.3k, False: 0]
  ------------------
 4994|  57.3k|            (tmp->children->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (4994:13): [True: 57.3k, False: 0]
  ------------------
 4995|  57.3k|            tmp = tmp->children;
 4996|  57.3k|            continue;
 4997|  57.3k|	}
 4998|  68.8k|	if (tmp == node)
  ------------------
  |  Branch (4998:6): [True: 0, False: 68.8k]
  ------------------
 4999|      0|	    break;
 5000|       |
 5001|  68.8k|	if (tmp->next != NULL) {
  ------------------
  |  Branch (5001:6): [True: 66.1k, False: 2.71k]
  ------------------
 5002|  66.1k|	    tmp = tmp->next;
 5003|  66.1k|	    continue;
 5004|  66.1k|	}
 5005|       |
 5006|  5.60k|	do {
 5007|  5.60k|	    tmp = tmp->parent;
 5008|  5.60k|	    if (tmp == NULL)
  ------------------
  |  Branch (5008:10): [True: 0, False: 5.60k]
  ------------------
 5009|      0|		break;
 5010|  5.60k|	    if (tmp == node) {
  ------------------
  |  Branch (5010:10): [True: 1.97k, False: 3.62k]
  ------------------
 5011|  1.97k|		tmp = NULL;
 5012|  1.97k|		break;
 5013|  1.97k|	    }
 5014|  3.62k|	    if (tmp->next != NULL) {
  ------------------
  |  Branch (5014:10): [True: 737, False: 2.88k]
  ------------------
 5015|    737|		tmp = tmp->next;
 5016|    737|		break;
 5017|    737|	    }
 5018|  3.62k|	} while (tmp != NULL);
  ------------------
  |  Branch (5018:11): [True: 2.88k, False: 0]
  ------------------
 5019|  2.71k|    }
 5020|  24.5k|    return(ret);
 5021|  43.5k|}
xpath.c:xmlXPathEqualNodeSetFloat:
 5370|  33.8k|    xmlXPathObjectPtr arg, double f, int neq) {
 5371|  33.8k|  int i, ret=0;
 5372|  33.8k|  xmlNodeSetPtr ns;
 5373|  33.8k|  xmlChar *str2;
 5374|  33.8k|  xmlXPathObjectPtr val;
 5375|  33.8k|  double v;
 5376|       |
 5377|  33.8k|    if ((arg == NULL) ||
  ------------------
  |  Branch (5377:9): [True: 0, False: 33.8k]
  ------------------
 5378|  33.8k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5378:3): [True: 0, False: 33.8k]
  |  Branch (5378:35): [True: 0, False: 0]
  ------------------
 5379|      0|        return(0);
 5380|       |
 5381|  33.8k|    ns = arg->nodesetval;
 5382|  33.8k|    if (ns != NULL) {
  ------------------
  |  Branch (5382:9): [True: 33.8k, False: 0]
  ------------------
 5383|  90.1k|	for (i=0;i<ns->nodeNr;i++) {
  ------------------
  |  Branch (5383:11): [True: 56.9k, False: 33.1k]
  ------------------
 5384|  56.9k|	    str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5385|  56.9k|	    if (str2 != NULL) {
  ------------------
  |  Branch (5385:10): [True: 56.9k, False: 10]
  ------------------
 5386|  56.9k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5387|  56.9k|		xmlFree(str2);
 5388|  56.9k|		xmlXPathNumberFunction(ctxt, 1);
 5389|  56.9k|                CHECK_ERROR0;
  ------------------
  |  |  236|  56.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 16, False: 56.9k]
  |  |  ------------------
  ------------------
 5390|  56.9k|		val = xmlXPathValuePop(ctxt);
 5391|  56.9k|		v = val->floatval;
 5392|  56.9k|		xmlXPathReleaseObject(ctxt->context, val);
 5393|  56.9k|		if (!xmlXPathIsNaN(v)) {
  ------------------
  |  Branch (5393:7): [True: 1.72k, False: 55.2k]
  ------------------
 5394|  1.72k|		    if ((!neq) && (v==f)) {
  ------------------
  |  Branch (5394:11): [True: 1.19k, False: 527]
  |  Branch (5394:21): [True: 193, False: 1.00k]
  ------------------
 5395|    193|			ret = 1;
 5396|    193|			break;
 5397|  1.53k|		    } else if ((neq) && (v!=f)) {
  ------------------
  |  Branch (5397:18): [True: 527, False: 1.00k]
  |  Branch (5397:27): [True: 506, False: 21]
  ------------------
 5398|    506|			ret = 1;
 5399|    506|			break;
 5400|    506|		    }
 5401|  55.2k|		} else {	/* NaN is unequal to any value */
 5402|  55.2k|		    if (neq)
  ------------------
  |  Branch (5402:11): [True: 6.93k, False: 48.3k]
  ------------------
 5403|  6.93k|			ret = 1;
 5404|  55.2k|		}
 5405|  56.9k|	    } else {
 5406|     10|                xmlXPathPErrMemory(ctxt);
 5407|     10|            }
 5408|  56.9k|	}
 5409|  33.8k|    }
 5410|       |
 5411|  33.8k|    return(ret);
 5412|  33.8k|}
xpath.c:xmlXPathEqualNodeSetString:
 5314|  9.95k|{
 5315|  9.95k|    int i;
 5316|  9.95k|    xmlNodeSetPtr ns;
 5317|  9.95k|    xmlChar *str2;
 5318|  9.95k|    unsigned int hash;
 5319|       |
 5320|  9.95k|    if ((str == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5320:9): [True: 0, False: 9.95k]
  |  Branch (5320:26): [True: 0, False: 9.95k]
  ------------------
 5321|  9.95k|        ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5321:10): [True: 0, False: 9.95k]
  |  Branch (5321:42): [True: 0, False: 0]
  ------------------
 5322|      0|        return (0);
 5323|  9.95k|    ns = arg->nodesetval;
 5324|       |    /*
 5325|       |     * A NULL nodeset compared with a string is always false
 5326|       |     * (since there is no node equal, and no node not equal)
 5327|       |     */
 5328|  9.95k|    if ((ns == NULL) || (ns->nodeNr <= 0) )
  ------------------
  |  Branch (5328:9): [True: 0, False: 9.95k]
  |  Branch (5328:25): [True: 8.77k, False: 1.18k]
  ------------------
 5329|  8.77k|        return (0);
 5330|  1.18k|    hash = xmlXPathStringHash(str);
 5331|  11.5k|    for (i = 0; i < ns->nodeNr; i++) {
  ------------------
  |  Branch (5331:17): [True: 11.0k, False: 515]
  ------------------
 5332|  11.0k|        if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
  ------------------
  |  Branch (5332:13): [True: 1.37k, False: 9.64k]
  ------------------
 5333|  1.37k|            str2 = xmlNodeGetContent(ns->nodeTab[i]);
 5334|  1.37k|            if (str2 == NULL) {
  ------------------
  |  Branch (5334:17): [True: 4, False: 1.37k]
  ------------------
 5335|      4|                xmlXPathPErrMemory(ctxt);
 5336|      4|                return(0);
 5337|      4|            }
 5338|  1.37k|            if (xmlStrEqual(str, str2)) {
  ------------------
  |  Branch (5338:17): [True: 1.02k, False: 342]
  ------------------
 5339|  1.02k|                xmlFree(str2);
 5340|  1.02k|		if (neq)
  ------------------
  |  Branch (5340:7): [True: 979, False: 49]
  ------------------
 5341|    979|		    continue;
 5342|     49|                return (1);
 5343|  1.02k|            } else if (neq) {
  ------------------
  |  Branch (5343:24): [True: 262, False: 80]
  ------------------
 5344|    262|		xmlFree(str2);
 5345|    262|		return (1);
 5346|    262|	    }
 5347|     80|            xmlFree(str2);
 5348|  9.64k|        } else if (neq)
  ------------------
  |  Branch (5348:20): [True: 354, False: 9.28k]
  ------------------
 5349|    354|	    return (1);
 5350|  11.0k|    }
 5351|    515|    return (0);
 5352|  1.18k|}
xpath.c:xmlXPathStringHash:
 5031|  1.18k|xmlXPathStringHash(const xmlChar * string) {
 5032|  1.18k|    if (string == NULL)
  ------------------
  |  Branch (5032:9): [True: 0, False: 1.18k]
  ------------------
 5033|      0|	return(0);
 5034|  1.18k|    if (string[0] == 0)
  ------------------
  |  Branch (5034:9): [True: 174, False: 1.01k]
  ------------------
 5035|    174|	return(0);
 5036|  1.01k|    return(string[0] + (string[1] << 8));
 5037|  1.18k|}
xpath.c:xmlXPathEqualValuesCommon:
 5540|   203k|  xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5541|   203k|    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|   203k|    switch (arg1->type) {
  ------------------
  |  Branch (5546:13): [True: 203k, False: 0]
  ------------------
 5547|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5547:9): [True: 0, False: 203k]
  ------------------
 5548|      0|	    break;
 5549|   109k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5549:9): [True: 109k, False: 94.1k]
  ------------------
 5550|   109k|	    switch (arg2->type) {
  ------------------
  |  Branch (5550:14): [True: 109k, False: 0]
  ------------------
 5551|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5551:10): [True: 0, False: 109k]
  ------------------
 5552|      0|		    break;
 5553|  72.9k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5553:3): [True: 72.9k, False: 36.7k]
  ------------------
 5554|  72.9k|		    ret = (arg1->boolval == arg2->boolval);
 5555|  72.9k|		    break;
 5556|  23.7k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5556:3): [True: 23.7k, False: 85.9k]
  ------------------
 5557|  23.7k|		    ret = (arg1->boolval ==
 5558|  23.7k|			   xmlXPathCastNumberToBoolean(arg2->floatval));
 5559|  23.7k|		    break;
 5560|  13.0k|		case XPATH_STRING:
  ------------------
  |  Branch (5560:3): [True: 13.0k, False: 96.6k]
  ------------------
 5561|  13.0k|		    if ((arg2->stringval == NULL) ||
  ------------------
  |  Branch (5561:11): [True: 0, False: 13.0k]
  ------------------
 5562|  13.0k|			(arg2->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5562:4): [True: 2.60k, False: 10.4k]
  ------------------
 5563|  10.4k|		    else
 5564|  10.4k|			ret = 1;
 5565|  13.0k|		    ret = (arg1->boolval == ret);
 5566|  13.0k|		    break;
 5567|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5567:3): [True: 0, False: 109k]
  ------------------
 5568|       |		    /* TODO */
 5569|      0|		    break;
 5570|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5570:3): [True: 0, False: 109k]
  ------------------
 5571|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5571:3): [True: 0, False: 109k]
  ------------------
 5572|      0|		    break;
 5573|   109k|	    }
 5574|   109k|	    break;
 5575|   109k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5575:9): [True: 92.8k, False: 110k]
  ------------------
 5576|  92.8k|	    switch (arg2->type) {
  ------------------
  |  Branch (5576:14): [True: 92.8k, False: 0]
  ------------------
 5577|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5577:10): [True: 0, False: 92.8k]
  ------------------
 5578|      0|		    break;
 5579|  22.3k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5579:3): [True: 22.3k, False: 70.4k]
  ------------------
 5580|  22.3k|		    ret = (arg2->boolval==
 5581|  22.3k|			   xmlXPathCastNumberToBoolean(arg1->floatval));
 5582|  22.3k|		    break;
 5583|    667|		case XPATH_STRING:
  ------------------
  |  Branch (5583:3): [True: 667, False: 92.1k]
  ------------------
 5584|    667|		    xmlXPathValuePush(ctxt, arg2);
 5585|    667|		    xmlXPathNumberFunction(ctxt, 1);
 5586|    667|		    arg2 = xmlXPathValuePop(ctxt);
 5587|    667|                    if (ctxt->error)
  ------------------
  |  Branch (5587:25): [True: 2, False: 665]
  ------------------
 5588|      2|                        break;
 5589|       |                    /* Falls through. */
 5590|  70.4k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5590:3): [True: 69.7k, False: 23.0k]
  ------------------
 5591|       |		    /* Hand check NaN and Infinity equalities */
 5592|  70.4k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5592:11): [True: 3.75k, False: 66.6k]
  ------------------
 5593|  66.6k|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5593:8): [True: 814, False: 65.8k]
  ------------------
 5594|  4.57k|		        ret = 0;
 5595|  65.8k|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5595:18): [True: 230, False: 65.6k]
  ------------------
 5596|    230|		        if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5596:15): [True: 111, False: 119]
  ------------------
 5597|    111|			    ret = 1;
 5598|    119|			else
 5599|    119|			    ret = 0;
 5600|  65.6k|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5600:18): [True: 560, False: 65.0k]
  ------------------
 5601|    560|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5601:8): [True: 36, False: 524]
  ------------------
 5602|     36|			    ret = 1;
 5603|    524|			else
 5604|    524|			    ret = 0;
 5605|  65.0k|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5605:18): [True: 520, False: 64.5k]
  ------------------
 5606|    520|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5606:8): [True: 0, False: 520]
  ------------------
 5607|      0|			    ret = 1;
 5608|    520|			else
 5609|    520|			    ret = 0;
 5610|  64.5k|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5610:18): [True: 532, False: 64.0k]
  ------------------
 5611|    532|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5611:8): [True: 0, False: 532]
  ------------------
 5612|      0|			    ret = 1;
 5613|    532|			else
 5614|    532|			    ret = 0;
 5615|  64.0k|		    } else {
 5616|  64.0k|		        ret = (arg1->floatval == arg2->floatval);
 5617|  64.0k|		    }
 5618|  70.4k|		    break;
 5619|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5619:3): [True: 0, False: 92.8k]
  ------------------
 5620|       |		    /* TODO */
 5621|      0|		    break;
 5622|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5622:3): [True: 0, False: 92.8k]
  ------------------
 5623|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5623:3): [True: 0, False: 92.8k]
  ------------------
 5624|      0|		    break;
 5625|  92.8k|	    }
 5626|  92.8k|	    break;
 5627|  92.8k|        case XPATH_STRING:
  ------------------
  |  Branch (5627:9): [True: 1.28k, False: 202k]
  ------------------
 5628|  1.28k|	    switch (arg2->type) {
  ------------------
  |  Branch (5628:14): [True: 1.28k, False: 0]
  ------------------
 5629|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5629:10): [True: 0, False: 1.28k]
  ------------------
 5630|      0|		    break;
 5631|    385|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5631:3): [True: 385, False: 902]
  ------------------
 5632|    385|		    if ((arg1->stringval == NULL) ||
  ------------------
  |  Branch (5632:11): [True: 0, False: 385]
  ------------------
 5633|    385|			(arg1->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5633:4): [True: 241, False: 144]
  ------------------
 5634|    144|		    else
 5635|    144|			ret = 1;
 5636|    385|		    ret = (arg2->boolval == ret);
 5637|    385|		    break;
 5638|     73|		case XPATH_STRING:
  ------------------
  |  Branch (5638:3): [True: 73, False: 1.21k]
  ------------------
 5639|     73|		    ret = xmlStrEqual(arg1->stringval, arg2->stringval);
 5640|     73|		    break;
 5641|    829|		case XPATH_NUMBER:
  ------------------
  |  Branch (5641:3): [True: 829, False: 458]
  ------------------
 5642|    829|		    xmlXPathValuePush(ctxt, arg1);
 5643|    829|		    xmlXPathNumberFunction(ctxt, 1);
 5644|    829|		    arg1 = xmlXPathValuePop(ctxt);
 5645|    829|                    if (ctxt->error)
  ------------------
  |  Branch (5645:25): [True: 4, False: 825]
  ------------------
 5646|      4|                        break;
 5647|       |		    /* Hand check NaN and Infinity equalities */
 5648|    825|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5648:11): [True: 488, False: 337]
  ------------------
 5649|    722|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5649:8): [True: 234, False: 103]
  ------------------
 5650|    722|		        ret = 0;
 5651|    722|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5651:18): [True: 3, False: 100]
  ------------------
 5652|      3|			if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5652:8): [True: 0, False: 3]
  ------------------
 5653|      0|			    ret = 1;
 5654|      3|			else
 5655|      3|			    ret = 0;
 5656|    100|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5656:18): [True: 0, False: 100]
  ------------------
 5657|      0|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5657:8): [True: 0, False: 0]
  ------------------
 5658|      0|			    ret = 1;
 5659|      0|			else
 5660|      0|			    ret = 0;
 5661|    100|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5661:18): [True: 9, False: 91]
  ------------------
 5662|      9|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5662:8): [True: 0, False: 9]
  ------------------
 5663|      0|			    ret = 1;
 5664|      9|			else
 5665|      9|			    ret = 0;
 5666|     91|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5666:18): [True: 4, False: 87]
  ------------------
 5667|      4|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5667:8): [True: 0, False: 4]
  ------------------
 5668|      0|			    ret = 1;
 5669|      4|			else
 5670|      4|			    ret = 0;
 5671|     87|		    } else {
 5672|     87|		        ret = (arg1->floatval == arg2->floatval);
 5673|     87|		    }
 5674|    825|		    break;
 5675|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5675:3): [True: 0, False: 1.28k]
  ------------------
 5676|       |		    /* TODO */
 5677|      0|		    break;
 5678|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5678:3): [True: 0, False: 1.28k]
  ------------------
 5679|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5679:3): [True: 0, False: 1.28k]
  ------------------
 5680|      0|		    break;
 5681|  1.28k|	    }
 5682|  1.28k|	    break;
 5683|  1.28k|        case XPATH_USERS:
  ------------------
  |  Branch (5683:9): [True: 0, False: 203k]
  ------------------
 5684|       |	    /* TODO */
 5685|      0|	    break;
 5686|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (5686:2): [True: 0, False: 203k]
  ------------------
 5687|      0|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5687:2): [True: 0, False: 203k]
  ------------------
 5688|      0|	    break;
 5689|   203k|    }
 5690|   203k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5691|   203k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5692|   203k|    return(ret);
 5693|   203k|}
xpath.c:xmlXPathCompareNodeSets:
 5178|  82.7k|	                xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5179|  82.7k|    int i, j, init = 0;
 5180|  82.7k|    double val1;
 5181|  82.7k|    double *values2;
 5182|  82.7k|    int ret = 0;
 5183|  82.7k|    xmlNodeSetPtr ns1;
 5184|  82.7k|    xmlNodeSetPtr ns2;
 5185|       |
 5186|  82.7k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5186:9): [True: 0, False: 82.7k]
  ------------------
 5187|  82.7k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5187:3): [True: 0, False: 82.7k]
  |  Branch (5187:36): [True: 0, False: 0]
  ------------------
 5188|      0|	xmlXPathFreeObject(arg2);
 5189|      0|        return(0);
 5190|      0|    }
 5191|  82.7k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5191:9): [True: 0, False: 82.7k]
  ------------------
 5192|  82.7k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5192:3): [True: 0, False: 82.7k]
  |  Branch (5192:36): [True: 0, False: 0]
  ------------------
 5193|      0|	xmlXPathFreeObject(arg1);
 5194|      0|	xmlXPathFreeObject(arg2);
 5195|      0|        return(0);
 5196|      0|    }
 5197|       |
 5198|  82.7k|    ns1 = arg1->nodesetval;
 5199|  82.7k|    ns2 = arg2->nodesetval;
 5200|       |
 5201|  82.7k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0)) {
  ------------------
  |  Branch (5201:9): [True: 0, False: 82.7k]
  |  Branch (5201:26): [True: 51.8k, False: 30.8k]
  ------------------
 5202|  51.8k|	xmlXPathFreeObject(arg1);
 5203|  51.8k|	xmlXPathFreeObject(arg2);
 5204|  51.8k|	return(0);
 5205|  51.8k|    }
 5206|  30.8k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0)) {
  ------------------
  |  Branch (5206:9): [True: 0, False: 30.8k]
  |  Branch (5206:26): [True: 26.7k, False: 4.17k]
  ------------------
 5207|  26.7k|	xmlXPathFreeObject(arg1);
 5208|  26.7k|	xmlXPathFreeObject(arg2);
 5209|  26.7k|	return(0);
 5210|  26.7k|    }
 5211|       |
 5212|  4.17k|    values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
 5213|  4.17k|    if (values2 == NULL) {
  ------------------
  |  Branch (5213:9): [True: 2, False: 4.17k]
  ------------------
 5214|      2|        xmlXPathPErrMemory(ctxt);
 5215|      2|	xmlXPathFreeObject(arg1);
 5216|      2|	xmlXPathFreeObject(arg2);
 5217|      2|	return(0);
 5218|      2|    }
 5219|  67.0k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5219:16): [True: 65.0k, False: 1.95k]
  ------------------
 5220|  65.0k|	val1 = xmlXPathNodeToNumberInternal(ctxt, ns1->nodeTab[i]);
 5221|  65.0k|	if (xmlXPathIsNaN(val1))
  ------------------
  |  Branch (5221:6): [True: 59.3k, False: 5.74k]
  ------------------
 5222|  59.3k|	    continue;
 5223|  65.5k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5223:13): [True: 61.9k, False: 3.52k]
  ------------------
 5224|  61.9k|	    if (init == 0) {
  ------------------
  |  Branch (5224:10): [True: 55.0k, False: 6.90k]
  ------------------
 5225|  55.0k|		values2[j] = xmlXPathNodeToNumberInternal(ctxt,
 5226|  55.0k|                                                          ns2->nodeTab[j]);
 5227|  55.0k|	    }
 5228|  61.9k|	    if (xmlXPathIsNaN(values2[j]))
  ------------------
  |  Branch (5228:10): [True: 55.1k, False: 6.84k]
  ------------------
 5229|  55.1k|		continue;
 5230|  6.84k|	    if (inf && strict)
  ------------------
  |  Branch (5230:10): [True: 316, False: 6.52k]
  |  Branch (5230:17): [True: 241, False: 75]
  ------------------
 5231|    241|		ret = (val1 < values2[j]);
 5232|  6.60k|	    else if (inf && !strict)
  ------------------
  |  Branch (5232:15): [True: 75, False: 6.52k]
  |  Branch (5232:22): [True: 75, False: 0]
  ------------------
 5233|     75|		ret = (val1 <= values2[j]);
 5234|  6.52k|	    else if (!inf && strict)
  ------------------
  |  Branch (5234:15): [True: 6.52k, False: 0]
  |  Branch (5234:23): [True: 6.22k, False: 302]
  ------------------
 5235|  6.22k|		ret = (val1 > values2[j]);
 5236|    302|	    else if (!inf && !strict)
  ------------------
  |  Branch (5236:15): [True: 302, False: 0]
  |  Branch (5236:23): [True: 302, False: 0]
  ------------------
 5237|    302|		ret = (val1 >= values2[j]);
 5238|  6.84k|	    if (ret)
  ------------------
  |  Branch (5238:10): [True: 2.21k, False: 4.62k]
  ------------------
 5239|  2.21k|		break;
 5240|  6.84k|	}
 5241|  5.74k|	if (ret)
  ------------------
  |  Branch (5241:6): [True: 2.21k, False: 3.52k]
  ------------------
 5242|  2.21k|	    break;
 5243|  3.52k|	init = 1;
 5244|  3.52k|    }
 5245|  4.17k|    xmlFree(values2);
 5246|  4.17k|    xmlXPathFreeObject(arg1);
 5247|  4.17k|    xmlXPathFreeObject(arg2);
 5248|  4.17k|    return(ret);
 5249|  4.17k|}
xpath.c:xmlXPathCompareNodeSetValue:
 5272|  64.2k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
 5273|  64.2k|    if ((val == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5273:9): [True: 0, False: 64.2k]
  |  Branch (5273:26): [True: 0, False: 64.2k]
  ------------------
 5274|  64.2k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5274:3): [True: 0, False: 64.2k]
  |  Branch (5274:35): [True: 0, False: 0]
  ------------------
 5275|      0|        return(0);
 5276|       |
 5277|  64.2k|    switch(val->type) {
 5278|  56.3k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5278:9): [True: 56.3k, False: 7.93k]
  ------------------
 5279|  56.3k|	    return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
 5280|      0|        case XPATH_NODESET:
  ------------------
  |  Branch (5280:9): [True: 0, False: 64.2k]
  ------------------
 5281|      0|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5281:9): [True: 0, False: 64.2k]
  ------------------
 5282|      0|	    return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
 5283|    804|        case XPATH_STRING:
  ------------------
  |  Branch (5283:9): [True: 804, False: 63.4k]
  ------------------
 5284|    804|	    return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
 5285|  7.12k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5285:9): [True: 7.12k, False: 57.1k]
  ------------------
 5286|  7.12k|	    xmlXPathValuePush(ctxt, arg);
 5287|  7.12k|	    xmlXPathBooleanFunction(ctxt, 1);
 5288|  7.12k|	    xmlXPathValuePush(ctxt, val);
 5289|  7.12k|	    return(xmlXPathCompareValues(ctxt, inf, strict));
 5290|      0|	default:
  ------------------
  |  Branch (5290:2): [True: 0, False: 64.2k]
  ------------------
 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|  64.2k|    }
 5295|      0|    return(0);
 5296|  64.2k|}
xpath.c:xmlXPathCompareNodeSetFloat:
 5061|  56.3k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr f) {
 5062|  56.3k|    int i, ret = 0;
 5063|  56.3k|    xmlNodeSetPtr ns;
 5064|  56.3k|    xmlChar *str2;
 5065|       |
 5066|  56.3k|    if ((f == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5066:9): [True: 0, False: 56.3k]
  |  Branch (5066:24): [True: 0, False: 56.3k]
  ------------------
 5067|  56.3k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5067:3): [True: 0, False: 56.3k]
  |  Branch (5067:35): [True: 0, False: 0]
  ------------------
 5068|      0|	xmlXPathReleaseObject(ctxt->context, arg);
 5069|      0|	xmlXPathReleaseObject(ctxt->context, f);
 5070|      0|        return(0);
 5071|      0|    }
 5072|  56.3k|    ns = arg->nodesetval;
 5073|  56.3k|    if (ns != NULL) {
  ------------------
  |  Branch (5073:9): [True: 56.3k, False: 0]
  ------------------
 5074|   106k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5074:13): [True: 50.8k, False: 55.3k]
  ------------------
 5075|  50.8k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5076|  50.8k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5076:11): [True: 50.8k, False: 7]
  ------------------
 5077|  50.8k|		 xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5078|  50.8k|		 xmlFree(str2);
 5079|  50.8k|		 xmlXPathNumberFunction(ctxt, 1);
 5080|  50.8k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f));
 5081|  50.8k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5082|  50.8k|		 if (ret)
  ------------------
  |  Branch (5082:8): [True: 1.04k, False: 49.8k]
  ------------------
 5083|  1.04k|		     break;
 5084|  50.8k|	     } else {
 5085|      7|                 xmlXPathPErrMemory(ctxt);
 5086|      7|             }
 5087|  50.8k|	}
 5088|  56.3k|    }
 5089|  56.3k|    xmlXPathReleaseObject(ctxt->context, arg);
 5090|  56.3k|    xmlXPathReleaseObject(ctxt->context, f);
 5091|  56.3k|    return(ret);
 5092|  56.3k|}
xpath.c:xmlXPathCacheObjectCopy:
 1881|   287k|{
 1882|   287k|    xmlXPathObjectPtr ret;
 1883|   287k|    xmlXPathContextPtr ctxt = pctxt->context;
 1884|       |
 1885|   287k|    if (val == NULL)
  ------------------
  |  Branch (1885:9): [True: 0, False: 287k]
  ------------------
 1886|      0|	return(NULL);
 1887|       |
 1888|   287k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1888:9): [True: 287k, False: 0]
  |  Branch (1888:27): [True: 0, False: 287k]
  ------------------
 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|   287k|    ret = xmlXPathObjectCopy(val);
 1911|   287k|    if (ret == NULL)
  ------------------
  |  Branch (1911:9): [True: 70, False: 287k]
  ------------------
 1912|     70|        xmlXPathPErrMemory(pctxt);
 1913|   287k|    return(ret);
 1914|   287k|}
xpath.c:xmlXPathCompareNodeSetString:
 5115|    804|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr s) {
 5116|    804|    int i, ret = 0;
 5117|    804|    xmlNodeSetPtr ns;
 5118|    804|    xmlChar *str2;
 5119|       |
 5120|    804|    if ((s == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5120:9): [True: 0, False: 804]
  |  Branch (5120:24): [True: 0, False: 804]
  ------------------
 5121|    804|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5121:3): [True: 0, False: 804]
  |  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|    804|    ns = arg->nodesetval;
 5127|    804|    if (ns != NULL) {
  ------------------
  |  Branch (5127:9): [True: 804, False: 0]
  ------------------
 5128|  1.58k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5128:13): [True: 781, False: 804]
  ------------------
 5129|    781|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5130|    781|	     if (str2 != NULL) {
  ------------------
  |  Branch (5130:11): [True: 780, False: 1]
  ------------------
 5131|    780|		 xmlXPathValuePush(ctxt,
 5132|    780|			   xmlXPathCacheNewString(ctxt, str2));
 5133|    780|		 xmlFree(str2);
 5134|    780|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s));
 5135|    780|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5136|    780|		 if (ret)
  ------------------
  |  Branch (5136:8): [True: 0, False: 780]
  ------------------
 5137|      0|		     break;
 5138|    780|	     } else {
 5139|      1|                 xmlXPathPErrMemory(ctxt);
 5140|      1|             }
 5141|    781|	}
 5142|    804|    }
 5143|    804|    xmlXPathReleaseObject(ctxt->context, arg);
 5144|    804|    xmlXPathReleaseObject(ctxt->context, s);
 5145|    804|    return(ret);
 5146|    804|}
xpath.c:xmlXPathCacheNewNodeSet:
 1689|  1.09M|{
 1690|  1.09M|    xmlXPathObjectPtr ret;
 1691|  1.09M|    xmlXPathContextPtr ctxt = pctxt->context;
 1692|       |
 1693|  1.09M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1693:9): [True: 1.09M, False: 0]
  |  Branch (1693:27): [True: 0, False: 1.09M]
  ------------------
 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.09M|    ret = xmlXPathNewNodeSet(val);
 1741|  1.09M|    if (ret == NULL)
  ------------------
  |  Branch (1741:9): [True: 400, False: 1.08M]
  ------------------
 1742|    400|        xmlXPathPErrMemory(pctxt);
 1743|  1.09M|    return(ret);
 1744|  1.09M|}
xpath.c:xmlXPathCacheNewFloat:
 1847|   356k|{
 1848|   356k|    xmlXPathObjectPtr ret;
 1849|   356k|    xmlXPathContextPtr ctxt = pctxt->context;
 1850|       |
 1851|   356k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1851:9): [True: 356k, False: 0]
  |  Branch (1851:27): [True: 0, False: 356k]
  ------------------
 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|   356k|    ret = xmlXPathNewFloat(val);
 1866|   356k|    if (ret == NULL)
  ------------------
  |  Branch (1866:9): [True: 132, False: 356k]
  ------------------
 1867|    132|        xmlXPathPErrMemory(pctxt);
 1868|   356k|    return(ret);
 1869|   356k|}
xpath.c:xmlXPathGetElementsByIds:
 6976|  9.19k|xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) {
 6977|  9.19k|    xmlNodeSetPtr ret;
 6978|  9.19k|    const xmlChar *cur = ids;
 6979|  9.19k|    xmlChar *ID;
 6980|  9.19k|    xmlAttrPtr attr;
 6981|  9.19k|    xmlNodePtr elem = NULL;
 6982|       |
 6983|  9.19k|    if (ids == NULL) return(NULL);
  ------------------
  |  Branch (6983:9): [True: 16, False: 9.17k]
  ------------------
 6984|       |
 6985|  9.17k|    ret = xmlXPathNodeSetCreate(NULL);
 6986|  9.17k|    if (ret == NULL)
  ------------------
  |  Branch (6986:9): [True: 5, False: 9.17k]
  ------------------
 6987|      5|        return(ret);
 6988|       |
 6989|  9.17k|    while (IS_BLANK_CH(*cur)) cur++;
 6990|  20.8k|    while (*cur != 0) {
  ------------------
  |  Branch (6990:12): [True: 11.6k, False: 9.14k]
  ------------------
 6991|   120k|	while ((!IS_BLANK_CH(*cur)) && (*cur != 0))
  ------------------
  |  |  137|   120k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   120k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 4.38k, False: 116k]
  |  |  |  |  ------------------
  |  |  |  |   91|   120k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 110k, False: 6.45k]
  |  |  |  |  |  Branch (91:23): [True: 529, False: 109k]
  |  |  |  |  ------------------
  |  |  |  |   92|   120k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 310, False: 115k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6991:33): [True: 109k, False: 6.45k]
  ------------------
 6992|   109k|	    cur++;
 6993|       |
 6994|  11.6k|        ID = xmlStrndup(ids, cur - ids);
 6995|  11.6k|	if (ID == NULL) {
  ------------------
  |  Branch (6995:6): [True: 21, False: 11.6k]
  ------------------
 6996|     21|            xmlXPathFreeNodeSet(ret);
 6997|     21|            return(NULL);
 6998|     21|        }
 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|  11.6k|        attr = xmlGetID(doc, ID);
 7007|  11.6k|        xmlFree(ID);
 7008|  11.6k|        if (attr != NULL) {
  ------------------
  |  Branch (7008:13): [True: 1.10k, False: 10.5k]
  ------------------
 7009|  1.10k|            if (attr->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (7009:17): [True: 1.10k, False: 0]
  ------------------
 7010|  1.10k|                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.10k|            if (elem != NULL) {
  ------------------
  |  Branch (7015:17): [True: 1.10k, False: 0]
  ------------------
 7016|  1.10k|                if (xmlXPathNodeSetAdd(ret, elem) < 0) {
  ------------------
  |  Branch (7016:21): [True: 1, False: 1.10k]
  ------------------
 7017|      1|                    xmlXPathFreeNodeSet(ret);
 7018|      1|                    return(NULL);
 7019|      1|                }
 7020|  1.10k|            }
 7021|  1.10k|        }
 7022|       |
 7023|  13.2k|	while (IS_BLANK_CH(*cur)) cur++;
 7024|  11.6k|	ids = cur;
 7025|  11.6k|    }
 7026|  9.14k|    return(ret);
 7027|  9.17k|}
xpath.c:xmlXPathCacheWrapNodeSet:
 1620|   969k|{
 1621|   969k|    xmlXPathObjectPtr ret;
 1622|   969k|    xmlXPathContextPtr ctxt = pctxt->context;
 1623|       |
 1624|   969k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1624:9): [True: 969k, False: 0]
  |  Branch (1624:27): [True: 0, False: 969k]
  ------------------
 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|   969k|    ret = xmlXPathWrapNodeSet(val);
 1640|   969k|    if (ret == NULL)
  ------------------
  |  Branch (1640:9): [True: 186, False: 969k]
  ------------------
 1641|    186|        xmlXPathPErrMemory(pctxt);
 1642|   969k|    return(ret);
 1643|   969k|}
xpath.c:xmlXPathCacheNewCString:
 1799|  5.33k|{
 1800|  5.33k|    return xmlXPathCacheNewString(pctxt, BAD_CAST val);
  ------------------
  |  |   34|  5.33k|#define BAD_CAST (xmlChar *)
  ------------------
 1801|  5.33k|}
xpath.c:xmlXPathCacheNewString:
 1756|   118k|{
 1757|   118k|    xmlXPathObjectPtr ret;
 1758|   118k|    xmlXPathContextPtr ctxt = pctxt->context;
 1759|       |
 1760|   118k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1760:9): [True: 118k, False: 0]
  |  Branch (1760:27): [True: 0, False: 118k]
  ------------------
 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|   118k|    ret = xmlXPathNewString(val);
 1784|   118k|    if (ret == NULL)
  ------------------
  |  Branch (1784:9): [True: 45, False: 118k]
  ------------------
 1785|     45|        xmlXPathPErrMemory(pctxt);
 1786|   118k|    return(ret);
 1787|   118k|}
xpath.c:xmlXPathCacheWrapString:
 1655|  43.2k|{
 1656|  43.2k|    xmlXPathObjectPtr ret;
 1657|  43.2k|    xmlXPathContextPtr ctxt = pctxt->context;
 1658|       |
 1659|  43.2k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1659:9): [True: 43.2k, False: 0]
  |  Branch (1659:27): [True: 0, False: 43.2k]
  ------------------
 1660|      0|	xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
 1661|       |
 1662|      0|	if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1662:6): [True: 0, False: 0]
  ------------------
 1663|      0|	    ret = cache->miscObjs;
 1664|      0|            cache->miscObjs = (void *) ret->stringval;
 1665|      0|            cache->numMisc -= 1;
 1666|      0|	    ret->type = XPATH_STRING;
 1667|      0|	    ret->stringval = val;
 1668|      0|	    return(ret);
 1669|      0|	}
 1670|      0|    }
 1671|       |
 1672|  43.2k|    ret = xmlXPathWrapString(val);
 1673|  43.2k|    if (ret == NULL)
  ------------------
  |  Branch (1673:9): [True: 35, False: 43.2k]
  ------------------
 1674|     35|        xmlXPathPErrMemory(pctxt);
 1675|  43.2k|    return(ret);
 1676|  43.2k|}
xpath.c:xmlXPathCacheNewBoolean:
 1813|   521k|{
 1814|   521k|    xmlXPathObjectPtr ret;
 1815|   521k|    xmlXPathContextPtr ctxt = pctxt->context;
 1816|       |
 1817|   521k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1817:9): [True: 521k, False: 0]
  |  Branch (1817:27): [True: 0, False: 521k]
  ------------------
 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|   521k|    ret = xmlXPathNewBoolean(val);
 1832|   521k|    if (ret == NULL)
  ------------------
  |  Branch (1832:9): [True: 82, False: 521k]
  ------------------
 1833|     82|        xmlXPathPErrMemory(pctxt);
 1834|   521k|    return(ret);
 1835|   521k|}
xpath.c:xmlXPathCheckOpLimit:
  803|  12.2M|xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) {
  804|  12.2M|    xmlXPathContextPtr xpctxt = ctxt->context;
  805|       |
  806|  12.2M|    if ((opCount > xpctxt->opLimit) ||
  ------------------
  |  Branch (806:9): [True: 0, False: 12.2M]
  ------------------
  807|  12.2M|        (xpctxt->opCount > xpctxt->opLimit - opCount)) {
  ------------------
  |  Branch (807:9): [True: 101, False: 12.2M]
  ------------------
  808|    101|        xpctxt->opCount = xpctxt->opLimit;
  809|    101|        xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED);
  810|    101|        return(-1);
  811|    101|    }
  812|       |
  813|  12.2M|    xpctxt->opCount += opCount;
  814|  12.2M|    return(0);
  815|  12.2M|}
xpath.c:xmlXPathCompileExpr:
 9088|  43.4k|xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
 9089|  43.4k|    xmlXPathContextPtr xpctxt = ctxt->context;
 9090|       |
 9091|  43.4k|    if (xpctxt != NULL) {
  ------------------
  |  Branch (9091:9): [True: 43.4k, False: 0]
  ------------------
 9092|  43.4k|        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  43.4k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9092:13): [True: 704, False: 42.7k]
  ------------------
 9093|  42.7k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|    704|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9094|       |        /*
 9095|       |         * Parsing a single '(' pushes about 10 functions on the call stack
 9096|       |         * before recursing!
 9097|       |         */
 9098|  42.7k|        xpctxt->depth += 10;
 9099|  42.7k|    }
 9100|       |
 9101|  42.7k|    xmlXPathCompAndExpr(ctxt);
 9102|  42.7k|    CHECK_ERROR;
  ------------------
  |  |  230|  42.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.18k, False: 37.5k]
  |  |  ------------------
  ------------------
 9103|  37.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  37.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  42.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9104|  39.4k|    while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2193|  39.4k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2195|  2.00k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9104:12): [True: 2.00k, False: 37.4k]
  |  Branch (9104:28): [True: 2.00k, False: 3]
  ------------------
 9105|  2.00k|	int op1 = ctxt->comp->last;
 9106|  2.00k|        SKIP(2);
  ------------------
  |  | 2194|  2.00k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9107|  2.00k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  2.00k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.71k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.71k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9108|  2.00k|        xmlXPathCompAndExpr(ctxt);
 9109|  2.00k|	CHECK_ERROR;
  ------------------
  |  |  230|  2.00k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 123, False: 1.88k]
  |  |  ------------------
  ------------------
 9110|  1.88k|	PUSH_BINARY_EXPR(XPATH_OP_OR, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  1.88k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  1.88k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  1.88k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9111|  1.88k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.88k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.88k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9112|  1.88k|    }
 9113|  37.4k|    if ((sort) && (ctxt->comp->steps[ctxt->comp->last].op != XPATH_OP_VALUE)) {
  ------------------
  |  Branch (9113:9): [True: 30.7k, False: 6.68k]
  |  Branch (9113:19): [True: 23.9k, False: 6.78k]
  ------------------
 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|  23.9k|	PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0);
  ------------------
  |  | 1091|  23.9k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  23.9k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 9121|  23.9k|    }
 9122|       |
 9123|  37.4k|    if (xpctxt != NULL)
  ------------------
  |  Branch (9123:9): [True: 37.4k, False: 0]
  ------------------
 9124|  37.4k|        xpctxt->depth -= 10;
 9125|  37.4k|}
xpath.c:xmlXPathCompAndExpr:
 9062|  44.7k|xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
 9063|  44.7k|    xmlXPathCompEqualityExpr(ctxt);
 9064|  44.7k|    CHECK_ERROR;
  ------------------
  |  |  230|  44.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.25k, False: 39.4k]
  |  |  ------------------
  ------------------
 9065|  39.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  39.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  44.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9066|  39.7k|    while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2193|  39.7k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    325|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    288|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9066:12): [True: 325, False: 39.3k]
  |  Branch (9066:28): [True: 288, False: 37]
  |  Branch (9066:47): [True: 284, False: 4]
  ------------------
 9067|    284|	int op1 = ctxt->comp->last;
 9068|    284|        SKIP(3);
  ------------------
  |  | 2194|    284|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9069|    284|	SKIP_BLANKS;
  ------------------
  |  | 2199|  2.26k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.26k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.26k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9070|    284|        xmlXPathCompEqualityExpr(ctxt);
 9071|    284|	CHECK_ERROR;
  ------------------
  |  |  230|    284|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 53, False: 231]
  |  |  ------------------
  ------------------
 9072|    231|	PUSH_BINARY_EXPR(XPATH_OP_AND, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|    231|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|    231|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|    231|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9073|    231|	SKIP_BLANKS;
  ------------------
  |  | 2199|    231|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    231|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9074|    231|    }
 9075|  39.4k|}
xpath.c:xmlXPathCompEqualityExpr:
 9033|  45.0k|xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
 9034|  45.0k|    xmlXPathCompRelationalExpr(ctxt);
 9035|  45.0k|    CHECK_ERROR;
  ------------------
  |  |  230|  45.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.72k, False: 40.2k]
  |  |  ------------------
  ------------------
 9036|  40.2k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  40.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  45.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9037|  73.8k|    while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  73.8k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  41.1k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2195|  1.40k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9037:12): [True: 32.7k, False: 41.1k]
  |  Branch (9037:29): [True: 1.40k, False: 39.7k]
  |  Branch (9037:45): [True: 1.39k, False: 10]
  ------------------
 9038|  34.1k|	int eq;
 9039|  34.1k|	int op1 = ctxt->comp->last;
 9040|       |
 9041|  34.1k|        if (CUR == '=') eq = 1;
  ------------------
  |  | 2193|  34.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9041:13): [True: 32.7k, False: 1.39k]
  ------------------
 9042|  1.39k|	else eq = 0;
 9043|  34.1k|	NEXT;
  ------------------
  |  | 2202|  34.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 34.1k, False: 0]
  |  |  ------------------
  ------------------
 9044|  34.1k|	if (!eq) NEXT;
  ------------------
  |  | 2202|  1.39k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.39k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9044:6): [True: 1.39k, False: 32.7k]
  ------------------
 9045|  34.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  77.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  77.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 77.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9046|  34.1k|        xmlXPathCompRelationalExpr(ctxt);
 9047|  34.1k|	CHECK_ERROR;
  ------------------
  |  |  230|  34.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 584, False: 33.5k]
  |  |  ------------------
  ------------------
 9048|  33.5k|	PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0);
  ------------------
  |  | 1094|  33.5k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  33.5k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  33.5k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9049|  33.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  33.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  33.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9050|  33.5k|    }
 9051|  40.2k|}
xpath.c:xmlXPathCompRelationalExpr:
 8996|  79.1k|xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
 8997|  79.1k|    xmlXPathCompAdditiveExpr(ctxt);
 8998|  79.1k|    CHECK_ERROR;
  ------------------
  |  |  230|  79.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.66k, False: 74.5k]
  |  |  ------------------
  ------------------
 8999|  74.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  74.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  79.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9000|  92.8k|    while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|  92.8k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|  90.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9000:12): [True: 2.10k, False: 90.7k]
  |  Branch (9000:28): [True: 16.8k, False: 73.8k]
  ------------------
 9001|  18.9k|	int inf, strict;
 9002|  18.9k|	int op1 = ctxt->comp->last;
 9003|       |
 9004|  18.9k|        if (CUR == '<') inf = 1;
  ------------------
  |  | 2193|  18.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9004:13): [True: 2.10k, False: 16.8k]
  ------------------
 9005|  16.8k|	else inf = 0;
 9006|  18.9k|	if (NXT(1) == '=') strict = 0;
  ------------------
  |  | 2195|  18.9k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9006:6): [True: 1.25k, False: 17.6k]
  ------------------
 9007|  17.6k|	else strict = 1;
 9008|  18.9k|	NEXT;
  ------------------
  |  | 2202|  18.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18.9k, False: 0]
  |  |  ------------------
  ------------------
 9009|  18.9k|	if (!strict) NEXT;
  ------------------
  |  | 2202|  1.25k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.25k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9009:6): [True: 1.25k, False: 17.6k]
  ------------------
 9010|  18.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  18.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.94k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.94k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9011|  18.9k|        xmlXPathCompAdditiveExpr(ctxt);
 9012|  18.9k|	CHECK_ERROR;
  ------------------
  |  |  230|  18.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 648, False: 18.2k]
  |  |  ------------------
  ------------------
 9013|  18.2k|	PUSH_BINARY_EXPR(XPATH_OP_CMP, op1, ctxt->comp->last, inf, strict);
  ------------------
  |  | 1094|  18.2k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  18.2k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  18.2k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9014|  18.2k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  18.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  18.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9015|  18.2k|    }
 9016|  74.5k|}
xpath.c:xmlXPathCompAdditiveExpr:
 8958|  98.1k|xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
 8959|       |
 8960|  98.1k|    xmlXPathCompMultiplicativeExpr(ctxt);
 8961|  98.1k|    CHECK_ERROR;
  ------------------
  |  |  230|  98.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.75k, False: 93.3k]
  |  |  ------------------
  ------------------
 8962|  93.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  93.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  98.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8963|   128k|    while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   128k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   123k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8963:12): [True: 4.82k, False: 123k]
  |  Branch (8963:28): [True: 30.8k, False: 92.8k]
  ------------------
 8964|  35.7k|	int plus;
 8965|  35.7k|	int op1 = ctxt->comp->last;
 8966|       |
 8967|  35.7k|        if (CUR == '+') plus = 1;
  ------------------
  |  | 2193|  35.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8967:13): [True: 4.82k, False: 30.8k]
  ------------------
 8968|  30.8k|	else plus = 0;
 8969|  35.7k|	NEXT;
  ------------------
  |  | 2202|  35.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 35.7k, False: 0]
  |  |  ------------------
  ------------------
 8970|  35.7k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  35.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.37k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.37k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8971|  35.7k|        xmlXPathCompMultiplicativeExpr(ctxt);
 8972|  35.7k|	CHECK_ERROR;
  ------------------
  |  |  230|  35.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 552, False: 35.1k]
  |  |  ------------------
  ------------------
 8973|  35.1k|	PUSH_BINARY_EXPR(XPATH_OP_PLUS, op1, ctxt->comp->last, plus, 0);
  ------------------
  |  | 1094|  35.1k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  35.1k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  35.1k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8974|  35.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  35.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  35.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8975|  35.1k|    }
 8976|  93.3k|}
xpath.c:xmlXPathCompMultiplicativeExpr:
 8919|   133k|xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
 8920|   133k|    xmlXPathCompUnaryExpr(ctxt);
 8921|   133k|    CHECK_ERROR;
  ------------------
  |  |  230|   133k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.94k, False: 128k]
  |  |  ------------------
  ------------------
 8922|   128k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   128k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   133k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8923|   660k|    while ((CUR == '*') ||
  ------------------
  |  | 2193|   660k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8923:12): [True: 531k, False: 129k]
  ------------------
 8924|   129k|           ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2193|   129k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    957|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    938|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8924:13): [True: 957, False: 128k]
  |  Branch (8924:29): [True: 938, False: 19]
  |  Branch (8924:48): [True: 927, False: 11]
  ------------------
 8925|   532k|           ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2193|   128k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    153|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    139|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8925:13): [True: 153, False: 128k]
  |  Branch (8925:29): [True: 139, False: 14]
  |  Branch (8925:48): [True: 130, False: 9]
  ------------------
 8926|   532k|	int op = -1;
 8927|   532k|	int op1 = ctxt->comp->last;
 8928|       |
 8929|   532k|        if (CUR == '*') {
  ------------------
  |  | 2193|   532k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8929:13): [True: 531k, False: 1.05k]
  ------------------
 8930|   531k|	    op = 0;
 8931|   531k|	    NEXT;
  ------------------
  |  | 2202|   531k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 531k, False: 0]
  |  |  ------------------
  ------------------
 8932|   531k|	} else if (CUR == 'd') {
  ------------------
  |  | 2193|  1.05k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8932:13): [True: 927, False: 130]
  ------------------
 8933|    927|	    op = 1;
 8934|    927|	    SKIP(3);
  ------------------
  |  | 2194|    927|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8935|    927|	} else if (CUR == 'm') {
  ------------------
  |  | 2193|    130|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8935:13): [True: 130, False: 0]
  ------------------
 8936|    130|	    op = 2;
 8937|    130|	    SKIP(3);
  ------------------
  |  | 2194|    130|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8938|    130|	}
 8939|   532k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   532k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.96k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.96k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8940|   532k|        xmlXPathCompUnaryExpr(ctxt);
 8941|   532k|	CHECK_ERROR;
  ------------------
  |  |  230|   532k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 365, False: 531k]
  |  |  ------------------
  ------------------
 8942|   531k|	PUSH_BINARY_EXPR(XPATH_OP_MULT, op1, ctxt->comp->last, op, 0);
  ------------------
  |  | 1094|   531k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|   531k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|   531k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8943|   531k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   531k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   531k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8944|   531k|    }
 8945|   128k|}
xpath.c:xmlXPathCompUnaryExpr:
 8884|   666k|xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
 8885|   666k|    int minus = 0;
 8886|   666k|    int found = 0;
 8887|       |
 8888|   666k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   666k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  13.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8889|   720k|    while (CUR == '-') {
  ------------------
  |  | 2193|   720k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8889:12): [True: 54.6k, False: 666k]
  ------------------
 8890|  54.6k|        minus = 1 - minus;
 8891|  54.6k|	found = 1;
 8892|  54.6k|	NEXT;
  ------------------
  |  | 2202|  54.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 54.6k, False: 0]
  |  |  ------------------
  ------------------
 8893|  54.6k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  54.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.24k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.24k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8894|  54.6k|    }
 8895|       |
 8896|   666k|    xmlXPathCompUnionExpr(ctxt);
 8897|   666k|    CHECK_ERROR;
  ------------------
  |  |  230|   666k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.30k, False: 660k]
  |  |  ------------------
  ------------------
 8898|   660k|    if (found) {
  ------------------
  |  Branch (8898:9): [True: 34.0k, False: 626k]
  ------------------
 8899|  34.0k|	if (minus)
  ------------------
  |  Branch (8899:6): [True: 28.6k, False: 5.41k]
  ------------------
 8900|  28.6k|	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 2, 0);
  ------------------
  |  | 1091|  28.6k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  28.6k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8901|  5.41k|	else
 8902|       |	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 3, 0);
  ------------------
  |  | 1091|  5.41k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  5.41k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8903|  34.0k|    }
 8904|   660k|}
xpath.c:xmlXPathCompUnionExpr:
 8856|   666k|xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
 8857|   666k|    xmlXPathCompPathExpr(ctxt);
 8858|   666k|    CHECK_ERROR;
  ------------------
  |  |  230|   666k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.12k, False: 660k]
  |  |  ------------------
  ------------------
 8859|   660k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   660k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   666k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8860|   670k|    while (CUR == '|') {
  ------------------
  |  | 2193|   670k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8860:12): [True: 9.50k, False: 660k]
  ------------------
 8861|  9.50k|	int op1 = ctxt->comp->last;
 8862|  9.50k|	PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  9.50k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  9.50k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8863|       |
 8864|  9.50k|	NEXT;
  ------------------
  |  | 2202|  9.50k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.50k, False: 0]
  |  |  ------------------
  ------------------
 8865|  9.50k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  9.50k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.19k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8866|  9.50k|	xmlXPathCompPathExpr(ctxt);
 8867|       |
 8868|  9.50k|	PUSH_BINARY_EXPR(XPATH_OP_UNION, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  9.50k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  9.50k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  9.50k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8869|       |
 8870|  9.50k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  9.50k|    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|  9.50k|    }
 8872|   660k|}
xpath.c:xmlXPathCompPathExpr:
 8734|   675k|xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 8735|   675k|    int lc = 1;           /* Should we branch to LocationPath ?         */
 8736|   675k|    xmlChar *name = NULL; /* we may have to preparse a name to find out */
 8737|       |
 8738|   675k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   675k|    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|   675k|    if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|   675k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|   674k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8739:9): [True: 985, False: 674k]
  |  Branch (8739:25): [True: 4.10k, False: 670k]
  ------------------
 8740|   670k|	(IS_ASCII_DIGIT(CUR)) ||
  ------------------
  |  |  230|   670k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 96.0k, False: 574k]
  |  |  |  Branch (230:45): [True: 32.8k, False: 63.1k]
  |  |  ------------------
  ------------------
 8741|   637k|        (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|   637k|#define CUR (*ctxt->cur)
  ------------------
                      (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|   636k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8741:9): [True: 1.62k, False: 636k]
  |  Branch (8741:26): [True: 122, False: 635k]
  ------------------
 8742|   635k|	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|   635k|#define CUR (*ctxt->cur)
  ------------------
              	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  7.68k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 4.84k, False: 2.84k]
  |  |  |  Branch (230:45): [True: 3.01k, False: 1.82k]
  |  |  ------------------
  ------------------
  |  Branch (8742:3): [True: 7.68k, False: 628k]
  ------------------
 8743|  42.6k|	lc = 0;
 8744|   632k|    } else if (CUR == '*') {
  ------------------
  |  | 2193|   632k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8744:16): [True: 520k, False: 112k]
  ------------------
 8745|       |	/* relative or absolute location path */
 8746|   520k|	lc = 1;
 8747|   520k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   112k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8747:16): [True: 44.1k, False: 68.2k]
  ------------------
 8748|       |	/* relative or absolute location path */
 8749|  44.1k|	lc = 1;
 8750|  68.2k|    } else if (CUR == '@') {
  ------------------
  |  | 2193|  68.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8750:16): [True: 787, False: 67.4k]
  ------------------
 8751|       |	/* relative abbreviated attribute location path */
 8752|    787|	lc = 1;
 8753|  67.4k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  67.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8753:16): [True: 4.67k, False: 62.7k]
  ------------------
 8754|       |	/* relative abbreviated attribute location path */
 8755|  4.67k|	lc = 1;
 8756|  62.7k|    } 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|  62.7k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  62.7k|    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|  62.7k|	name = xmlXPathScanName(ctxt);
 8770|  62.7k|	if ((name != NULL) && (xmlStrstr(name, (xmlChar *) "::") != NULL)) {
  ------------------
  |  Branch (8770:6): [True: 59.8k, False: 2.87k]
  |  Branch (8770:24): [True: 630, False: 59.2k]
  ------------------
 8771|    630|	    lc = 1;
 8772|    630|	    xmlFree(name);
 8773|  62.1k|	} else if (name != NULL) {
  ------------------
  |  Branch (8773:13): [True: 59.2k, False: 2.87k]
  ------------------
 8774|  59.2k|	    int len =xmlStrlen(name);
 8775|       |
 8776|       |
 8777|   617k|	    while (NXT(len) != 0) {
  ------------------
  |  | 2195|   617k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8777:13): [True: 616k, False: 805]
  ------------------
 8778|   616k|		if (NXT(len) == '/') {
  ------------------
  |  | 2195|   616k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8778:7): [True: 3.70k, False: 613k]
  ------------------
 8779|       |		    /* element name */
 8780|  3.70k|		    lc = 1;
 8781|  3.70k|		    break;
 8782|   613k|		} else if (IS_BLANK_CH(NXT(len))) {
  ------------------
  |  |  137|   613k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   613k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 556k, False: 56.2k]
  |  |  |  |  ------------------
  |  |  |  |   91|   613k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 56.2k, False: 3]
  |  |  |  |  |  Branch (91:23): [True: 1.30k, False: 54.9k]
  |  |  |  |  ------------------
  |  |  |  |   92|   613k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 172, False: 54.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8783|       |		    /* ignore blanks */
 8784|   558k|		    ;
 8785|   558k|		} else if (NXT(len) == ':') {
  ------------------
  |  | 2195|  54.7k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8785:14): [True: 504, False: 54.2k]
  ------------------
 8786|    504|		    lc = 1;
 8787|    504|		    break;
 8788|  54.2k|		} else if ((NXT(len) == '(')) {
  ------------------
  |  | 2195|  54.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8788:14): [True: 11.7k, False: 42.4k]
  ------------------
 8789|       |		    /* Node Type or Function */
 8790|  11.7k|		    if (xmlXPathIsNodeType(name)) {
  ------------------
  |  Branch (8790:11): [True: 227, False: 11.5k]
  ------------------
 8791|    227|			lc = 1;
 8792|  11.5k|		    } else {
 8793|  11.5k|			lc = 0;
 8794|  11.5k|		    }
 8795|  11.7k|                    break;
 8796|  42.4k|		} else if ((NXT(len) == '[')) {
  ------------------
  |  | 2195|  42.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8796:14): [True: 1.00k, False: 41.4k]
  ------------------
 8797|       |		    /* element name */
 8798|  1.00k|		    lc = 1;
 8799|  1.00k|		    break;
 8800|  41.4k|		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  41.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
              		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  40.6k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8800:14): [True: 859, False: 40.6k]
  |  Branch (8800:35): [True: 6.79k, False: 33.8k]
  ------------------
 8801|  33.8k|			   (NXT(len) == '=')) {
  ------------------
  |  | 2195|  33.8k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8801:7): [True: 5.84k, False: 27.9k]
  ------------------
 8802|  13.4k|		    lc = 1;
 8803|  13.4k|		    break;
 8804|  27.9k|		} else {
 8805|  27.9k|		    lc = 1;
 8806|  27.9k|		    break;
 8807|  27.9k|		}
 8808|   558k|		len++;
 8809|   558k|	    }
 8810|  59.2k|	    if (NXT(len) == 0) {
  ------------------
  |  | 2195|  59.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8810:10): [True: 805, False: 58.4k]
  ------------------
 8811|       |		/* element name */
 8812|    805|		lc = 1;
 8813|    805|	    }
 8814|  59.2k|	    xmlFree(name);
 8815|  59.2k|	} else {
 8816|       |	    /* make sure all cases are covered explicitly */
 8817|  2.87k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  2.87k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8818|      0|	}
 8819|  62.7k|    }
 8820|       |
 8821|   672k|    if (lc) {
  ------------------
  |  Branch (8821:9): [True: 618k, False: 54.2k]
  ------------------
 8822|   618k|	if (CUR == '/') {
  ------------------
  |  | 2193|   618k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8822:6): [True: 44.1k, False: 574k]
  ------------------
 8823|  44.1k|	    PUSH_LEAVE_EXPR(XPATH_OP_ROOT, 0, 0);
  ------------------
  |  | 1088|  44.1k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  44.1k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8824|   574k|	} else {
 8825|   574k|	    PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|   574k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|   574k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8826|   574k|	}
 8827|   618k|	xmlXPathCompLocationPath(ctxt);
 8828|   618k|    } else {
 8829|  54.2k|	xmlXPathCompFilterExpr(ctxt);
 8830|  54.2k|	CHECK_ERROR;
  ------------------
  |  |  230|  54.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.20k, False: 52.0k]
  |  |  ------------------
  ------------------
 8831|  52.0k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  52.0k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  2.41k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8831:6): [True: 2.41k, False: 49.5k]
  |  Branch (8831:22): [True: 660, False: 1.75k]
  ------------------
 8832|    660|	    SKIP(2);
  ------------------
  |  | 2194|    660|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8833|    660|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.97k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.97k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.97k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8834|       |
 8835|    660|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|    660|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    660|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 8836|    660|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 8837|       |
 8838|    660|	    xmlXPathCompRelativeLocationPath(ctxt);
 8839|  51.3k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  51.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8839:13): [True: 1.75k, False: 49.5k]
  ------------------
 8840|  1.75k|	    xmlXPathCompRelativeLocationPath(ctxt);
 8841|  1.75k|	}
 8842|  52.0k|    }
 8843|   670k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   670k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   677k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8844|   670k|}
xpath.c:xmlXPathScanName:
 8705|  62.7k|xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
 8706|  62.7k|    const xmlChar *end;
 8707|  62.7k|    xmlChar *ret;
 8708|       |
 8709|  62.7k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  62.7k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8710|  62.7k|    if (end == NULL) {
  ------------------
  |  Branch (8710:9): [True: 1, False: 62.7k]
  ------------------
 8711|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8712|      0|    }
 8713|  62.7k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8713:9): [True: 2.81k, False: 59.9k]
  ------------------
 8714|  2.81k|        return(NULL);
 8715|       |
 8716|  59.9k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8717|  59.9k|    if (ret == NULL)
  ------------------
  |  Branch (8717:9): [True: 60, False: 59.8k]
  ------------------
 8718|     60|        xmlXPathPErrMemory(ctxt);
 8719|  59.9k|    return(ret);
 8720|  62.7k|}
xpath.c:xmlXPathCompLocationPath:
 9524|   618k|xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
 9525|   618k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   618k|    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|   618k|    if (CUR != '/') {
  ------------------
  |  | 2193|   618k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9526:9): [True: 574k, False: 44.1k]
  ------------------
 9527|   574k|        xmlXPathCompRelativeLocationPath(ctxt);
 9528|   574k|    } else {
 9529|  91.0k|	while (CUR == '/') {
  ------------------
  |  | 2193|  91.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9529:9): [True: 47.2k, False: 43.7k]
  ------------------
 9530|  47.2k|	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  47.2k|#define CUR (*ctxt->cur)
  ------------------
              	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  47.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9530:10): [True: 47.2k, False: 0]
  |  Branch (9530:26): [True: 10.7k, False: 36.5k]
  ------------------
 9531|  10.7k|		SKIP(2);
  ------------------
  |  | 2194|  10.7k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9532|  10.7k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  10.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.17k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.17k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9533|  10.7k|		PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  10.7k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  10.7k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9534|  10.7k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9535|  10.7k|		xmlXPathCompRelativeLocationPath(ctxt);
 9536|  36.5k|	    } else if (CUR == '/') {
  ------------------
  |  | 2193|  36.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9536:17): [True: 36.5k, False: 0]
  ------------------
 9537|  36.5k|		NEXT;
  ------------------
  |  | 2202|  36.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 36.5k, False: 0]
  |  |  ------------------
  ------------------
 9538|  36.5k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  38.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  38.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 38.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9539|  36.5k|		if ((CUR != 0) &&
  ------------------
  |  | 2193|  36.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9539:7): [True: 35.8k, False: 674]
  ------------------
 9540|  35.8k|		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  |  222|  35.8k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 8.62k, False: 27.2k]
  |  |  ------------------
  |  |  223|  35.8k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 7.01k, False: 1.60k]
  |  |  ------------------
  ------------------
              		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  | 2193|  28.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9540:34): [True: 455, False: 28.3k]
  ------------------
 9541|  28.3k|                     (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  28.3k|#define CUR (*ctxt->cur)
  ------------------
                                   (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  27.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9541:22): [True: 546, False: 27.8k]
  |  Branch (9541:38): [True: 3.46k, False: 24.3k]
  ------------------
 9542|  24.3k|		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  24.3k|#define CUR (*ctxt->cur)
  ------------------
              		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  23.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9542:8): [True: 591, False: 23.7k]
  |  Branch (9542:24): [True: 18.1k, False: 5.66k]
  ------------------
 9543|  30.1k|		    xmlXPathCompRelativeLocationPath(ctxt);
 9544|  36.5k|	    }
 9545|  47.2k|	    CHECK_ERROR;
  ------------------
  |  |  230|  47.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 383, False: 46.9k]
  |  |  ------------------
  ------------------
 9546|  47.2k|	}
 9547|  44.1k|    }
 9548|   618k|}
xpath.c:xmlXPathCompFilterExpr:
 8683|  54.2k|xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
 8684|  54.2k|    xmlXPathCompPrimaryExpr(ctxt);
 8685|  54.2k|    CHECK_ERROR;
  ------------------
  |  |  230|  54.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.72k, False: 52.4k]
  |  |  ------------------
  ------------------
 8686|  52.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  52.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  54.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8687|       |
 8688|  60.3k|    while (CUR == '[') {
  ------------------
  |  | 2193|  60.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8688:12): [True: 7.86k, False: 52.4k]
  ------------------
 8689|  7.86k|	xmlXPathCompPredicate(ctxt, 1);
 8690|  7.86k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  7.86k|    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.86k|    }
 8692|       |
 8693|       |
 8694|  52.4k|}
xpath.c:xmlXPathCompPrimaryExpr:
 8645|  54.2k|xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
 8646|  54.2k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  54.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8647|  54.2k|    if (CUR == '$') xmlXPathCompVariableReference(ctxt);
  ------------------
  |  | 2193|  54.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8647:9): [True: 985, False: 53.2k]
  ------------------
 8648|  53.2k|    else if (CUR == '(') {
  ------------------
  |  | 2193|  53.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8648:14): [True: 4.10k, False: 49.1k]
  ------------------
 8649|  4.10k|	NEXT;
  ------------------
  |  | 2202|  4.10k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.10k, False: 0]
  |  |  ------------------
  ------------------
 8650|  4.10k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  7.68k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.68k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.68k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8651|  4.10k|	xmlXPathCompileExpr(ctxt, 1);
 8652|  4.10k|	CHECK_ERROR;
  ------------------
  |  |  230|  4.10k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 553, False: 3.55k]
  |  |  ------------------
  ------------------
 8653|  3.55k|	if (CUR != ')') {
  ------------------
  |  | 2193|  3.55k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8653:6): [True: 41, False: 3.51k]
  ------------------
 8654|     41|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     41|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8655|      0|	}
 8656|  3.51k|	NEXT;
  ------------------
  |  | 2202|  3.51k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.51k, False: 0]
  |  |  ------------------
  ------------------
 8657|  3.51k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  14.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  18.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 14.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8658|  49.1k|    } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  98.2k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 44.3k, False: 4.76k]
  |  |  |  Branch (230:45): [True: 32.8k, False: 11.5k]
  |  |  ------------------
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  16.2k|#define CUR (*ctxt->cur)
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  3.01k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 3.01k, False: 0]
  |  |  |  Branch (230:45): [True: 3.01k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (8658:40): [True: 3.01k, False: 13.2k]
  ------------------
 8659|  35.8k|	xmlXPathCompNumber(ctxt);
 8660|  35.8k|    } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  13.2k|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  11.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8660:16): [True: 1.62k, False: 11.6k]
  |  Branch (8660:33): [True: 122, False: 11.5k]
  ------------------
 8661|  1.74k|	xmlXPathCompLiteral(ctxt);
 8662|  11.5k|    } else {
 8663|  11.5k|	xmlXPathCompFunctionCall(ctxt);
 8664|  11.5k|    }
 8665|  53.6k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  61.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   115k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 61.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8666|  53.6k|}
xpath.c:xmlXPathCompVariableReference:
 8511|    985|xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
 8512|    985|    xmlChar *name;
 8513|    985|    xmlChar *prefix;
 8514|       |
 8515|    985|    SKIP_BLANKS;
  ------------------
  |  | 2199|    985|    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|    985|    if (CUR != '$') {
  ------------------
  |  | 2193|    985|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8516:9): [True: 0, False: 985]
  ------------------
 8517|      0|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8518|      0|    }
 8519|    985|    NEXT;
  ------------------
  |  | 2202|    985|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 985, False: 0]
  |  |  ------------------
  ------------------
 8520|    985|    name = xmlXPathParseQName(ctxt, &prefix);
 8521|    985|    if (name == NULL) {
  ------------------
  |  Branch (8521:9): [True: 38, False: 947]
  ------------------
 8522|     38|        xmlFree(prefix);
 8523|     38|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|     38|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8524|      0|    }
 8525|    947|    ctxt->comp->last = -1;
 8526|    947|    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|    947|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    947|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8526:9): [True: 2, False: 945]
  ------------------
 8527|      2|        xmlFree(prefix);
 8528|      2|        xmlFree(name);
 8529|      2|    }
 8530|    947|    SKIP_BLANKS;
  ------------------
  |  | 2199|  5.23k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.18k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.23k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8531|    947|    if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
  ------------------
  |  |  241|    947|#define XML_XPATH_NOVAR	  (1<<1)
  ------------------
  |  Branch (8531:9): [True: 947, False: 0]
  |  Branch (8531:36): [True: 0, False: 947]
  ------------------
 8532|      0|	XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8533|      0|    }
 8534|    947|}
xpath.c:xmlXPathParseQName:
 8178|  12.5k|xmlXPathParseQName(xmlXPathParserContextPtr ctxt, xmlChar **prefix) {
 8179|  12.5k|    xmlChar *ret = NULL;
 8180|       |
 8181|  12.5k|    *prefix = NULL;
 8182|  12.5k|    ret = xmlXPathParseNCName(ctxt);
 8183|  12.5k|    if (ret && CUR == ':') {
  ------------------
  |  | 2193|  12.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8183:9): [True: 12.4k, False: 56]
  |  Branch (8183:16): [True: 1.19k, False: 11.2k]
  ------------------
 8184|  1.19k|        *prefix = ret;
 8185|  1.19k|	NEXT;
  ------------------
  |  | 2202|  1.19k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.19k, False: 0]
  |  |  ------------------
  ------------------
 8186|  1.19k|	ret = xmlXPathParseNCName(ctxt);
 8187|  1.19k|    }
 8188|  12.5k|    return(ret);
 8189|  12.5k|}
xpath.c:xmlXPathCompNumber:
 8337|  35.8k|{
 8338|  35.8k|    double ret = 0.0;
 8339|  35.8k|    int ok = 0;
 8340|  35.8k|    int exponent = 0;
 8341|  35.8k|    int is_exponent_negative = 0;
 8342|  35.8k|    xmlXPathObjectPtr num;
 8343|  35.8k|#ifdef __GNUC__
 8344|  35.8k|    unsigned long tmp = 0;
 8345|  35.8k|    double temp;
 8346|  35.8k|#endif
 8347|       |
 8348|  35.8k|    CHECK_ERROR;
  ------------------
  |  |  230|  35.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 25, False: 35.8k]
  |  |  ------------------
  ------------------
 8349|  35.8k|    if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  35.8k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  32.8k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  32.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8349:9): [True: 32.8k, False: 3.01k]
  |  Branch (8349:26): [True: 0, False: 32.8k]
  |  Branch (8349:41): [True: 0, False: 32.8k]
  ------------------
 8350|      0|        XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8351|      0|    }
 8352|  35.8k|#ifdef __GNUC__
 8353|       |    /*
 8354|       |     * tmp/temp is a workaround against a gcc compiler bug
 8355|       |     * http://veillard.com/gcc.bug
 8356|       |     */
 8357|  35.8k|    ret = 0;
 8358|   120k|    while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   120k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  98.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8358:12): [True: 98.7k, False: 21.6k]
  |  Branch (8358:28): [True: 84.5k, False: 14.2k]
  ------------------
 8359|  84.5k|	ret = ret * 10;
 8360|  84.5k|	tmp = (CUR - '0');
  ------------------
  |  | 2193|  84.5k|#define CUR (*ctxt->cur)
  ------------------
 8361|  84.5k|        ok = 1;
 8362|  84.5k|        NEXT;
  ------------------
  |  | 2202|  84.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 84.5k, False: 0]
  |  |  ------------------
  ------------------
 8363|  84.5k|	temp = (double) tmp;
 8364|  84.5k|	ret = ret + temp;
 8365|  84.5k|    }
 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|  35.8k|    if (CUR == '.') {
  ------------------
  |  | 2193|  35.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8374:9): [True: 5.15k, False: 30.6k]
  ------------------
 8375|  5.15k|	int v, frac = 0, max;
 8376|  5.15k|	double fraction = 0;
 8377|       |
 8378|  5.15k|        NEXT;
  ------------------
  |  | 2202|  5.15k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.15k, False: 0]
  |  |  ------------------
  ------------------
 8379|  5.15k|        if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  5.15k|#define CUR (*ctxt->cur)
  ------------------
                      if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  4.22k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8379:14): [True: 935, False: 4.22k]
  |  Branch (8379:29): [True: 578, False: 3.64k]
  |  Branch (8379:45): [True: 0, False: 1.51k]
  ------------------
 8380|      0|            XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8381|      0|        }
 8382|  7.65k|        while (CUR == '0') {
  ------------------
  |  | 2193|  7.65k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8382:16): [True: 2.50k, False: 5.15k]
  ------------------
 8383|  2.50k|            frac = frac + 1;
 8384|  2.50k|            NEXT;
  ------------------
  |  | 2202|  2.50k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.50k, False: 0]
  |  |  ------------------
  ------------------
 8385|  2.50k|        }
 8386|  5.15k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  5.15k|#define MAX_FRAC 20
  ------------------
 8387|  23.2k|        while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  23.2k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  20.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8387:16): [True: 20.5k, False: 2.70k]
  |  Branch (8387:32): [True: 18.2k, False: 2.37k]
  |  Branch (8387:48): [True: 18.1k, False: 79]
  ------------------
 8388|  18.1k|	    v = (CUR - '0');
  ------------------
  |  | 2193|  18.1k|#define CUR (*ctxt->cur)
  ------------------
 8389|  18.1k|	    fraction = fraction * 10 + v;
 8390|  18.1k|	    frac = frac + 1;
 8391|  18.1k|            NEXT;
  ------------------
  |  | 2202|  18.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18.1k, False: 0]
  |  |  ------------------
  ------------------
 8392|  18.1k|        }
 8393|  5.15k|        fraction /= pow(10.0, frac);
 8394|  5.15k|        ret = ret + fraction;
 8395|  5.61k|        while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  5.61k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  2.83k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8395:16): [True: 2.83k, False: 2.77k]
  |  Branch (8395:32): [True: 452, False: 2.38k]
  ------------------
 8396|    452|            NEXT;
  ------------------
  |  | 2202|  5.61k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 452, False: 0]
  |  |  ------------------
  ------------------
 8397|  5.15k|    }
 8398|  35.8k|    if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  35.8k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  34.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8398:9): [True: 934, False: 34.9k]
  |  Branch (8398:25): [True: 4.26k, False: 30.6k]
  ------------------
 8399|  5.20k|        NEXT;
  ------------------
  |  | 2202|  5.20k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.20k, False: 0]
  |  |  ------------------
  ------------------
 8400|  5.20k|        if (CUR == '-') {
  ------------------
  |  | 2193|  5.20k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8400:13): [True: 771, False: 4.43k]
  ------------------
 8401|    771|            is_exponent_negative = 1;
 8402|    771|            NEXT;
  ------------------
  |  | 2202|    771|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 771, False: 0]
  |  |  ------------------
  ------------------
 8403|  4.43k|        } else if (CUR == '+') {
  ------------------
  |  | 2193|  4.43k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8403:20): [True: 1.01k, False: 3.42k]
  ------------------
 8404|  1.01k|	    NEXT;
  ------------------
  |  | 2202|  1.01k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.01k, False: 0]
  |  |  ------------------
  ------------------
 8405|  1.01k|	}
 8406|  22.6k|        while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  22.6k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  18.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8406:16): [True: 18.7k, False: 3.87k]
  |  Branch (8406:32): [True: 17.4k, False: 1.32k]
  ------------------
 8407|  17.4k|            if (exponent < 1000000)
  ------------------
  |  Branch (8407:17): [True: 16.1k, False: 1.25k]
  ------------------
 8408|  16.1k|                exponent = exponent * 10 + (CUR - '0');
  ------------------
  |  | 2193|  16.1k|#define CUR (*ctxt->cur)
  ------------------
 8409|  17.4k|            NEXT;
  ------------------
  |  | 2202|  17.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 17.4k, False: 0]
  |  |  ------------------
  ------------------
 8410|  17.4k|        }
 8411|  5.20k|        if (is_exponent_negative)
  ------------------
  |  Branch (8411:13): [True: 771, False: 4.43k]
  ------------------
 8412|    771|            exponent = -exponent;
 8413|  5.20k|        ret *= pow(10.0, (double) exponent);
 8414|  5.20k|    }
 8415|  35.8k|    num = xmlXPathCacheNewFloat(ctxt, ret);
 8416|  35.8k|    if (num == NULL) {
  ------------------
  |  Branch (8416:9): [True: 33, False: 35.8k]
  ------------------
 8417|     33|	ctxt->error = XPATH_MEMORY_ERROR;
 8418|  35.8k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
  ------------------
  |  | 1085|  35.8k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  35.8k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8418:16): [True: 7, False: 35.7k]
  ------------------
 8419|  35.8k|                              NULL) == -1) {
 8420|      7|        xmlXPathReleaseObject(ctxt->context, num);
 8421|      7|    }
 8422|  35.8k|}
xpath.c:xmlXPathCompLiteral:
 8478|  1.74k|xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
 8479|  1.74k|    xmlChar *ret = NULL;
 8480|  1.74k|    xmlXPathObjectPtr lit;
 8481|       |
 8482|  1.74k|    ret = xmlXPathParseLiteral(ctxt);
 8483|  1.74k|    if (ret == NULL)
  ------------------
  |  Branch (8483:9): [True: 127, False: 1.62k]
  ------------------
 8484|    127|        return;
 8485|  1.62k|    lit = xmlXPathCacheNewString(ctxt, ret);
 8486|  1.62k|    if (lit == NULL) {
  ------------------
  |  Branch (8486:9): [True: 7, False: 1.61k]
  ------------------
 8487|      7|        ctxt->error = XPATH_MEMORY_ERROR;
 8488|  1.61k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
  ------------------
  |  | 1085|  1.61k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.61k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8488:16): [True: 6, False: 1.60k]
  ------------------
 8489|  1.61k|                              NULL) == -1) {
 8490|      6|        xmlXPathReleaseObject(ctxt->context, lit);
 8491|      6|    }
 8492|  1.62k|    xmlFree(ret);
 8493|  1.62k|}
xpath.c:xmlXPathParseLiteral:
 8434|  1.86k|xmlXPathParseLiteral(xmlXPathParserContextPtr ctxt) {
 8435|  1.86k|    const xmlChar *q;
 8436|  1.86k|    xmlChar *ret = NULL;
 8437|  1.86k|    int quote;
 8438|       |
 8439|  1.86k|    if (CUR == '"') {
  ------------------
  |  | 2193|  1.86k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8439:9): [True: 124, False: 1.73k]
  ------------------
 8440|    124|        quote = '"';
 8441|  1.73k|    } else if (CUR == '\'') {
  ------------------
  |  | 2193|  1.73k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8441:16): [True: 1.72k, False: 8]
  ------------------
 8442|  1.72k|        quote = '\'';
 8443|  1.72k|    } else {
 8444|      8|	XP_ERRORNULL(XPATH_START_LITERAL_ERROR);
  ------------------
  |  |  633|      8|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8445|      0|    }
 8446|       |
 8447|  1.85k|    NEXT;
  ------------------
  |  | 2202|  1.85k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.85k, False: 0]
  |  |  ------------------
  ------------------
 8448|  1.85k|    q = CUR_PTR;
  ------------------
  |  | 2196|  1.85k|#define CUR_PTR ctxt->cur
  ------------------
 8449|  21.1k|    while (CUR != quote) {
  ------------------
  |  | 2193|  21.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8449:12): [True: 19.4k, False: 1.72k]
  ------------------
 8450|  19.4k|        int ch;
 8451|  19.4k|        int len = 4;
 8452|       |
 8453|  19.4k|        if (CUR == 0)
  ------------------
  |  | 2193|  19.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8453:13): [True: 107, False: 19.3k]
  ------------------
 8454|  19.3k|            XP_ERRORNULL(XPATH_UNFINISHED_LITERAL_ERROR);
  ------------------
  |  |  633|    107|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8455|  19.3k|        ch = xmlGetUTF8Char(CUR_PTR, &len);
  ------------------
  |  | 2196|  19.3k|#define CUR_PTR ctxt->cur
  ------------------
 8456|  19.3k|        if ((ch < 0) || (IS_CHAR(ch) == 0))
  ------------------
  |  |  115|  19.3k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  19.3k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 18.9k, False: 368]
  |  |  |  |  ------------------
  |  |  |  |  118|  19.3k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  18.9k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 18.9k, False: 18]
  |  |  |  |  |  |  |  Branch (108:44): [True: 131, False: 18.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.9k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 110, False: 18.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  18.9k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 18.7k, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  19.3k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 368, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 111, False: 257]
  |  |  |  |  ------------------
  |  |  |  |  120|    368|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 257, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 27, False: 230]
  |  |  |  |  ------------------
  |  |  |  |  121|    368|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 230, False: 0]
  |  |  |  |  |  Branch (121:27): [True: 230, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8456:13): [True: 3, False: 19.3k]
  |  Branch (8456:25): [True: 18, False: 19.3k]
  ------------------
 8457|  19.3k|            XP_ERRORNULL(XPATH_INVALID_CHAR_ERROR);
  ------------------
  |  |  633|     21|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8458|  19.3k|        CUR_PTR += len;
  ------------------
  |  | 2196|  19.3k|#define CUR_PTR ctxt->cur
  ------------------
 8459|  19.3k|    }
 8460|  1.72k|    ret = xmlStrndup(q, CUR_PTR - q);
  ------------------
  |  | 2196|  1.72k|#define CUR_PTR ctxt->cur
  ------------------
 8461|  1.72k|    if (ret == NULL)
  ------------------
  |  Branch (8461:9): [True: 5, False: 1.71k]
  ------------------
 8462|      5|        xmlXPathPErrMemory(ctxt);
 8463|  1.72k|    NEXT;
  ------------------
  |  | 2202|  1.72k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.72k, False: 0]
  |  |  ------------------
  ------------------
 8464|  1.72k|    return(ret);
 8465|  1.85k|}
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: 23, False: 11.4k]
  ------------------
 8581|     23|	xmlFree(prefix);
 8582|     23|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     23|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8583|      0|    }
 8584|  11.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   351k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   363k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 351k, 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|   116k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   128k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 116k, 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.5k, False: 903]
  |  Branch (8597:29): [True: 975, False: 9.61k]
  ------------------
 8598|    975|	xmlStrEqual(name, BAD_CAST "count"))
  ------------------
  |  |   34|    975|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8598:2): [True: 64, False: 911]
  ------------------
 8599|     64|    {
 8600|     64|	sort = 0;
 8601|     64|    }
 8602|  11.4k|    ctxt->comp->last = -1;
 8603|  11.4k|    if (CUR != ')') {
  ------------------
  |  | 2193|  11.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8603:9): [True: 9.28k, False: 2.20k]
  ------------------
 8604|  13.4k|	while (CUR != 0) {
  ------------------
  |  | 2193|  13.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8604:9): [True: 13.4k, False: 6]
  ------------------
 8605|  13.4k|	    int op1 = ctxt->comp->last;
 8606|  13.4k|	    ctxt->comp->last = -1;
 8607|  13.4k|	    xmlXPathCompileExpr(ctxt, sort);
 8608|  13.4k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (8608:10): [True: 725, False: 12.6k]
  ------------------
 8609|    725|		xmlFree(name);
 8610|    725|		xmlFree(prefix);
 8611|    725|		return;
 8612|    725|	    }
 8613|  12.6k|	    PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  12.6k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  12.6k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  12.6k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8614|  12.6k|	    nbargs++;
 8615|  12.6k|	    if (CUR == ')') break;
  ------------------
  |  | 2193|  12.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8615:10): [True: 8.44k, False: 4.24k]
  ------------------
 8616|  4.24k|	    if (CUR != ',') {
  ------------------
  |  | 2193|  4.24k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8616:10): [True: 108, False: 4.13k]
  ------------------
 8617|    108|		xmlFree(name);
 8618|    108|		xmlFree(prefix);
 8619|    108|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    108|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8620|      0|	    }
 8621|  4.13k|	    NEXT;
  ------------------
  |  | 2202|  4.13k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.13k, False: 0]
  |  |  ------------------
  ------------------
 8622|  4.13k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  4.13k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.52k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.39k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8623|  4.13k|	}
 8624|  9.28k|    }
 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: 4, False: 10.6k]
  ------------------
 8626|      4|        xmlFree(prefix);
 8627|      4|        xmlFree(name);
 8628|      4|    }
 8629|  10.6k|    NEXT;
  ------------------
  |  | 2202|  10.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 10.6k, False: 6]
  |  |  ------------------
  ------------------
 8630|  10.6k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   117k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   128k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 117k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8631|  10.6k|}
xpath.c:xmlXPathCompPredicate:
 9137|  16.7k|xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
 9138|  16.7k|    int op1 = ctxt->comp->last;
 9139|       |
 9140|  16.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  16.7k|    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|  16.7k|    if (CUR != '[') {
  ------------------
  |  | 2193|  16.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9141:9): [True: 0, False: 16.7k]
  ------------------
 9142|      0|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9143|      0|    }
 9144|  16.7k|    NEXT;
  ------------------
  |  | 2202|  16.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 16.7k, False: 0]
  |  |  ------------------
  ------------------
 9145|  16.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  16.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  29.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9146|       |
 9147|  16.7k|    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|  16.7k|    if (! filter)
  ------------------
  |  Branch (9157:9): [True: 8.87k, False: 7.86k]
  ------------------
 9158|  8.87k|	xmlXPathCompileExpr(ctxt, 0);
 9159|  7.86k|    else
 9160|  7.86k|	xmlXPathCompileExpr(ctxt, 1);
 9161|  16.7k|    CHECK_ERROR;
  ------------------
  |  |  230|  16.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.92k, False: 13.8k]
  |  |  ------------------
  ------------------
 9162|       |
 9163|  13.8k|    if (CUR != ']') {
  ------------------
  |  | 2193|  13.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9163:9): [True: 232, False: 13.5k]
  ------------------
 9164|    232|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|    232|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9165|      0|    }
 9166|       |
 9167|  13.5k|    if (filter)
  ------------------
  |  Branch (9167:9): [True: 7.15k, False: 6.42k]
  ------------------
 9168|  7.15k|	PUSH_BINARY_EXPR(XPATH_OP_FILTER, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  7.15k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  7.15k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  7.15k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9169|  6.42k|    else
 9170|  6.42k|	PUSH_BINARY_EXPR(XPATH_OP_PREDICATE, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  6.42k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  6.42k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  6.42k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9171|       |
 9172|  13.5k|    NEXT;
  ------------------
  |  | 2202|  13.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 13.5k, False: 0]
  |  |  ------------------
  ------------------
 9173|  13.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  21.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  35.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 21.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9174|  13.5k|}
xpath.c:xmlXPathCompRelativeLocationPath:
 9481|   617k|(xmlXPathParserContextPtr ctxt) {
 9482|   617k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   617k|    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|   617k|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|   617k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  7.93k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9483:9): [True: 7.93k, False: 609k]
  |  Branch (9483:25): [True: 3.67k, False: 4.25k]
  ------------------
 9484|  3.67k|	SKIP(2);
  ------------------
  |  | 2194|  3.67k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9485|  3.67k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  9.84k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.84k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 9.84k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9486|  3.67k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  3.67k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  3.67k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9487|  3.67k|		         NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9488|   614k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   614k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9488:16): [True: 4.25k, False: 609k]
  ------------------
 9489|  4.25k|	    NEXT;
  ------------------
  |  | 2202|  4.25k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.25k, False: 0]
  |  |  ------------------
  ------------------
 9490|  4.25k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  19.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  19.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 19.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9491|  4.25k|    }
 9492|   617k|    xmlXPathCompStep(ctxt);
 9493|   617k|    CHECK_ERROR;
  ------------------
  |  |  230|   617k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.01k, False: 616k]
  |  |  ------------------
  ------------------
 9494|   616k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   616k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   617k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9495|   635k|    while (CUR == '/') {
  ------------------
  |  | 2193|   635k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9495:12): [True: 18.6k, False: 616k]
  ------------------
 9496|  18.6k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  18.6k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  18.6k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9496:6): [True: 18.6k, False: 0]
  |  Branch (9496:22): [True: 6.28k, False: 12.3k]
  ------------------
 9497|  6.28k|	    SKIP(2);
  ------------------
  |  | 2194|  6.28k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9498|  6.28k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  8.10k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.10k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.10k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9499|  6.28k|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  6.28k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  6.28k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9500|  6.28k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9501|  6.28k|	    xmlXPathCompStep(ctxt);
 9502|  12.3k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  12.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9502:13): [True: 12.3k, False: 0]
  ------------------
 9503|  12.3k|	    NEXT;
  ------------------
  |  | 2202|  12.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 12.3k, False: 0]
  |  |  ------------------
  ------------------
 9504|  12.3k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  12.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.19k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9505|  12.3k|	    xmlXPathCompStep(ctxt);
 9506|  12.3k|	}
 9507|  18.6k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  18.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    703|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 703, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9508|  18.6k|    }
 9509|   616k|}
xpath.c:xmlXPathCompStep:
 9390|   636k|xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
 9391|   636k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   636k|    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|   636k|    if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2193|   636k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2195|  19.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9392:9): [True: 19.4k, False: 617k]
  |  Branch (9392:25): [True: 6.86k, False: 12.5k]
  ------------------
 9393|  6.86k|	SKIP(2);
  ------------------
  |  | 2194|  6.86k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9394|  6.86k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  6.86k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.89k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.89k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9395|  6.86k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
  ------------------
  |  | 1085|  6.86k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  6.86k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9396|  6.86k|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9397|   629k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|   629k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9397:16): [True: 12.5k, False: 617k]
  ------------------
 9398|  12.5k|	NEXT;
  ------------------
  |  | 2202|  12.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 12.5k, False: 0]
  |  |  ------------------
  ------------------
 9399|  12.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  12.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  12.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9400|   617k|    } else {
 9401|   617k|	xmlChar *name = NULL;
 9402|   617k|	xmlChar *prefix = NULL;
 9403|   617k|	xmlXPathTestVal test = (xmlXPathTestVal) 0;
 9404|   617k|	xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
 9405|   617k|	xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
 9406|   617k|	int op1;
 9407|       |
 9408|   617k|	if (CUR == '*') {
  ------------------
  |  | 2193|   617k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9408:6): [True: 543k, False: 73.4k]
  ------------------
 9409|   543k|	    axis = AXIS_CHILD;
 9410|   543k|	} else {
 9411|  73.4k|	    if (name == NULL)
  ------------------
  |  Branch (9411:10): [True: 73.4k, False: 0]
  ------------------
 9412|  73.4k|		name = xmlXPathParseNCName(ctxt);
 9413|  73.4k|	    if (name != NULL) {
  ------------------
  |  Branch (9413:10): [True: 69.3k, False: 4.09k]
  ------------------
 9414|  69.3k|		axis = xmlXPathIsAxisName(name);
 9415|  69.3k|		if (axis != 0) {
  ------------------
  |  Branch (9415:7): [True: 3.64k, False: 65.7k]
  ------------------
 9416|  3.64k|		    SKIP_BLANKS;
  ------------------
  |  | 2199|  56.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  56.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 56.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9417|  3.64k|		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2193|  3.64k|#define CUR (*ctxt->cur)
  ------------------
              		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2195|  2.19k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9417:11): [True: 2.19k, False: 1.44k]
  |  Branch (9417:27): [True: 2.10k, False: 86]
  ------------------
 9418|  2.10k|			SKIP(2);
  ------------------
  |  | 2194|  2.10k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9419|  2.10k|			xmlFree(name);
 9420|  2.10k|			name = NULL;
 9421|  2.10k|		    } else {
 9422|       |			/* an element name can conflict with an axis one :-\ */
 9423|  1.53k|			axis = AXIS_CHILD;
 9424|  1.53k|		    }
 9425|  65.7k|		} else {
 9426|  65.7k|		    axis = AXIS_CHILD;
 9427|  65.7k|		}
 9428|  69.3k|	    } else if (CUR == '@') {
  ------------------
  |  | 2193|  4.09k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9428:17): [True: 3.41k, False: 675]
  ------------------
 9429|  3.41k|		NEXT;
  ------------------
  |  | 2202|  3.41k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.41k, False: 0]
  |  |  ------------------
  ------------------
 9430|  3.41k|		axis = AXIS_ATTRIBUTE;
 9431|  3.41k|	    } else {
 9432|    675|		axis = AXIS_CHILD;
 9433|    675|	    }
 9434|  73.4k|	}
 9435|       |
 9436|   617k|        if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (9436:13): [True: 790, False: 616k]
  ------------------
 9437|    790|            xmlFree(name);
 9438|    790|            return;
 9439|    790|        }
 9440|       |
 9441|   616k|	name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
 9442|   616k|	if (test == 0)
  ------------------
  |  Branch (9442:6): [True: 368, False: 615k]
  ------------------
 9443|    368|	    return;
 9444|       |
 9445|   615k|        if ((prefix != NULL) && (ctxt->context != NULL) &&
  ------------------
  |  Branch (9445:13): [True: 2.01k, False: 613k]
  |  Branch (9445:33): [True: 2.01k, False: 0]
  ------------------
 9446|  2.01k|	    (ctxt->context->flags & XML_XPATH_CHECKNS)) {
  ------------------
  |  |  237|  2.01k|#define XML_XPATH_CHECKNS (1<<0)
  ------------------
  |  Branch (9446:6): [True: 0, False: 2.01k]
  ------------------
 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|   615k|	op1 = ctxt->comp->last;
 9454|   615k|	ctxt->comp->last = -1;
 9455|       |
 9456|   615k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   615k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   628k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9457|   624k|	while (CUR == '[') {
  ------------------
  |  | 2193|   624k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9457:9): [True: 8.87k, False: 615k]
  ------------------
 9458|  8.87k|	    xmlXPathCompPredicate(ctxt, 0);
 9459|  8.87k|	}
 9460|       |
 9461|   615k|        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
  ------------------
  |  | 1082|   615k|    xmlXPathCompExprAdd(ctxt, (op1), (op2),			\
  |  | 1083|   615k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (9461:13): [True: 26, False: 615k]
  ------------------
 9462|   615k|                           test, type, (void *)prefix, (void *)name) == -1) {
 9463|     26|            xmlFree(prefix);
 9464|     26|            xmlFree(name);
 9465|     26|        }
 9466|   615k|    }
 9467|   636k|}
xpath.c:xmlXPathIsAxisName:
 9321|  69.3k|xmlXPathIsAxisName(const xmlChar *name) {
 9322|  69.3k|    xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
 9323|  69.3k|    switch (name[0]) {
  ------------------
  |  Branch (9323:13): [True: 22.1k, False: 47.1k]
  ------------------
 9324|  8.49k|	case 'a':
  ------------------
  |  Branch (9324:2): [True: 8.49k, False: 60.8k]
  ------------------
 9325|  8.49k|	    if (xmlStrEqual(name, BAD_CAST "ancestor"))
  ------------------
  |  |   34|  8.49k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9325:10): [True: 1.85k, False: 6.64k]
  ------------------
 9326|  1.85k|		ret = AXIS_ANCESTOR;
 9327|  8.49k|	    if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
  ------------------
  |  |   34|  8.49k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9327:10): [True: 120, False: 8.37k]
  ------------------
 9328|    120|		ret = AXIS_ANCESTOR_OR_SELF;
 9329|  8.49k|	    if (xmlStrEqual(name, BAD_CAST "attribute"))
  ------------------
  |  |   34|  8.49k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9329:10): [True: 3, False: 8.48k]
  ------------------
 9330|      3|		ret = AXIS_ATTRIBUTE;
 9331|  8.49k|	    break;
 9332|  2.51k|	case 'c':
  ------------------
  |  Branch (9332:2): [True: 2.51k, False: 66.8k]
  ------------------
 9333|  2.51k|	    if (xmlStrEqual(name, BAD_CAST "child"))
  ------------------
  |  |   34|  2.51k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9333:10): [True: 72, False: 2.44k]
  ------------------
 9334|     72|		ret = AXIS_CHILD;
 9335|  2.51k|	    break;
 9336|  1.24k|	case 'd':
  ------------------
  |  Branch (9336:2): [True: 1.24k, False: 68.1k]
  ------------------
 9337|  1.24k|	    if (xmlStrEqual(name, BAD_CAST "descendant"))
  ------------------
  |  |   34|  1.24k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9337:10): [True: 41, False: 1.20k]
  ------------------
 9338|     41|		ret = AXIS_DESCENDANT;
 9339|  1.24k|	    if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
  ------------------
  |  |   34|  1.24k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9339:10): [True: 10, False: 1.23k]
  ------------------
 9340|     10|		ret = AXIS_DESCENDANT_OR_SELF;
 9341|  1.24k|	    break;
 9342|  2.72k|	case 'f':
  ------------------
  |  Branch (9342:2): [True: 2.72k, False: 66.6k]
  ------------------
 9343|  2.72k|	    if (xmlStrEqual(name, BAD_CAST "following"))
  ------------------
  |  |   34|  2.72k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9343:10): [True: 289, False: 2.43k]
  ------------------
 9344|    289|		ret = AXIS_FOLLOWING;
 9345|  2.72k|	    if (xmlStrEqual(name, BAD_CAST "following-sibling"))
  ------------------
  |  |   34|  2.72k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9345:10): [True: 70, False: 2.65k]
  ------------------
 9346|     70|		ret = AXIS_FOLLOWING_SIBLING;
 9347|  2.72k|	    break;
 9348|  3.55k|	case 'n':
  ------------------
  |  Branch (9348:2): [True: 3.55k, False: 65.8k]
  ------------------
 9349|  3.55k|	    if (xmlStrEqual(name, BAD_CAST "namespace"))
  ------------------
  |  |   34|  3.55k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9349:10): [True: 336, False: 3.21k]
  ------------------
 9350|    336|		ret = AXIS_NAMESPACE;
 9351|  3.55k|	    break;
 9352|    989|	case 'p':
  ------------------
  |  Branch (9352:2): [True: 989, False: 68.3k]
  ------------------
 9353|    989|	    if (xmlStrEqual(name, BAD_CAST "parent"))
  ------------------
  |  |   34|    989|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9353:10): [True: 118, False: 871]
  ------------------
 9354|    118|		ret = AXIS_PARENT;
 9355|    989|	    if (xmlStrEqual(name, BAD_CAST "preceding"))
  ------------------
  |  |   34|    989|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9355:10): [True: 66, False: 923]
  ------------------
 9356|     66|		ret = AXIS_PRECEDING;
 9357|    989|	    if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
  ------------------
  |  |   34|    989|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9357:10): [True: 18, False: 971]
  ------------------
 9358|     18|		ret = AXIS_PRECEDING_SIBLING;
 9359|    989|	    break;
 9360|  2.65k|	case 's':
  ------------------
  |  Branch (9360:2): [True: 2.65k, False: 66.7k]
  ------------------
 9361|  2.65k|	    if (xmlStrEqual(name, BAD_CAST "self"))
  ------------------
  |  |   34|  2.65k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9361:10): [True: 645, False: 2.00k]
  ------------------
 9362|    645|		ret = AXIS_SELF;
 9363|  2.65k|	    break;
 9364|  69.3k|    }
 9365|  69.3k|    return(ret);
 9366|  69.3k|}
xpath.c:xmlXPathCompNodeTest:
 9201|   616k|		     xmlChar *name) {
 9202|   616k|    int blanks;
 9203|       |
 9204|   616k|    if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
  ------------------
  |  Branch (9204:9): [True: 0, False: 616k]
  |  Branch (9204:27): [True: 0, False: 616k]
  |  Branch (9204:45): [True: 0, False: 616k]
  ------------------
 9205|      0|	return(NULL);
 9206|      0|    }
 9207|   616k|    *type = (xmlXPathTypeVal) 0;
 9208|   616k|    *test = (xmlXPathTestVal) 0;
 9209|   616k|    *prefix = NULL;
 9210|   616k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   616k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   817k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 201k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9211|       |
 9212|   616k|    if ((name == NULL) && (CUR == '*')) {
  ------------------
  |  | 2193|   549k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9212:9): [True: 549k, False: 66.8k]
  |  Branch (9212:27): [True: 544k, False: 5.25k]
  ------------------
 9213|       |	/*
 9214|       |	 * All elements
 9215|       |	 */
 9216|   544k|	NEXT;
  ------------------
  |  | 2202|   544k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 544k, False: 0]
  |  |  ------------------
  ------------------
 9217|   544k|	*test = NODE_TEST_ALL;
 9218|   544k|	return(NULL);
 9219|   544k|    }
 9220|       |
 9221|  72.1k|    if (name == NULL)
  ------------------
  |  Branch (9221:9): [True: 5.25k, False: 66.8k]
  ------------------
 9222|  5.25k|	name = xmlXPathParseNCName(ctxt);
 9223|  72.1k|    if (name == NULL) {
  ------------------
  |  Branch (9223:9): [True: 297, False: 71.8k]
  ------------------
 9224|    297|	XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|    297|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9225|      0|    }
 9226|       |
 9227|  71.8k|    blanks = IS_BLANK_CH(CUR);
  ------------------
  |  |  137|  71.8k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  71.8k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.53k, False: 70.3k]
  |  |  |  |  ------------------
  |  |  |  |   91|  71.8k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 68.6k, False: 1.65k]
  |  |  |  |  |  Branch (91:23): [True: 17, False: 68.6k]
  |  |  |  |  ------------------
  |  |  |  |   92|  71.8k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 7, False: 70.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9228|  71.8k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  71.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  85.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9229|  71.8k|    if (CUR == '(') {
  ------------------
  |  | 2193|  71.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9229:9): [True: 795, False: 71.0k]
  ------------------
 9230|    795|	NEXT;
  ------------------
  |  | 2202|    795|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 795, False: 0]
  |  |  ------------------
  ------------------
 9231|       |	/*
 9232|       |	 * NodeType or PI search
 9233|       |	 */
 9234|    795|	if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    795|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9234:6): [True: 20, False: 775]
  ------------------
 9235|     20|	    *type = NODE_TYPE_COMMENT;
 9236|    775|	else if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|    775|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9236:11): [True: 57, False: 718]
  ------------------
 9237|     57|	    *type = NODE_TYPE_NODE;
 9238|    718|	else if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|    718|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9238:11): [True: 131, False: 587]
  ------------------
 9239|    131|	    *type = NODE_TYPE_PI;
 9240|    587|	else if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|    587|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9240:11): [True: 516, False: 71]
  ------------------
 9241|    516|	    *type = NODE_TYPE_TEXT;
 9242|     71|	else {
 9243|     71|	    if (name != NULL)
  ------------------
  |  Branch (9243:10): [True: 71, False: 0]
  ------------------
 9244|     71|		xmlFree(name);
 9245|     71|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     71|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9246|      0|	}
 9247|       |
 9248|    724|	*test = NODE_TEST_TYPE;
 9249|       |
 9250|    724|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.45k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.18k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.45k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9251|    724|	if (*type == NODE_TYPE_PI) {
  ------------------
  |  Branch (9251:6): [True: 131, False: 593]
  ------------------
 9252|       |	    /*
 9253|       |	     * Specific case: search a PI by name.
 9254|       |	     */
 9255|    131|	    if (name != NULL)
  ------------------
  |  Branch (9255:10): [True: 131, False: 0]
  ------------------
 9256|    131|		xmlFree(name);
 9257|    131|	    name = NULL;
 9258|    131|	    if (CUR != ')') {
  ------------------
  |  | 2193|    131|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9258:10): [True: 111, False: 20]
  ------------------
 9259|    111|		name = xmlXPathParseLiteral(ctxt);
 9260|    111|		*test = NODE_TEST_PI;
 9261|    111|		SKIP_BLANKS;
  ------------------
  |  | 2199|    588|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    588|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 588, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9262|    111|	    }
 9263|    131|	}
 9264|    724|	if (CUR != ')') {
  ------------------
  |  | 2193|    724|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9264:6): [True: 52, False: 672]
  ------------------
 9265|     52|	    if (name != NULL)
  ------------------
  |  Branch (9265:10): [True: 38, False: 14]
  ------------------
 9266|     38|		xmlFree(name);
 9267|     52|	    XP_ERRORNULL(XPATH_UNCLOSED_ERROR);
  ------------------
  |  |  633|     52|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9268|      0|	}
 9269|    672|	NEXT;
  ------------------
  |  | 2202|    672|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 672, False: 0]
  |  |  ------------------
  ------------------
 9270|    672|	return(name);
 9271|    724|    }
 9272|  71.0k|    *test = NODE_TEST_NAME;
 9273|  71.0k|    if ((!blanks) && (CUR == ':')) {
  ------------------
  |  | 2193|  69.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9273:9): [True: 69.4k, False: 1.55k]
  |  Branch (9273:22): [True: 2.01k, False: 67.4k]
  ------------------
 9274|  2.01k|	NEXT;
  ------------------
  |  | 2202|  2.01k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.01k, False: 0]
  |  |  ------------------
  ------------------
 9275|       |
 9276|       |	/*
 9277|       |	 * Since currently the parser context don't have a
 9278|       |	 * namespace list associated:
 9279|       |	 * The namespace name for this prefix can be computed
 9280|       |	 * only at evaluation time. The compilation is done
 9281|       |	 * outside of any context.
 9282|       |	 */
 9283|  2.01k|	*prefix = name;
 9284|       |
 9285|  2.01k|	if (CUR == '*') {
  ------------------
  |  | 2193|  2.01k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9285:6): [True: 402, False: 1.61k]
  ------------------
 9286|       |	    /*
 9287|       |	     * All elements
 9288|       |	     */
 9289|    402|	    NEXT;
  ------------------
  |  | 2202|    402|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 402, False: 0]
  |  |  ------------------
  ------------------
 9290|    402|	    *test = NODE_TEST_ALL;
 9291|    402|	    return(NULL);
 9292|    402|	}
 9293|       |
 9294|  1.61k|	name = xmlXPathParseNCName(ctxt);
 9295|  1.61k|	if (name == NULL) {
  ------------------
  |  Branch (9295:6): [True: 35, False: 1.57k]
  ------------------
 9296|     35|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     35|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9297|      0|	}
 9298|  1.61k|    }
 9299|  70.6k|    return(name);
 9300|  71.0k|}
xpath.c:xmlXPathCompExprAdd:
 1031|  2.03M|   int value2, int value3, void *value4, void *value5) {
 1032|  2.03M|    xmlXPathCompExprPtr comp = ctxt->comp;
 1033|  2.03M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1033:9): [True: 54.1k, False: 1.98M]
  ------------------
 1034|  54.1k|	xmlXPathStepOp *real;
 1035|  54.1k|        int newSize;
 1036|       |
 1037|  54.1k|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]),
 1038|  54.1k|                                  10, XPATH_MAX_STEPS);
  ------------------
  |  |   88|  54.1k|#define XPATH_MAX_STEPS 1000000
  ------------------
 1039|  54.1k|        if (newSize < 0) {
  ------------------
  |  Branch (1039:13): [True: 0, False: 54.1k]
  ------------------
 1040|      0|	    xmlXPathPErrMemory(ctxt);
 1041|      0|	    return(-1);
 1042|      0|        }
 1043|  54.1k|	real = xmlRealloc(comp->steps, newSize * sizeof(real[0]));
 1044|  54.1k|	if (real == NULL) {
  ------------------
  |  Branch (1044:6): [True: 123, False: 54.0k]
  ------------------
 1045|    123|	    xmlXPathPErrMemory(ctxt);
 1046|    123|	    return(-1);
 1047|    123|	}
 1048|  54.0k|	comp->steps = real;
 1049|  54.0k|	comp->maxStep = newSize;
 1050|  54.0k|    }
 1051|  2.03M|    comp->last = comp->nbStep;
 1052|  2.03M|    comp->steps[comp->nbStep].ch1 = ch1;
 1053|  2.03M|    comp->steps[comp->nbStep].ch2 = ch2;
 1054|  2.03M|    comp->steps[comp->nbStep].op = op;
 1055|  2.03M|    comp->steps[comp->nbStep].value = value;
 1056|  2.03M|    comp->steps[comp->nbStep].value2 = value2;
 1057|  2.03M|    comp->steps[comp->nbStep].value3 = value3;
 1058|  2.03M|    if ((comp->dict != NULL) &&
  ------------------
  |  Branch (1058:9): [True: 0, False: 2.03M]
  ------------------
 1059|      0|        ((op == XPATH_OP_FUNCTION) || (op == XPATH_OP_VARIABLE) ||
  ------------------
  |  Branch (1059:10): [True: 0, False: 0]
  |  Branch (1059:39): [True: 0, False: 0]
  ------------------
 1060|      0|	 (op == XPATH_OP_COLLECT))) {
  ------------------
  |  Branch (1060:3): [True: 0, False: 0]
  ------------------
 1061|      0|        if (value4 != NULL) {
  ------------------
  |  Branch (1061:13): [True: 0, False: 0]
  ------------------
 1062|      0|	    comp->steps[comp->nbStep].value4 = (xmlChar *)
 1063|      0|	        (void *)xmlDictLookup(comp->dict, value4, -1);
 1064|      0|	    xmlFree(value4);
 1065|      0|	} else
 1066|      0|	    comp->steps[comp->nbStep].value4 = NULL;
 1067|      0|        if (value5 != NULL) {
  ------------------
  |  Branch (1067:13): [True: 0, False: 0]
  ------------------
 1068|      0|	    comp->steps[comp->nbStep].value5 = (xmlChar *)
 1069|      0|	        (void *)xmlDictLookup(comp->dict, value5, -1);
 1070|      0|	    xmlFree(value5);
 1071|      0|	} else
 1072|      0|	    comp->steps[comp->nbStep].value5 = NULL;
 1073|  2.03M|    } else {
 1074|  2.03M|	comp->steps[comp->nbStep].value4 = value4;
 1075|  2.03M|	comp->steps[comp->nbStep].value5 = value5;
 1076|  2.03M|    }
 1077|       |    comp->steps[comp->nbStep].cache = NULL;
 1078|  2.03M|    return(comp->nbStep++);
 1079|  2.03M|}
xpath.c:xmlXPathOptimizeExpression:
11740|  1.53M|{
11741|  1.53M|    xmlXPathCompExprPtr comp = pctxt->comp;
11742|  1.53M|    xmlXPathContextPtr ctxt;
11743|       |
11744|       |    /*
11745|       |    * Try to rewrite "descendant-or-self::node()/foo" to an optimized
11746|       |    * internal representation.
11747|       |    */
11748|       |
11749|  1.53M|    if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11749:9): [True: 484k, False: 1.05M]
  ------------------
11750|   484k|        (op->ch1 != -1) &&
  ------------------
  |  Branch (11750:9): [True: 484k, False: 0]
  ------------------
11751|   484k|        (op->ch2 == -1 /* no predicate */))
  ------------------
  |  Branch (11751:9): [True: 478k, False: 5.80k]
  ------------------
11752|   478k|    {
11753|   478k|        xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
11754|       |
11755|   478k|        if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11755:13): [True: 18.9k, False: 459k]
  ------------------
11756|  18.9k|            ((xmlXPathAxisVal) prevop->value ==
  ------------------
  |  Branch (11756:13): [True: 9.65k, False: 9.27k]
  ------------------
11757|  18.9k|                AXIS_DESCENDANT_OR_SELF) &&
11758|  9.65k|            (prevop->ch2 == -1) &&
  ------------------
  |  Branch (11758:13): [True: 9.65k, False: 0]
  ------------------
11759|  9.65k|            ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
  ------------------
  |  Branch (11759:13): [True: 9.65k, False: 0]
  ------------------
11760|  9.65k|            ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE))
  ------------------
  |  Branch (11760:13): [True: 9.65k, False: 0]
  ------------------
11761|  9.65k|        {
11762|       |            /*
11763|       |            * This is a "descendant-or-self::node()" without predicates.
11764|       |            * Try to eliminate it.
11765|       |            */
11766|       |
11767|  9.65k|            switch ((xmlXPathAxisVal) op->value) {
11768|  2.62k|                case AXIS_CHILD:
  ------------------
  |  Branch (11768:17): [True: 2.62k, False: 7.03k]
  ------------------
11769|  2.62k|                case AXIS_DESCENDANT:
  ------------------
  |  Branch (11769:17): [True: 0, False: 9.65k]
  ------------------
11770|       |                    /*
11771|       |                    * Convert "descendant-or-self::node()/child::" or
11772|       |                    * "descendant-or-self::node()/descendant::" to
11773|       |                    * "descendant::"
11774|       |                    */
11775|  2.62k|                    op->ch1   = prevop->ch1;
11776|  2.62k|                    op->value = AXIS_DESCENDANT;
11777|  2.62k|                    break;
11778|      0|                case AXIS_SELF:
  ------------------
  |  Branch (11778:17): [True: 0, False: 9.65k]
  ------------------
11779|  1.96k|                case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (11779:17): [True: 1.96k, False: 7.69k]
  ------------------
11780|       |                    /*
11781|       |                    * Convert "descendant-or-self::node()/self::" or
11782|       |                    * "descendant-or-self::node()/descendant-or-self::" to
11783|       |                    * to "descendant-or-self::"
11784|       |                    */
11785|  1.96k|                    op->ch1   = prevop->ch1;
11786|  1.96k|                    op->value = AXIS_DESCENDANT_OR_SELF;
11787|  1.96k|                    break;
11788|  5.06k|                default:
  ------------------
  |  Branch (11788:17): [True: 5.06k, False: 4.59k]
  ------------------
11789|  5.06k|                    break;
11790|  9.65k|            }
11791|  9.65k|	}
11792|   478k|    }
11793|       |
11794|       |    /* OP_VALUE has invalid ch1. */
11795|  1.53M|    if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (11795:9): [True: 27.8k, False: 1.51M]
  ------------------
11796|  27.8k|        return;
11797|       |
11798|       |    /* Recurse */
11799|  1.51M|    ctxt = pctxt->context;
11800|  1.51M|    if (ctxt != NULL) {
  ------------------
  |  Branch (11800:9): [True: 1.51M, False: 0]
  ------------------
11801|  1.51M|        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.51M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (11801:13): [True: 1.39k, False: 1.50M]
  ------------------
11802|  1.39k|            return;
11803|  1.50M|        ctxt->depth += 1;
11804|  1.50M|    }
11805|  1.50M|    if (op->ch1 != -1)
  ------------------
  |  Branch (11805:9): [True: 1.02M, False: 483k]
  ------------------
11806|  1.02M|        xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]);
11807|  1.50M|    if (op->ch2 != -1)
  ------------------
  |  Branch (11807:9): [True: 505k, False: 1.00M]
  ------------------
11808|   505k|	xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]);
11809|  1.50M|    if (ctxt != NULL)
  ------------------
  |  Branch (11809:9): [True: 1.50M, False: 0]
  ------------------
11810|  1.50M|        ctxt->depth -= 1;
11811|  1.50M|}
xpath.c:xmlXPathRunEval:
11496|  7.01k|{
11497|  7.01k|    xmlXPathCompExprPtr comp;
11498|  7.01k|    int oldDepth;
11499|       |
11500|  7.01k|    if ((ctxt == NULL) || (ctxt->comp == NULL))
  ------------------
  |  Branch (11500:9): [True: 0, False: 7.01k]
  |  Branch (11500:27): [True: 0, False: 7.01k]
  ------------------
11501|      0|	return(-1);
11502|       |
11503|  7.01k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11503:9): [True: 0, False: 7.01k]
  ------------------
11504|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
11505|      0|        int valueMax = 1;
11506|       |#else
11507|       |        int valueMax = 10;
11508|       |#endif
11509|       |
11510|       |	/* Allocate the value stack */
11511|      0|	ctxt->valueTab = xmlMalloc(valueMax * sizeof(xmlXPathObjectPtr));
11512|      0|	if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11512:6): [True: 0, False: 0]
  ------------------
11513|      0|	    xmlXPathPErrMemory(ctxt);
11514|      0|	    return(-1);
11515|      0|	}
11516|      0|	ctxt->valueNr = 0;
11517|      0|	ctxt->valueMax = valueMax;
11518|      0|	ctxt->value = NULL;
11519|      0|    }
11520|       |#ifdef XPATH_STREAMING
11521|       |    if (ctxt->comp->stream) {
11522|       |	int res;
11523|       |
11524|       |	if (toBool) {
11525|       |	    /*
11526|       |	    * Evaluation to boolean result.
11527|       |	    */
11528|       |	    res = xmlXPathRunStreamEval(ctxt, ctxt->comp->stream, NULL, 1);
11529|       |	    if (res != -1)
11530|       |		return(res);
11531|       |	} else {
11532|       |	    xmlXPathObjectPtr resObj = NULL;
11533|       |
11534|       |	    /*
11535|       |	    * Evaluation to a sequence.
11536|       |	    */
11537|       |	    res = xmlXPathRunStreamEval(ctxt, ctxt->comp->stream, &resObj, 0);
11538|       |
11539|       |	    if ((res != -1) && (resObj != NULL)) {
11540|       |		xmlXPathValuePush(ctxt, resObj);
11541|       |		return(0);
11542|       |	    }
11543|       |	    if (resObj != NULL)
11544|       |		xmlXPathReleaseObject(ctxt->context, resObj);
11545|       |	}
11546|       |	/*
11547|       |	* QUESTION TODO: This falls back to normal XPath evaluation
11548|       |	* if res == -1. Is this intended?
11549|       |	*/
11550|       |    }
11551|       |#endif
11552|  7.01k|    comp = ctxt->comp;
11553|  7.01k|    if (comp->last < 0) {
  ------------------
  |  Branch (11553:9): [True: 0, False: 7.01k]
  ------------------
11554|      0|        xmlXPathErr(ctxt, XPATH_STACK_ERROR);
11555|      0|	return(-1);
11556|      0|    }
11557|  7.01k|    oldDepth = ctxt->context->depth;
11558|  7.01k|    if (toBool)
  ------------------
  |  Branch (11558:9): [True: 0, False: 7.01k]
  ------------------
11559|      0|	return(xmlXPathCompOpEvalToBoolean(ctxt,
11560|      0|	    &comp->steps[comp->last], 0));
11561|  7.01k|    else
11562|  7.01k|	xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
11563|  7.01k|    ctxt->context->depth = oldDepth;
11564|       |
11565|  7.01k|    return(0);
11566|  7.01k|}
xpath.c:xmlXPathCompOpEvalToBoolean:
11177|   451k|{
11178|   451k|    xmlXPathObjectPtr resObj = NULL;
11179|       |
11180|   455k|start:
11181|   455k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   455k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 455k, False: 0]
  |  |  |  Branch (818:39): [True: 6, False: 455k]
  |  |  ------------------
  ------------------
11182|      6|        return(0);
11183|       |    /* comp = ctxt->comp; */
11184|   455k|    switch (op->op) {
11185|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (11185:9): [True: 0, False: 455k]
  ------------------
11186|      0|            return (0);
11187|  28.7k|	case XPATH_OP_VALUE:
  ------------------
  |  Branch (11187:2): [True: 28.7k, False: 426k]
  ------------------
11188|  28.7k|	    resObj = (xmlXPathObjectPtr) op->value4;
11189|  28.7k|	    if (isPredicate)
  ------------------
  |  Branch (11189:10): [True: 28.7k, False: 0]
  ------------------
11190|  28.7k|		return(xmlXPathEvaluatePredicateResult(ctxt, resObj));
11191|      0|	    return(xmlXPathCastToBoolean(resObj));
11192|  3.13k|	case XPATH_OP_SORT:
  ------------------
  |  Branch (11192:2): [True: 3.13k, False: 451k]
  ------------------
11193|       |	    /*
11194|       |	    * We don't need sorting for boolean results. Skip this one.
11195|       |	    */
11196|  3.13k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11196:17): [True: 3.13k, False: 0]
  ------------------
11197|  3.13k|		op = &ctxt->comp->steps[op->ch1];
11198|  3.13k|		goto start;
11199|  3.13k|	    }
11200|      0|	    return(0);
11201|   115k|	case XPATH_OP_COLLECT:
  ------------------
  |  Branch (11201:2): [True: 115k, False: 340k]
  ------------------
11202|   115k|	    if (op->ch1 == -1)
  ------------------
  |  Branch (11202:10): [True: 0, False: 115k]
  ------------------
11203|      0|		return(0);
11204|       |
11205|   115k|            xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]);
11206|   115k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11206:10): [True: 132, False: 114k]
  ------------------
11207|    132|		return(-1);
11208|       |
11209|   114k|            xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1);
11210|   114k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11210:10): [True: 318, False: 114k]
  ------------------
11211|    318|		return(-1);
11212|       |
11213|   114k|	    resObj = xmlXPathValuePop(ctxt);
11214|   114k|	    if (resObj == NULL)
  ------------------
  |  Branch (11214:10): [True: 0, False: 114k]
  ------------------
11215|      0|		return(-1);
11216|   114k|	    break;
11217|   308k|	default:
  ------------------
  |  Branch (11217:2): [True: 308k, False: 146k]
  ------------------
11218|       |	    /*
11219|       |	    * Fallback to call xmlXPathCompOpEval().
11220|       |	    */
11221|   308k|	    xmlXPathCompOpEval(ctxt, op);
11222|   308k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11222:10): [True: 1.17k, False: 307k]
  ------------------
11223|  1.17k|		return(-1);
11224|       |
11225|   307k|	    resObj = xmlXPathValuePop(ctxt);
11226|   307k|	    if (resObj == NULL)
  ------------------
  |  Branch (11226:10): [True: 0, False: 307k]
  ------------------
11227|      0|		return(-1);
11228|   307k|	    break;
11229|   455k|    }
11230|       |
11231|   421k|    if (resObj) {
  ------------------
  |  Branch (11231:9): [True: 421k, False: 0]
  ------------------
11232|   421k|	int res;
11233|       |
11234|   421k|	if (resObj->type == XPATH_BOOLEAN) {
  ------------------
  |  Branch (11234:6): [True: 209k, False: 211k]
  ------------------
11235|   209k|	    res = resObj->boolval;
11236|   211k|	} else if (isPredicate) {
  ------------------
  |  Branch (11236:13): [True: 211k, 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|   211k|	    res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
11246|   211k|	} else {
11247|      0|	    res = xmlXPathCastToBoolean(resObj);
11248|      0|	}
11249|   421k|	xmlXPathReleaseObject(ctxt->context, resObj);
11250|   421k|	return(res);
11251|   421k|    }
11252|       |
11253|      0|    return(0);
11254|   421k|}
xpath.c:xmlXPathNodeCollectAndTest:
 9793|  1.03M|{
 9794|       |
 9795|  1.03M|#define XP_TEST_HIT \
 9796|  1.03M|    if (hasAxisRange != 0) { \
 9797|  1.03M|	if (++pos == maxPos) { \
 9798|  1.03M|	    if (addNode(seq, cur) < 0) \
 9799|  1.03M|	        xmlXPathPErrMemory(ctxt); \
 9800|  1.03M|	    goto axis_range_end; } \
 9801|  1.03M|    } else { \
 9802|  1.03M|	if (addNode(seq, cur) < 0) \
 9803|  1.03M|	    xmlXPathPErrMemory(ctxt); \
 9804|  1.03M|	if (breakOnFirstHit) goto first_hit; }
 9805|       |
 9806|  1.03M|#define XP_TEST_HIT_NS \
 9807|  1.03M|    if (hasAxisRange != 0) { \
 9808|  1.03M|	if (++pos == maxPos) { \
 9809|  1.03M|	    hasNsNodes = 1; \
 9810|  1.03M|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9811|  1.03M|	        xmlXPathPErrMemory(ctxt); \
 9812|  1.03M|	goto axis_range_end; } \
 9813|  1.03M|    } else { \
 9814|  1.03M|	hasNsNodes = 1; \
 9815|  1.03M|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9816|  1.03M|	    xmlXPathPErrMemory(ctxt); \
 9817|  1.03M|	if (breakOnFirstHit) goto first_hit; }
 9818|       |
 9819|  1.03M|    xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value;
 9820|  1.03M|    xmlXPathTestVal test = (xmlXPathTestVal) op->value2;
 9821|  1.03M|    xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3;
 9822|  1.03M|    const xmlChar *prefix = op->value4;
 9823|  1.03M|    const xmlChar *name = op->value5;
 9824|  1.03M|    const xmlChar *URI = NULL;
 9825|       |
 9826|  1.03M|    int total = 0, hasNsNodes = 0;
 9827|       |    /* The popped object holding the context nodes */
 9828|  1.03M|    xmlXPathObjectPtr obj;
 9829|       |    /* The set of context nodes for the node tests */
 9830|  1.03M|    xmlNodeSetPtr contextSeq;
 9831|  1.03M|    int contextIdx;
 9832|  1.03M|    xmlNodePtr contextNode;
 9833|       |    /* The final resulting node set wrt to all context nodes */
 9834|  1.03M|    xmlNodeSetPtr outSeq;
 9835|       |    /*
 9836|       |    * The temporary resulting node set wrt 1 context node.
 9837|       |    * Used to feed predicate evaluation.
 9838|       |    */
 9839|  1.03M|    xmlNodeSetPtr seq;
 9840|  1.03M|    xmlNodePtr cur;
 9841|       |    /* First predicate operator */
 9842|  1.03M|    xmlXPathStepOpPtr predOp;
 9843|  1.03M|    int maxPos; /* The requested position() (when a "[n]" predicate) */
 9844|  1.03M|    int hasPredicateRange, hasAxisRange, pos;
 9845|  1.03M|    int breakOnFirstHit;
 9846|       |
 9847|  1.03M|    xmlXPathTraversalFunction next = NULL;
 9848|  1.03M|    int (*addNode) (xmlNodeSetPtr, xmlNodePtr);
 9849|  1.03M|    xmlXPathNodeSetMergeFunction mergeAndClear;
 9850|  1.03M|    xmlNodePtr oldContextNode;
 9851|  1.03M|    xmlXPathContextPtr xpctxt = ctxt->context;
 9852|       |
 9853|       |
 9854|  1.03M|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.03M|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.03M]
  |  |  |  Branch (271:34): [True: 100, False: 1.03M]
  |  |  ------------------
  |  |  272|  1.03M|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|    100|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
 9855|  1.03M|    obj = xmlXPathValuePop(ctxt);
 9856|       |    /*
 9857|       |    * Setup namespaces.
 9858|       |    */
 9859|  1.03M|    if (prefix != NULL) {
  ------------------
  |  Branch (9859:9): [True: 8.80k, False: 1.02M]
  ------------------
 9860|  8.80k|        URI = xmlXPathNsLookup(xpctxt, prefix);
 9861|  8.80k|        if (URI == NULL) {
  ------------------
  |  Branch (9861:13): [True: 163, False: 8.63k]
  ------------------
 9862|    163|	    xmlXPathReleaseObject(xpctxt, obj);
 9863|    163|            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9864|    163|                           "Undefined namespace prefix: %s\n", prefix);
 9865|    163|            return 0;
 9866|    163|	}
 9867|  8.80k|    }
 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.03M|    mergeAndClear = xmlXPathNodeSetMergeAndClear;
 9882|  1.03M|    switch (axis) {
  ------------------
  |  Branch (9882:13): [True: 1.03M, False: 0]
  ------------------
 9883|    507|        case AXIS_ANCESTOR:
  ------------------
  |  Branch (9883:9): [True: 507, False: 1.03M]
  ------------------
 9884|    507|            first = NULL;
 9885|    507|            next = xmlXPathNextAncestor;
 9886|    507|            break;
 9887|     90|        case AXIS_ANCESTOR_OR_SELF:
  ------------------
  |  Branch (9887:9): [True: 90, False: 1.03M]
  ------------------
 9888|     90|            first = NULL;
 9889|     90|            next = xmlXPathNextAncestorOrSelf;
 9890|     90|            break;
 9891|  26.2k|        case AXIS_ATTRIBUTE:
  ------------------
  |  Branch (9891:9): [True: 26.2k, False: 1.00M]
  ------------------
 9892|  26.2k|            first = NULL;
 9893|  26.2k|	    last = NULL;
 9894|  26.2k|            next = xmlXPathNextAttribute;
 9895|  26.2k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9896|  26.2k|            break;
 9897|   809k|        case AXIS_CHILD:
  ------------------
  |  Branch (9897:9): [True: 809k, False: 225k]
  ------------------
 9898|   809k|	    last = NULL;
 9899|   809k|	    if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
  ------------------
  |  Branch (9899:11): [True: 629k, False: 179k]
  |  Branch (9899:39): [True: 174k, False: 5.23k]
  ------------------
 9900|   804k|		(type == NODE_TYPE_NODE))
  ------------------
  |  Branch (9900:3): [True: 804k, False: 0]
  ------------------
 9901|   804k|	    {
 9902|       |		/*
 9903|       |		* Optimization if an element node type is 'element'.
 9904|       |		*/
 9905|   804k|		next = xmlXPathNextChildElement;
 9906|   804k|	    } else
 9907|  5.23k|		next = xmlXPathNextChild;
 9908|   809k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9909|   809k|            break;
 9910|  45.4k|        case AXIS_DESCENDANT:
  ------------------
  |  Branch (9910:9): [True: 45.4k, False: 989k]
  ------------------
 9911|  45.4k|	    last = NULL;
 9912|  45.4k|            next = xmlXPathNextDescendant;
 9913|  45.4k|            break;
 9914|   117k|        case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (9914:9): [True: 117k, False: 917k]
  ------------------
 9915|   117k|	    last = NULL;
 9916|   117k|            next = xmlXPathNextDescendantOrSelf;
 9917|   117k|            break;
 9918|    560|        case AXIS_FOLLOWING:
  ------------------
  |  Branch (9918:9): [True: 560, False: 1.03M]
  ------------------
 9919|    560|	    last = NULL;
 9920|    560|            next = xmlXPathNextFollowing;
 9921|    560|            break;
 9922|      0|        case AXIS_FOLLOWING_SIBLING:
  ------------------
  |  Branch (9922:9): [True: 0, False: 1.03M]
  ------------------
 9923|      0|	    last = NULL;
 9924|      0|            next = xmlXPathNextFollowingSibling;
 9925|      0|            break;
 9926|  1.41k|        case AXIS_NAMESPACE:
  ------------------
  |  Branch (9926:9): [True: 1.41k, False: 1.03M]
  ------------------
 9927|  1.41k|            first = NULL;
 9928|  1.41k|	    last = NULL;
 9929|  1.41k|            next = (xmlXPathTraversalFunction) xmlXPathNextNamespace;
 9930|  1.41k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9931|  1.41k|            break;
 9932|  33.3k|        case AXIS_PARENT:
  ------------------
  |  Branch (9932:9): [True: 33.3k, False: 1.00M]
  ------------------
 9933|  33.3k|            first = NULL;
 9934|  33.3k|            next = xmlXPathNextParent;
 9935|  33.3k|            break;
 9936|     59|        case AXIS_PRECEDING:
  ------------------
  |  Branch (9936:9): [True: 59, False: 1.03M]
  ------------------
 9937|     59|            first = NULL;
 9938|     59|            next = xmlXPathNextPrecedingInternal;
 9939|     59|            break;
 9940|      3|        case AXIS_PRECEDING_SIBLING:
  ------------------
  |  Branch (9940:9): [True: 3, False: 1.03M]
  ------------------
 9941|      3|            first = NULL;
 9942|      3|            next = xmlXPathNextPrecedingSibling;
 9943|      3|            break;
 9944|    309|        case AXIS_SELF:
  ------------------
  |  Branch (9944:9): [True: 309, False: 1.03M]
  ------------------
 9945|    309|            first = NULL;
 9946|    309|	    last = NULL;
 9947|    309|            next = xmlXPathNextSelf;
 9948|    309|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9949|    309|            break;
 9950|  1.03M|    }
 9951|       |
 9952|  1.03M|    if (next == NULL) {
  ------------------
  |  Branch (9952:9): [True: 0, False: 1.03M]
  ------------------
 9953|      0|	xmlXPathReleaseObject(xpctxt, obj);
 9954|      0|        return(0);
 9955|      0|    }
 9956|  1.03M|    contextSeq = obj->nodesetval;
 9957|  1.03M|    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
  ------------------
  |  Branch (9957:9): [True: 0, False: 1.03M]
  |  Branch (9957:33): [True: 73.0k, False: 961k]
  ------------------
 9958|  73.0k|        xmlXPathValuePush(ctxt, obj);
 9959|  73.0k|        return(0);
 9960|  73.0k|    }
 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|   961k|    maxPos = 0;
 9980|   961k|    predOp = NULL;
 9981|   961k|    hasPredicateRange = 0;
 9982|   961k|    hasAxisRange = 0;
 9983|   961k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9983:9): [True: 104k, False: 857k]
  ------------------
 9984|       |	/*
 9985|       |	* There's at least one predicate. 16 == XPATH_OP_PREDICATE
 9986|       |	*/
 9987|   104k|	predOp = &ctxt->comp->steps[op->ch2];
 9988|   104k|	if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) {
  ------------------
  |  Branch (9988:6): [True: 50.1k, False: 54.7k]
  ------------------
 9989|  50.1k|	    if (predOp->ch1 != -1) {
  ------------------
  |  Branch (9989:10): [True: 25.9k, False: 24.2k]
  ------------------
 9990|       |		/*
 9991|       |		* Use the next inner predicate operator.
 9992|       |		*/
 9993|  25.9k|		predOp = &ctxt->comp->steps[predOp->ch1];
 9994|  25.9k|		hasPredicateRange = 1;
 9995|  25.9k|	    } else {
 9996|       |		/*
 9997|       |		* There's no other predicate than the [n] predicate.
 9998|       |		*/
 9999|  24.2k|		predOp = NULL;
10000|  24.2k|		hasAxisRange = 1;
10001|  24.2k|	    }
10002|  50.1k|	}
10003|   104k|    }
10004|   961k|    breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
  ------------------
  |  Branch (10004:24): [True: 113k, False: 848k]
  |  Branch (10004:36): [True: 94.9k, False: 18.1k]
  ------------------
10005|       |    /*
10006|       |    * Axis traversal -----------------------------------------------------
10007|       |    */
10008|       |    /*
10009|       |     * 2.3 Node Tests
10010|       |     *  - For the attribute axis, the principal node type is attribute.
10011|       |     *  - For the namespace axis, the principal node type is namespace.
10012|       |     *  - For other axes, the principal node type is element.
10013|       |     *
10014|       |     * A node test * is true for any node of the
10015|       |     * principal node type. For example, child::* will
10016|       |     * select all element children of the context node
10017|       |     */
10018|   961k|    oldContextNode = xpctxt->node;
10019|   961k|    addNode = xmlXPathNodeSetAddUnique;
10020|   961k|    outSeq = NULL;
10021|   961k|    seq = NULL;
10022|   961k|    contextNode = NULL;
10023|   961k|    contextIdx = 0;
10024|       |
10025|       |
10026|  2.92M|    while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) &&
  ------------------
  |  Branch (10026:13): [True: 2.02M, False: 900k]
  |  Branch (10026:50): [True: 0, False: 900k]
  ------------------
10027|  2.02M|           (ctxt->error == XPATH_EXPRESSION_OK)) {
  ------------------
  |  Branch (10027:12): [True: 2.02M, False: 83]
  ------------------
10028|  2.02M|	xpctxt->node = contextSeq->nodeTab[contextIdx++];
10029|       |
10030|  2.02M|	if (seq == NULL) {
  ------------------
  |  Branch (10030:6): [True: 981k, False: 1.04M]
  ------------------
10031|   981k|	    seq = xmlXPathNodeSetCreate(NULL);
10032|   981k|	    if (seq == NULL) {
  ------------------
  |  Branch (10032:10): [True: 121, False: 981k]
  ------------------
10033|    121|                xmlXPathPErrMemory(ctxt);
10034|    121|		total = 0;
10035|    121|		goto error;
10036|    121|	    }
10037|   981k|	}
10038|       |	/*
10039|       |	* Traverse the axis and test the nodes.
10040|       |	*/
10041|  2.02M|	pos = 0;
10042|  2.02M|	cur = NULL;
10043|  2.02M|	hasNsNodes = 0;
10044|  8.16M|        do {
10045|  8.16M|            if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  8.16M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 8.16M, False: 0]
  |  |  |  Branch (818:39): [True: 37, False: 8.16M]
  |  |  ------------------
  ------------------
10046|     37|                goto error;
10047|       |
10048|  8.16M|            cur = next(ctxt, cur);
10049|  8.16M|            if (cur == NULL)
  ------------------
  |  Branch (10049:17): [True: 1.96M, False: 6.19M]
  ------------------
10050|  1.96M|                break;
10051|       |
10052|       |	    /*
10053|       |	    * QUESTION TODO: What does the "first" and "last" stuff do?
10054|       |	    */
10055|  6.19M|            if ((first != NULL) && (*first != NULL)) {
  ------------------
  |  Branch (10055:17): [True: 3.88k, False: 6.19M]
  |  Branch (10055:36): [True: 1.74k, False: 2.14k]
  ------------------
10056|  1.74k|		if (*first == cur)
  ------------------
  |  Branch (10056:7): [True: 317, False: 1.42k]
  ------------------
10057|    317|		    break;
10058|  1.42k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10058:7): [True: 1.32k, False: 100]
  ------------------
10059|  1.32k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10060|  1.32k|		    (xmlXPathCmpNodesExt(*first, cur) >= 0))
  ------------------
  |  Branch (10060:7): [True: 1.15k, False: 174]
  ------------------
10061|       |#else
10062|       |		    (xmlXPathCmpNodes(*first, cur) >= 0))
10063|       |#endif
10064|  1.15k|		{
10065|  1.15k|		    break;
10066|  1.15k|		}
10067|  1.42k|	    }
10068|  6.19M|	    if ((last != NULL) && (*last != NULL)) {
  ------------------
  |  Branch (10068:10): [True: 2.33k, False: 6.19M]
  |  Branch (10068:28): [True: 848, False: 1.48k]
  ------------------
10069|    848|		if (*last == cur)
  ------------------
  |  Branch (10069:7): [True: 102, False: 746]
  ------------------
10070|    102|		    break;
10071|    746|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10071:7): [True: 645, False: 101]
  ------------------
10072|    645|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10073|    645|		    (xmlXPathCmpNodesExt(cur, *last) >= 0))
  ------------------
  |  Branch (10073:7): [True: 564, False: 81]
  ------------------
10074|       |#else
10075|       |		    (xmlXPathCmpNodes(cur, *last) >= 0))
10076|       |#endif
10077|    564|		{
10078|    564|		    break;
10079|    564|		}
10080|    746|	    }
10081|       |
10082|  6.19M|            total++;
10083|       |
10084|  6.19M|	    switch (test) {
  ------------------
  |  Branch (10084:14): [True: 6.19M, False: 0]
  ------------------
10085|      0|                case NODE_TEST_NONE:
  ------------------
  |  Branch (10085:17): [True: 0, False: 6.19M]
  ------------------
10086|      0|		    total = 0;
10087|      0|		    goto error;
10088|  3.14M|                case NODE_TEST_TYPE:
  ------------------
  |  Branch (10088:17): [True: 3.14M, False: 3.04M]
  ------------------
10089|  3.14M|		    if (type == NODE_TYPE_NODE) {
  ------------------
  |  Branch (10089:11): [True: 3.04M, False: 106k]
  ------------------
10090|  3.04M|			switch (cur->type) {
10091|  94.2k|			    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (10091:8): [True: 94.2k, False: 2.94M]
  ------------------
10092|  94.2k|			    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (10092:8): [True: 0, False: 3.04M]
  ------------------
10093|  2.26M|			    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10093:8): [True: 2.16M, False: 875k]
  ------------------
10094|  2.26M|			    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (10094:8): [True: 886, False: 3.04M]
  ------------------
10095|  2.29M|			    case XML_PI_NODE:
  ------------------
  |  Branch (10095:8): [True: 31.4k, False: 3.01M]
  ------------------
10096|  2.31M|			    case XML_COMMENT_NODE:
  ------------------
  |  Branch (10096:8): [True: 18.4k, False: 3.02M]
  ------------------
10097|  2.34M|			    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (10097:8): [True: 29.3k, False: 3.01M]
  ------------------
10098|  3.02M|			    case XML_TEXT_NODE:
  ------------------
  |  Branch (10098:8): [True: 680k, False: 2.36M]
  ------------------
10099|  3.02M|				XP_TEST_HIT
  ------------------
  |  | 9796|  3.02M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 358, False: 3.02M]
  |  |  ------------------
  |  | 9797|    358|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 88, False: 270]
  |  |  ------------------
  |  | 9798|     88|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 87]
  |  |  ------------------
  |  | 9799|     88|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     88|	    goto axis_range_end; } \
  |  | 9801|  3.02M|    } else { \
  |  | 9802|  3.02M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 76, False: 3.02M]
  |  |  ------------------
  |  | 9803|  3.02M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  3.02M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 497, False: 3.02M]
  |  |  ------------------
  ------------------
10100|  3.02M|				break;
10101|  3.02M|			    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (10101:8): [True: 19.7k, False: 3.02M]
  ------------------
10102|  19.7k|				if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10102:9): [True: 0, False: 19.7k]
  ------------------
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|  19.7k|				} else {
10105|  19.7k|	                            hasNsNodes = 1;
10106|  19.7k|				    XP_TEST_HIT
  ------------------
  |  | 9796|  19.7k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 19.7k]
  |  |  ------------------
  |  | 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|  19.7k|    } else { \
  |  | 9802|  19.7k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 8, False: 19.7k]
  |  |  ------------------
  |  | 9803|  19.7k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  19.7k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 19.7k]
  |  |  ------------------
  ------------------
10107|  19.7k|				}
10108|  19.7k|				break;
10109|  19.7k|                            }
10110|  19.7k|			    default:
  ------------------
  |  Branch (10110:8): [True: 1.18k, False: 3.04M]
  ------------------
10111|  1.18k|				break;
10112|  3.04M|			}
10113|  3.04M|		    } else if (cur->type == (xmlElementType) type) {
  ------------------
  |  Branch (10113:18): [True: 52.6k, False: 53.5k]
  ------------------
10114|  52.6k|			if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10114:8): [True: 0, False: 52.6k]
  ------------------
10115|      0|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 9808|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9809|      0|	    hasNsNodes = 1; \
  |  | 9810|      0|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9811|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|      0|	goto axis_range_end; } \
  |  | 9813|      0|    } else { \
  |  | 9814|      0|	hasNsNodes = 1; \
  |  | 9815|      0|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9816|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10116|  52.6k|			else
10117|  52.6k|			    XP_TEST_HIT
  ------------------
  |  | 9796|  52.6k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 1.78k, False: 50.9k]
  |  |  ------------------
  |  | 9797|  1.78k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 245, False: 1.53k]
  |  |  ------------------
  |  | 9798|    245|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 244]
  |  |  ------------------
  |  | 9799|    245|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    245|	    goto axis_range_end; } \
  |  | 9801|  50.9k|    } else { \
  |  | 9802|  50.9k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 50.9k]
  |  |  ------------------
  |  | 9803|  50.9k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  50.9k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 251, False: 50.6k]
  |  |  ------------------
  ------------------
10118|  53.5k|		    } else if ((type == NODE_TYPE_TEXT) &&
  ------------------
  |  Branch (10118:18): [True: 53.5k, False: 25]
  ------------------
10119|  53.5k|			 (cur->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (10119:5): [True: 15.5k, False: 37.9k]
  ------------------
10120|  15.5k|		    {
10121|  15.5k|			XP_TEST_HIT
  ------------------
  |  | 9796|  15.5k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 378, False: 15.1k]
  |  |  ------------------
  |  | 9797|    378|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 35, False: 343]
  |  |  ------------------
  |  | 9798|     35|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 34]
  |  |  ------------------
  |  | 9799|     35|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     35|	    goto axis_range_end; } \
  |  | 9801|  15.1k|    } else { \
  |  | 9802|  15.1k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 15.1k]
  |  |  ------------------
  |  | 9803|  15.1k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  15.1k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 207, False: 14.9k]
  |  |  ------------------
  ------------------
10122|  15.5k|		    }
10123|  3.14M|		    break;
10124|  3.14M|                case NODE_TEST_PI:
  ------------------
  |  Branch (10124:17): [True: 182, False: 6.19M]
  ------------------
10125|    182|                    if ((cur->type == XML_PI_NODE) &&
  ------------------
  |  Branch (10125:25): [True: 42, False: 140]
  ------------------
10126|     42|                        ((name == NULL) || xmlStrEqual(name, cur->name)))
  ------------------
  |  Branch (10126:26): [True: 0, False: 42]
  |  Branch (10126:44): [True: 8, False: 34]
  ------------------
10127|      8|		    {
10128|      8|			XP_TEST_HIT
  ------------------
  |  | 9796|      8|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 8]
  |  |  ------------------
  |  | 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|      8|    } else { \
  |  | 9802|      8|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 7]
  |  |  ------------------
  |  | 9803|      8|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      8|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 8]
  |  |  ------------------
  ------------------
10129|      8|                    }
10130|    182|                    break;
10131|  1.26M|                case NODE_TEST_ALL:
  ------------------
  |  Branch (10131:17): [True: 1.26M, False: 4.93M]
  ------------------
10132|  1.26M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10132:25): [True: 11.8k, False: 1.25M]
  ------------------
10133|  11.8k|                        if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10133:29): [True: 11.8k, False: 0]
  ------------------
10134|  11.8k|			{
10135|  11.8k|                            if (prefix == NULL)
  ------------------
  |  Branch (10135:33): [True: 11.2k, False: 681]
  ------------------
10136|  11.2k|			    {
10137|  11.2k|				XP_TEST_HIT
  ------------------
  |  | 9796|  11.2k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 3.17k, False: 8.04k]
  |  |  ------------------
  |  | 9797|  3.17k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 811, False: 2.36k]
  |  |  ------------------
  |  | 9798|    811|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 810]
  |  |  ------------------
  |  | 9799|    811|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    811|	    goto axis_range_end; } \
  |  | 9801|  8.04k|    } else { \
  |  | 9802|  8.04k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 3, False: 8.03k]
  |  |  ------------------
  |  | 9803|  8.04k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  8.04k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 3.35k, False: 4.68k]
  |  |  ------------------
  ------------------
10138|  11.2k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10138:40): [True: 479, False: 202]
  ------------------
10139|    479|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10139:5): [True: 479, False: 0]
  ------------------
10140|    479|			    {
10141|    479|				XP_TEST_HIT
  ------------------
  |  | 9796|    479|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 241, False: 238]
  |  |  ------------------
  |  | 9797|    241|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 73, False: 168]
  |  |  ------------------
  |  | 9798|     73|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 72]
  |  |  ------------------
  |  | 9799|     73|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     73|	    goto axis_range_end; } \
  |  | 9801|    241|    } else { \
  |  | 9802|    238|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 237]
  |  |  ------------------
  |  | 9803|    238|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    238|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 40, False: 198]
  |  |  ------------------
  ------------------
10142|    479|                            }
10143|  11.8k|                        }
10144|  1.25M|                    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10144:32): [True: 73.2k, False: 1.17M]
  ------------------
10145|  73.2k|                        if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10145:29): [True: 73.2k, False: 0]
  ------------------
10146|  73.2k|			{
10147|  73.2k|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|  73.2k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 3.37k, False: 69.9k]
  |  |  ------------------
  |  | 9808|  3.37k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 2.68k, False: 695]
  |  |  ------------------
  |  | 9809|  2.68k|	    hasNsNodes = 1; \
  |  | 9810|  2.68k|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 8, False: 2.67k]
  |  |  ------------------
  |  | 9811|  2.68k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|  2.68k|	goto axis_range_end; } \
  |  | 9813|  69.9k|    } else { \
  |  | 9814|  69.9k|	hasNsNodes = 1; \
  |  | 9815|  69.9k|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 24, False: 69.8k]
  |  |  ------------------
  |  | 9816|  69.9k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|  69.9k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 69.9k]
  |  |  ------------------
  ------------------
10148|  73.2k|                        }
10149|  1.17M|                    } else {
10150|  1.17M|                        if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (10150:29): [True: 1.08M, False: 92.7k]
  ------------------
10151|  1.08M|                            if (prefix == NULL)
  ------------------
  |  Branch (10151:33): [True: 1.07M, False: 12.6k]
  ------------------
10152|  1.07M|			    {
10153|  1.07M|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.07M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 34.9k, False: 1.03M]
  |  |  ------------------
  |  | 9797|  34.9k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 11.5k, False: 23.4k]
  |  |  ------------------
  |  | 9798|  11.5k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 11.5k]
  |  |  ------------------
  |  | 9799|  11.5k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  11.5k|	    goto axis_range_end; } \
  |  | 9801|  1.03M|    } else { \
  |  | 9802|  1.03M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 34, False: 1.03M]
  |  |  ------------------
  |  | 9803|  1.03M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  1.03M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 30.9k, False: 1.00M]
  |  |  ------------------
  ------------------
10154|       |
10155|  1.07M|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10155:40): [True: 2.77k, False: 9.85k]
  ------------------
10156|  2.77k|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10156:5): [True: 1.14k, False: 1.62k]
  ------------------
10157|  1.14k|			    {
10158|  1.14k|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.14k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 314, False: 831]
  |  |  ------------------
  |  | 9797|    314|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 70, False: 244]
  |  |  ------------------
  |  | 9798|     70|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 69]
  |  |  ------------------
  |  | 9799|     70|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     70|	    goto axis_range_end; } \
  |  | 9801|    831|    } else { \
  |  | 9802|    831|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 3, False: 828]
  |  |  ------------------
  |  | 9803|    831|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    831|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 534, False: 297]
  |  |  ------------------
  ------------------
10159|  1.14k|                            }
10160|  1.08M|                        }
10161|  1.17M|                    }
10162|  1.21M|                    break;
10163|  1.21M|                case NODE_TEST_NS:{
  ------------------
  |  Branch (10163:17): [True: 0, False: 6.19M]
  ------------------
10164|       |                        /* TODO */
10165|      0|                        break;
10166|  1.26M|                    }
10167|  1.78M|                case NODE_TEST_NAME:
  ------------------
  |  Branch (10167:17): [True: 1.78M, False: 4.41M]
  ------------------
10168|  1.78M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10168:25): [True: 5.44k, False: 1.77M]
  ------------------
10169|  5.44k|                        if (cur->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10169:29): [True: 0, False: 5.44k]
  ------------------
10170|      0|			    break;
10171|  1.77M|		    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10171:18): [True: 2.61k, False: 1.77M]
  ------------------
10172|  2.61k|                        if (cur->type != XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10172:29): [True: 0, False: 2.61k]
  ------------------
10173|      0|			    break;
10174|  1.77M|		    } else {
10175|  1.77M|		        if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (10175:15): [True: 305k, False: 1.47M]
  ------------------
10176|   305k|			    break;
10177|  1.77M|		    }
10178|  1.47M|                    switch (cur->type) {
10179|  1.47M|                        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10179:25): [True: 1.47M, False: 8.06k]
  ------------------
10180|  1.47M|                            if (xmlStrEqual(name, cur->name)) {
  ------------------
  |  Branch (10180:33): [True: 289k, False: 1.18M]
  ------------------
10181|   289k|                                if (prefix == NULL) {
  ------------------
  |  Branch (10181:37): [True: 284k, False: 5.44k]
  ------------------
10182|   284k|                                    if (cur->ns == NULL)
  ------------------
  |  Branch (10182:41): [True: 283k, False: 664]
  ------------------
10183|   283k|				    {
10184|   283k|					XP_TEST_HIT
  ------------------
  |  | 9796|   283k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 17.8k, False: 265k]
  |  |  ------------------
  |  | 9797|  17.8k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 7.04k, False: 10.7k]
  |  |  ------------------
  |  | 9798|  7.04k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 2, False: 7.04k]
  |  |  ------------------
  |  | 9799|  7.04k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  7.04k|	    goto axis_range_end; } \
  |  | 9801|   265k|    } else { \
  |  | 9802|   265k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 10, False: 265k]
  |  |  ------------------
  |  | 9803|   265k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   265k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 125, False: 265k]
  |  |  ------------------
  ------------------
10185|   283k|                                    }
10186|   284k|                                } else {
10187|  5.44k|                                    if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10187:41): [True: 371, False: 5.07k]
  ------------------
10188|    371|                                        (xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10188:41): [True: 89, False: 282]
  ------------------
10189|     89|				    {
10190|     89|					XP_TEST_HIT
  ------------------
  |  | 9796|     89|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 89]
  |  |  ------------------
  |  | 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|     89|    } else { \
  |  | 9802|     89|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 88]
  |  |  ------------------
  |  | 9803|     89|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     89|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 89]
  |  |  ------------------
  ------------------
10191|     89|                                    }
10192|  5.44k|                                }
10193|   289k|                            }
10194|  1.46M|                            break;
10195|  1.46M|                        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (10195:25): [True: 5.44k, False: 1.47M]
  ------------------
10196|  5.44k|                                xmlAttrPtr attr = (xmlAttrPtr) cur;
10197|       |
10198|  5.44k|                                if (xmlStrEqual(name, attr->name)) {
  ------------------
  |  Branch (10198:37): [True: 4.04k, False: 1.40k]
  ------------------
10199|  4.04k|                                    if (prefix == NULL) {
  ------------------
  |  Branch (10199:41): [True: 3.59k, False: 448]
  ------------------
10200|  3.59k|                                        if ((attr->ns == NULL) ||
  ------------------
  |  Branch (10200:45): [True: 3.51k, False: 80]
  ------------------
10201|     80|                                            (attr->ns->prefix == NULL))
  ------------------
  |  Branch (10201:45): [True: 0, False: 80]
  ------------------
10202|  3.51k|					{
10203|  3.51k|					    XP_TEST_HIT
  ------------------
  |  | 9796|  3.51k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 2.83k, False: 685]
  |  |  ------------------
  |  | 9797|  2.83k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 1.06k, False: 1.76k]
  |  |  ------------------
  |  | 9798|  1.06k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 1.06k]
  |  |  ------------------
  |  | 9799|  1.06k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  1.06k|	    goto axis_range_end; } \
  |  | 9801|  2.83k|    } else { \
  |  | 9802|    685|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 684]
  |  |  ------------------
  |  | 9803|    685|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    685|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 89, False: 596]
  |  |  ------------------
  ------------------
10204|  3.51k|                                        }
10205|  3.59k|                                    } else {
10206|    448|                                        if ((attr->ns != NULL) &&
  ------------------
  |  Branch (10206:45): [True: 2, False: 446]
  ------------------
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|    448|                                    }
10213|  4.04k|                                }
10214|  4.29k|                                break;
10215|  5.44k|                            }
10216|  4.29k|                        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (10216:25): [True: 2.61k, False: 1.47M]
  ------------------
10217|  2.61k|                            if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (10217:33): [True: 2.61k, False: 0]
  ------------------
10218|  2.61k|                                xmlNsPtr ns = (xmlNsPtr) cur;
10219|       |
10220|  2.61k|                                if ((ns->prefix != NULL) && (name != NULL)
  ------------------
  |  Branch (10220:37): [True: 2.01k, False: 594]
  |  Branch (10220:61): [True: 2.01k, False: 0]
  ------------------
10221|  2.01k|                                    && (xmlStrEqual(ns->prefix, name)))
  ------------------
  |  Branch (10221:40): [True: 1.11k, False: 906]
  ------------------
10222|  1.11k|				{
10223|  1.11k|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|  1.11k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 255, False: 858]
  |  |  ------------------
  |  | 9808|    255|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 174, False: 81]
  |  |  ------------------
  |  | 9809|    174|	    hasNsNodes = 1; \
  |  | 9810|    174|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 2, False: 172]
  |  |  ------------------
  |  | 9811|    174|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|    174|	goto axis_range_end; } \
  |  | 9813|    858|    } else { \
  |  | 9814|    858|	hasNsNodes = 1; \
  |  | 9815|    858|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 1, False: 857]
  |  |  ------------------
  |  | 9816|    858|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|    858|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 858]
  |  |  ------------------
  ------------------
10224|  1.11k|                                }
10225|  2.61k|                            }
10226|  2.43k|                            break;
10227|  2.43k|                        default:
  ------------------
  |  Branch (10227:25): [True: 0, False: 1.47M]
  ------------------
10228|      0|                            break;
10229|  1.47M|                    }
10230|  1.47M|                    break;
10231|  6.19M|	    } /* switch(test) */
10232|  6.19M|        } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK));
  ------------------
  |  Branch (10232:18): [True: 6.13M, False: 0]
  |  Branch (10232:35): [True: 6.13M, False: 164]
  ------------------
10233|       |
10234|  1.96M|	goto apply_predicates;
10235|       |
10236|  1.96M|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|  23.7k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10243:6): [True: 17.3k, False: 6.41k]
  ------------------
10244|  17.3k|	    outSeq = seq;
10245|  17.3k|	    seq = NULL;
10246|  17.3k|	} else {
10247|  6.41k|	    outSeq = mergeAndClear(outSeq, seq);
10248|  6.41k|            if (outSeq == NULL)
  ------------------
  |  Branch (10248:17): [True: 7, False: 6.40k]
  ------------------
10249|      7|                xmlXPathPErrMemory(ctxt);
10250|  6.41k|        }
10251|       |	/*
10252|       |	* Break if only a true/false result was requested.
10253|       |	*/
10254|  23.7k|	if (toBool)
  ------------------
  |  Branch (10254:6): [True: 13.5k, False: 10.2k]
  ------------------
10255|  13.5k|	    break;
10256|  10.2k|	continue;
10257|       |
10258|  36.0k|first_hit: /* ---------------------------------------------------------- */
10259|       |	/*
10260|       |	* Break if only a true/false result was requested and
10261|       |	* no predicates existed and a node test succeeded.
10262|       |	*/
10263|  36.0k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10263:6): [True: 36.0k, False: 0]
  ------------------
10264|  36.0k|	    outSeq = seq;
10265|  36.0k|	    seq = NULL;
10266|  36.0k|	} else {
10267|      0|	    outSeq = mergeAndClear(outSeq, seq);
10268|      0|            if (outSeq == NULL)
  ------------------
  |  Branch (10268:17): [True: 0, False: 0]
  ------------------
10269|      0|                xmlXPathPErrMemory(ctxt);
10270|      0|        }
10271|  36.0k|	break;
10272|       |
10273|  1.96M|apply_predicates: /* --------------------------------------------------- */
10274|  1.96M|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10274:13): [True: 169, False: 1.96M]
  ------------------
10275|    169|	    goto error;
10276|       |
10277|       |        /*
10278|       |	* Apply predicates.
10279|       |	*/
10280|  1.96M|        if ((predOp != NULL) && (seq->nodeNr > 0)) {
  ------------------
  |  Branch (10280:13): [True: 590k, False: 1.37M]
  |  Branch (10280:33): [True: 123k, False: 466k]
  ------------------
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|   123k|	    if (hasPredicateRange != 0)
  ------------------
  |  Branch (10309:10): [True: 8.41k, False: 115k]
  ------------------
10310|  8.41k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos,
10311|  8.41k|					    hasNsNodes);
10312|   115k|	    else
10313|   115k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr,
10314|   115k|					    hasNsNodes);
10315|       |
10316|   123k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (10316:10): [True: 1.58k, False: 122k]
  ------------------
10317|  1.58k|		total = 0;
10318|  1.58k|		goto error;
10319|  1.58k|	    }
10320|   123k|        }
10321|       |
10322|  1.96M|        if (seq->nodeNr > 0) {
  ------------------
  |  Branch (10322:13): [True: 473k, False: 1.49M]
  ------------------
10323|       |	    /*
10324|       |	    * Add to result set.
10325|       |	    */
10326|   473k|	    if (outSeq == NULL) {
  ------------------
  |  Branch (10326:10): [True: 211k, False: 261k]
  ------------------
10327|   211k|		outSeq = seq;
10328|   211k|		seq = NULL;
10329|   261k|	    } else {
10330|   261k|		outSeq = mergeAndClear(outSeq, seq);
10331|   261k|                if (outSeq == NULL)
  ------------------
  |  Branch (10331:21): [True: 79, False: 261k]
  ------------------
10332|     79|                    xmlXPathPErrMemory(ctxt);
10333|   261k|	    }
10334|       |
10335|   473k|            if (toBool)
  ------------------
  |  Branch (10335:17): [True: 10.1k, False: 462k]
  ------------------
10336|  10.1k|                break;
10337|   473k|	}
10338|  1.96M|    }
10339|       |
10340|   961k|error:
10341|   961k|    if ((obj->boolval) && (obj->user != NULL)) {
  ------------------
  |  Branch (10341:9): [True: 0, False: 961k]
  |  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|   961k|    xmlXPathReleaseObject(xpctxt, obj);
10353|       |
10354|       |    /*
10355|       |    * Ensure we return at least an empty set.
10356|       |    */
10357|   961k|    if (outSeq == NULL) {
  ------------------
  |  Branch (10357:9): [True: 697k, False: 264k]
  ------------------
10358|   697k|	if ((seq != NULL) && (seq->nodeNr == 0)) {
  ------------------
  |  Branch (10358:6): [True: 696k, False: 116]
  |  Branch (10358:23): [True: 696k, False: 120]
  ------------------
10359|   696k|	    outSeq = seq;
10360|   696k|        } else {
10361|    236|	    outSeq = xmlXPathNodeSetCreate(NULL);
10362|    236|            if (outSeq == NULL)
  ------------------
  |  Branch (10362:17): [True: 1, False: 235]
  ------------------
10363|      1|                xmlXPathPErrMemory(ctxt);
10364|    236|        }
10365|   697k|    }
10366|   961k|    if ((seq != NULL) && (seq != outSeq)) {
  ------------------
  |  Branch (10366:9): [True: 716k, False: 245k]
  |  Branch (10366:26): [True: 19.5k, False: 696k]
  ------------------
10367|  19.5k|	 xmlXPathFreeNodeSet(seq);
10368|  19.5k|    }
10369|       |    /*
10370|       |    * Hand over the result. Better to push the set also in
10371|       |    * case of errors.
10372|       |    */
10373|   961k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq));
10374|       |    /*
10375|       |    * Reset the context node.
10376|       |    */
10377|   961k|    xpctxt->node = oldContextNode;
10378|       |    /*
10379|       |    * When traversing the namespace axis in "toBool" mode, it's
10380|       |    * possible that tmpNsList wasn't freed.
10381|       |    */
10382|   961k|    if (xpctxt->tmpNsList != NULL) {
  ------------------
  |  Branch (10382:9): [True: 146, False: 961k]
  ------------------
10383|    146|        xmlFree(xpctxt->tmpNsList);
10384|    146|        xpctxt->tmpNsList = NULL;
10385|    146|    }
10386|       |
10387|   961k|    return(total);
10388|   961k|}
xpath.c:xmlXPathNodeSetMergeAndClear:
 2958|   134k|{
 2959|   134k|    {
 2960|   134k|	int i, j, initNbSet1;
 2961|   134k|	xmlNodePtr n1, n2;
 2962|       |
 2963|   134k|	initNbSet1 = set1->nodeNr;
 2964|   350k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (2964:13): [True: 215k, False: 134k]
  ------------------
 2965|   215k|	    n2 = set2->nodeTab[i];
 2966|       |	    /*
 2967|       |	    * Skip duplicates.
 2968|       |	    */
 2969|  10.4M|	    for (j = 0; j < initNbSet1; j++) {
  ------------------
  |  Branch (2969:18): [True: 10.3M, False: 79.5k]
  ------------------
 2970|  10.3M|		n1 = set1->nodeTab[j];
 2971|  10.3M|		if (n1 == n2) {
  ------------------
  |  Branch (2971:7): [True: 136k, False: 10.2M]
  ------------------
 2972|   136k|		    goto skip_node;
 2973|  10.2M|		} else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2973:14): [True: 1.57M, False: 8.67M]
  ------------------
 2974|  1.57M|		    (n2->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2974:7): [True: 1.57M, False: 0]
  ------------------
 2975|  1.57M|		{
 2976|  1.57M|		    if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2976:11): [True: 20.1k, False: 1.55M]
  ------------------
 2977|  20.1k|			(xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2977:4): [True: 0, False: 20.1k]
  ------------------
 2978|  20.1k|			((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|  1.57M|		}
 2987|  10.3M|	    }
 2988|       |	    /*
 2989|       |	    * grow the nodeTab if needed
 2990|       |	    */
 2991|  79.5k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (2991:17): [True: 13.5k, False: 66.0k]
  ------------------
 2992|  13.5k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (2992:21): [True: 37, False: 13.5k]
  ------------------
 2993|     37|                    goto error;
 2994|  13.5k|            }
 2995|  79.5k|	    set1->nodeTab[set1->nodeNr++] = n2;
 2996|   215k|skip_node:
 2997|   215k|            set2->nodeTab[i] = NULL;
 2998|   215k|	}
 2999|   134k|    }
 3000|   134k|    set2->nodeNr = 0;
 3001|   134k|    return(set1);
 3002|       |
 3003|     37|error:
 3004|     37|    xmlXPathFreeNodeSet(set1);
 3005|     37|    xmlXPathNodeSetClear(set2, 1);
 3006|       |    return(NULL);
 3007|   134k|}
xpath.c:xmlXPathNodeSetClear:
 3154|  1.69k|{
 3155|  1.69k|    xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes);
 3156|  1.69k|}
xpath.c:xmlXPathNodeSetClearFromPos:
 3127|  1.79k|{
 3128|  1.79k|    if ((set == NULL) || (pos >= set->nodeNr))
  ------------------
  |  Branch (3128:9): [True: 0, False: 1.79k]
  |  Branch (3128:26): [True: 0, False: 1.79k]
  ------------------
 3129|      0|	return;
 3130|  1.79k|    else if ((hasNsNodes)) {
  ------------------
  |  Branch (3130:14): [True: 194, False: 1.60k]
  ------------------
 3131|    194|	int i;
 3132|    194|	xmlNodePtr node;
 3133|       |
 3134|  2.84k|	for (i = pos; i < set->nodeNr; i++) {
  ------------------
  |  Branch (3134:16): [True: 2.64k, False: 194]
  ------------------
 3135|  2.64k|	    node = set->nodeTab[i];
 3136|  2.64k|	    if ((node != NULL) &&
  ------------------
  |  Branch (3136:10): [True: 2.04k, False: 606]
  ------------------
 3137|  2.04k|		(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3137:3): [True: 44, False: 1.99k]
  ------------------
 3138|     44|		xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3139|  2.64k|	}
 3140|    194|    }
 3141|  1.79k|    set->nodeNr = pos;
 3142|  1.79k|}
xpath.c:xmlXPathNodeSetMergeAndClearNoDupls:
 3021|   133k|{
 3022|   133k|    {
 3023|   133k|	int i;
 3024|   133k|	xmlNodePtr n2;
 3025|       |
 3026|   410k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (3026:13): [True: 276k, False: 133k]
  ------------------
 3027|   276k|	    n2 = set2->nodeTab[i];
 3028|   276k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (3028:17): [True: 39.6k, False: 237k]
  ------------------
 3029|  39.6k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (3029:21): [True: 49, False: 39.6k]
  ------------------
 3030|     49|                    goto error;
 3031|  39.6k|            }
 3032|   276k|	    set1->nodeTab[set1->nodeNr++] = n2;
 3033|   276k|            set2->nodeTab[i] = NULL;
 3034|   276k|	}
 3035|   133k|    }
 3036|   133k|    set2->nodeNr = 0;
 3037|   133k|    return(set1);
 3038|       |
 3039|     49|error:
 3040|     49|    xmlXPathFreeNodeSet(set1);
 3041|     49|    xmlXPathNodeSetClear(set2, 1);
 3042|       |    return(NULL);
 3043|   133k|}
xpath.c:xmlXPathNextChildElement:
 6200|  2.64M|xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
 6201|  2.64M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6201:9): [True: 0, False: 2.64M]
  |  Branch (6201:27): [True: 0, False: 2.64M]
  ------------------
 6202|  2.64M|    if (cur == NULL) {
  ------------------
  |  Branch (6202:9): [True: 1.32M, False: 1.32M]
  ------------------
 6203|  1.32M|	cur = ctxt->context->node;
 6204|  1.32M|	if (cur == NULL) return(NULL);
  ------------------
  |  Branch (6204:6): [True: 0, False: 1.32M]
  ------------------
 6205|       |	/*
 6206|       |	* Get the first element child.
 6207|       |	*/
 6208|  1.32M|	switch (cur->type) {
 6209|  1.00M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6209:13): [True: 1.00M, False: 314k]
  ------------------
 6210|  1.00M|	    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6210:6): [True: 0, False: 1.32M]
  ------------------
 6211|  1.00M|	    case XML_ENTITY_REF_NODE: /* URGENT TODO: entify-refs as well? */
  ------------------
  |  Branch (6211:6): [True: 0, False: 1.32M]
  ------------------
 6212|  1.00M|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6212:13): [True: 0, False: 1.32M]
  ------------------
 6213|  1.00M|		cur = cur->children;
 6214|  1.00M|		if (cur != NULL) {
  ------------------
  |  Branch (6214:7): [True: 387k, False: 622k]
  ------------------
 6215|   387k|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6215:11): [True: 195k, False: 192k]
  ------------------
 6216|   195k|			return(cur);
 6217|   202k|		    do {
 6218|   202k|			cur = cur->next;
 6219|   202k|		    } while ((cur != NULL) &&
  ------------------
  |  Branch (6219:16): [True: 118k, False: 84.0k]
  ------------------
 6220|   118k|			(cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6220:4): [True: 9.40k, False: 108k]
  ------------------
 6221|   192k|		    return(cur);
 6222|   387k|		}
 6223|   622k|		return(NULL);
 6224|   160k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6224:13): [True: 160k, False: 1.16M]
  ------------------
 6225|   160k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6225:13): [True: 0, False: 1.32M]
  ------------------
 6226|   160k|		return(xmlDocGetRootElement((xmlDocPtr) cur));
 6227|   153k|	    default:
  ------------------
  |  Branch (6227:6): [True: 153k, False: 1.17M]
  ------------------
 6228|   153k|		return(NULL);
 6229|  1.32M|	}
 6230|      0|	return(NULL);
 6231|  1.32M|    }
 6232|       |    /*
 6233|       |    * Get the next sibling element node.
 6234|       |    */
 6235|  1.32M|    switch (cur->type) {
 6236|  1.32M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6236:2): [True: 1.32M, False: 0]
  ------------------
 6237|  1.32M|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6237:2): [True: 0, False: 1.32M]
  ------------------
 6238|  1.32M|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6238:2): [True: 0, False: 1.32M]
  ------------------
 6239|  1.32M|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6239:2): [True: 0, False: 1.32M]
  ------------------
 6240|  1.32M|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6240:2): [True: 0, False: 1.32M]
  ------------------
 6241|  1.32M|	case XML_PI_NODE:
  ------------------
  |  Branch (6241:2): [True: 0, False: 1.32M]
  ------------------
 6242|  1.32M|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6242:2): [True: 0, False: 1.32M]
  ------------------
 6243|  1.32M|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6243:2): [True: 0, False: 1.32M]
  ------------------
 6244|  1.32M|	    break;
 6245|       |	/* case XML_DTD_NODE: */ /* URGENT TODO: DTD-node as well? */
 6246|      0|	default:
  ------------------
  |  Branch (6246:2): [True: 0, False: 1.32M]
  ------------------
 6247|      0|	    return(NULL);
 6248|  1.32M|    }
 6249|  1.32M|    if (cur->next != NULL) {
  ------------------
  |  Branch (6249:9): [True: 968k, False: 352k]
  ------------------
 6250|   968k|	if (cur->next->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6250:6): [True: 800k, False: 167k]
  ------------------
 6251|   800k|	    return(cur->next);
 6252|   167k|	cur = cur->next;
 6253|   174k|	do {
 6254|   174k|	    cur = cur->next;
 6255|   174k|	} while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6255:11): [True: 82.2k, False: 92.2k]
  |  Branch (6255:28): [True: 6.66k, False: 75.6k]
  ------------------
 6256|   167k|	return(cur);
 6257|   968k|    }
 6258|   352k|    return(NULL);
 6259|  1.32M|}
xpath.c:xmlXPathNextPrecedingInternal:
 6756|  19.0k|{
 6757|  19.0k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6757:9): [True: 0, False: 19.0k]
  |  Branch (6757:27): [True: 0, False: 19.0k]
  ------------------
 6758|  19.0k|    if (cur == NULL) {
  ------------------
  |  Branch (6758:9): [True: 1.15k, False: 17.9k]
  ------------------
 6759|  1.15k|        cur = ctxt->context->node;
 6760|  1.15k|        if (cur == NULL)
  ------------------
  |  Branch (6760:13): [True: 0, False: 1.15k]
  ------------------
 6761|      0|            return (NULL);
 6762|  1.15k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6762:13): [True: 0, False: 1.15k]
  ------------------
 6763|      0|            cur = cur->parent;
 6764|  1.15k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6764:20): [True: 0, False: 1.15k]
  ------------------
 6765|      0|            xmlNsPtr ns = (xmlNsPtr) cur;
 6766|       |
 6767|      0|            if ((ns->next == NULL) ||
  ------------------
  |  Branch (6767:17): [True: 0, False: 0]
  ------------------
 6768|      0|                (ns->next->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6768:17): [True: 0, False: 0]
  ------------------
 6769|      0|                return (NULL);
 6770|      0|            cur = (xmlNodePtr) ns->next;
 6771|      0|        }
 6772|  1.15k|        ctxt->ancestor = cur->parent;
 6773|  1.15k|    }
 6774|       |
 6775|  19.0k|    if (cur->type == XML_NAMESPACE_DECL || cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6775:9): [True: 0, False: 19.0k]
  |  Branch (6775:44): [True: 59, False: 19.0k]
  ------------------
 6776|     59|        return(NULL);
 6777|       |
 6778|  19.0k|    if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
  ------------------
  |  Branch (6778:9): [True: 9.48k, False: 9.51k]
  |  Branch (6778:32): [True: 368, False: 9.11k]
  ------------------
 6779|    368|	cur = cur->prev;
 6780|       |
 6781|  21.7k|    while (cur->prev == NULL) {
  ------------------
  |  Branch (6781:12): [True: 11.3k, False: 10.4k]
  ------------------
 6782|  11.3k|        cur = cur->parent;
 6783|  11.3k|        if (cur == NULL)
  ------------------
  |  Branch (6783:13): [True: 599, False: 10.7k]
  ------------------
 6784|    599|            return (NULL);
 6785|  10.7k|        if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6785:13): [True: 495, False: 10.2k]
  ------------------
 6786|    495|            return (NULL);
 6787|  10.2k|        if (cur != ctxt->ancestor)
  ------------------
  |  Branch (6787:13): [True: 7.47k, False: 2.78k]
  ------------------
 6788|  7.47k|            return (cur);
 6789|  2.78k|        ctxt->ancestor = cur->parent;
 6790|  2.78k|    }
 6791|       |
 6792|  10.4k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6792:9): [True: 0, False: 10.4k]
  ------------------
 6793|      0|        return(NULL);
 6794|       |
 6795|  10.4k|    cur = cur->prev;
 6796|  17.9k|    while (cur->last != NULL)
  ------------------
  |  Branch (6796:12): [True: 7.47k, False: 10.4k]
  ------------------
 6797|  7.47k|        cur = cur->last;
 6798|  10.4k|    return (cur);
 6799|  10.4k|}
xpath.c:xmlXPathIsPositionalPredicate:
 9736|   104k|{
 9737|       |
 9738|   104k|    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|   104k|    if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
  ------------------
  |  Branch (9753:9): [True: 0, False: 104k]
  |  Branch (9753:43): [True: 0, False: 0]
  ------------------
 9754|      0|	return(0);
 9755|       |
 9756|   104k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9756:9): [True: 104k, False: 0]
  ------------------
 9757|   104k|	exprOp = &ctxt->comp->steps[op->ch2];
 9758|   104k|    } else
 9759|      0|	return(0);
 9760|       |
 9761|   104k|    if ((exprOp != NULL) &&
  ------------------
  |  Branch (9761:9): [True: 104k, False: 0]
  ------------------
 9762|   104k|	(exprOp->op == XPATH_OP_VALUE) &&
  ------------------
  |  Branch (9762:2): [True: 53.6k, False: 51.3k]
  ------------------
 9763|  53.6k|	(exprOp->value4 != NULL) &&
  ------------------
  |  Branch (9763:2): [True: 53.6k, False: 0]
  ------------------
 9764|  53.6k|	(((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER))
  ------------------
  |  Branch (9764:2): [True: 53.0k, False: 642]
  ------------------
 9765|  53.0k|    {
 9766|  53.0k|        double floatval = ((xmlXPathObjectPtr) exprOp->value4)->floatval;
 9767|       |
 9768|       |	/*
 9769|       |	* We have a "[n]" predicate here.
 9770|       |	* TODO: Unfortunately this simplistic test here is not
 9771|       |	* able to detect a position() predicate in compound
 9772|       |	* expressions like "[@attr = 'a" and position() = 1],
 9773|       |	* and even not the usage of position() in
 9774|       |	* "[position() = 1]"; thus - obviously - a position-range,
 9775|       |	* like it "[position() < 5]", is also not detected.
 9776|       |	* Maybe we could rewrite the AST to ease the optimization.
 9777|       |	*/
 9778|       |
 9779|  53.0k|        if ((floatval > INT_MIN) && (floatval < INT_MAX)) {
  ------------------
  |  Branch (9779:13): [True: 52.9k, False: 38]
  |  Branch (9779:37): [True: 50.4k, False: 2.55k]
  ------------------
 9780|  50.4k|	    *maxPos = (int) floatval;
 9781|  50.4k|            if (floatval == (double) *maxPos)
  ------------------
  |  Branch (9781:17): [True: 50.1k, False: 225]
  ------------------
 9782|  50.1k|                return(1);
 9783|  50.4k|        }
 9784|  53.0k|    }
 9785|  54.7k|    return(0);
 9786|   104k|}
xpath.c:xmlXPathCompOpEvalPredicate:
 9710|   124k|{
 9711|   124k|    if (op->ch1 != -1) {
  ------------------
  |  Branch (9711:9): [True: 1.07k, False: 123k]
  ------------------
 9712|  1.07k|	xmlXPathCompExprPtr comp = ctxt->comp;
 9713|       |	/*
 9714|       |	* Process inner predicates first.
 9715|       |	*/
 9716|  1.07k|	if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) {
  ------------------
  |  Branch (9716:6): [True: 0, False: 1.07k]
  ------------------
 9717|      0|            XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9718|      0|	}
 9719|  1.07k|        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.07k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9719:13): [True: 0, False: 1.07k]
  ------------------
 9720|  1.07k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9721|  1.07k|        ctxt->context->depth += 1;
 9722|  1.07k|	xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
 9723|  1.07k|                                    1, set->nodeNr, hasNsNodes);
 9724|  1.07k|        ctxt->context->depth -= 1;
 9725|  1.07k|	CHECK_ERROR;
  ------------------
  |  |  230|  1.07k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 76, False: 1.00k]
  |  |  ------------------
  ------------------
 9726|  1.07k|    }
 9727|       |
 9728|   124k|    if (op->ch2 != -1)
  ------------------
  |  Branch (9728:9): [True: 124k, False: 0]
  ------------------
 9729|   124k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes);
 9730|   124k|}
xpath.c:xmlXPathNodeSetFilter:
 9577|   128k|{
 9578|   128k|    xmlXPathContextPtr xpctxt;
 9579|   128k|    xmlNodePtr oldnode;
 9580|   128k|    xmlDocPtr olddoc;
 9581|   128k|    xmlXPathStepOpPtr filterOp;
 9582|   128k|    int oldcs, oldpp;
 9583|   128k|    int i, j, pos;
 9584|       |
 9585|   128k|    if ((set == NULL) || (set->nodeNr == 0))
  ------------------
  |  Branch (9585:9): [True: 0, False: 128k]
  |  Branch (9585:26): [True: 1.89k, False: 126k]
  ------------------
 9586|  1.89k|        return;
 9587|       |
 9588|       |    /*
 9589|       |    * Check if the node set contains a sufficient number of nodes for
 9590|       |    * the requested range.
 9591|       |    */
 9592|   126k|    if (set->nodeNr < minPos) {
  ------------------
  |  Branch (9592:9): [True: 1.60k, False: 124k]
  ------------------
 9593|  1.60k|        xmlXPathNodeSetClear(set, hasNsNodes);
 9594|  1.60k|        return;
 9595|  1.60k|    }
 9596|       |
 9597|   124k|    xpctxt = ctxt->context;
 9598|   124k|    oldnode = xpctxt->node;
 9599|   124k|    olddoc = xpctxt->doc;
 9600|   124k|    oldcs = xpctxt->contextSize;
 9601|   124k|    oldpp = xpctxt->proximityPosition;
 9602|   124k|    filterOp = &ctxt->comp->steps[filterOpIndex];
 9603|       |
 9604|   124k|    xpctxt->contextSize = set->nodeNr;
 9605|       |
 9606|   500k|    for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9606:33): [True: 451k, False: 48.1k]
  ------------------
 9607|   451k|        xmlNodePtr node = set->nodeTab[i];
 9608|   451k|        int res;
 9609|       |
 9610|   451k|        xpctxt->node = node;
 9611|   451k|        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|   451k|        if ((node->type != XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (9619:13): [True: 403k, False: 48.1k]
  ------------------
 9620|   403k|            (node->doc != NULL))
  ------------------
  |  Branch (9620:13): [True: 403k, False: 0]
  ------------------
 9621|   403k|            xpctxt->doc = node->doc;
 9622|       |
 9623|   451k|        res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 9624|       |
 9625|   451k|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (9625:13): [True: 1.62k, False: 450k]
  ------------------
 9626|  1.62k|            break;
 9627|   450k|        if (res < 0) {
  ------------------
  |  Branch (9627:13): [True: 0, False: 450k]
  ------------------
 9628|       |            /* Shouldn't happen */
 9629|      0|            xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
 9630|      0|            break;
 9631|      0|        }
 9632|       |
 9633|   450k|        if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
  ------------------
  |  Branch (9633:13): [True: 209k, False: 241k]
  |  Branch (9633:28): [True: 192k, False: 16.6k]
  |  Branch (9633:47): [True: 182k, False: 10.5k]
  ------------------
 9634|   182k|            if (i != j) {
  ------------------
  |  Branch (9634:17): [True: 5.85k, False: 176k]
  ------------------
 9635|  5.85k|                set->nodeTab[j] = node;
 9636|  5.85k|                set->nodeTab[i] = NULL;
 9637|  5.85k|            }
 9638|       |
 9639|   182k|            j += 1;
 9640|   268k|        } else {
 9641|       |            /* Remove the entry from the initial node set. */
 9642|   268k|            set->nodeTab[i] = NULL;
 9643|   268k|            if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (9643:17): [True: 15.6k, False: 252k]
  ------------------
 9644|  15.6k|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9645|   268k|        }
 9646|       |
 9647|   450k|        if (res != 0) {
  ------------------
  |  Branch (9647:13): [True: 209k, False: 241k]
  ------------------
 9648|   209k|            if (pos == maxPos) {
  ------------------
  |  Branch (9648:17): [True: 75.1k, False: 134k]
  ------------------
 9649|  75.1k|                i += 1;
 9650|  75.1k|                break;
 9651|  75.1k|            }
 9652|       |
 9653|   134k|            pos += 1;
 9654|   134k|        }
 9655|   450k|    }
 9656|       |
 9657|       |    /* Free remaining nodes. */
 9658|   124k|    if (hasNsNodes) {
  ------------------
  |  Branch (9658:9): [True: 23.6k, False: 101k]
  ------------------
 9659|  24.3k|        for (; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9659:16): [True: 684, False: 23.6k]
  ------------------
 9660|    684|            xmlNodePtr node = set->nodeTab[i];
 9661|    684|            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (9661:17): [True: 684, False: 0]
  |  Branch (9661:35): [True: 32, False: 652]
  ------------------
 9662|     32|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9663|    684|        }
 9664|  23.6k|    }
 9665|       |
 9666|   124k|    set->nodeNr = j;
 9667|       |
 9668|       |    /* If too many elements were removed, shrink table to preserve memory. */
 9669|   124k|    if ((set->nodeMax > XML_NODESET_DEFAULT) &&
  ------------------
  |  | 2593|   124k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9669:9): [True: 12.7k, False: 112k]
  ------------------
 9670|  12.7k|        (set->nodeNr < set->nodeMax / 2)) {
  ------------------
  |  Branch (9670:9): [True: 8.25k, False: 4.47k]
  ------------------
 9671|  8.25k|        xmlNodePtr *tmp;
 9672|  8.25k|        int nodeMax = set->nodeNr;
 9673|       |
 9674|  8.25k|        if (nodeMax < XML_NODESET_DEFAULT)
  ------------------
  |  | 2593|  8.25k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9674:13): [True: 8.12k, False: 125]
  ------------------
 9675|  8.12k|            nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  8.12k|#define XML_NODESET_DEFAULT	10
  ------------------
 9676|  8.25k|        tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab,
 9677|  8.25k|                nodeMax * sizeof(xmlNodePtr));
 9678|  8.25k|        if (tmp == NULL) {
  ------------------
  |  Branch (9678:13): [True: 1, False: 8.25k]
  ------------------
 9679|      1|            xmlXPathPErrMemory(ctxt);
 9680|  8.25k|        } else {
 9681|  8.25k|            set->nodeTab = tmp;
 9682|  8.25k|            set->nodeMax = nodeMax;
 9683|  8.25k|        }
 9684|  8.25k|    }
 9685|       |
 9686|   124k|    xpctxt->node = oldnode;
 9687|   124k|    xpctxt->doc = olddoc;
 9688|   124k|    xpctxt->contextSize = oldcs;
 9689|   124k|    xpctxt->proximityPosition = oldpp;
 9690|   124k|}
xpath.c:xmlXPathCompOpEval:
10750|  3.37M|{
10751|  3.37M|    int total = 0;
10752|  3.37M|    int equal, ret;
10753|  3.37M|    xmlXPathCompExprPtr comp;
10754|  3.37M|    xmlXPathObjectPtr arg1, arg2;
10755|       |
10756|  3.37M|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.37M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 2, False: 3.37M]
  |  |  ------------------
  ------------------
10757|  3.37M|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  3.37M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 3.37M, False: 0]
  |  |  |  Branch (818:39): [True: 43, False: 3.37M]
  |  |  ------------------
  ------------------
10758|     43|        return(0);
10759|  3.37M|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  3.37M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10759:9): [True: 27, False: 3.37M]
  ------------------
10760|  3.37M|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|     27|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10761|  3.37M|    ctxt->context->depth += 1;
10762|  3.37M|    comp = ctxt->comp;
10763|  3.37M|    switch (op->op) {
10764|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10764:9): [True: 0, False: 3.37M]
  ------------------
10765|      0|            break;
10766|  1.43k|        case XPATH_OP_AND:
  ------------------
  |  Branch (10766:9): [True: 1.43k, False: 3.37M]
  ------------------
10767|  1.43k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10768|  1.43k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.43k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 21, False: 1.41k]
  |  |  ------------------
  ------------------
10769|  1.41k|            xmlXPathBooleanFunction(ctxt, 1);
10770|  1.41k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
  ------------------
  |  Branch (10770:17): [True: 1, False: 1.41k]
  |  Branch (10770:42): [True: 1.04k, False: 362]
  ------------------
10771|  1.05k|                break;
10772|    362|            arg2 = xmlXPathValuePop(ctxt);
10773|    362|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10774|    362|	    if (ctxt->error) {
  ------------------
  |  Branch (10774:10): [True: 34, False: 328]
  ------------------
10775|     34|		xmlXPathFreeObject(arg2);
10776|     34|		break;
10777|     34|	    }
10778|    328|            xmlXPathBooleanFunction(ctxt, 1);
10779|    328|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10779:17): [True: 326, False: 2]
  ------------------
10780|    326|                ctxt->value->boolval &= arg2->boolval;
10781|    328|	    xmlXPathReleaseObject(ctxt->context, arg2);
10782|    328|            break;
10783|  1.97k|        case XPATH_OP_OR:
  ------------------
  |  Branch (10783:9): [True: 1.97k, False: 3.37M]
  ------------------
10784|  1.97k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10785|  1.97k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.97k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 364, False: 1.61k]
  |  |  ------------------
  ------------------
10786|  1.61k|            xmlXPathBooleanFunction(ctxt, 1);
10787|  1.61k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
  ------------------
  |  Branch (10787:17): [True: 1, False: 1.61k]
  |  Branch (10787:42): [True: 417, False: 1.19k]
  ------------------
10788|    418|                break;
10789|  1.19k|            arg2 = xmlXPathValuePop(ctxt);
10790|  1.19k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10791|  1.19k|	    if (ctxt->error) {
  ------------------
  |  Branch (10791:10): [True: 129, False: 1.06k]
  ------------------
10792|    129|		xmlXPathFreeObject(arg2);
10793|    129|		break;
10794|    129|	    }
10795|  1.06k|            xmlXPathBooleanFunction(ctxt, 1);
10796|  1.06k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10796:17): [True: 1.06k, False: 4]
  ------------------
10797|  1.06k|                ctxt->value->boolval |= arg2->boolval;
10798|  1.06k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10799|  1.06k|            break;
10800|   354k|        case XPATH_OP_EQUAL:
  ------------------
  |  Branch (10800:9): [True: 354k, False: 3.02M]
  ------------------
10801|   354k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10802|   354k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   354k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 6.20k, False: 348k]
  |  |  ------------------
  ------------------
10803|   348k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10804|   348k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   348k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.66k, False: 346k]
  |  |  ------------------
  ------------------
10805|   346k|	    if (op->value)
  ------------------
  |  Branch (10805:10): [True: 342k, False: 4.57k]
  ------------------
10806|   342k|		equal = xmlXPathEqualValues(ctxt);
10807|  4.57k|	    else
10808|  4.57k|		equal = xmlXPathNotEqualValues(ctxt);
10809|   346k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal));
10810|   346k|            break;
10811|   161k|        case XPATH_OP_CMP:
  ------------------
  |  Branch (10811:9): [True: 161k, False: 3.21M]
  ------------------
10812|   161k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10813|   161k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   161k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.01k, False: 160k]
  |  |  ------------------
  ------------------
10814|   160k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10815|   160k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   160k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 814, False: 159k]
  |  |  ------------------
  ------------------
10816|   159k|            ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
10817|   159k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
10818|   159k|            break;
10819|   218k|        case XPATH_OP_PLUS:
  ------------------
  |  Branch (10819:9): [True: 218k, False: 3.15M]
  ------------------
10820|   218k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10821|   218k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   218k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 5.99k, False: 212k]
  |  |  ------------------
  ------------------
10822|   212k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (10822:17): [True: 115k, False: 97.3k]
  ------------------
10823|   115k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10824|   115k|	    }
10825|   212k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   212k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.01k, False: 211k]
  |  |  ------------------
  ------------------
10826|   211k|            if (op->value == 0)
  ------------------
  |  Branch (10826:17): [True: 44.1k, False: 167k]
  ------------------
10827|  44.1k|                xmlXPathSubValues(ctxt);
10828|   167k|            else if (op->value == 1)
  ------------------
  |  Branch (10828:22): [True: 70.1k, False: 97.3k]
  ------------------
10829|  70.1k|                xmlXPathAddValues(ctxt);
10830|  97.3k|            else if (op->value == 2)
  ------------------
  |  Branch (10830:22): [True: 88.5k, False: 8.75k]
  ------------------
10831|  88.5k|                xmlXPathValueFlipSign(ctxt);
10832|  8.75k|            else if (op->value == 3) {
  ------------------
  |  Branch (10832:22): [True: 8.75k, False: 0]
  ------------------
10833|  8.75k|                CAST_TO_NUMBER;
  ------------------
  |  |  297|  8.75k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 8.75k, False: 0]
  |  |  |  Branch (297:34): [True: 7.65k, False: 1.09k]
  |  |  ------------------
  |  |  298|  8.75k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
10834|  8.75k|                CHECK_TYPE0(XPATH_NUMBER);
  ------------------
  |  |  271|  8.75k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 1, False: 8.75k]
  |  |  |  Branch (271:34): [True: 1, False: 8.74k]
  |  |  ------------------
  |  |  272|  8.75k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      2|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10835|  8.74k|            }
10836|   211k|            break;
10837|   211k|        case XPATH_OP_MULT:
  ------------------
  |  Branch (10837:9): [True: 137k, False: 3.23M]
  ------------------
10838|   137k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10839|   137k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   137k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 11.1k, False: 126k]
  |  |  ------------------
  ------------------
10840|   126k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10841|   126k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   126k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 388, False: 126k]
  |  |  ------------------
  ------------------
10842|   126k|            if (op->value == 0)
  ------------------
  |  Branch (10842:17): [True: 122k, False: 3.81k]
  ------------------
10843|   122k|                xmlXPathMultValues(ctxt);
10844|  3.81k|            else if (op->value == 1)
  ------------------
  |  Branch (10844:22): [True: 2.91k, False: 898]
  ------------------
10845|  2.91k|                xmlXPathDivValues(ctxt);
10846|    898|            else if (op->value == 2)
  ------------------
  |  Branch (10846:22): [True: 898, False: 0]
  ------------------
10847|    898|                xmlXPathModValues(ctxt);
10848|   126k|            break;
10849|   103k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10849:9): [True: 103k, False: 3.27M]
  ------------------
10850|   103k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10851|   103k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   103k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 459, False: 103k]
  |  |  ------------------
  ------------------
10852|   103k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10853|   103k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   103k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 355, False: 103k]
  |  |  ------------------
  ------------------
10854|       |
10855|   103k|            arg2 = xmlXPathValuePop(ctxt);
10856|   103k|            arg1 = xmlXPathValuePop(ctxt);
10857|   103k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10857:17): [True: 0, False: 103k]
  |  Branch (10857:35): [True: 44, False: 103k]
  ------------------
10858|   103k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10858:17): [True: 0, False: 103k]
  |  Branch (10858:35): [True: 10, False: 103k]
  ------------------
10859|     54|	        xmlXPathReleaseObject(ctxt->context, arg1);
10860|     54|	        xmlXPathReleaseObject(ctxt->context, arg2);
10861|     54|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|     54|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10862|      0|            }
10863|   103k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10863:17): [True: 103k, False: 0]
  ------------------
10864|   103k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10864:19): [True: 103k, False: 0]
  ------------------
10865|   103k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10865:19): [True: 8, False: 103k]
  ------------------
10866|   103k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10867|   103k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10867:19): [True: 103k, False: 0]
  ------------------
10868|   103k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10868:19): [True: 2, False: 102k]
  ------------------
10869|   103k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10870|     10|	        xmlXPathReleaseObject(ctxt->context, arg1);
10871|     10|	        xmlXPathReleaseObject(ctxt->context, arg2);
10872|     10|                break;
10873|     10|            }
10874|       |
10875|   102k|	    if (((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10875:11): [True: 102k, False: 0]
  ------------------
10876|   102k|		 (arg2->nodesetval->nodeNr != 0)))
  ------------------
  |  Branch (10876:4): [True: 46.8k, False: 56.1k]
  ------------------
10877|  46.8k|	    {
10878|  46.8k|		arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10879|  46.8k|							arg2->nodesetval);
10880|  46.8k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10880:21): [True: 34, False: 46.7k]
  ------------------
10881|     34|                    xmlXPathPErrMemory(ctxt);
10882|  46.8k|	    }
10883|       |
10884|   102k|            xmlXPathValuePush(ctxt, arg1);
10885|   102k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10886|   102k|            break;
10887|   321k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10887:9): [True: 321k, False: 3.05M]
  ------------------
10888|   321k|            xmlXPathRoot(ctxt);
10889|   321k|            break;
10890|   761k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10890:9): [True: 761k, False: 2.61M]
  ------------------
10891|   761k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10891:17): [True: 0, False: 761k]
  ------------------
10892|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10893|   761k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   761k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 761k]
  |  |  ------------------
  ------------------
10894|   761k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10894:17): [True: 0, False: 761k]
  ------------------
10895|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10896|   761k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   761k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 761k]
  |  |  ------------------
  ------------------
10897|   761k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10898|   761k|                                                    ctxt->context->node));
10899|   761k|            break;
10900|   903k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10900:9): [True: 903k, False: 2.47M]
  ------------------
10901|   903k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10901:21): [True: 0, False: 903k]
  ------------------
10902|      0|                    break;
10903|       |
10904|   903k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10905|   903k|		CHECK_ERROR0;
  ------------------
  |  |  236|   903k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.43k, False: 901k]
  |  |  ------------------
  ------------------
10906|       |
10907|   901k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0);
10908|   901k|                break;
10909|   903k|            }
10910|   235k|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10910:9): [True: 235k, False: 3.13M]
  ------------------
10911|   235k|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10912|   235k|            break;
10913|     46|        case XPATH_OP_VARIABLE:{
  ------------------
  |  Branch (10913:9): [True: 46, False: 3.37M]
  ------------------
10914|     46|		xmlXPathObjectPtr val;
10915|       |
10916|     46|                if (op->ch1 != -1)
  ------------------
  |  Branch (10916:21): [True: 0, False: 46]
  ------------------
10917|      0|                    total +=
10918|      0|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10919|     46|                if (op->value5 == NULL) {
  ------------------
  |  Branch (10919:21): [True: 27, False: 19]
  ------------------
10920|     27|		    val = xmlXPathVariableLookup(ctxt->context, op->value4);
10921|     27|		    if (val == NULL) {
  ------------------
  |  Branch (10921:11): [True: 27, False: 0]
  ------------------
10922|     27|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10923|     27|                                       "Undefined variable: %s\n", op->value4);
10924|     27|                        return 0;
10925|     27|                    }
10926|      0|                    xmlXPathValuePush(ctxt, val);
10927|     19|		} else {
10928|     19|                    const xmlChar *URI;
10929|       |
10930|     19|                    URI = xmlXPathNsLookup(ctxt->context, op->value5);
10931|     19|                    if (URI == NULL) {
  ------------------
  |  Branch (10931:25): [True: 8, False: 11]
  ------------------
10932|      8|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10933|      8|                                       "Undefined namespace prefix: %s\n",
10934|      8|                                       op->value5);
10935|      8|                        return 0;
10936|      8|                    }
10937|     11|		    val = xmlXPathVariableLookupNS(ctxt->context,
10938|     11|                                                       op->value4, URI);
10939|     11|		    if (val == NULL) {
  ------------------
  |  Branch (10939:11): [True: 11, False: 0]
  ------------------
10940|     11|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10941|     11|                                       "Undefined variable: %s:%s\n",
10942|     11|                                       op->value5, op->value4);
10943|     11|                        return 0;
10944|     11|                    }
10945|      0|                    xmlXPathValuePush(ctxt, val);
10946|      0|                }
10947|      0|                break;
10948|     46|            }
10949|  33.0k|        case XPATH_OP_FUNCTION:{
  ------------------
  |  Branch (10949:9): [True: 33.0k, False: 3.34M]
  ------------------
10950|  33.0k|                xmlXPathFunction func;
10951|  33.0k|                const xmlChar *oldFunc, *oldFuncURI;
10952|  33.0k|		int i;
10953|  33.0k|                int frame;
10954|       |
10955|  33.0k|                frame = ctxt->valueNr;
10956|  33.0k|                if (op->ch1 != -1) {
  ------------------
  |  Branch (10956:21): [True: 29.2k, False: 3.83k]
  ------------------
10957|  29.2k|                    total +=
10958|  29.2k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10959|  29.2k|                    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10959:25): [True: 1.04k, False: 28.2k]
  ------------------
10960|  1.04k|                        break;
10961|  29.2k|                }
10962|  32.0k|		if (ctxt->valueNr < frame + op->value)
  ------------------
  |  Branch (10962:7): [True: 0, False: 32.0k]
  ------------------
10963|  32.0k|		    XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10964|  83.1k|		for (i = 0; i < op->value; i++) {
  ------------------
  |  Branch (10964:15): [True: 51.0k, False: 32.0k]
  ------------------
10965|  51.0k|		    if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL)
  ------------------
  |  Branch (10965:11): [True: 0, False: 51.0k]
  ------------------
10966|  51.0k|			XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10967|  51.0k|                }
10968|  32.0k|                if (op->cache != NULL)
  ------------------
  |  Branch (10968:21): [True: 26.0k, False: 5.96k]
  ------------------
10969|  26.0k|                    func = op->cache;
10970|  5.96k|                else {
10971|  5.96k|                    const xmlChar *URI = NULL;
10972|       |
10973|  5.96k|                    if (op->value5 == NULL) {
  ------------------
  |  Branch (10973:25): [True: 5.87k, False: 93]
  ------------------
10974|  5.87k|                        func = xmlXPathFunctionLookup(ctxt->context,
10975|  5.87k|                                                      op->value4);
10976|  5.87k|                        if (func == NULL) {
  ------------------
  |  Branch (10976:29): [True: 467, False: 5.40k]
  ------------------
10977|    467|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10978|    467|                                           "Unregistered function: %s\n",
10979|    467|                                           op->value4);
10980|    467|                            return 0;
10981|    467|                        }
10982|  5.87k|                    } else {
10983|     93|                        URI = xmlXPathNsLookup(ctxt->context, op->value5);
10984|     93|                        if (URI == NULL) {
  ------------------
  |  Branch (10984:29): [True: 75, False: 18]
  ------------------
10985|     75|                            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10986|     75|                                           "Undefined namespace prefix: %s\n",
10987|     75|                                           op->value5);
10988|     75|                            return 0;
10989|     75|                        }
10990|     18|                        func = xmlXPathFunctionLookupNS(ctxt->context,
10991|     18|                                                        op->value4, URI);
10992|     18|                        if (func == NULL) {
  ------------------
  |  Branch (10992:29): [True: 18, False: 0]
  ------------------
10993|     18|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10994|     18|                                           "Unregistered function: %s:%s\n",
10995|     18|                                           op->value5, op->value4);
10996|     18|                            return 0;
10997|     18|                        }
10998|     18|                    }
10999|  5.40k|                    op->cache = func;
11000|  5.40k|                    op->cacheURI = (void *) URI;
11001|  5.40k|                }
11002|  31.4k|                oldFunc = ctxt->context->function;
11003|  31.4k|                oldFuncURI = ctxt->context->functionURI;
11004|  31.4k|                ctxt->context->function = op->value4;
11005|  31.4k|                ctxt->context->functionURI = op->cacheURI;
11006|  31.4k|                func(ctxt, op->value);
11007|  31.4k|                ctxt->context->function = oldFunc;
11008|  31.4k|                ctxt->context->functionURI = oldFuncURI;
11009|  31.4k|                if ((ctxt->error == XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (11009:21): [True: 31.2k, False: 232]
  ------------------
11010|  31.2k|                    (ctxt->valueNr != frame + 1))
  ------------------
  |  Branch (11010:21): [True: 0, False: 31.2k]
  ------------------
11011|  31.4k|                    XP_ERROR0(XPATH_STACK_ERROR);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11012|  31.4k|                break;
11013|  31.4k|            }
11014|  53.0k|        case XPATH_OP_ARG:
  ------------------
  |  Branch (11014:9): [True: 53.0k, False: 3.32M]
  ------------------
11015|  53.0k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11015:17): [True: 23.7k, False: 29.2k]
  ------------------
11016|  23.7k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11017|  23.7k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  23.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 495, False: 23.2k]
  |  |  ------------------
  ------------------
11018|  23.7k|            }
11019|  52.5k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (11019:17): [True: 52.5k, False: 0]
  ------------------
11020|  52.5k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
11021|  52.5k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  52.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.04k, False: 51.4k]
  |  |  ------------------
  ------------------
11022|  52.5k|	    }
11023|  51.4k|            break;
11024|  51.4k|        case XPATH_OP_PREDICATE:
  ------------------
  |  Branch (11024:9): [True: 0, False: 3.37M]
  ------------------
11025|  10.3k|        case XPATH_OP_FILTER:{
  ------------------
  |  Branch (11025:9): [True: 10.3k, False: 3.36M]
  ------------------
11026|  10.3k|                xmlXPathObjectPtr obj;
11027|  10.3k|                xmlNodeSetPtr set;
11028|       |
11029|       |                /*
11030|       |                 * Optimization for ()[1] selection i.e. the first elem
11031|       |                 */
11032|  10.3k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11032:21): [True: 10.3k, False: 0]
  |  Branch (11032:40): [True: 10.3k, False: 0]
  ------------------
11033|  10.3k|#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|  10.3k|                    ((comp->steps[op->ch1].op == XPATH_OP_SORT) || /* 18 */
  ------------------
  |  Branch (11043:22): [True: 5.72k, False: 4.65k]
  ------------------
11044|  4.65k|		     (comp->steps[op->ch1].op == XPATH_OP_FILTER)) && /* 17 */
  ------------------
  |  Branch (11044:8): [True: 4.59k, False: 69]
  ------------------
11045|       |#else
11046|       |		    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
11047|       |#endif
11048|  10.3k|                    (comp->steps[op->ch2].op == XPATH_OP_VALUE)) { /* 12 */
  ------------------
  |  Branch (11048:21): [True: 6.35k, False: 3.96k]
  ------------------
11049|  6.35k|                    xmlXPathObjectPtr val;
11050|       |
11051|  6.35k|                    val = comp->steps[op->ch2].value4;
11052|  6.35k|                    if ((val != NULL) && (val->type == XPATH_NUMBER) &&
  ------------------
  |  Branch (11052:25): [True: 6.35k, False: 0]
  |  Branch (11052:42): [True: 6.34k, False: 10]
  ------------------
11053|  6.34k|                        (val->floatval == 1.0)) {
  ------------------
  |  Branch (11053:25): [True: 5.52k, False: 817]
  ------------------
11054|  5.52k|                        xmlNodePtr first = NULL;
11055|       |
11056|  5.52k|                        total +=
11057|  5.52k|                            xmlXPathCompOpEvalFirst(ctxt,
11058|  5.52k|                                                    &comp->steps[op->ch1],
11059|  5.52k|                                                    &first);
11060|  5.52k|			CHECK_ERROR0;
  ------------------
  |  |  236|  5.52k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 867, False: 4.65k]
  |  |  ------------------
  ------------------
11061|       |                        /*
11062|       |                         * The nodeset should be in document order,
11063|       |                         * Keep only the first value
11064|       |                         */
11065|  4.65k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11065:29): [True: 4.65k, False: 0]
  ------------------
11066|  4.65k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11066:29): [True: 4.54k, False: 114]
  ------------------
11067|  4.54k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11067:29): [True: 4.54k, False: 0]
  ------------------
11068|  4.54k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11068:29): [True: 108, False: 4.43k]
  ------------------
11069|    108|                            xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval,
11070|    108|                                                        1, 1);
11071|  4.65k|                        break;
11072|  5.52k|                    }
11073|  6.35k|                }
11074|       |                /*
11075|       |                 * Optimization for ()[last()] selection i.e. the last elem
11076|       |                 */
11077|  4.85k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11077:21): [True: 4.85k, False: 0]
  |  Branch (11077:40): [True: 4.85k, False: 0]
  ------------------
11078|  4.85k|                    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (11078:21): [True: 4.06k, False: 790]
  ------------------
11079|  4.06k|                    (comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (11079:21): [True: 3.69k, False: 378]
  ------------------
11080|  3.69k|                    int f = comp->steps[op->ch2].ch1;
11081|       |
11082|  3.69k|                    if ((f != -1) &&
  ------------------
  |  Branch (11082:25): [True: 3.69k, False: 0]
  ------------------
11083|  3.69k|                        (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (11083:25): [True: 2.08k, False: 1.60k]
  ------------------
11084|  2.08k|                        (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (11084:25): [True: 1.87k, False: 208]
  ------------------
11085|  1.87k|                        (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (11085:25): [True: 1.73k, False: 136]
  ------------------
11086|  1.73k|                        (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (11086:25): [True: 1.73k, False: 0]
  ------------------
11087|  1.73k|                        (xmlStrEqual
  ------------------
  |  Branch (11087:25): [True: 1.52k, False: 209]
  ------------------
11088|  1.73k|                         (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  1.73k|#define BAD_CAST (xmlChar *)
  ------------------
11089|  1.52k|                        xmlNodePtr last = NULL;
11090|       |
11091|  1.52k|                        total +=
11092|  1.52k|                            xmlXPathCompOpEvalLast(ctxt,
11093|  1.52k|                                                   &comp->steps[op->ch1],
11094|  1.52k|                                                   &last);
11095|  1.52k|			CHECK_ERROR0;
  ------------------
  |  |  236|  1.52k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 36, False: 1.49k]
  |  |  ------------------
  ------------------
11096|       |                        /*
11097|       |                         * The nodeset should be in document order,
11098|       |                         * Keep only the last value
11099|       |                         */
11100|  1.49k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11100:29): [True: 1.49k, False: 0]
  ------------------
11101|  1.49k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11101:29): [True: 1.43k, False: 56]
  ------------------
11102|  1.43k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11102:29): [True: 1.43k, False: 0]
  ------------------
11103|  1.43k|                            (ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (11103:29): [True: 1.19k, False: 243]
  ------------------
11104|  1.19k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11104:29): [True: 348, False: 846]
  ------------------
11105|    348|                            xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
11106|  1.49k|                        break;
11107|  1.52k|                    }
11108|  3.69k|                }
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|  3.32k|                if (op->ch1 != -1)
  ------------------
  |  Branch (11120:21): [True: 3.32k, False: 0]
  ------------------
11121|  3.32k|                    total +=
11122|  3.32k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11123|  3.32k|		CHECK_ERROR0;
  ------------------
  |  |  236|  3.32k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 354, False: 2.97k]
  |  |  ------------------
  ------------------
11124|  2.97k|                if (op->ch2 == -1)
  ------------------
  |  Branch (11124:21): [True: 0, False: 2.97k]
  ------------------
11125|      0|                    break;
11126|  2.97k|                if (ctxt->value == NULL)
  ------------------
  |  Branch (11126:21): [True: 0, False: 2.97k]
  ------------------
11127|      0|                    break;
11128|       |
11129|       |                /*
11130|       |                 * In case of errors, xmlXPathNodeSetFilter can pop additional
11131|       |                 * nodes from the stack. We have to temporarily remove the
11132|       |                 * nodeset object from the stack to avoid freeing it
11133|       |                 * prematurely.
11134|       |                 */
11135|  2.97k|                CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  2.97k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 2.97k]
  |  |  |  Branch (271:34): [True: 28, False: 2.94k]
  |  |  ------------------
  |  |  272|  2.97k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     28|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
11136|  2.94k|                obj = xmlXPathValuePop(ctxt);
11137|  2.94k|                set = obj->nodesetval;
11138|  2.94k|                if (set != NULL)
  ------------------
  |  Branch (11138:21): [True: 2.94k, False: 0]
  ------------------
11139|  2.94k|                    xmlXPathNodeSetFilter(ctxt, set, op->ch2,
11140|  2.94k|                                          1, set->nodeNr, 1);
11141|  2.94k|                xmlXPathValuePush(ctxt, obj);
11142|  2.94k|                break;
11143|  2.97k|            }
11144|  76.5k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (11144:9): [True: 76.5k, False: 3.29M]
  ------------------
11145|  76.5k|            if (op->ch1 != -1)
  ------------------
  |  Branch (11145:17): [True: 76.5k, False: 0]
  ------------------
11146|  76.5k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11147|  76.5k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  76.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.23k, False: 72.3k]
  |  |  ------------------
  ------------------
11148|  72.3k|            if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11148:17): [True: 72.3k, False: 0]
  ------------------
11149|  72.3k|                (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11149:17): [True: 51.1k, False: 21.2k]
  ------------------
11150|  51.1k|                (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11150:17): [True: 51.1k, False: 0]
  ------------------
11151|  51.1k|		(ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11151:3): [True: 3.36k, False: 47.7k]
  ------------------
11152|  3.36k|	    {
11153|  3.36k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
11154|  3.36k|	    }
11155|  72.3k|            break;
11156|      0|        default:
  ------------------
  |  Branch (11156:9): [True: 0, False: 3.37M]
  ------------------
11157|      0|            XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11158|      0|            break;
11159|  3.37M|    }
11160|       |
11161|  3.33M|    ctxt->context->depth -= 1;
11162|  3.33M|    return (total);
11163|  3.37M|}
xpath.c:xmlXPathCompOpEvalFirst:
10406|  12.1k|{
10407|  12.1k|    int total = 0, cur;
10408|  12.1k|    xmlXPathCompExprPtr comp;
10409|  12.1k|    xmlXPathObjectPtr arg1, arg2;
10410|       |
10411|  12.1k|    CHECK_ERROR0;
  ------------------
  |  |  236|  12.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 12.1k]
  |  |  ------------------
  ------------------
10412|  12.1k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  12.1k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 12.1k, False: 0]
  |  |  |  Branch (818:39): [True: 0, False: 12.1k]
  |  |  ------------------
  ------------------
10413|      0|        return(0);
10414|  12.1k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  12.1k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10414:9): [True: 1, False: 12.1k]
  ------------------
10415|  12.1k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      1|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10416|  12.1k|    ctxt->context->depth += 1;
10417|  12.1k|    comp = ctxt->comp;
10418|  12.1k|    switch (op->op) {
10419|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10419:9): [True: 0, False: 12.1k]
  ------------------
10420|      0|            break;
10421|  2.60k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10421:9): [True: 2.60k, False: 9.56k]
  ------------------
10422|  2.60k|            total =
10423|  2.60k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10424|  2.60k|                                        first);
10425|  2.60k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.60k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 255, False: 2.34k]
  |  |  ------------------
  ------------------
10426|  2.34k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10426:17): [True: 2.34k, False: 0]
  ------------------
10427|  2.34k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10427:20): [True: 2.34k, False: 4]
  ------------------
10428|  2.34k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10428:20): [True: 2.34k, False: 0]
  ------------------
10429|  2.34k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10429:20): [True: 1.67k, False: 672]
  ------------------
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.67k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10440:7): [True: 1.06k, False: 607]
  ------------------
10441|  1.06k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10442|  1.67k|                *first = ctxt->value->nodesetval->nodeTab[0];
10443|  1.67k|            }
10444|  2.34k|            cur =
10445|  2.34k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch2],
10446|  2.34k|                                        first);
10447|  2.34k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.34k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 23, False: 2.32k]
  |  |  ------------------
  ------------------
10448|       |
10449|  2.32k|            arg2 = xmlXPathValuePop(ctxt);
10450|  2.32k|            arg1 = xmlXPathValuePop(ctxt);
10451|  2.32k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10451:17): [True: 0, False: 2.32k]
  |  Branch (10451:35): [True: 4, False: 2.32k]
  ------------------
10452|  2.32k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10452:17): [True: 0, False: 2.32k]
  |  Branch (10452:35): [True: 3, False: 2.31k]
  ------------------
10453|      7|	        xmlXPathReleaseObject(ctxt->context, arg1);
10454|      7|	        xmlXPathReleaseObject(ctxt->context, arg2);
10455|      7|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      7|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10456|      0|            }
10457|  2.31k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10457:17): [True: 2.31k, False: 0]
  ------------------
10458|  2.31k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10458:19): [True: 2.31k, False: 0]
  ------------------
10459|  2.31k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10459:19): [True: 0, False: 2.31k]
  ------------------
10460|  2.31k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10461|  2.31k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10461:19): [True: 2.31k, False: 0]
  ------------------
10462|  2.31k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10462:19): [True: 0, False: 2.31k]
  ------------------
10463|  2.31k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10464|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10465|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10466|      0|                break;
10467|      0|            }
10468|       |
10469|  2.31k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10469:17): [True: 2.31k, False: 0]
  ------------------
10470|  2.31k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10470:17): [True: 192, False: 2.12k]
  ------------------
10471|    192|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10472|    192|                                                        arg2->nodesetval);
10473|    192|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10473:21): [True: 2, False: 190]
  ------------------
10474|      2|                    xmlXPathPErrMemory(ctxt);
10475|    192|            }
10476|  2.31k|            xmlXPathValuePush(ctxt, arg1);
10477|  2.31k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10478|  2.31k|            total += cur;
10479|  2.31k|            break;
10480|     47|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10480:9): [True: 47, False: 12.1k]
  ------------------
10481|     47|            xmlXPathRoot(ctxt);
10482|     47|            break;
10483|    692|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10483:9): [True: 692, False: 11.4k]
  ------------------
10484|    692|            if (op->ch1 != -1)
  ------------------
  |  Branch (10484:17): [True: 0, False: 692]
  ------------------
10485|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10486|    692|	    CHECK_ERROR0;
  ------------------
  |  |  236|    692|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 692]
  |  |  ------------------
  ------------------
10487|    692|            if (op->ch2 != -1)
  ------------------
  |  Branch (10487:17): [True: 0, False: 692]
  ------------------
10488|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10489|    692|	    CHECK_ERROR0;
  ------------------
  |  |  236|    692|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 692]
  |  |  ------------------
  ------------------
10490|    692|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10491|    692|		ctxt->context->node));
10492|    692|            break;
10493|  3.04k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10493:9): [True: 3.04k, False: 9.12k]
  ------------------
10494|  3.04k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10494:21): [True: 0, False: 3.04k]
  ------------------
10495|      0|                    break;
10496|       |
10497|  3.04k|                total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10498|  3.04k|		CHECK_ERROR0;
  ------------------
  |  |  236|  3.04k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 11, False: 3.03k]
  |  |  ------------------
  ------------------
10499|       |
10500|  3.03k|                total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0);
10501|  3.03k|                break;
10502|  3.04k|            }
10503|      6|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10503:9): [True: 6, False: 12.1k]
  ------------------
10504|      6|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10505|      6|            break;
10506|  1.69k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10506:9): [True: 1.69k, False: 10.4k]
  ------------------
10507|  1.69k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10507:17): [True: 1.69k, False: 0]
  ------------------
10508|  1.69k|                total +=
10509|  1.69k|                    xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10510|  1.69k|                                            first);
10511|  1.69k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.69k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 43, False: 1.64k]
  |  |  ------------------
  ------------------
10512|  1.64k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10512:17): [True: 1.64k, False: 0]
  ------------------
10513|  1.64k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10513:20): [True: 1.54k, False: 106]
  ------------------
10514|  1.54k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10514:20): [True: 1.54k, False: 0]
  ------------------
10515|  1.54k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10515:6): [True: 125, False: 1.41k]
  ------------------
10516|    125|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10517|  1.64k|            break;
10518|      0|#ifdef XP_OPTIMIZED_FILTER_FIRST
10519|  3.97k|	case XPATH_OP_FILTER:
  ------------------
  |  Branch (10519:2): [True: 3.97k, False: 8.19k]
  ------------------
10520|  3.97k|                total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first);
10521|  3.97k|            break;
10522|      0|#endif
10523|    110|        default:
  ------------------
  |  Branch (10523:9): [True: 110, False: 12.0k]
  ------------------
10524|    110|            total += xmlXPathCompOpEval(ctxt, op);
10525|    110|            break;
10526|  12.1k|    }
10527|       |
10528|  11.8k|    ctxt->context->depth -= 1;
10529|  11.8k|    return(total);
10530|  12.1k|}
xpath.c:xmlXPathCompOpEvalFilterFirst:
10668|  3.97k|{
10669|  3.97k|    int total = 0;
10670|  3.97k|    xmlXPathCompExprPtr comp;
10671|  3.97k|    xmlXPathObjectPtr obj;
10672|  3.97k|    xmlNodeSetPtr set;
10673|       |
10674|  3.97k|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.97k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 3.97k]
  |  |  ------------------
  ------------------
10675|  3.97k|    comp = ctxt->comp;
10676|       |    /*
10677|       |    * Optimization for ()[last()] selection i.e. the last elem
10678|       |    */
10679|  3.97k|    if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (10679:9): [True: 3.97k, False: 0]
  |  Branch (10679:28): [True: 3.97k, False: 0]
  ------------------
10680|  3.97k|	(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (10680:2): [True: 2.99k, False: 983]
  ------------------
10681|  2.99k|	(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (10681:2): [True: 2.73k, False: 259]
  ------------------
10682|  2.73k|	int f = comp->steps[op->ch2].ch1;
10683|       |
10684|  2.73k|	if ((f != -1) &&
  ------------------
  |  Branch (10684:6): [True: 2.73k, False: 0]
  ------------------
10685|  2.73k|	    (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (10685:6): [True: 2.40k, False: 331]
  ------------------
10686|  2.40k|	    (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (10686:6): [True: 2.39k, False: 7]
  ------------------
10687|  2.39k|	    (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (10687:6): [True: 2.30k, False: 87]
  ------------------
10688|  2.30k|	    (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (10688:6): [True: 2.30k, False: 0]
  ------------------
10689|  2.30k|	    (xmlStrEqual
  ------------------
  |  Branch (10689:6): [True: 2.23k, False: 69]
  ------------------
10690|  2.30k|	    (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  2.30k|#define BAD_CAST (xmlChar *)
  ------------------
10691|  2.23k|	    xmlNodePtr last = NULL;
10692|       |
10693|  2.23k|	    total +=
10694|  2.23k|		xmlXPathCompOpEvalLast(ctxt,
10695|  2.23k|		    &comp->steps[op->ch1],
10696|  2.23k|		    &last);
10697|  2.23k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.23k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 7, False: 2.23k]
  |  |  ------------------
  ------------------
10698|       |	    /*
10699|       |	    * The nodeset should be in document order,
10700|       |	    * Keep only the last value
10701|       |	    */
10702|  2.23k|	    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (10702:10): [True: 2.23k, False: 0]
  ------------------
10703|  2.23k|		(ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (10703:3): [True: 2.22k, False: 10]
  ------------------
10704|  2.22k|		(ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (10704:3): [True: 2.22k, False: 0]
  ------------------
10705|  2.22k|		(ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (10705:3): [True: 1.98k, False: 233]
  ------------------
10706|  1.98k|		(ctxt->value->nodesetval->nodeNr > 1)) {
  ------------------
  |  Branch (10706:3): [True: 929, False: 1.06k]
  ------------------
10707|    929|                xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
10708|    929|		*first = *(ctxt->value->nodesetval->nodeTab);
10709|    929|	    }
10710|  2.23k|	    return (total);
10711|  2.23k|	}
10712|  2.73k|    }
10713|       |
10714|  1.73k|    if (op->ch1 != -1)
  ------------------
  |  Branch (10714:9): [True: 1.73k, False: 0]
  ------------------
10715|  1.73k|	total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10716|  1.73k|    CHECK_ERROR0;
  ------------------
  |  |  236|  1.73k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 817, False: 919]
  |  |  ------------------
  ------------------
10717|    919|    if (op->ch2 == -1)
  ------------------
  |  Branch (10717:9): [True: 0, False: 919]
  ------------------
10718|      0|	return (total);
10719|    919|    if (ctxt->value == NULL)
  ------------------
  |  Branch (10719:9): [True: 0, False: 919]
  ------------------
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|    919|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|    919|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 919]
  |  |  |  Branch (271:34): [True: 6, False: 913]
  |  |  ------------------
  |  |  272|    919|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      6|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10728|    913|    obj = xmlXPathValuePop(ctxt);
10729|    913|    set = obj->nodesetval;
10730|    913|    if (set != NULL) {
  ------------------
  |  Branch (10730:9): [True: 913, False: 0]
  ------------------
10731|    913|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1);
10732|    913|        if (set->nodeNr > 0)
  ------------------
  |  Branch (10732:13): [True: 408, False: 505]
  ------------------
10733|    408|            *first = set->nodeTab[0];
10734|    913|    }
10735|    913|    xmlXPathValuePush(ctxt, obj);
10736|       |
10737|    913|    return (total);
10738|    919|}
xpath.c:xmlXPathCompOpEvalLast:
10544|  33.6k|{
10545|  33.6k|    int total = 0, cur;
10546|  33.6k|    xmlXPathCompExprPtr comp;
10547|  33.6k|    xmlXPathObjectPtr arg1, arg2;
10548|       |
10549|  33.6k|    CHECK_ERROR0;
  ------------------
  |  |  236|  33.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 33.6k]
  |  |  ------------------
  ------------------
10550|  33.6k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  33.6k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 33.6k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 33.6k]
  |  |  ------------------
  ------------------
10551|      1|        return(0);
10552|  33.6k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  33.6k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10552:9): [True: 0, False: 33.6k]
  ------------------
10553|  33.6k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10554|  33.6k|    ctxt->context->depth += 1;
10555|  33.6k|    comp = ctxt->comp;
10556|  33.6k|    switch (op->op) {
10557|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10557:9): [True: 0, False: 33.6k]
  ------------------
10558|      0|            break;
10559|  13.1k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10559:9): [True: 13.1k, False: 20.5k]
  ------------------
10560|  13.1k|            total =
10561|  13.1k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
10562|  13.1k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  13.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 80, False: 13.0k]
  |  |  ------------------
  ------------------
10563|  13.0k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10563:17): [True: 13.0k, False: 0]
  ------------------
10564|  13.0k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10564:20): [True: 13.0k, False: 1]
  ------------------
10565|  13.0k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10565:20): [True: 13.0k, False: 0]
  ------------------
10566|  13.0k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10566:20): [True: 8.72k, False: 4.29k]
  ------------------
10567|       |                /*
10568|       |                 * limit tree traversing to first node in the result
10569|       |                 */
10570|  8.72k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10570:7): [True: 2.21k, False: 6.51k]
  ------------------
10571|  2.21k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10572|  8.72k|                *last =
10573|  8.72k|                    ctxt->value->nodesetval->nodeTab[ctxt->value->
10574|  8.72k|                                                     nodesetval->nodeNr -
10575|  8.72k|                                                     1];
10576|  8.72k|            }
10577|  13.0k|            cur =
10578|  13.0k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
10579|  13.0k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  13.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 26, False: 12.9k]
  |  |  ------------------
  ------------------
10580|  12.9k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10580:17): [True: 12.9k, False: 0]
  ------------------
10581|  12.9k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10581:20): [True: 12.9k, False: 2]
  ------------------
10582|  12.9k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10582:20): [True: 12.9k, False: 0]
  ------------------
10583|  12.9k|                && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */
  ------------------
  |  Branch (10583:20): [True: 4.09k, False: 8.90k]
  ------------------
10584|  4.09k|            }
10585|       |
10586|  12.9k|            arg2 = xmlXPathValuePop(ctxt);
10587|  12.9k|            arg1 = xmlXPathValuePop(ctxt);
10588|  12.9k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10588:17): [True: 0, False: 12.9k]
  |  Branch (10588:35): [True: 1, False: 12.9k]
  ------------------
10589|  12.9k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10589:17): [True: 0, False: 12.9k]
  |  Branch (10589:35): [True: 1, False: 12.9k]
  ------------------
10590|      2|	        xmlXPathReleaseObject(ctxt->context, arg1);
10591|      2|	        xmlXPathReleaseObject(ctxt->context, arg2);
10592|      2|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      2|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10593|      0|            }
10594|  12.9k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10594:17): [True: 12.9k, False: 0]
  ------------------
10595|  12.9k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10595:19): [True: 12.9k, False: 0]
  ------------------
10596|  12.9k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10596:19): [True: 1, False: 12.9k]
  ------------------
10597|  12.9k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10598|  12.9k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10598:19): [True: 12.9k, False: 0]
  ------------------
10599|  12.9k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10599:19): [True: 0, False: 12.9k]
  ------------------
10600|  12.9k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10601|      1|	        xmlXPathReleaseObject(ctxt->context, arg1);
10602|      1|	        xmlXPathReleaseObject(ctxt->context, arg2);
10603|      1|                break;
10604|      1|            }
10605|       |
10606|  12.9k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10606:17): [True: 12.9k, False: 0]
  ------------------
10607|  12.9k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10607:17): [True: 4.09k, False: 8.90k]
  ------------------
10608|  4.09k|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10609|  4.09k|                                                        arg2->nodesetval);
10610|  4.09k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10610:21): [True: 3, False: 4.08k]
  ------------------
10611|      3|                    xmlXPathPErrMemory(ctxt);
10612|  4.09k|            }
10613|  12.9k|            xmlXPathValuePush(ctxt, arg1);
10614|  12.9k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10615|  12.9k|            total += cur;
10616|  12.9k|            break;
10617|    355|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10617:9): [True: 355, False: 33.3k]
  ------------------
10618|    355|            xmlXPathRoot(ctxt);
10619|    355|            break;
10620|    636|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10620:9): [True: 636, False: 33.0k]
  ------------------
10621|    636|            if (op->ch1 != -1)
  ------------------
  |  Branch (10621:17): [True: 0, False: 636]
  ------------------
10622|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10623|    636|	    CHECK_ERROR0;
  ------------------
  |  |  236|    636|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 636]
  |  |  ------------------
  ------------------
10624|    636|            if (op->ch2 != -1)
  ------------------
  |  Branch (10624:17): [True: 0, False: 636]
  ------------------
10625|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10626|    636|	    CHECK_ERROR0;
  ------------------
  |  |  236|    636|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 636]
  |  |  ------------------
  ------------------
10627|    636|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10628|    636|		ctxt->context->node));
10629|    636|            break;
10630|  15.7k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10630:9): [True: 15.7k, False: 17.9k]
  ------------------
10631|  15.7k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10631:21): [True: 0, False: 15.7k]
  ------------------
10632|      0|                    break;
10633|       |
10634|  15.7k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10635|  15.7k|		CHECK_ERROR0;
  ------------------
  |  |  236|  15.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 13, False: 15.7k]
  |  |  ------------------
  ------------------
10636|       |
10637|  15.7k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0);
10638|  15.7k|                break;
10639|  15.7k|            }
10640|      4|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10640:9): [True: 4, False: 33.6k]
  ------------------
10641|      4|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10642|      4|            break;
10643|  3.76k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10643:9): [True: 3.76k, False: 29.8k]
  ------------------
10644|  3.76k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10644:17): [True: 3.76k, False: 0]
  ------------------
10645|  3.76k|                total +=
10646|  3.76k|                    xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1],
10647|  3.76k|                                           last);
10648|  3.76k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  3.76k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 43, False: 3.72k]
  |  |  ------------------
  ------------------
10649|  3.72k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10649:17): [True: 3.72k, False: 0]
  ------------------
10650|  3.72k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10650:20): [True: 3.65k, False: 66]
  ------------------
10651|  3.65k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10651:20): [True: 3.65k, False: 0]
  ------------------
10652|  3.65k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10652:6): [True: 1.27k, False: 2.38k]
  ------------------
10653|  1.27k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10654|  3.72k|            break;
10655|     73|        default:
  ------------------
  |  Branch (10655:9): [True: 73, False: 33.5k]
  ------------------
10656|     73|            total += xmlXPathCompOpEval(ctxt, op);
10657|     73|            break;
10658|  33.6k|    }
10659|       |
10660|  33.4k|    ctxt->context->depth -= 1;
10661|  33.4k|    return (total);
10662|  33.6k|}
xpath.c:xmlXPathNodeSetKeepLast:
 3167|  1.27k|{
 3168|  1.27k|    int i;
 3169|  1.27k|    xmlNodePtr node;
 3170|       |
 3171|  1.27k|    if ((set == NULL) || (set->nodeNr <= 1))
  ------------------
  |  Branch (3171:9): [True: 0, False: 1.27k]
  |  Branch (3171:26): [True: 0, False: 1.27k]
  ------------------
 3172|      0|	return;
 3173|  6.19k|    for (i = 0; i < set->nodeNr - 1; i++) {
  ------------------
  |  Branch (3173:17): [True: 4.92k, False: 1.27k]
  ------------------
 3174|  4.92k|        node = set->nodeTab[i];
 3175|  4.92k|        if ((node != NULL) &&
  ------------------
  |  Branch (3175:13): [True: 4.92k, False: 0]
  ------------------
 3176|  4.92k|            (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3176:13): [True: 0, False: 4.92k]
  ------------------
 3177|      0|            xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3178|  4.92k|    }
 3179|  1.27k|    set->nodeTab[0] = set->nodeTab[set->nodeNr-1];
 3180|  1.27k|    set->nodeNr = 1;
 3181|  1.27k|}

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

