htmlNewDocNoDtD:
 2229|      1|htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *publicId) {
 2230|      1|    xmlDocPtr cur;
 2231|       |
 2232|       |    /*
 2233|       |     * Allocate a new document and fill the fields.
 2234|       |     */
 2235|      1|    cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc));
 2236|      1|    if (cur == NULL)
  ------------------
  |  Branch (2236:9): [True: 0, False: 1]
  ------------------
 2237|      0|	return(NULL);
 2238|      1|    memset(cur, 0, sizeof(xmlDoc));
 2239|       |
 2240|      1|    cur->type = XML_HTML_DOCUMENT_NODE;
 2241|      1|    cur->version = NULL;
 2242|      1|    cur->intSubset = NULL;
 2243|      1|    cur->doc = cur;
 2244|      1|    cur->name = NULL;
 2245|      1|    cur->children = NULL;
 2246|      1|    cur->extSubset = NULL;
 2247|      1|    cur->oldNs = NULL;
 2248|      1|    cur->encoding = NULL;
 2249|      1|    cur->standalone = 1;
 2250|      1|    cur->compression = 0;
 2251|      1|    cur->ids = NULL;
 2252|      1|    cur->refs = NULL;
 2253|      1|    cur->_private = NULL;
 2254|      1|    cur->charset = XML_CHAR_ENCODING_UTF8;
 2255|      1|    cur->properties = XML_DOC_HTML | XML_DOC_USERBUILT;
 2256|      1|    if ((publicId != NULL) ||
  ------------------
  |  Branch (2256:9): [True: 0, False: 1]
  ------------------
 2257|      1|	(URI != NULL)) {
  ------------------
  |  Branch (2257:2): [True: 0, False: 1]
  ------------------
 2258|      0|        xmlDtdPtr intSubset;
 2259|       |
 2260|      0|	intSubset = xmlCreateIntSubset(cur, BAD_CAST "html", publicId, URI);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 2261|      0|        if (intSubset == NULL) {
  ------------------
  |  Branch (2261:13): [True: 0, False: 0]
  ------------------
 2262|      0|            xmlFree(cur);
 2263|      0|            return(NULL);
 2264|      0|        }
 2265|      0|    }
 2266|      1|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2266:9): [True: 0, False: 1]
  |  Branch (2266:35): [True: 0, False: 0]
  ------------------
 2267|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2268|      1|    return(cur);
 2269|      1|}
htmlParseDocument:
 4397|      1|htmlParseDocument(htmlParserCtxt *ctxt) {
 4398|      1|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (4398:9): [True: 0, False: 1]
  |  Branch (4398:27): [True: 0, False: 1]
  ------------------
 4399|      0|	return(-1);
 4400|       |
 4401|      1|    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (4401:9): [True: 1, False: 0]
  |  Branch (4401:24): [True: 1, False: 0]
  ------------------
 4402|      1|        ctxt->sax->setDocumentLocator(ctxt->userData,
 4403|      1|                (xmlSAXLocator *) &xmlDefaultSAXLocator);
 4404|      1|    }
 4405|       |
 4406|      1|    xmlDetectEncoding(ctxt);
 4407|       |
 4408|       |    /*
 4409|       |     * TODO: Implement HTML5 prescan algorithm
 4410|       |     */
 4411|       |
 4412|       |    /*
 4413|       |     * This is wrong but matches long-standing behavior. In most
 4414|       |     * cases, a document starting with an XML declaration will
 4415|       |     * specify UTF-8. The HTML5 prescan algorithm handles
 4416|       |     * XML declarations in a better way.
 4417|       |     */
 4418|      1|    if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
  ------------------
  |  |   33|      1|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (4418:9): [True: 1, False: 0]
  ------------------
 4419|      1|        (xmlStrncmp(ctxt->input->cur, BAD_CAST "<?xm", 4) == 0))
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4419:9): [True: 0, False: 1]
  ------------------
 4420|      0|        xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_UTF8);
 4421|       |
 4422|       |    /*
 4423|       |     * Wipe out everything which is before the first '<'
 4424|       |     */
 4425|      1|    SKIP_BLANKS;
  ------------------
  |  |  306|      1|#define SKIP_BLANKS htmlSkipBlankChars(ctxt)
  ------------------
 4426|       |
 4427|      1|    if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
  ------------------
  |  Branch (4427:9): [True: 1, False: 0]
  |  Branch (4427:24): [True: 1, False: 0]
  |  Branch (4427:54): [True: 1, False: 0]
  ------------------
 4428|      1|	ctxt->sax->startDocument(ctxt->userData);
 4429|       |
 4430|       |    /*
 4431|       |     * Parse possible comments, PIs or doctype declarations
 4432|       |     * before any content.
 4433|       |     */
 4434|      1|    ctxt->instate = XML_PARSER_MISC;
 4435|      1|    while (CUR == '<') {
  ------------------
  |  |  310|      1|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4435:12): [True: 0, False: 1]
  ------------------
 4436|      0|        if (NXT(1) == '!') {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4436:13): [True: 0, False: 0]
  ------------------
 4437|      0|            if ((NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                          if ((NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4437:17): [True: 0, False: 0]
  |  Branch (4437:36): [True: 0, False: 0]
  ------------------
 4438|      0|                SKIP(4);
  ------------------
  |  |  286|      0|#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
  ------------------
 4439|      0|                htmlParseComment(ctxt, /* bogus */ 0);
 4440|      0|            } else if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
                          } else if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
  |  Branch (4440:24): [True: 0, False: 0]
  |  Branch (4440:25): [True: 0, False: 0]
  |  Branch (4440:25): [True: 0, False: 0]
  |  Branch (4440:25): [Folded, False: 0]
  |  Branch (4440:43): [True: 0, False: 0]
  |  Branch (4440:44): [True: 0, False: 0]
  |  Branch (4440:44): [True: 0, False: 0]
  |  Branch (4440:44): [Folded, False: 0]
  ------------------
 4441|      0|                       (UPP(4) == 'C') && (UPP(5) == 'T') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
                                     (UPP(4) == 'C') && (UPP(5) == 'T') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
  |  Branch (4441:24): [True: 0, False: 0]
  |  Branch (4441:25): [True: 0, False: 0]
  |  Branch (4441:25): [True: 0, False: 0]
  |  Branch (4441:25): [Folded, False: 0]
  |  Branch (4441:43): [True: 0, False: 0]
  |  Branch (4441:44): [True: 0, False: 0]
  |  Branch (4441:44): [True: 0, False: 0]
  |  Branch (4441:44): [Folded, False: 0]
  ------------------
 4442|      0|                       (UPP(6) == 'Y') && (UPP(7) == 'P') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
                                     (UPP(6) == 'Y') && (UPP(7) == 'P') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
  |  Branch (4442:24): [True: 0, False: 0]
  |  Branch (4442:25): [True: 0, False: 0]
  |  Branch (4442:25): [True: 0, False: 0]
  |  Branch (4442:25): [Folded, False: 0]
  |  Branch (4442:43): [True: 0, False: 0]
  |  Branch (4442:44): [True: 0, False: 0]
  |  Branch (4442:44): [True: 0, False: 0]
  |  Branch (4442:44): [Folded, False: 0]
  ------------------
 4443|      0|                       (UPP(8) == 'E')) {
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
  |  Branch (4443:24): [True: 0, False: 0]
  |  Branch (4443:25): [True: 0, False: 0]
  |  Branch (4443:25): [True: 0, False: 0]
  |  Branch (4443:25): [Folded, False: 0]
  ------------------
 4444|      0|                htmlParseDocTypeDecl(ctxt);
 4445|      0|                ctxt->instate = XML_PARSER_PROLOG;
 4446|      0|            } else {
 4447|      0|                SKIP(2);
  ------------------
  |  |  286|      0|#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
  ------------------
 4448|      0|                htmlParseComment(ctxt, /* bogus */ 1);
 4449|      0|            }
 4450|      0|        } else if (NXT(1) == '?') {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4450:20): [True: 0, False: 0]
  ------------------
 4451|      0|            SKIP(1);
  ------------------
  |  |  286|      0|#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
  ------------------
 4452|      0|            htmlParseComment(ctxt, /* bogus */ 1);
 4453|      0|        } else {
 4454|      0|            break;
 4455|      0|        }
 4456|      0|	SKIP_BLANKS;
  ------------------
  |  |  306|      0|#define SKIP_BLANKS htmlSkipBlankChars(ctxt)
  ------------------
 4457|      0|        GROW;
  ------------------
  |  |  302|      0|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|      0|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|      0|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (302:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  303|      0|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|      0|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (303:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  304|      0|	xmlParserGrow(ctxt);
  ------------------
 4458|      0|    }
 4459|       |
 4460|       |    /*
 4461|       |     * Time to start parsing the tree itself
 4462|       |     */
 4463|      1|    ctxt->instate = XML_PARSER_CONTENT;
 4464|      1|    htmlParseContent(ctxt);
 4465|       |
 4466|       |    /*
 4467|       |     * Only check for truncated multi-byte sequences
 4468|       |     */
 4469|      1|    xmlParserCheckEOF(ctxt, XML_ERR_INTERNAL_ERROR);
 4470|       |
 4471|       |    /*
 4472|       |     * SAX: end of the document processing.
 4473|       |     */
 4474|      1|    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
  ------------------
  |  Branch (4474:9): [True: 1, False: 0]
  |  Branch (4474:24): [True: 1, False: 0]
  ------------------
 4475|      1|        ctxt->sax->endDocument(ctxt->userData);
 4476|       |
 4477|      1|    if (! ctxt->wellFormed) return(-1);
  ------------------
  |  Branch (4477:9): [True: 0, False: 1]
  ------------------
 4478|      1|    return(0);
 4479|      1|}
htmlNewParserCtxt:
 4604|     33|{
 4605|     33|    return(htmlNewSAXParserCtxt(NULL, NULL));
 4606|     33|}
htmlNewSAXParserCtxt:
 4625|     33|{
 4626|     33|    xmlParserCtxtPtr ctxt;
 4627|       |
 4628|     33|    xmlInitParser();
 4629|       |
 4630|     33|    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
 4631|     33|    if (ctxt == NULL)
  ------------------
  |  Branch (4631:9): [True: 0, False: 33]
  ------------------
 4632|      0|	return(NULL);
 4633|     33|    memset(ctxt, 0, sizeof(xmlParserCtxt));
 4634|     33|    if (htmlInitParserCtxt(ctxt, sax, userData) < 0) {
  ------------------
  |  Branch (4634:9): [True: 0, False: 33]
  ------------------
 4635|      0|        htmlFreeParserCtxt(ctxt);
 4636|      0|	return(NULL);
 4637|      0|    }
 4638|     33|    return(ctxt);
 4639|     33|}
htmlCtxtReset:
 5492|     34|{
 5493|     34|    xmlCtxtReset(ctxt);
 5494|     34|}
htmlCtxtUseOptions:
 5594|     67|{
 5595|     67|    int keepMask;
 5596|       |
 5597|       |    /*
 5598|       |     * For historic reasons, some options can only be enabled.
 5599|       |     */
 5600|     67|    keepMask = HTML_PARSE_NODEFDTD |
 5601|     67|               HTML_PARSE_NOERROR |
 5602|     67|               HTML_PARSE_NOWARNING |
 5603|     67|               HTML_PARSE_NOIMPLIED |
 5604|     67|               HTML_PARSE_COMPACT |
 5605|     67|               HTML_PARSE_HUGE |
 5606|     67|               HTML_PARSE_IGNORE_ENC |
 5607|     67|               HTML_PARSE_BIG_LINES;
 5608|       |
 5609|     67|    return(htmlCtxtSetOptionsInternal(ctxt, options, keepMask));
 5610|     67|}
htmlCtxtParseDocument:
 5623|      1|{
 5624|      1|    htmlDocPtr ret;
 5625|       |
 5626|      1|    if ((ctxt == NULL) || (input == NULL)) {
  ------------------
  |  Branch (5626:9): [True: 0, False: 1]
  |  Branch (5626:27): [True: 0, False: 1]
  ------------------
 5627|      0|        xmlFatalErr(ctxt, XML_ERR_ARGUMENT, NULL);
 5628|      0|        xmlFreeInputStream(input);
 5629|      0|        return(NULL);
 5630|      0|    }
 5631|       |
 5632|       |    /* assert(ctxt->inputNr == 0); */
 5633|      1|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (5633:12): [True: 0, False: 1]
  ------------------
 5634|      0|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 5635|       |
 5636|      1|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (5636:9): [True: 0, False: 1]
  ------------------
 5637|      0|        xmlFreeInputStream(input);
 5638|      0|        return(NULL);
 5639|      0|    }
 5640|       |
 5641|      1|    ctxt->html = INSERT_INITIAL;
 5642|      1|    htmlParseDocument(ctxt);
 5643|       |
 5644|      1|    ret = xmlCtxtGetDocument(ctxt);
 5645|       |
 5646|       |    /* assert(ctxt->inputNr == 1); */
 5647|      2|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (5647:12): [True: 1, False: 1]
  ------------------
 5648|      1|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 5649|       |
 5650|      1|    return(ret);
 5651|      1|}
htmlCtxtReadFile:
 5884|     34|{
 5885|     34|    xmlParserInputPtr input;
 5886|       |
 5887|     34|    if (ctxt == NULL)
  ------------------
  |  Branch (5887:9): [True: 0, False: 34]
  ------------------
 5888|      0|        return (NULL);
 5889|       |
 5890|     34|    htmlCtxtReset(ctxt);
 5891|     34|    htmlCtxtUseOptions(ctxt, options);
 5892|       |
 5893|     34|    input = xmlCtxtNewInputFromUrl(ctxt, filename, NULL, encoding, 0);
 5894|     34|    if (input == NULL)
  ------------------
  |  Branch (5894:9): [True: 33, False: 1]
  ------------------
 5895|     33|        return(NULL);
 5896|       |
 5897|      1|    return(htmlCtxtParseDocument(ctxt, input));
 5898|     34|}
HTMLparser.c:htmlCheckImplied:
 1485|      1|htmlCheckImplied(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
 1486|      1|    int i;
 1487|       |
 1488|      1|    if (ctxt->options & (HTML_PARSE_NOIMPLIED | HTML_PARSE_HTML5))
  ------------------
  |  Branch (1488:9): [True: 0, False: 1]
  ------------------
 1489|      0|        return;
 1490|      1|    if (!htmlOmittedDefaultValue)
  ------------------
  |  Branch (1490:9): [True: 0, False: 1]
  ------------------
 1491|      0|	return;
 1492|      1|    if (xmlStrEqual(newtag, BAD_CAST"html"))
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1492:9): [True: 0, False: 1]
  ------------------
 1493|      0|	return;
 1494|      1|    if (ctxt->nameNr <= 0) {
  ------------------
  |  Branch (1494:9): [True: 1, False: 0]
  ------------------
 1495|      1|	htmlnamePush(ctxt, BAD_CAST"html");
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 1496|      1|	if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
  ------------------
  |  Branch (1496:6): [True: 1, False: 0]
  |  Branch (1496:29): [True: 1, False: 0]
  ------------------
 1497|      1|	    ctxt->sax->startElement(ctxt->userData, BAD_CAST"html", NULL);
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 1498|      1|    }
 1499|      1|    if ((xmlStrEqual(newtag, BAD_CAST"body")) || (xmlStrEqual(newtag, BAD_CAST"head")))
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
                  if ((xmlStrEqual(newtag, BAD_CAST"body")) || (xmlStrEqual(newtag, BAD_CAST"head")))
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1499:9): [True: 0, False: 1]
  |  Branch (1499:50): [True: 0, False: 1]
  ------------------
 1500|      0|        return;
 1501|      1|    if ((ctxt->nameNr <= 1) &&
  ------------------
  |  Branch (1501:9): [True: 1, False: 0]
  ------------------
 1502|      1|        ((xmlStrEqual(newtag, BAD_CAST"script")) ||
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1502:10): [True: 0, False: 1]
  ------------------
 1503|      1|	 (xmlStrEqual(newtag, BAD_CAST"style")) ||
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1503:3): [True: 0, False: 1]
  ------------------
 1504|      1|	 (xmlStrEqual(newtag, BAD_CAST"meta")) ||
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1504:3): [True: 0, False: 1]
  ------------------
 1505|      1|	 (xmlStrEqual(newtag, BAD_CAST"link")) ||
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1505:3): [True: 0, False: 1]
  ------------------
 1506|      1|	 (xmlStrEqual(newtag, BAD_CAST"title")) ||
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1506:3): [True: 0, False: 1]
  ------------------
 1507|      1|	 (xmlStrEqual(newtag, BAD_CAST"base")))) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1507:3): [True: 0, False: 1]
  ------------------
 1508|      0|        if (ctxt->html >= INSERT_IN_HEAD) {
  ------------------
  |  Branch (1508:13): [True: 0, False: 0]
  ------------------
 1509|       |            /* we already saw or generated an <head> before */
 1510|      0|            return;
 1511|      0|        }
 1512|       |        /*
 1513|       |         * dropped OBJECT ... i you put it first BODY will be
 1514|       |         * assumed !
 1515|       |         */
 1516|      0|        htmlnamePush(ctxt, BAD_CAST"head");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1517|      0|        if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
  ------------------
  |  Branch (1517:13): [True: 0, False: 0]
  |  Branch (1517:36): [True: 0, False: 0]
  ------------------
 1518|      0|            ctxt->sax->startElement(ctxt->userData, BAD_CAST"head", NULL);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1519|      1|    } else if ((!xmlStrEqual(newtag, BAD_CAST"noframes")) &&
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1519:16): [True: 1, False: 0]
  ------------------
 1520|      1|	       (!xmlStrEqual(newtag, BAD_CAST"frame")) &&
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1520:9): [True: 1, False: 0]
  ------------------
 1521|      1|	       (!xmlStrEqual(newtag, BAD_CAST"frameset"))) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1521:9): [True: 1, False: 0]
  ------------------
 1522|      1|        if (ctxt->html >= INSERT_IN_BODY) {
  ------------------
  |  Branch (1522:13): [True: 0, False: 1]
  ------------------
 1523|       |            /* we already saw or generated a <body> before */
 1524|      0|            return;
 1525|      0|        }
 1526|      2|	for (i = 0;i < ctxt->nameNr;i++) {
  ------------------
  |  Branch (1526:13): [True: 1, False: 1]
  ------------------
 1527|      1|	    if (xmlStrEqual(ctxt->nameTab[i], BAD_CAST"body")) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1527:10): [True: 0, False: 1]
  ------------------
 1528|      0|		return;
 1529|      0|	    }
 1530|      1|	    if (xmlStrEqual(ctxt->nameTab[i], BAD_CAST"head")) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1530:10): [True: 0, False: 1]
  ------------------
 1531|      0|		return;
 1532|      0|	    }
 1533|      1|	}
 1534|       |
 1535|      1|	htmlnamePush(ctxt, BAD_CAST"body");
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 1536|      1|	if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
  ------------------
  |  Branch (1536:6): [True: 1, False: 0]
  |  Branch (1536:29): [True: 1, False: 0]
  ------------------
 1537|      1|	    ctxt->sax->startElement(ctxt->userData, BAD_CAST"body", NULL);
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 1538|      1|    }
 1539|      1|}
HTMLparser.c:htmlParserFinishElementParsing:
 1227|      2|htmlParserFinishElementParsing(htmlParserCtxtPtr ctxt) {
 1228|       |    /*
 1229|       |     * Capture end position and add node
 1230|       |     */
 1231|      2|    if ( ctxt->node != NULL && ctxt->record_info ) {
  ------------------
  |  Branch (1231:10): [True: 2, False: 0]
  |  Branch (1231:32): [True: 0, False: 2]
  ------------------
 1232|      0|       ctxt->nodeInfo->end_pos = ctxt->input->consumed +
 1233|      0|                                (CUR_PTR - ctxt->input->base);
  ------------------
  |  |  292|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 1234|      0|       ctxt->nodeInfo->end_line = ctxt->input->line;
 1235|      0|       ctxt->nodeInfo->node = ctxt->node;
 1236|      0|       xmlParserAddNodeInfo(ctxt, ctxt->nodeInfo);
 1237|      0|       htmlNodeInfoPop(ctxt);
 1238|      0|    }
 1239|      2|}
HTMLparser.c:htmlParseContent:
 4176|      1|htmlParseContent(htmlParserCtxtPtr ctxt) {
 4177|      1|    GROW;
  ------------------
  |  |  302|      1|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|      1|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|      1|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (302:9): [True: 1, False: 0]
  |  |  ------------------
  |  |  303|      1|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|      1|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (303:9): [True: 1, False: 0]
  |  |  ------------------
  |  |  304|      1|	xmlParserGrow(ctxt);
  ------------------
 4178|       |
 4179|      2|    while ((PARSER_STOPPED(ctxt) == 0) &&
  ------------------
  |  |   44|      2|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (4179:12): [True: 2, False: 0]
  ------------------
 4180|      2|           (ctxt->input->cur < ctxt->input->end)) {
  ------------------
  |  Branch (4180:12): [True: 1, False: 1]
  ------------------
 4181|      1|        int mode;
 4182|       |
 4183|      1|        mode = ctxt->endCheckState;
 4184|       |
 4185|      1|        if ((mode == 0) && (CUR == '<')) {
  ------------------
  |  |  310|      1|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4185:13): [True: 1, False: 0]
  |  Branch (4185:28): [True: 0, False: 1]
  ------------------
 4186|      0|            if (NXT(1) == '/') {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4186:17): [True: 0, False: 0]
  ------------------
 4187|      0|	        htmlParseEndTag(ctxt);
 4188|      0|            } else if (NXT(1) == '!') {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4188:24): [True: 0, False: 0]
  ------------------
 4189|       |                /*
 4190|       |                 * Sometimes DOCTYPE arrives in the middle of the document
 4191|       |                 */
 4192|      0|                if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
                              if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
  |  Branch (4192:21): [True: 0, False: 0]
  |  Branch (4192:22): [True: 0, False: 0]
  |  Branch (4192:22): [True: 0, False: 0]
  |  Branch (4192:22): [Folded, False: 0]
  |  Branch (4192:40): [True: 0, False: 0]
  |  Branch (4192:41): [True: 0, False: 0]
  |  Branch (4192:41): [True: 0, False: 0]
  |  Branch (4192:41): [Folded, False: 0]
  ------------------
 4193|      0|                    (UPP(4) == 'C') && (UPP(5) == 'T') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
                                  (UPP(4) == 'C') && (UPP(5) == 'T') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
  |  Branch (4193:21): [True: 0, False: 0]
  |  Branch (4193:22): [True: 0, False: 0]
  |  Branch (4193:22): [True: 0, False: 0]
  |  Branch (4193:22): [Folded, False: 0]
  |  Branch (4193:40): [True: 0, False: 0]
  |  Branch (4193:41): [True: 0, False: 0]
  |  Branch (4193:41): [True: 0, False: 0]
  |  Branch (4193:41): [Folded, False: 0]
  ------------------
 4194|      0|                    (UPP(6) == 'Y') && (UPP(7) == 'P') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
                                  (UPP(6) == 'Y') && (UPP(7) == 'P') &&
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
  |  Branch (4194:21): [True: 0, False: 0]
  |  Branch (4194:22): [True: 0, False: 0]
  |  Branch (4194:22): [True: 0, False: 0]
  |  Branch (4194:22): [Folded, False: 0]
  |  Branch (4194:40): [True: 0, False: 0]
  |  Branch (4194:41): [True: 0, False: 0]
  |  Branch (4194:41): [True: 0, False: 0]
  |  Branch (4194:41): [Folded, False: 0]
  ------------------
 4195|      0|                    (UPP(8) == 'E')) {
  ------------------
  |  |  290|      0|#define UPP(val) (toupper(ctxt->input->cur[(val)]))
  ------------------
  |  Branch (4195:21): [True: 0, False: 0]
  |  Branch (4195:22): [True: 0, False: 0]
  |  Branch (4195:22): [True: 0, False: 0]
  |  Branch (4195:22): [Folded, False: 0]
  ------------------
 4196|      0|                    htmlParseDocTypeDecl(ctxt);
 4197|      0|                } else if ((NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                              } else if ((NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4197:28): [True: 0, False: 0]
  |  Branch (4197:47): [True: 0, False: 0]
  ------------------
 4198|      0|                    SKIP(4);
  ------------------
  |  |  286|      0|#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
  ------------------
 4199|      0|                    htmlParseComment(ctxt, /* bogus */ 0);
 4200|      0|                } else {
 4201|      0|                    SKIP(2);
  ------------------
  |  |  286|      0|#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
  ------------------
 4202|      0|                    htmlParseComment(ctxt, /* bogus */ 1);
 4203|      0|                }
 4204|      0|            } else if (NXT(1) == '?') {
  ------------------
  |  |  288|      0|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4204:24): [True: 0, False: 0]
  ------------------
 4205|      0|                SKIP(1);
  ------------------
  |  |  286|      0|#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
  ------------------
 4206|      0|                htmlParseComment(ctxt, /* bogus */ 1);
 4207|      0|            } else if (IS_ASCII_LETTER(NXT(1))) {
  ------------------
  |  |  222|      0|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 0, False: 0]
  |  |  ------------------
  |  |  223|      0|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4208|      0|                htmlParseElementInternal(ctxt);
 4209|      0|            } else {
 4210|      0|                htmlStartCharData(ctxt);
 4211|      0|                if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (4211:21): [True: 0, False: 0]
  |  Branch (4211:44): [True: 0, False: 0]
  ------------------
 4212|      0|                    (ctxt->sax->characters != NULL))
  ------------------
  |  Branch (4212:21): [True: 0, False: 0]
  ------------------
 4213|      0|                    ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4214|      0|                SKIP(1);
  ------------------
  |  |  286|      0|#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
  ------------------
 4215|      0|            }
 4216|      1|        } else {
 4217|      1|            htmlParseCharData(ctxt, /* partial */ 0);
 4218|      1|        }
 4219|       |
 4220|      1|        SHRINK;
  ------------------
  |  |  296|      1|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|      1|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|      1|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (296:9): [True: 1, False: 0]
  |  |  ------------------
  |  |  297|      1|        (ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \
  |  |  ------------------
  |  |  |  |   63|      1|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  298|      1|	(ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|      0|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (298:2): [True: 0, False: 0]
  |  |  ------------------
  |  |  299|      1|	xmlParserShrink(ctxt);
  ------------------
 4221|      1|        GROW;
  ------------------
  |  |  302|      1|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|      1|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|      1|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (302:9): [True: 1, False: 0]
  |  |  ------------------
  |  |  303|      1|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|      1|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (303:9): [True: 1, False: 0]
  |  |  ------------------
  |  |  304|      1|	xmlParserGrow(ctxt);
  ------------------
 4222|      1|    }
 4223|       |
 4224|      1|    if (ctxt->input->cur >= ctxt->input->end)
  ------------------
  |  Branch (4224:9): [True: 1, False: 0]
  ------------------
 4225|      1|        htmlAutoCloseOnEnd(ctxt);
 4226|      1|}
HTMLparser.c:htmlStartCharData:
 1548|      1|htmlStartCharData(htmlParserCtxtPtr ctxt) {
 1549|      1|    if (ctxt->options & (HTML_PARSE_NOIMPLIED | HTML_PARSE_HTML5))
  ------------------
  |  Branch (1549:9): [True: 0, False: 1]
  ------------------
 1550|      0|        return;
 1551|      1|    if (!htmlOmittedDefaultValue)
  ------------------
  |  Branch (1551:9): [True: 0, False: 1]
  ------------------
 1552|      0|	return;
 1553|       |
 1554|      1|    if (xmlStrEqual(ctxt->name, BAD_CAST "head"))
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1554:9): [True: 0, False: 1]
  ------------------
 1555|      0|        htmlAutoClose(ctxt, BAD_CAST "p");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1556|      1|    htmlCheckImplied(ctxt, BAD_CAST "p");
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 1557|      1|}
HTMLparser.c:htmlParseCharData:
 2965|      1|htmlParseCharData(htmlParserCtxtPtr ctxt, int partial) {
 2966|      1|    xmlParserInputPtr input = ctxt->input;
 2967|      1|    xmlChar utf8Char[4];
 2968|      1|    int complete = 0;
 2969|      1|    int done = 0;
 2970|      1|    int mode;
 2971|      1|    int eof = PARSER_PROGRESSIVE(ctxt);
  ------------------
  |  |   47|      1|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|      1|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  ------------------
 2972|      1|    int line, col;
 2973|       |
 2974|      1|    mode = ctxt->endCheckState;
 2975|       |
 2976|      1|    line = input->line;
 2977|      1|    col = input->col;
 2978|       |
 2979|      1|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|      1|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2979:12): [True: 1, False: 0]
  ------------------
 2980|      1|        const xmlChar *chunk, *in, *repl;
 2981|      1|        size_t avail;
 2982|      1|        int replSize;
 2983|      1|        int skip = 0;
 2984|      1|        int ncr = 0;
 2985|      1|        int ncrSize = 0;
 2986|      1|        int cp = 0;
 2987|       |
 2988|      1|        chunk = input->cur;
 2989|      1|        avail = input->end - chunk;
 2990|      1|        in = chunk;
 2991|       |
 2992|      1|        repl = BAD_CAST "";
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 2993|      1|        replSize = 0;
 2994|       |
 2995|      2|        while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|      2|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2995:16): [True: 2, False: 0]
  ------------------
 2996|      2|            size_t j;
 2997|      2|            int cur, size;
 2998|       |
 2999|      2|            if (avail <= 64) {
  ------------------
  |  Branch (2999:17): [True: 2, False: 0]
  ------------------
 3000|      2|                if (!eof) {
  ------------------
  |  Branch (3000:21): [True: 1, False: 1]
  ------------------
 3001|      1|                    size_t oldAvail = avail;
 3002|      1|                    size_t off = in - chunk;
 3003|       |
 3004|      1|                    input->cur = in;
 3005|       |
 3006|      1|                    xmlParserGrow(ctxt);
 3007|       |
 3008|      1|                    in = input->cur;
 3009|      1|                    chunk = in - off;
 3010|      1|                    input->cur = chunk;
 3011|      1|                    avail = input->end - in;
 3012|       |
 3013|      1|                    if (oldAvail == avail)
  ------------------
  |  Branch (3013:25): [True: 1, False: 0]
  ------------------
 3014|      1|                        eof = 1;
 3015|      1|                }
 3016|       |
 3017|      2|                if (avail == 0) {
  ------------------
  |  Branch (3017:21): [True: 1, False: 1]
  ------------------
 3018|      1|                    if ((partial) && (ncr)) {
  ------------------
  |  Branch (3018:25): [True: 0, False: 1]
  |  Branch (3018:38): [True: 0, False: 0]
  ------------------
 3019|      0|                        in -= ncrSize;
 3020|      0|                        ncrSize = 0;
 3021|      0|                    }
 3022|       |
 3023|      1|                    done = 1;
 3024|      1|                    break;
 3025|      1|                }
 3026|      2|            }
 3027|       |
 3028|       |            /* Accelerator */
 3029|      1|            if (!ncr) {
  ------------------
  |  Branch (3029:17): [True: 1, False: 0]
  ------------------
 3030|     23|                while (avail > 0) {
  ------------------
  |  Branch (3030:24): [True: 22, False: 1]
  ------------------
 3031|     22|                    static const unsigned mask[8] = {
 3032|     22|                        0x00002401, 0x10002040,
 3033|     22|                        0x00000000, 0x00000000,
 3034|     22|                        0xFFFFFFFF, 0xFFFFFFFF,
 3035|     22|                        0xFFFFFFFF, 0xFFFFFFFF
 3036|     22|                    };
 3037|     22|                    cur = *in;
 3038|     22|                    if ((1u << (cur & 0x1F)) & mask[cur >> 5])
  ------------------
  |  Branch (3038:25): [True: 0, False: 22]
  ------------------
 3039|      0|                        break;
 3040|     22|                    col += 1;
 3041|     22|                    in += 1;
 3042|     22|                    avail -= 1;
 3043|     22|                }
 3044|       |
 3045|      1|                if ((!eof) && (avail <= 64))
  ------------------
  |  Branch (3045:21): [True: 0, False: 1]
  |  Branch (3045:31): [True: 0, False: 0]
  ------------------
 3046|      0|                    continue;
 3047|      1|                if (avail == 0)
  ------------------
  |  Branch (3047:21): [True: 1, False: 0]
  ------------------
 3048|      1|                    continue;
 3049|      1|            }
 3050|       |
 3051|      0|            cur = *in;
 3052|      0|            size = 1;
 3053|      0|            col += 1;
 3054|       |
 3055|      0|            if (ncr) {
  ------------------
  |  Branch (3055:17): [True: 0, False: 0]
  ------------------
 3056|      0|                int lc = cur | 0x20;
 3057|      0|                int digit;
 3058|       |
 3059|      0|                if ((cur >= '0') && (cur <= '9')) {
  ------------------
  |  Branch (3059:21): [True: 0, False: 0]
  |  Branch (3059:37): [True: 0, False: 0]
  ------------------
 3060|      0|                    digit = cur - '0';
 3061|      0|                } else if ((ncr == 16) && (lc >= 'a') && (lc <= 'f')) {
  ------------------
  |  Branch (3061:28): [True: 0, False: 0]
  |  Branch (3061:43): [True: 0, False: 0]
  |  Branch (3061:58): [True: 0, False: 0]
  ------------------
 3062|      0|                    digit = (lc - 'a') + 10;
 3063|      0|                } else {
 3064|      0|                    if (cur == ';') {
  ------------------
  |  Branch (3064:25): [True: 0, False: 0]
  ------------------
 3065|      0|                        in += 1;
 3066|      0|                        size += 1;
 3067|      0|                        ncrSize += 1;
 3068|      0|                    }
 3069|      0|                    goto next_chunk;
 3070|      0|                }
 3071|       |
 3072|      0|                cp = cp * ncr + digit;
 3073|      0|                if (cp >= 0x110000)
  ------------------
  |  Branch (3073:21): [True: 0, False: 0]
  ------------------
 3074|      0|                    cp = 0x110000;
 3075|       |
 3076|      0|                ncrSize += 1;
 3077|       |
 3078|      0|                goto next_char;
 3079|      0|            }
 3080|       |
 3081|      0|            switch (cur) {
 3082|      0|            case '<':
  ------------------
  |  Branch (3082:13): [True: 0, False: 0]
  ------------------
 3083|      0|                if (mode == 0) {
  ------------------
  |  Branch (3083:21): [True: 0, False: 0]
  ------------------
 3084|      0|                    done = 1;
 3085|      0|                    complete = 1;
 3086|      0|                    goto next_chunk;
 3087|      0|                }
 3088|      0|                if (mode == DATA_PLAINTEXT)
  ------------------
  |  |   14|      0|#define DATA_PLAINTEXT      3
  ------------------
  |  Branch (3088:21): [True: 0, False: 0]
  ------------------
 3089|      0|                    break;
 3090|       |
 3091|      0|                j = 1;
 3092|      0|                if (j < avail) {
  ------------------
  |  Branch (3092:21): [True: 0, False: 0]
  ------------------
 3093|      0|                    if ((mode == DATA_SCRIPT) && (in[j] == '!')) {
  ------------------
  |  |   15|      0|#define DATA_SCRIPT         4
  ------------------
  |  Branch (3093:25): [True: 0, False: 0]
  |  Branch (3093:50): [True: 0, False: 0]
  ------------------
 3094|       |                        /* Check for comment start */
 3095|       |
 3096|      0|                        j += 1;
 3097|      0|                        if ((j < avail) && (in[j] == '-')) {
  ------------------
  |  Branch (3097:29): [True: 0, False: 0]
  |  Branch (3097:44): [True: 0, False: 0]
  ------------------
 3098|      0|                            j += 1;
 3099|      0|                            if ((j < avail) && (in[j] == '-'))
  ------------------
  |  Branch (3099:33): [True: 0, False: 0]
  |  Branch (3099:48): [True: 0, False: 0]
  ------------------
 3100|      0|                                mode = DATA_SCRIPT_ESC1;
  ------------------
  |  |   16|      0|#define DATA_SCRIPT_ESC1    5
  ------------------
 3101|      0|                        }
 3102|      0|                    } else {
 3103|      0|                        int i = 0;
 3104|      0|                        int solidus = 0;
 3105|       |
 3106|       |                        /* Check for tag */
 3107|       |
 3108|      0|                        if (in[j] == '/') {
  ------------------
  |  Branch (3108:29): [True: 0, False: 0]
  ------------------
 3109|      0|                            j += 1;
 3110|      0|                            solidus = 1;
 3111|      0|                        }
 3112|       |
 3113|      0|                        if ((solidus) || (mode == DATA_SCRIPT_ESC1)) {
  ------------------
  |  |   16|      0|#define DATA_SCRIPT_ESC1    5
  ------------------
  |  Branch (3113:29): [True: 0, False: 0]
  |  Branch (3113:42): [True: 0, False: 0]
  ------------------
 3114|      0|                            while ((j < avail) &&
  ------------------
  |  Branch (3114:36): [True: 0, False: 0]
  ------------------
 3115|      0|                                   (ctxt->name[i] != 0) &&
  ------------------
  |  Branch (3115:36): [True: 0, False: 0]
  ------------------
 3116|      0|                                   (ctxt->name[i] == (in[j] | 0x20))) {
  ------------------
  |  Branch (3116:36): [True: 0, False: 0]
  ------------------
 3117|      0|                                i += 1;
 3118|      0|                                j += 1;
 3119|      0|                            }
 3120|       |
 3121|      0|                            if ((ctxt->name[i] == 0) && (j < avail)) {
  ------------------
  |  Branch (3121:33): [True: 0, False: 0]
  |  Branch (3121:57): [True: 0, False: 0]
  ------------------
 3122|      0|                                int c = in[j];
 3123|       |
 3124|      0|                                if ((c == '>') || (c == '/') ||
  ------------------
  |  Branch (3124:37): [True: 0, False: 0]
  |  Branch (3124:51): [True: 0, False: 0]
  ------------------
 3125|      0|                                    (IS_WS_HTML(c))) {
  ------------------
  |  |    9|      0|    (((c) == 0x20) || \
  |  |  ------------------
  |  |  |  Branch (9:6): [True: 0, False: 0]
  |  |  ------------------
  |  |   10|      0|     (((c) >= 0x09) && ((c) <= 0x0D) && ((c) != 0x0B)))
  |  |  ------------------
  |  |  |  Branch (10:7): [True: 0, False: 0]
  |  |  |  Branch (10:24): [True: 0, False: 0]
  |  |  |  Branch (10:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3126|      0|                                    if ((mode == DATA_SCRIPT_ESC1) &&
  ------------------
  |  |   16|      0|#define DATA_SCRIPT_ESC1    5
  ------------------
  |  Branch (3126:41): [True: 0, False: 0]
  ------------------
 3127|      0|                                        (!solidus)) {
  ------------------
  |  Branch (3127:41): [True: 0, False: 0]
  ------------------
 3128|      0|                                        mode = DATA_SCRIPT_ESC2;
  ------------------
  |  |   17|      0|#define DATA_SCRIPT_ESC2    6
  ------------------
 3129|      0|                                    } else if (mode == DATA_SCRIPT_ESC2) {
  ------------------
  |  |   17|      0|#define DATA_SCRIPT_ESC2    6
  ------------------
  |  Branch (3129:48): [True: 0, False: 0]
  ------------------
 3130|      0|                                        mode = DATA_SCRIPT_ESC1;
  ------------------
  |  |   16|      0|#define DATA_SCRIPT_ESC1    5
  ------------------
 3131|      0|                                    } else {
 3132|      0|                                        complete = 1;
 3133|      0|                                        done = 1;
 3134|      0|                                        goto next_chunk;
 3135|      0|                                    }
 3136|      0|                                }
 3137|      0|                            }
 3138|      0|                        }
 3139|      0|                    }
 3140|      0|                }
 3141|       |
 3142|      0|                if ((partial) && (j >= avail)) {
  ------------------
  |  Branch (3142:21): [True: 0, False: 0]
  |  Branch (3142:34): [True: 0, False: 0]
  ------------------
 3143|      0|                    done = 1;
 3144|      0|                    goto next_chunk;
 3145|      0|                }
 3146|       |
 3147|      0|                break;
 3148|       |
 3149|      0|            case '-':
  ------------------
  |  Branch (3149:13): [True: 0, False: 0]
  ------------------
 3150|      0|                if ((mode != DATA_SCRIPT_ESC1) && (mode != DATA_SCRIPT_ESC2))
  ------------------
  |  |   16|      0|#define DATA_SCRIPT_ESC1    5
  ------------------
                              if ((mode != DATA_SCRIPT_ESC1) && (mode != DATA_SCRIPT_ESC2))
  ------------------
  |  |   17|      0|#define DATA_SCRIPT_ESC2    6
  ------------------
  |  Branch (3150:21): [True: 0, False: 0]
  |  Branch (3150:51): [True: 0, False: 0]
  ------------------
 3151|      0|                    break;
 3152|       |
 3153|       |                /* Check for comment end */
 3154|       |
 3155|      0|                j = 1;
 3156|      0|                if ((j < avail) && (in[j] == '-')) {
  ------------------
  |  Branch (3156:21): [True: 0, False: 0]
  |  Branch (3156:36): [True: 0, False: 0]
  ------------------
 3157|      0|                    j += 1;
 3158|      0|                    if ((j < avail) && (in[j] == '>'))
  ------------------
  |  Branch (3158:25): [True: 0, False: 0]
  |  Branch (3158:40): [True: 0, False: 0]
  ------------------
 3159|      0|                        mode = DATA_SCRIPT;
  ------------------
  |  |   15|      0|#define DATA_SCRIPT         4
  ------------------
 3160|      0|                }
 3161|       |
 3162|      0|                if ((partial) && (j >= avail)) {
  ------------------
  |  Branch (3162:21): [True: 0, False: 0]
  |  Branch (3162:34): [True: 0, False: 0]
  ------------------
 3163|      0|                    done = 1;
 3164|      0|                    goto next_chunk;
 3165|      0|                }
 3166|       |
 3167|      0|                break;
 3168|       |
 3169|      0|            case '&':
  ------------------
  |  Branch (3169:13): [True: 0, False: 0]
  ------------------
 3170|      0|                if ((mode != 0) && (mode != DATA_RCDATA))
  ------------------
  |  |   12|      0|#define DATA_RCDATA         1
  ------------------
  |  Branch (3170:21): [True: 0, False: 0]
  |  Branch (3170:36): [True: 0, False: 0]
  ------------------
 3171|      0|                    break;
 3172|       |
 3173|      0|                j = 1;
 3174|       |
 3175|      0|                if ((j < avail) && (in[j] == '#')) {
  ------------------
  |  Branch (3175:21): [True: 0, False: 0]
  |  Branch (3175:36): [True: 0, False: 0]
  ------------------
 3176|      0|                    j += 1;
 3177|      0|                    if (j < avail) {
  ------------------
  |  Branch (3177:25): [True: 0, False: 0]
  ------------------
 3178|      0|                        if ((in[j] | 0x20) == 'x') {
  ------------------
  |  Branch (3178:29): [True: 0, False: 0]
  ------------------
 3179|      0|                            j += 1;
 3180|      0|                            if ((j < avail) && (IS_HEX_DIGIT(in[j]))) {
  ------------------
  |  |   54|      0|    ((IS_ASCII_DIGIT(c)) || \
  |  |  ------------------
  |  |  |  |  230|      0|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (230:28): [True: 0, False: 0]
  |  |  |  |  |  Branch (230:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   55|      0|     ((((c) | 0x20) >= 'a') && (((c) | 0x20) <= 'f')))
  |  |  ------------------
  |  |  |  Branch (55:7): [True: 0, False: 0]
  |  |  |  Branch (55:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3180:33): [True: 0, False: 0]
  ------------------
 3181|      0|                                ncr = 16;
 3182|      0|                                size = 3;
 3183|      0|                                ncrSize = 3;
 3184|      0|                                cp = 0;
 3185|      0|                            }
 3186|      0|                        } else if (IS_ASCII_DIGIT(in[j])) {
  ------------------
  |  |  230|      0|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 0, False: 0]
  |  |  |  Branch (230:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3187|      0|                            ncr = 10;
 3188|      0|                            size = 2;
 3189|      0|                            ncrSize = 2;
 3190|      0|                            cp = 0;
 3191|      0|                        }
 3192|      0|                    }
 3193|      0|                } else {
 3194|      0|                    if (partial) {
  ------------------
  |  Branch (3194:25): [True: 0, False: 0]
  ------------------
 3195|      0|                        int terminated = 0;
 3196|      0|                        size_t i;
 3197|       |
 3198|       |                        /*
 3199|       |                         * &CounterClockwiseContourIntegral; has 33 bytes.
 3200|       |                         */
 3201|      0|                        for (i = 1; i < avail; i++) {
  ------------------
  |  Branch (3201:37): [True: 0, False: 0]
  ------------------
 3202|      0|                            if ((i >= 32) ||
  ------------------
  |  Branch (3202:33): [True: 0, False: 0]
  ------------------
 3203|      0|                                (!IS_ASCII_LETTER(in[i]) &&
  ------------------
  |  |  222|      0|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 0, False: 0]
  |  |  ------------------
  |  |  223|      0|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3204|      0|                                 ((i < 2) || !IS_ASCII_DIGIT(in[i])))) {
  ------------------
  |  |  230|      0|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 0, False: 0]
  |  |  |  Branch (230:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3204:35): [True: 0, False: 0]
  ------------------
 3205|      0|                                terminated = 1;
 3206|      0|                                break;
 3207|      0|                            }
 3208|      0|                        }
 3209|       |
 3210|      0|                        if (!terminated) {
  ------------------
  |  Branch (3210:29): [True: 0, False: 0]
  ------------------
 3211|      0|                            done = 1;
 3212|      0|                            goto next_chunk;
 3213|      0|                        }
 3214|      0|                    }
 3215|       |
 3216|      0|                    repl = htmlFindEntityPrefix(in + j,
 3217|      0|                                                avail - j,
 3218|      0|                                                /* isAttr */ 0,
 3219|      0|                                                &skip, &replSize);
 3220|      0|                    if (repl != NULL) {
  ------------------
  |  Branch (3220:25): [True: 0, False: 0]
  ------------------
 3221|      0|                        skip += 1;
 3222|      0|                        goto next_chunk;
 3223|      0|                    }
 3224|       |
 3225|      0|                    skip = 0;
 3226|      0|                }
 3227|       |
 3228|      0|                if ((partial) && (j >= avail)) {
  ------------------
  |  Branch (3228:21): [True: 0, False: 0]
  |  Branch (3228:34): [True: 0, False: 0]
  ------------------
 3229|      0|                    done = 1;
 3230|      0|                    goto next_chunk;
 3231|      0|                }
 3232|       |
 3233|      0|                break;
 3234|       |
 3235|      0|            case '\0':
  ------------------
  |  Branch (3235:13): [True: 0, False: 0]
  ------------------
 3236|      0|                skip = 1;
 3237|       |
 3238|      0|                if (mode == 0) {
  ------------------
  |  Branch (3238:21): [True: 0, False: 0]
  ------------------
 3239|       |                    /*
 3240|       |                     * The HTML5 spec says that the tokenizer should
 3241|       |                     * pass on U+0000 unmodified in normal data mode.
 3242|       |                     * These characters should then be ignored in body
 3243|       |                     * and other text, but should be replaced with
 3244|       |                     * U+FFFD in foreign content.
 3245|       |                     *
 3246|       |                     * At least for now, we always strip U+0000 when
 3247|       |                     * tokenizing.
 3248|       |                     */
 3249|      0|                    repl = BAD_CAST "";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3250|      0|                    replSize = 0;
 3251|      0|                } else {
 3252|      0|                    repl = BAD_CAST "\xEF\xBF\xBD";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3253|      0|                    replSize = 3;
 3254|      0|                }
 3255|       |
 3256|      0|                goto next_chunk;
 3257|       |
 3258|      0|            case '\n':
  ------------------
  |  Branch (3258:13): [True: 0, False: 0]
  ------------------
 3259|      0|                line += 1;
 3260|      0|                col = 1;
 3261|      0|                break;
 3262|       |
 3263|      0|            case '\r':
  ------------------
  |  Branch (3263:13): [True: 0, False: 0]
  ------------------
 3264|      0|                if (partial && avail < 2) {
  ------------------
  |  Branch (3264:21): [True: 0, False: 0]
  |  Branch (3264:32): [True: 0, False: 0]
  ------------------
 3265|      0|                    done = 1;
 3266|      0|                    goto next_chunk;
 3267|      0|                }
 3268|       |
 3269|      0|                skip = 1;
 3270|      0|                if (in[1] != 0x0A) {
  ------------------
  |  Branch (3270:21): [True: 0, False: 0]
  ------------------
 3271|      0|                    repl = BAD_CAST "\x0A";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3272|      0|                    replSize = 1;
 3273|      0|                }
 3274|      0|                goto next_chunk;
 3275|       |
 3276|      0|            default:
  ------------------
  |  Branch (3276:13): [True: 0, False: 0]
  ------------------
 3277|      0|                if (cur < 0x80)
  ------------------
  |  Branch (3277:21): [True: 0, False: 0]
  ------------------
 3278|      0|                    break;
 3279|       |
 3280|      0|                if ((input->flags & XML_INPUT_HAS_ENCODING) == 0) {
  ------------------
  |  |   33|      0|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (3280:21): [True: 0, False: 0]
  ------------------
 3281|      0|                    xmlChar * guess;
 3282|       |
 3283|      0|                    if (in > chunk)
  ------------------
  |  Branch (3283:25): [True: 0, False: 0]
  ------------------
 3284|      0|                        goto next_chunk;
 3285|       |
 3286|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 3287|      0|                    guess = NULL;
 3288|       |#else
 3289|       |                    guess = htmlFindEncoding(ctxt);
 3290|       |#endif
 3291|      0|                    if (guess == NULL) {
  ------------------
  |  Branch (3291:25): [True: 0, False: 0]
  ------------------
 3292|      0|                        xmlSwitchEncoding(ctxt,
 3293|      0|                                XML_CHAR_ENCODING_WINDOWS_1252);
 3294|      0|                    } else {
 3295|      0|                        xmlSwitchEncodingName(ctxt, (const char *) guess);
 3296|      0|                        xmlFree(guess);
 3297|      0|                    }
 3298|      0|                    input->flags |= XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|      0|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 3299|       |
 3300|      0|                    eof = PARSER_PROGRESSIVE(ctxt);
  ------------------
  |  |   47|      0|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|      0|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  ------------------
 3301|      0|                    goto restart;
 3302|      0|                }
 3303|       |
 3304|      0|                size = htmlValidateUtf8(ctxt, in, avail, partial);
 3305|       |
 3306|      0|                if ((partial) && (size == 0)) {
  ------------------
  |  Branch (3306:21): [True: 0, False: 0]
  |  Branch (3306:34): [True: 0, False: 0]
  ------------------
 3307|      0|                    done = 1;
 3308|      0|                    goto next_chunk;
 3309|      0|                }
 3310|       |
 3311|      0|                if (size <= 0) {
  ------------------
  |  Branch (3311:21): [True: 0, False: 0]
  ------------------
 3312|      0|                    skip = 1;
 3313|      0|                    repl = BAD_CAST "\xEF\xBF\xBD";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3314|      0|                    replSize = 3;
 3315|      0|                    goto next_chunk;
 3316|      0|                }
 3317|       |
 3318|      0|                break;
 3319|      0|            }
 3320|       |
 3321|      0|next_char:
 3322|      0|            in += size;
 3323|      0|            avail -= size;
 3324|      0|        }
 3325|       |
 3326|      1|next_chunk:
 3327|      1|        if (ncrSize > 0) {
  ------------------
  |  Branch (3327:13): [True: 0, False: 1]
  ------------------
 3328|      0|            skip = ncrSize;
 3329|      0|            in -= ncrSize;
 3330|       |
 3331|      0|            repl = htmlCodePointToUtf8(cp, utf8Char, &replSize);
 3332|      0|        }
 3333|       |
 3334|      1|        if (in > chunk) {
  ------------------
  |  Branch (3334:13): [True: 1, False: 0]
  ------------------
 3335|      1|            input->cur += in - chunk;
 3336|      1|            htmlCharDataSAXCallback(ctxt, chunk, in - chunk, mode);
 3337|      1|        }
 3338|       |
 3339|      1|        input->cur += skip;
 3340|      1|        if (replSize > 0)
  ------------------
  |  Branch (3340:13): [True: 0, False: 1]
  ------------------
 3341|      0|            htmlCharDataSAXCallback(ctxt, repl, replSize, mode);
 3342|       |
 3343|      1|        SHRINK;
  ------------------
  |  |  296|      1|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|      1|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|      1|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (296:9): [True: 1, False: 0]
  |  |  ------------------
  |  |  297|      1|        (ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \
  |  |  ------------------
  |  |  |  |   63|      1|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 0, False: 1]
  |  |  ------------------
  |  |  298|      1|	(ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|      0|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (298:2): [True: 0, False: 0]
  |  |  ------------------
  |  |  299|      1|	xmlParserShrink(ctxt);
  ------------------
 3344|       |
 3345|      1|        if (done)
  ------------------
  |  Branch (3345:13): [True: 1, False: 0]
  ------------------
 3346|      1|            break;
 3347|       |
 3348|      0|restart:
 3349|      0|        ;
 3350|      0|    }
 3351|       |
 3352|      1|    input->line = line;
 3353|      1|    input->col = col;
 3354|       |
 3355|      1|    if (complete)
  ------------------
  |  Branch (3355:9): [True: 0, False: 1]
  ------------------
 3356|      0|        ctxt->endCheckState = 0;
 3357|      1|    else
 3358|      1|        ctxt->endCheckState = mode;
 3359|       |
 3360|      1|    return(complete);
 3361|      1|}
HTMLparser.c:htmlCharDataSAXCallback:
 2898|      1|                        int size, int mode) {
 2899|      1|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (2899:9): [True: 0, False: 1]
  |  Branch (2899:32): [True: 0, False: 1]
  ------------------
 2900|      0|        return;
 2901|       |
 2902|      1|    if ((mode == 0) || (mode == DATA_RCDATA) ||
  ------------------
  |  |   12|      0|#define DATA_RCDATA         1
  ------------------
  |  Branch (2902:9): [True: 1, False: 0]
  |  Branch (2902:24): [True: 0, False: 0]
  ------------------
 2903|      1|        (ctxt->sax->cdataBlock == NULL)) {
  ------------------
  |  Branch (2903:9): [True: 0, False: 0]
  ------------------
 2904|      1|        if ((ctxt->name == NULL) ||
  ------------------
  |  Branch (2904:13): [True: 1, False: 0]
  ------------------
 2905|      0|            (xmlStrEqual(ctxt->name, BAD_CAST "html")) ||
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2905:13): [True: 0, False: 0]
  ------------------
 2906|      1|            (xmlStrEqual(ctxt->name, BAD_CAST "head"))) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2906:13): [True: 0, False: 0]
  ------------------
 2907|      1|            int i;
 2908|       |
 2909|       |            /*
 2910|       |             * Add leading whitespace to html or head elements before
 2911|       |             * calling htmlStartCharData.
 2912|       |             */
 2913|      1|            for (i = 0; i < size; i++)
  ------------------
  |  Branch (2913:25): [True: 1, False: 0]
  ------------------
 2914|      1|                if (!IS_WS_HTML(buf[i]))
  ------------------
  |  |    9|      1|    (((c) == 0x20) || \
  |  |  ------------------
  |  |  |  Branch (9:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   10|      1|     (((c) >= 0x09) && ((c) <= 0x0D) && ((c) != 0x0B)))
  |  |  ------------------
  |  |  |  Branch (10:7): [True: 1, False: 0]
  |  |  |  Branch (10:24): [True: 0, False: 1]
  |  |  |  Branch (10:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2915|      1|                    break;
 2916|       |
 2917|      1|            if (i > 0) {
  ------------------
  |  Branch (2917:17): [True: 0, False: 1]
  ------------------
 2918|      0|                if (!ctxt->keepBlanks) {
  ------------------
  |  Branch (2918:21): [True: 0, False: 0]
  ------------------
 2919|      0|                    if (ctxt->sax->ignorableWhitespace != NULL)
  ------------------
  |  Branch (2919:25): [True: 0, False: 0]
  ------------------
 2920|      0|                        ctxt->sax->ignorableWhitespace(ctxt->userData, buf, i);
 2921|      0|                } else {
 2922|      0|                    if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (2922:25): [True: 0, False: 0]
  ------------------
 2923|      0|                        ctxt->sax->characters(ctxt->userData, buf, i);
 2924|      0|                }
 2925|       |
 2926|      0|                buf += i;
 2927|      0|                size -= i;
 2928|      0|            }
 2929|       |
 2930|      1|            if (size <= 0)
  ------------------
  |  Branch (2930:17): [True: 0, False: 1]
  ------------------
 2931|      0|                return;
 2932|       |
 2933|      1|            htmlStartCharData(ctxt);
 2934|       |
 2935|      1|            if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|      1|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 2936|      0|                return;
 2937|      1|        }
 2938|       |
 2939|      1|        if ((mode == 0) &&
  ------------------
  |  Branch (2939:13): [True: 1, False: 0]
  ------------------
 2940|      1|            (!ctxt->keepBlanks) &&
  ------------------
  |  Branch (2940:13): [True: 1, False: 0]
  ------------------
 2941|      1|            (areBlanks(ctxt, buf, size) > 0)) {
  ------------------
  |  Branch (2941:13): [True: 0, False: 1]
  ------------------
 2942|      0|            if (ctxt->sax->ignorableWhitespace != NULL)
  ------------------
  |  Branch (2942:17): [True: 0, False: 0]
  ------------------
 2943|      0|                ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
 2944|      1|        } else {
 2945|      1|            if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (2945:17): [True: 1, False: 0]
  ------------------
 2946|      1|                ctxt->sax->characters(ctxt->userData, buf, size);
 2947|      1|        }
 2948|      1|    } else {
 2949|       |        /*
 2950|       |         * Insert as CDATA, which is the same as HTML_PRESERVE_NODE
 2951|       |         */
 2952|      0|        ctxt->sax->cdataBlock(ctxt->userData, buf, size);
 2953|      0|    }
 2954|      1|}
HTMLparser.c:areBlanks:
 2164|      1|static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
 2165|      1|    unsigned int i;
 2166|      1|    int j;
 2167|      1|    xmlNodePtr lastChild;
 2168|      1|    xmlDtdPtr dtd;
 2169|       |
 2170|      1|    for (j = 0;j < len;j++)
  ------------------
  |  Branch (2170:16): [True: 1, False: 0]
  ------------------
 2171|      1|        if (!(IS_WS_HTML(str[j]))) return(-1);
  ------------------
  |  |    9|      1|    (((c) == 0x20) || \
  |  |  ------------------
  |  |  |  Branch (9:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   10|      1|     (((c) >= 0x09) && ((c) <= 0x0D) && ((c) != 0x0B)))
  |  |  ------------------
  |  |  |  Branch (10:7): [True: 1, False: 0]
  |  |  |  Branch (10:24): [True: 0, False: 1]
  |  |  |  Branch (10:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2172|       |
 2173|      0|    if (CUR == 0) return(1);
  ------------------
  |  |  310|      0|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2173:9): [True: 0, False: 0]
  ------------------
 2174|      0|    if (CUR != '<') return(0);
  ------------------
  |  |  310|      0|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2174:9): [True: 0, False: 0]
  ------------------
 2175|      0|    if (ctxt->name == NULL)
  ------------------
  |  Branch (2175:9): [True: 0, False: 0]
  ------------------
 2176|      0|	return(1);
 2177|      0|    if (xmlStrEqual(ctxt->name, BAD_CAST"html"))
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2177:9): [True: 0, False: 0]
  ------------------
 2178|      0|	return(1);
 2179|      0|    if (xmlStrEqual(ctxt->name, BAD_CAST"head"))
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2179:9): [True: 0, False: 0]
  ------------------
 2180|      0|	return(1);
 2181|       |
 2182|       |    /* Only strip CDATA children of the body tag for strict HTML DTDs */
 2183|      0|    if (xmlStrEqual(ctxt->name, BAD_CAST "body") && ctxt->myDoc != NULL) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2183:9): [True: 0, False: 0]
  |  Branch (2183:53): [True: 0, False: 0]
  ------------------
 2184|      0|        dtd = xmlGetIntSubset(ctxt->myDoc);
 2185|      0|        if (dtd != NULL && dtd->ExternalID != NULL) {
  ------------------
  |  Branch (2185:13): [True: 0, False: 0]
  |  Branch (2185:28): [True: 0, False: 0]
  ------------------
 2186|      0|            if (!xmlStrcasecmp(dtd->ExternalID, BAD_CAST "-//W3C//DTD HTML 4.01//EN") ||
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2186:17): [True: 0, False: 0]
  ------------------
 2187|      0|                    !xmlStrcasecmp(dtd->ExternalID, BAD_CAST "-//W3C//DTD HTML 4//EN"))
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2187:21): [True: 0, False: 0]
  ------------------
 2188|      0|                return(1);
 2189|      0|        }
 2190|      0|    }
 2191|       |
 2192|      0|    if (ctxt->node == NULL) return(0);
  ------------------
  |  Branch (2192:9): [True: 0, False: 0]
  ------------------
 2193|      0|    lastChild = xmlGetLastChild(ctxt->node);
 2194|      0|    while ((lastChild) && (lastChild->type == XML_COMMENT_NODE))
  ------------------
  |  Branch (2194:12): [True: 0, False: 0]
  |  Branch (2194:27): [True: 0, False: 0]
  ------------------
 2195|      0|	lastChild = lastChild->prev;
 2196|      0|    if (lastChild == NULL) {
  ------------------
  |  Branch (2196:9): [True: 0, False: 0]
  ------------------
 2197|      0|        if ((ctxt->node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (2197:13): [True: 0, False: 0]
  ------------------
 2198|      0|            (ctxt->node->content != NULL)) return(0);
  ------------------
  |  Branch (2198:13): [True: 0, False: 0]
  ------------------
 2199|       |	/* keep ws in constructs like ...<b> </b>...
 2200|       |	   for all tags "b" allowing PCDATA */
 2201|      0|	for ( i = 0; i < sizeof(allowPCData)/sizeof(allowPCData[0]); i++ ) {
  ------------------
  |  Branch (2201:15): [True: 0, False: 0]
  ------------------
 2202|      0|	    if ( xmlStrEqual(ctxt->name, BAD_CAST allowPCData[i]) ) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2202:11): [True: 0, False: 0]
  ------------------
 2203|      0|		return(0);
 2204|      0|	    }
 2205|      0|	}
 2206|      0|    } else if (xmlNodeIsText(lastChild)) {
  ------------------
  |  Branch (2206:16): [True: 0, False: 0]
  ------------------
 2207|      0|        return(0);
 2208|      0|    } else {
 2209|       |	/* keep ws in constructs like <p><b>xy</b> <i>z</i><p>
 2210|       |	   for all tags "p" allowing PCDATA */
 2211|      0|	for ( i = 0; i < sizeof(allowPCData)/sizeof(allowPCData[0]); i++ ) {
  ------------------
  |  Branch (2211:15): [True: 0, False: 0]
  ------------------
 2212|      0|	    if ( xmlStrEqual(lastChild->name, BAD_CAST allowPCData[i]) ) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2212:11): [True: 0, False: 0]
  ------------------
 2213|      0|		return(0);
 2214|      0|	    }
 2215|      0|	}
 2216|      0|    }
 2217|      0|    return(1);
 2218|      0|}
HTMLparser.c:htmlAutoCloseOnEnd:
 1379|      1|{
 1380|      1|    int i;
 1381|       |
 1382|      1|    if (ctxt->options & HTML_PARSE_HTML5)
  ------------------
  |  Branch (1382:9): [True: 0, False: 1]
  ------------------
 1383|      0|        return;
 1384|       |
 1385|      1|    if (ctxt->nameNr == 0)
  ------------------
  |  Branch (1385:9): [True: 0, False: 1]
  ------------------
 1386|      0|        return;
 1387|      3|    for (i = (ctxt->nameNr - 1); i >= 0; i--) {
  ------------------
  |  Branch (1387:34): [True: 2, False: 1]
  ------------------
 1388|      2|	htmlParserFinishElementParsing(ctxt);
 1389|      2|        if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
  ------------------
  |  Branch (1389:13): [True: 2, False: 0]
  |  Branch (1389:36): [True: 2, False: 0]
  ------------------
 1390|      2|            ctxt->sax->endElement(ctxt->userData, ctxt->name);
 1391|      2|	htmlnamePop(ctxt);
 1392|      2|    }
 1393|      1|}
HTMLparser.c:htmlnamePush:
  154|      2|{
  155|      2|    if ((ctxt->html < INSERT_IN_HEAD) && (xmlStrEqual(value, BAD_CAST "head")))
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (155:9): [True: 2, False: 0]
  |  Branch (155:42): [True: 0, False: 2]
  ------------------
  156|      0|        ctxt->html = INSERT_IN_HEAD;
  157|      2|    if ((ctxt->html < INSERT_IN_BODY) && (xmlStrEqual(value, BAD_CAST "body")))
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (157:9): [True: 2, False: 0]
  |  Branch (157:42): [True: 1, False: 1]
  ------------------
  158|      1|        ctxt->html = INSERT_IN_BODY;
  159|      2|    if (ctxt->nameNr >= ctxt->nameMax) {
  ------------------
  |  Branch (159:9): [True: 1, False: 1]
  ------------------
  160|      1|        const xmlChar **tmp;
  161|      1|        int newSize;
  162|       |
  163|      1|        newSize = xmlGrowCapacity(ctxt->nameMax, sizeof(tmp[0]),
  164|      1|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|      1|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  165|      1|        if (newSize < 0) {
  ------------------
  |  Branch (165:13): [True: 0, False: 1]
  ------------------
  166|      0|            htmlErrMemory(ctxt);
  167|      0|            return (-1);
  168|      0|        }
  169|      1|        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
  170|      1|        if (tmp == NULL) {
  ------------------
  |  Branch (170:13): [True: 0, False: 1]
  ------------------
  171|      0|            htmlErrMemory(ctxt);
  172|      0|            return(-1);
  173|      0|        }
  174|      1|        ctxt->nameTab = tmp;
  175|      1|        ctxt->nameMax = newSize;
  176|      1|    }
  177|      2|    ctxt->nameTab[ctxt->nameNr] = value;
  178|      2|    ctxt->name = value;
  179|      2|    return (ctxt->nameNr++);
  180|      2|}
HTMLparser.c:htmlnamePop:
  189|      2|{
  190|      2|    const xmlChar *ret;
  191|       |
  192|      2|    if (ctxt->nameNr <= 0)
  ------------------
  |  Branch (192:9): [True: 0, False: 2]
  ------------------
  193|      0|        return (NULL);
  194|      2|    ctxt->nameNr--;
  195|      2|    if (ctxt->nameNr < 0)
  ------------------
  |  Branch (195:9): [True: 0, False: 2]
  ------------------
  196|      0|        return (NULL);
  197|      2|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (197:9): [True: 1, False: 1]
  ------------------
  198|      1|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
  199|      1|    else
  200|      1|        ctxt->name = NULL;
  201|      2|    ret = ctxt->nameTab[ctxt->nameNr];
  202|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
  203|      2|    return (ret);
  204|      2|}
HTMLparser.c:htmlSkipBlankChars:
  438|      1|htmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
  439|      1|    const xmlChar *cur = ctxt->input->cur;
  440|      1|    size_t avail = ctxt->input->end - cur;
  441|      1|    int res = 0;
  442|      1|    int line = ctxt->input->line;
  443|      1|    int col = ctxt->input->col;
  444|       |
  445|      1|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|      1|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (445:12): [True: 1, False: 0]
  ------------------
  446|      1|        if (avail == 0) {
  ------------------
  |  Branch (446:13): [True: 0, False: 1]
  ------------------
  447|      0|            ctxt->input->cur = cur;
  448|      0|            GROW;
  ------------------
  |  |  302|      0|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|      0|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|      0|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (302:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  303|      0|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|      0|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (303:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  304|      0|	xmlParserGrow(ctxt);
  ------------------
  449|      0|            cur = ctxt->input->cur;
  450|      0|            avail = ctxt->input->end - cur;
  451|       |
  452|      0|            if (avail == 0)
  ------------------
  |  Branch (452:17): [True: 0, False: 0]
  ------------------
  453|      0|                break;
  454|      0|        }
  455|       |
  456|      1|        if (*cur == '\n') {
  ------------------
  |  Branch (456:13): [True: 0, False: 1]
  ------------------
  457|      0|            line++;
  458|      0|            col = 1;
  459|      1|        } else if (IS_WS_HTML(*cur)) {
  ------------------
  |  |    9|      1|    (((c) == 0x20) || \
  |  |  ------------------
  |  |  |  Branch (9:6): [True: 0, False: 1]
  |  |  ------------------
  |  |   10|      1|     (((c) >= 0x09) && ((c) <= 0x0D) && ((c) != 0x0B)))
  |  |  ------------------
  |  |  |  Branch (10:7): [True: 1, False: 0]
  |  |  |  Branch (10:24): [True: 0, False: 1]
  |  |  |  Branch (10:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  460|      0|            col++;
  461|      1|        } else {
  462|      1|            break;
  463|      1|        }
  464|       |
  465|      0|        cur += 1;
  466|      0|        avail -= 1;
  467|       |
  468|      0|	if (res < INT_MAX)
  ------------------
  |  Branch (468:6): [True: 0, False: 0]
  ------------------
  469|      0|	    res++;
  470|      0|    }
  471|       |
  472|      1|    ctxt->input->cur = cur;
  473|      1|    ctxt->input->line = line;
  474|      1|    ctxt->input->col = col;
  475|       |
  476|      1|    if (res > 8)
  ------------------
  |  Branch (476:9): [True: 0, False: 1]
  ------------------
  477|      0|        GROW;
  ------------------
  |  |  302|      0|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|      0|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|      0|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (302:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  303|      0|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|      0|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (303:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  304|      0|	xmlParserGrow(ctxt);
  ------------------
  478|       |
  479|      1|    return(res);
  480|      1|}
HTMLparser.c:htmlInitParserCtxt:
 4499|     33|{
 4500|     33|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 4501|     33|    size_t initialNodeTabSize = 1;
 4502|       |#else
 4503|       |    size_t initialNodeTabSize = 10;
 4504|       |#endif
 4505|       |
 4506|     33|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (4506:9): [True: 0, False: 33]
  ------------------
 4507|     33|    memset(ctxt, 0, sizeof(htmlParserCtxt));
 4508|       |
 4509|     33|    ctxt->dict = xmlDictCreate();
 4510|     33|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (4510:9): [True: 0, False: 33]
  ------------------
 4511|      0|	return(-1);
 4512|       |
 4513|     33|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (4513:9): [True: 33, False: 0]
  ------------------
 4514|     33|        ctxt->sax = (htmlSAXHandler *) xmlMalloc(sizeof(htmlSAXHandler));
 4515|     33|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (4515:9): [True: 0, False: 33]
  ------------------
 4516|      0|	return(-1);
 4517|     33|    if (sax == NULL) {
  ------------------
  |  Branch (4517:9): [True: 33, False: 0]
  ------------------
 4518|     33|        memset(ctxt->sax, 0, sizeof(htmlSAXHandler));
 4519|     33|        xmlSAX2InitHtmlDefaultSAXHandler(ctxt->sax);
 4520|     33|        ctxt->userData = ctxt;
 4521|     33|    } else {
 4522|      0|        memcpy(ctxt->sax, sax, sizeof(htmlSAXHandler));
 4523|      0|        ctxt->userData = userData ? userData : ctxt;
  ------------------
  |  Branch (4523:26): [True: 0, False: 0]
  ------------------
 4524|      0|    }
 4525|       |
 4526|       |    /* Allocate the Input stack */
 4527|     33|    ctxt->inputTab = (htmlParserInputPtr *)
 4528|     33|                      xmlMalloc(sizeof(htmlParserInputPtr));
 4529|     33|    if (ctxt->inputTab == NULL)
  ------------------
  |  Branch (4529:9): [True: 0, False: 33]
  ------------------
 4530|      0|	return(-1);
 4531|     33|    ctxt->inputNr = 0;
 4532|     33|    ctxt->inputMax = 1;
 4533|     33|    ctxt->input = NULL;
 4534|     33|    ctxt->version = NULL;
 4535|     33|    ctxt->encoding = NULL;
 4536|     33|    ctxt->standalone = -1;
 4537|     33|    ctxt->instate = XML_PARSER_START;
 4538|       |
 4539|       |    /* Allocate the Node stack */
 4540|     33|    ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(htmlNodePtr));
 4541|     33|    if (ctxt->nodeTab == NULL)
  ------------------
  |  Branch (4541:9): [True: 0, False: 33]
  ------------------
 4542|      0|	return(-1);
 4543|     33|    ctxt->nodeNr = 0;
 4544|     33|    ctxt->nodeMax = initialNodeTabSize;
 4545|     33|    ctxt->node = NULL;
 4546|       |
 4547|       |    /* Allocate the Name stack */
 4548|     33|    ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
 4549|     33|    if (ctxt->nameTab == NULL)
  ------------------
  |  Branch (4549:9): [True: 0, False: 33]
  ------------------
 4550|      0|	return(-1);
 4551|     33|    ctxt->nameNr = 0;
 4552|     33|    ctxt->nameMax = initialNodeTabSize;
 4553|     33|    ctxt->name = NULL;
 4554|       |
 4555|     33|    ctxt->nodeInfoTab = NULL;
 4556|     33|    ctxt->nodeInfoNr  = 0;
 4557|     33|    ctxt->nodeInfoMax = 0;
 4558|       |
 4559|     33|    ctxt->myDoc = NULL;
 4560|     33|    ctxt->wellFormed = 1;
 4561|     33|    ctxt->replaceEntities = 0;
 4562|     33|    ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
  ------------------
  |  | 1316|     33|  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
  ------------------
 4563|     33|    ctxt->html = INSERT_INITIAL;
 4564|     33|    ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
  ------------------
  |  |   20|     33|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
 4565|     33|    ctxt->vctxt.userData = ctxt;
 4566|     33|    ctxt->vctxt.error = xmlParserValidityError;
 4567|     33|    ctxt->vctxt.warning = xmlParserValidityWarning;
 4568|     33|    ctxt->record_info = 0;
 4569|     33|    ctxt->validate = 0;
 4570|     33|    ctxt->checkIndex = 0;
 4571|       |    ctxt->catalogs = NULL;
 4572|     33|    xmlInitNodeInfoSeq(&ctxt->node_seq);
 4573|     33|    return(0);
 4574|     33|}
HTMLparser.c:htmlCtxtSetOptionsInternal:
 5498|     67|{
 5499|     67|    int allMask;
 5500|       |
 5501|     67|    if (ctxt == NULL)
  ------------------
  |  Branch (5501:9): [True: 0, False: 67]
  ------------------
 5502|      0|        return(-1);
 5503|       |
 5504|     67|    allMask = HTML_PARSE_RECOVER |
 5505|     67|              HTML_PARSE_HTML5 |
 5506|     67|              HTML_PARSE_NODEFDTD |
 5507|     67|              HTML_PARSE_NOERROR |
 5508|     67|              HTML_PARSE_NOWARNING |
 5509|     67|              HTML_PARSE_PEDANTIC |
 5510|     67|              HTML_PARSE_NOBLANKS |
 5511|     67|              HTML_PARSE_NONET |
 5512|     67|              HTML_PARSE_NOIMPLIED |
 5513|     67|              HTML_PARSE_COMPACT |
 5514|     67|              HTML_PARSE_HUGE |
 5515|     67|              HTML_PARSE_IGNORE_ENC |
 5516|     67|              HTML_PARSE_BIG_LINES;
 5517|       |
 5518|     67|    ctxt->options = (ctxt->options & keepMask) | (options & allMask);
 5519|       |
 5520|       |    /*
 5521|       |     * For some options, struct members are historically the source
 5522|       |     * of truth. See xmlCtxtSetOptionsInternal.
 5523|       |     */
 5524|     67|    ctxt->keepBlanks = (options & HTML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (5524:24): [True: 47, False: 20]
  ------------------
 5525|       |
 5526|       |    /*
 5527|       |     * Recover from character encoding errors
 5528|       |     */
 5529|     67|    ctxt->recovery = 1;
 5530|       |
 5531|       |    /*
 5532|       |     * Changing SAX callbacks is a bad idea. This should be fixed.
 5533|       |     */
 5534|     67|    if (options & HTML_PARSE_NOBLANKS) {
  ------------------
  |  Branch (5534:9): [True: 47, False: 20]
  ------------------
 5535|     47|        ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 5536|     47|    }
 5537|     67|    if (options & HTML_PARSE_HUGE) {
  ------------------
  |  Branch (5537:9): [True: 25, False: 42]
  ------------------
 5538|     25|        if (ctxt->dict != NULL)
  ------------------
  |  Branch (5538:13): [True: 25, False: 0]
  ------------------
 5539|     25|            xmlDictSetLimit(ctxt->dict, 0);
 5540|     25|    }
 5541|       |
 5542|       |    /*
 5543|       |     * It would be useful to allow this feature.
 5544|       |     */
 5545|     67|    ctxt->dictNames = 0;
 5546|       |
 5547|       |    /*
 5548|       |     * Allow XML_PARSE_NOENT which many users set on the HTML parser.
 5549|       |     */
 5550|     67|    return(options & ~allMask & ~XML_PARSE_NOENT);
 5551|     67|}

xmlSAX2ResolveEntity:
  396|      1|{
  397|      1|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  398|      1|    xmlParserInputPtr ret = NULL;
  399|      1|    xmlChar *URI = NULL;
  400|       |
  401|      1|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (401:9): [True: 0, False: 1]
  ------------------
  402|       |
  403|      1|    if (systemId != NULL) {
  ------------------
  |  Branch (403:9): [True: 1, False: 0]
  ------------------
  404|      1|        const xmlChar *base = NULL;
  405|      1|        int res;
  406|       |
  407|      1|        if (ctxt->input != NULL)
  ------------------
  |  Branch (407:13): [True: 0, False: 1]
  ------------------
  408|      0|            base = BAD_CAST ctxt->input->filename;
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  409|       |
  410|       |        /*
  411|       |         * We don't really need the 'directory' struct member, but some
  412|       |         * users set it manually to a base URI for memory streams.
  413|       |         */
  414|      1|        if (base == NULL)
  ------------------
  |  Branch (414:13): [True: 1, False: 0]
  ------------------
  415|      1|            base = BAD_CAST ctxt->directory;
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  416|       |
  417|      1|        if ((xmlStrlen(systemId) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|      1|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (417:13): [True: 0, False: 1]
  ------------------
  418|      1|            (xmlStrlen(base) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|      1|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (418:13): [True: 0, False: 1]
  ------------------
  419|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  420|      0|            return(NULL);
  421|      0|        }
  422|      1|        res = xmlBuildURISafe(systemId, base, &URI);
  423|      1|        if (URI == NULL) {
  ------------------
  |  Branch (423:13): [True: 0, False: 1]
  ------------------
  424|      0|            if (res < 0)
  ------------------
  |  Branch (424:17): [True: 0, False: 0]
  ------------------
  425|      0|                xmlSAX2ErrMemory(ctxt);
  426|      0|            else
  427|      0|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  428|      0|                           "Can't resolve URI: %s\n", systemId);
  429|      0|            return(NULL);
  430|      0|        }
  431|      1|        if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|      1|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (431:13): [True: 0, False: 1]
  ------------------
  432|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  433|      0|            xmlFree(URI);
  434|      0|            return(NULL);
  435|      0|        }
  436|      1|    }
  437|       |
  438|      1|    ret = xmlLoadResource(ctxt, (const char *) URI,
  439|      1|                          (const char *) publicId, XML_RESOURCE_DTD);
  440|       |
  441|      1|    xmlFree(URI);
  442|      1|    return(ret);
  443|      1|}
xmlSAX2SetDocumentLocator:
  783|      1|{
  784|      1|}
xmlSAX2StartDocument:
  793|      1|{
  794|      1|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  795|      1|    xmlDocPtr doc;
  796|       |
  797|      1|    if (ctx == NULL) return;
  ------------------
  |  Branch (797:9): [True: 0, False: 1]
  ------------------
  798|       |
  799|      1|#ifdef LIBXML_HTML_ENABLED
  800|      1|    if (ctxt->html) {
  ------------------
  |  Branch (800:9): [True: 1, False: 0]
  ------------------
  801|      1|	if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (801:6): [True: 1, False: 0]
  ------------------
  802|      1|	    ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
  803|      1|	if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (803:6): [True: 0, False: 1]
  ------------------
  804|      0|	    xmlSAX2ErrMemory(ctxt);
  805|      0|	    return;
  806|      0|	}
  807|      1|	ctxt->myDoc->properties = XML_DOC_HTML;
  808|      1|	ctxt->myDoc->parseFlags = ctxt->options;
  809|      1|    } else
  810|      0|#endif
  811|      0|    {
  812|      0|	doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
  813|      0|	if (doc != NULL) {
  ------------------
  |  Branch (813:6): [True: 0, False: 0]
  ------------------
  814|      0|	    doc->properties = 0;
  815|      0|	    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (815:10): [True: 0, False: 0]
  ------------------
  816|      0|	        doc->properties |= XML_DOC_OLD10;
  817|      0|	    doc->parseFlags = ctxt->options;
  818|      0|	    doc->standalone = ctxt->standalone;
  819|      0|	} else {
  820|      0|	    xmlSAX2ErrMemory(ctxt);
  821|      0|	    return;
  822|      0|	}
  823|      0|	if ((ctxt->dictNames) && (doc != NULL)) {
  ------------------
  |  Branch (823:6): [True: 0, False: 0]
  |  Branch (823:27): [True: 0, False: 0]
  ------------------
  824|      0|	    doc->dict = ctxt->dict;
  825|      0|	    xmlDictReference(doc->dict);
  826|      0|	}
  827|      0|    }
  828|      1|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
  ------------------
  |  Branch (828:9): [True: 1, False: 0]
  |  Branch (828:34): [True: 1, False: 0]
  ------------------
  829|      1|	(ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
  ------------------
  |  Branch (829:2): [True: 1, False: 0]
  |  Branch (829:27): [True: 1, False: 0]
  ------------------
  830|      1|	ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
  831|      1|	if (ctxt->myDoc->URL == NULL)
  ------------------
  |  Branch (831:6): [True: 0, False: 1]
  ------------------
  832|      0|	    xmlSAX2ErrMemory(ctxt);
  833|      1|    }
  834|      1|}
xmlSAX2EndDocument:
  843|      1|{
  844|      1|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  845|      1|    xmlDocPtr doc;
  846|       |
  847|      1|    if (ctx == NULL) return;
  ------------------
  |  Branch (847:9): [True: 0, False: 1]
  ------------------
  848|      1|#ifdef LIBXML_VALID_ENABLED
  849|      1|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (849:9): [True: 0, False: 1]
  |  Branch (849:27): [True: 0, False: 0]
  ------------------
  850|      0|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (850:9): [True: 0, False: 0]
  |  Branch (850:24): [True: 0, False: 0]
  ------------------
  851|      0|	ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
  852|      1|#endif /* LIBXML_VALID_ENABLED */
  853|       |
  854|      1|    doc = ctxt->myDoc;
  855|      1|    if (doc == NULL)
  ------------------
  |  Branch (855:9): [True: 0, False: 1]
  ------------------
  856|      0|        return;
  857|       |
  858|      1|    if (doc->encoding == NULL) {
  ------------------
  |  Branch (858:9): [True: 1, False: 0]
  ------------------
  859|      1|        const xmlChar *encoding = xmlGetActualEncoding(ctxt);
  860|       |
  861|      1|        if (encoding != NULL) {
  ------------------
  |  Branch (861:13): [True: 0, False: 1]
  ------------------
  862|      0|            doc->encoding = xmlStrdup(encoding);
  863|      0|            if (doc->encoding == NULL)
  ------------------
  |  Branch (863:17): [True: 0, False: 0]
  ------------------
  864|      0|                xmlSAX2ErrMemory(ctxt);
  865|      0|        }
  866|      1|    }
  867|       |
  868|      1|#ifdef LIBXML_HTML_ENABLED
  869|      1|    if (ctxt->html) {
  ------------------
  |  Branch (869:9): [True: 1, False: 0]
  ------------------
  870|      1|        if (((ctxt->options & HTML_PARSE_NODEFDTD) == 0) &&
  ------------------
  |  Branch (870:13): [True: 1, False: 0]
  ------------------
  871|      1|            (doc->intSubset == NULL)) {
  ------------------
  |  Branch (871:13): [True: 1, False: 0]
  ------------------
  872|      1|            doc->intSubset = xmlCreateIntSubset(doc, BAD_CAST "html",
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  873|      1|                    BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN",
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  874|      1|                    BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd");
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  875|      1|            if (doc->intSubset == NULL)
  ------------------
  |  Branch (875:17): [True: 0, False: 1]
  ------------------
  876|      0|                xmlSAX2ErrMemory(ctxt);
  877|      1|        }
  878|      1|    } else
  879|      0|#endif /* LIBXML_HTML_ENABLED */
  880|      0|    {
  881|      0|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (881:13): [True: 0, False: 0]
  ------------------
  882|      0|            doc->properties |= XML_DOC_WELLFORMED;
  883|      0|            if (ctxt->valid)
  ------------------
  |  Branch (883:17): [True: 0, False: 0]
  ------------------
  884|      0|                doc->properties |= XML_DOC_DTDVALID;
  885|      0|            if (ctxt->nsWellFormed)
  ------------------
  |  Branch (885:17): [True: 0, False: 0]
  ------------------
  886|      0|                doc->properties |= XML_DOC_NSVALID;
  887|      0|        }
  888|       |
  889|      0|        if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (889:13): [True: 0, False: 0]
  ------------------
  890|      0|            doc->properties |= XML_DOC_OLD10;
  891|      0|    }
  892|      1|}
xmlSAX2StartElement:
 1713|      2|xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) {
 1714|      2|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1715|       |
 1716|      2|    (void) atts;
 1717|       |
 1718|      2|    if ((ctxt == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (1718:9): [True: 0, False: 2]
  |  Branch (1718:27): [True: 0, False: 2]
  |  Branch (1718:49): [True: 0, False: 2]
  ------------------
 1719|      0|        return;
 1720|       |
 1721|      2|#ifdef LIBXML_SAX1_ENABLED
 1722|      2|    if (!ctxt->html) {
  ------------------
  |  Branch (1722:9): [True: 0, False: 2]
  ------------------
 1723|      0|        xmlSAX1StartElement(ctxt, fullname, atts);
 1724|      0|        return;
 1725|      0|    }
 1726|      2|#endif
 1727|       |
 1728|      2|#ifdef LIBXML_HTML_ENABLED
 1729|      2|    if (ctxt->html) {
  ------------------
  |  Branch (1729:9): [True: 2, False: 0]
  ------------------
 1730|      2|        xmlSAX2StartHtmlElement(ctxt, fullname, atts);
 1731|      2|        return;
 1732|      2|    }
 1733|      2|#endif
 1734|      2|}
xmlSAX2EndElement:
 1748|      2|{
 1749|      2|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1750|       |
 1751|      2|    if (ctxt == NULL)
  ------------------
  |  Branch (1751:9): [True: 0, False: 2]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|      2|#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_VALID_ENABLED)
 1755|      2|    if (!ctxt->html && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1755:9): [True: 0, False: 2]
  |  Branch (1755:24): [True: 0, False: 0]
  |  Branch (1755:42): [True: 0, False: 0]
  ------------------
 1756|      0|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (1756:9): [True: 0, False: 0]
  |  Branch (1756:24): [True: 0, False: 0]
  ------------------
 1757|      0|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 1758|      0|					     ctxt->node);
 1759|      2|#endif /* LIBXML_VALID_ENABLED */
 1760|       |
 1761|      2|#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
 1762|      2|    ctxt->nodemem = -1;
 1763|       |
 1764|       |    /*
 1765|       |     * end of parsing of this node.
 1766|       |     */
 1767|      2|    nodePop(ctxt);
 1768|      2|#endif
 1769|      2|}
xmlSAX2Characters:
 2606|      1|{
 2607|      1|    xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
 2608|      1|}
xmlSAXVersion:
 2711|    189|{
 2712|    189|    if (hdlr == NULL) return(-1);
  ------------------
  |  Branch (2712:9): [True: 0, False: 189]
  ------------------
 2713|    189|    if (version == 2) {
  ------------------
  |  Branch (2713:9): [True: 189, False: 0]
  ------------------
 2714|    189|	hdlr->startElementNs = xmlSAX2StartElementNs;
 2715|    189|	hdlr->endElementNs = xmlSAX2EndElementNs;
 2716|    189|	hdlr->serror = NULL;
 2717|    189|	hdlr->initialized = XML_SAX2_MAGIC;
  ------------------
  |  |  953|    189|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
 2718|    189|#ifdef LIBXML_SAX1_ENABLED
 2719|    189|    } 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|    189|#ifdef LIBXML_SAX1_ENABLED
 2725|    189|    hdlr->startElement = xmlSAX2StartElement;
 2726|    189|    hdlr->endElement = xmlSAX2EndElement;
 2727|       |#else
 2728|       |    hdlr->startElement = NULL;
 2729|       |    hdlr->endElement = NULL;
 2730|       |#endif /* LIBXML_SAX1_ENABLED */
 2731|    189|    hdlr->internalSubset = xmlSAX2InternalSubset;
 2732|    189|    hdlr->externalSubset = xmlSAX2ExternalSubset;
 2733|    189|    hdlr->isStandalone = xmlSAX2IsStandalone;
 2734|    189|    hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
 2735|    189|    hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
 2736|    189|    hdlr->resolveEntity = xmlSAX2ResolveEntity;
 2737|    189|    hdlr->getEntity = xmlSAX2GetEntity;
 2738|    189|    hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
 2739|    189|    hdlr->entityDecl = xmlSAX2EntityDecl;
 2740|    189|    hdlr->attributeDecl = xmlSAX2AttributeDecl;
 2741|    189|    hdlr->elementDecl = xmlSAX2ElementDecl;
 2742|    189|    hdlr->notationDecl = xmlSAX2NotationDecl;
 2743|    189|    hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
 2744|    189|    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
 2745|    189|    hdlr->startDocument = xmlSAX2StartDocument;
 2746|    189|    hdlr->endDocument = xmlSAX2EndDocument;
 2747|    189|    hdlr->reference = xmlSAX2Reference;
 2748|    189|    hdlr->characters = xmlSAX2Characters;
 2749|    189|    hdlr->cdataBlock = xmlSAX2CDataBlock;
 2750|    189|    hdlr->ignorableWhitespace = xmlSAX2Characters;
 2751|    189|    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
 2752|    189|    hdlr->comment = xmlSAX2Comment;
 2753|    189|    hdlr->warning = xmlParserWarning;
 2754|    189|    hdlr->error = xmlParserError;
 2755|    189|    hdlr->fatalError = xmlParserError;
 2756|       |
 2757|    189|    return(0);
 2758|    189|}
xmlSAX2InitHtmlDefaultSAXHandler:
 2798|     33|{
 2799|     33|    if ((hdlr == NULL) || (hdlr->initialized != 0))
  ------------------
  |  Branch (2799:9): [True: 0, False: 33]
  |  Branch (2799:27): [True: 0, False: 33]
  ------------------
 2800|      0|	return;
 2801|       |
 2802|     33|    hdlr->internalSubset = xmlSAX2InternalSubset;
 2803|     33|    hdlr->externalSubset = NULL;
 2804|     33|    hdlr->isStandalone = NULL;
 2805|     33|    hdlr->hasInternalSubset = NULL;
 2806|     33|    hdlr->hasExternalSubset = NULL;
 2807|     33|    hdlr->resolveEntity = NULL;
 2808|     33|    hdlr->getEntity = xmlSAX2GetEntity;
 2809|     33|    hdlr->getParameterEntity = NULL;
 2810|     33|    hdlr->entityDecl = NULL;
 2811|     33|    hdlr->attributeDecl = NULL;
 2812|     33|    hdlr->elementDecl = NULL;
 2813|     33|    hdlr->notationDecl = NULL;
 2814|     33|    hdlr->unparsedEntityDecl = NULL;
 2815|     33|    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
 2816|     33|    hdlr->startDocument = xmlSAX2StartDocument;
 2817|     33|    hdlr->endDocument = xmlSAX2EndDocument;
 2818|     33|    hdlr->startElement = xmlSAX2StartElement;
 2819|     33|    hdlr->endElement = xmlSAX2EndElement;
 2820|     33|    hdlr->reference = NULL;
 2821|     33|    hdlr->characters = xmlSAX2Characters;
 2822|     33|    hdlr->cdataBlock = xmlSAX2CDataBlock;
 2823|     33|    hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 2824|     33|    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
 2825|     33|    hdlr->comment = xmlSAX2Comment;
 2826|     33|    hdlr->warning = xmlParserWarning;
 2827|     33|    hdlr->error = xmlParserError;
 2828|     33|    hdlr->fatalError = xmlParserError;
 2829|       |
 2830|     33|    hdlr->initialized = 1;
 2831|     33|}
SAX2.c:xmlSAX2StartHtmlElement:
 1655|      2|                        const xmlChar **atts) {
 1656|      2|    xmlNodePtr ret;
 1657|      2|    xmlNodePtr parent;
 1658|      2|    const xmlChar *att;
 1659|      2|    const xmlChar *value;
 1660|      2|    int i;
 1661|       |
 1662|      2|    ret = xmlNewDocNode(ctxt->myDoc, NULL, fullname, NULL);
 1663|      2|    if (ret == NULL) {
  ------------------
  |  Branch (1663:9): [True: 0, False: 2]
  ------------------
 1664|      0|	xmlSAX2ErrMemory(ctxt);
 1665|      0|        return;
 1666|      0|    }
 1667|      2|    ctxt->nodemem = -1;
 1668|       |
 1669|       |    /* Initialize parent before pushing node */
 1670|      2|    parent = ctxt->node;
 1671|      2|    if (parent == NULL)
  ------------------
  |  Branch (1671:9): [True: 1, False: 1]
  ------------------
 1672|      1|        parent = (xmlNodePtr) ctxt->myDoc;
 1673|       |
 1674|       |    /*
 1675|       |     * Link the child element
 1676|       |     */
 1677|      2|    xmlSAX2AppendChild(ctxt, ret);
 1678|       |
 1679|       |    /*
 1680|       |     * We are parsing a new node.
 1681|       |     */
 1682|      2|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (1682:9): [True: 0, False: 2]
  ------------------
 1683|      0|        xmlUnlinkNode(ret);
 1684|      0|        xmlFreeNode(ret);
 1685|      0|        return;
 1686|      0|    }
 1687|       |
 1688|      2|    if (atts != NULL) {
  ------------------
  |  Branch (1688:9): [True: 0, False: 2]
  ------------------
 1689|      0|        i = 0;
 1690|      0|	att = atts[i++];
 1691|      0|	value = atts[i++];
 1692|      0|        while (att != NULL) {
  ------------------
  |  Branch (1692:16): [True: 0, False: 0]
  ------------------
 1693|      0|            xmlSAX2HtmlAttribute(ctxt, att, value);
 1694|      0|            att = atts[i++];
 1695|      0|            value = atts[i++];
 1696|      0|        }
 1697|      0|    }
 1698|      2|}
SAX2.c:xmlSAX2AppendChild:
  895|      2|xmlSAX2AppendChild(xmlParserCtxtPtr ctxt, xmlNodePtr node) {
  896|      2|    xmlNodePtr parent;
  897|      2|    xmlNodePtr last;
  898|       |
  899|      2|    if (ctxt->inSubset == 1) {
  ------------------
  |  Branch (899:9): [True: 0, False: 2]
  ------------------
  900|      0|	parent = (xmlNodePtr) ctxt->myDoc->intSubset;
  901|      2|    } else if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (901:16): [True: 0, False: 2]
  ------------------
  902|      0|	parent = (xmlNodePtr) ctxt->myDoc->extSubset;
  903|      2|    } else {
  904|      2|        parent = ctxt->node;
  905|      2|        if (parent == NULL)
  ------------------
  |  Branch (905:13): [True: 1, False: 1]
  ------------------
  906|      1|            parent = (xmlNodePtr) ctxt->myDoc;
  907|      2|    }
  908|       |
  909|      2|    last = parent->last;
  910|      2|    if (last == NULL) {
  ------------------
  |  Branch (910:9): [True: 2, False: 0]
  ------------------
  911|      2|        parent->children = node;
  912|      2|    } else {
  913|      0|        last->next = node;
  914|      0|        node->prev = last;
  915|      0|    }
  916|       |
  917|      2|    parent->last = node;
  918|      2|    node->parent = parent;
  919|       |
  920|      2|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (920:9): [True: 2, False: 0]
  ------------------
  921|      2|	(ctxt->input != NULL)) {
  ------------------
  |  Branch (921:2): [True: 2, False: 0]
  ------------------
  922|      2|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (922:13): [True: 2, False: 0]
  ------------------
  923|      2|            node->line = ctxt->input->line;
  924|      0|        else
  925|      0|            node->line = USHRT_MAX;
  926|      2|    }
  927|      2|}
SAX2.c:xmlSAX2TextNode:
 1783|      1|                int len) {
 1784|      1|    xmlNodePtr ret;
 1785|      1|    const xmlChar *intern = NULL;
 1786|       |
 1787|       |    /*
 1788|       |     * Allocate
 1789|       |     */
 1790|      1|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (1790:9): [True: 0, False: 1]
  ------------------
 1791|      0|	ret = ctxt->freeElems;
 1792|      0|	ctxt->freeElems = ret->next;
 1793|      0|	ctxt->freeElemsNr--;
 1794|      1|    } else {
 1795|      1|	ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1796|      1|    }
 1797|      1|    if (ret == NULL) {
  ------------------
  |  Branch (1797:9): [True: 0, False: 1]
  ------------------
 1798|      0|        xmlCtxtErrMemory(ctxt);
 1799|      0|	return(NULL);
 1800|      0|    }
 1801|      1|    memset(ret, 0, sizeof(xmlNode));
 1802|       |    /*
 1803|       |     * intern the formatting blanks found between tags, or the
 1804|       |     * very short strings
 1805|       |     */
 1806|      1|    if ((!ctxt->html) && (ctxt->dictNames)) {
  ------------------
  |  Branch (1806:9): [True: 0, False: 1]
  |  Branch (1806:26): [True: 0, False: 0]
  ------------------
 1807|      0|        xmlChar cur = str[len];
 1808|       |
 1809|      0|	if ((len < (int) (2 * sizeof(void *))) &&
  ------------------
  |  Branch (1809:6): [True: 0, False: 0]
  ------------------
 1810|      0|	    (ctxt->options & XML_PARSE_COMPACT)) {
  ------------------
  |  Branch (1810:6): [True: 0, False: 0]
  ------------------
 1811|       |	    /* store the string in the node overriding properties and nsDef */
 1812|      0|	    xmlChar *tmp = (xmlChar *) &(ret->properties);
 1813|      0|	    memcpy(tmp, str, len);
 1814|      0|	    tmp[len] = 0;
 1815|      0|	    intern = tmp;
 1816|      0|	} else if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
  ------------------
  |  Branch (1816:13): [True: 0, False: 0]
  |  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|      0|	} else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
  ------------------
  |  |  137|      0|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|      0|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   92|      0|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1824:34): [True: 0, False: 0]
  |  Branch (1824:48): [True: 0, False: 0]
  ------------------
 1825|      0|	           (str[len + 1] != '!')) {
  ------------------
  |  Branch (1825:13): [True: 0, False: 0]
  ------------------
 1826|      0|	    int i;
 1827|       |
 1828|      0|	    for (i = 1;i < len;i++) {
  ------------------
  |  Branch (1828:17): [True: 0, False: 0]
  ------------------
 1829|      0|		if (!IS_BLANK_CH(str[i])) goto skip;
  ------------------
  |  |  137|      0|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|      0|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   92|      0|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1830|      0|	    }
 1831|      0|	    intern = xmlDictLookup(ctxt->dict, str, len);
 1832|      0|            if (intern == NULL) {
  ------------------
  |  Branch (1832:17): [True: 0, False: 0]
  ------------------
 1833|      0|                xmlSAX2ErrMemory(ctxt);
 1834|      0|                xmlFree(ret);
 1835|      0|                return(NULL);
 1836|      0|            }
 1837|      0|	}
 1838|      0|    }
 1839|      1|skip:
 1840|      1|    ret->type = XML_TEXT_NODE;
 1841|      1|    ret->doc = doc;
 1842|       |
 1843|      1|    ret->name = xmlStringText;
 1844|      1|    if (intern == NULL) {
  ------------------
  |  Branch (1844:9): [True: 1, False: 0]
  ------------------
 1845|      1|	ret->content = xmlStrndup(str, len);
 1846|      1|	if (ret->content == NULL) {
  ------------------
  |  Branch (1846:6): [True: 0, False: 1]
  ------------------
 1847|      0|	    xmlSAX2ErrMemory(ctxt);
 1848|      0|	    xmlFree(ret);
 1849|      0|	    return(NULL);
 1850|      0|	}
 1851|      1|    } else
 1852|      0|	ret->content = (xmlChar *) intern;
 1853|       |
 1854|      1|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1854:9): [True: 0, False: 1]
  |  Branch (1854:35): [True: 0, False: 0]
  ------------------
 1855|      0|	xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1856|      1|    return(ret);
 1857|      1|}
SAX2.c:xmlSAX2Text:
 2473|      1|{
 2474|      1|    xmlNodePtr lastChild;
 2475|      1|    xmlNodePtr parent;
 2476|       |
 2477|      1|    if (ctxt == NULL)
  ------------------
  |  Branch (2477:9): [True: 0, False: 1]
  ------------------
 2478|      0|        return;
 2479|       |
 2480|      1|    parent = ctxt->node;
 2481|      1|    if (parent == NULL)
  ------------------
  |  Branch (2481:9): [True: 0, False: 1]
  ------------------
 2482|      0|        return;
 2483|      1|    lastChild = parent->last;
 2484|       |
 2485|       |    /*
 2486|       |     * Try to merge with previous text node using size and capacity
 2487|       |     * stored in the parser context to avoid naive concatenation.
 2488|       |     *
 2489|       |     * Don't merge CDATA sections. In HTML mode, CDATA is used for
 2490|       |     * raw text which should be merged.
 2491|       |     */
 2492|      1|    if ((lastChild == NULL) ||
  ------------------
  |  Branch (2492:9): [True: 1, False: 0]
  ------------------
 2493|      0|        (lastChild->type != type) ||
  ------------------
  |  Branch (2493:9): [True: 0, False: 0]
  ------------------
 2494|      1|        ((!ctxt->html) && (type != XML_TEXT_NODE))) {
  ------------------
  |  Branch (2494:10): [True: 0, False: 0]
  |  Branch (2494:27): [True: 0, False: 0]
  ------------------
 2495|      1|        xmlNode *node;
 2496|       |
 2497|      1|        if (type == XML_TEXT_NODE)
  ------------------
  |  Branch (2497:13): [True: 1, False: 0]
  ------------------
 2498|      1|            node = xmlSAX2TextNode(ctxt, parent->doc, ch, len);
 2499|      0|        else
 2500|      0|            node = xmlNewCDataBlock(parent->doc, ch, len);
 2501|      1|	if (node == NULL) {
  ------------------
  |  Branch (2501:6): [True: 0, False: 1]
  ------------------
 2502|      0|	    xmlSAX2ErrMemory(ctxt);
 2503|      0|	    return;
 2504|      0|	}
 2505|       |
 2506|      1|        if (lastChild == NULL) {
  ------------------
  |  Branch (2506:13): [True: 1, False: 0]
  ------------------
 2507|      1|            parent->children = node;
 2508|      1|            parent->last = node;
 2509|      1|            node->parent = parent;
 2510|      1|        } else {
 2511|      0|            xmlSAX2AppendChild(ctxt, node);
 2512|      0|        }
 2513|       |
 2514|      1|        ctxt->nodelen = len;
 2515|      1|        ctxt->nodemem = len + 1;
 2516|      1|        lastChild = node;
 2517|      1|    } else {
 2518|      0|        xmlChar *content;
 2519|      0|        int oldSize, newSize, capacity;
 2520|      0|        int maxSize = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (2520:23): [True: 0, False: 0]
  ------------------
 2521|      0|                      XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|      0|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 2522|      0|                      XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|      0|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 2523|       |
 2524|      0|        content = lastChild->content;
 2525|      0|        oldSize = ctxt->nodelen;
 2526|      0|        capacity = ctxt->nodemem;
 2527|       |
 2528|       |        /* Shouldn't happen */
 2529|      0|        if ((content == NULL) || (capacity <= 0)) {
  ------------------
  |  Branch (2529:13): [True: 0, False: 0]
  |  Branch (2529:34): [True: 0, False: 0]
  ------------------
 2530|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 2531|      0|                        "xmlSAX2Text: no content");
 2532|      0|            return;
 2533|      0|        }
 2534|       |
 2535|      0|        if ((len > maxSize) || (oldSize > maxSize - len)) {
  ------------------
  |  Branch (2535:13): [True: 0, False: 0]
  |  Branch (2535:32): [True: 0, False: 0]
  ------------------
 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|      0|        newSize = oldSize + len;
 2542|       |
 2543|      0|        if (newSize >= capacity) {
  ------------------
  |  Branch (2543:13): [True: 0, False: 0]
  ------------------
 2544|      0|            if (newSize <= 20)
  ------------------
  |  Branch (2544:17): [True: 0, False: 0]
  ------------------
 2545|      0|                capacity = 40;
 2546|      0|            else
 2547|      0|                capacity = newSize > INT_MAX / 2 ? INT_MAX : newSize * 2;
  ------------------
  |  Branch (2547:28): [True: 0, False: 0]
  ------------------
 2548|       |
 2549|       |            /*
 2550|       |             * If the content was stored in properties or in
 2551|       |             * the dictionary, don't realloc.
 2552|       |             */
 2553|      0|            if ((content == (xmlChar *) &lastChild->properties) ||
  ------------------
  |  Branch (2553:17): [True: 0, False: 0]
  ------------------
 2554|      0|                ((ctxt->nodemem == oldSize + 1) &&
  ------------------
  |  Branch (2554:18): [True: 0, False: 0]
  ------------------
 2555|      0|                 (xmlDictOwns(ctxt->dict, content)))) {
  ------------------
  |  Branch (2555:18): [True: 0, False: 0]
  ------------------
 2556|      0|                xmlChar *newContent;
 2557|       |
 2558|      0|                newContent = xmlMalloc(capacity);
 2559|      0|                if (newContent == NULL) {
  ------------------
  |  Branch (2559:21): [True: 0, False: 0]
  ------------------
 2560|      0|                    xmlSAX2ErrMemory(ctxt);
 2561|      0|                    return;
 2562|      0|                }
 2563|       |
 2564|      0|                memcpy(newContent, content, oldSize);
 2565|      0|                lastChild->properties = NULL;
 2566|      0|                content = newContent;
 2567|      0|            } else {
 2568|      0|                content = xmlRealloc(content, capacity);
 2569|      0|                if (content == NULL) {
  ------------------
  |  Branch (2569:21): [True: 0, False: 0]
  ------------------
 2570|      0|                    xmlSAX2ErrMemory(ctxt);
 2571|      0|                    return;
 2572|      0|                }
 2573|      0|            }
 2574|       |
 2575|      0|            ctxt->nodemem = capacity;
 2576|      0|            lastChild->content = content;
 2577|      0|        }
 2578|       |
 2579|      0|        memcpy(&content[oldSize], ch, len);
 2580|      0|        content[newSize] = 0;
 2581|      0|        ctxt->nodelen = newSize;
 2582|      0|    }
 2583|       |
 2584|      1|    if ((lastChild != NULL) &&
  ------------------
  |  Branch (2584:9): [True: 1, False: 0]
  ------------------
 2585|      1|        (type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2585:9): [True: 1, False: 0]
  ------------------
 2586|      1|        (ctxt->input != NULL)) {
  ------------------
  |  Branch (2586:9): [True: 1, False: 0]
  ------------------
 2587|      1|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (2587:13): [True: 1, False: 0]
  ------------------
 2588|      1|            lastChild->line = ctxt->input->line;
 2589|      0|        else {
 2590|      0|            lastChild->line = USHRT_MAX;
 2591|      0|            if (ctxt->options & XML_PARSE_BIG_LINES)
  ------------------
  |  Branch (2591:17): [True: 0, False: 0]
  ------------------
 2592|      0|                lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
  ------------------
  |  |   59|      0|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 2593|      0|        }
 2594|      1|    }
 2595|      1|}

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

xmlC14NExecute:
 1819|      8|	 int with_comments, xmlOutputBuffer *buf) {
 1820|       |
 1821|      8|    xmlC14NCtxPtr ctx;
 1822|      8|    xmlC14NMode c14n_mode = XML_C14N_1_0;
 1823|      8|    int ret;
 1824|       |
 1825|      8|    if ((buf == NULL) || (doc == NULL)) {
  ------------------
  |  Branch (1825:9): [True: 0, False: 8]
  |  Branch (1825:26): [True: 0, False: 8]
  ------------------
 1826|      0|        xmlC14NErrParam(NULL);
 1827|      0|        return (-1);
 1828|      0|    }
 1829|       |
 1830|       |    /* for backward compatibility, we have to have "mode" as "int"
 1831|       |       and here we check that user gives valid value */
 1832|      8|    switch(mode) {
 1833|      0|    case XML_C14N_1_0:
  ------------------
  |  Branch (1833:5): [True: 0, False: 8]
  ------------------
 1834|      6|    case XML_C14N_EXCLUSIVE_1_0:
  ------------------
  |  Branch (1834:5): [True: 6, False: 2]
  ------------------
 1835|      8|    case XML_C14N_1_1:
  ------------------
  |  Branch (1835:5): [True: 2, False: 6]
  ------------------
 1836|      8|         c14n_mode = (xmlC14NMode)mode;
 1837|      8|         break;
 1838|      0|    default:
  ------------------
  |  Branch (1838:5): [True: 0, False: 8]
  ------------------
 1839|      0|        xmlC14NErrParam(NULL);
 1840|      0|        return (-1);
 1841|      8|    }
 1842|       |
 1843|       |    /*
 1844|       |     *  Validate the encoding output buffer encoding
 1845|       |     */
 1846|      8|    if (buf->encoder != NULL) {
  ------------------
  |  Branch (1846:9): [True: 0, False: 8]
  ------------------
 1847|      0|        xmlC14NErr(NULL, (xmlNodePtr) doc, XML_C14N_REQUIRES_UTF8,
 1848|      0|"xmlC14NExecute: output buffer encoder != NULL but C14N requires UTF8 output\n");
 1849|      0|        return (-1);
 1850|      0|    }
 1851|       |
 1852|      8|    ctx = xmlC14NNewCtx(doc, is_visible_callback, user_data,
 1853|      8|	            c14n_mode, inclusive_ns_prefixes,
 1854|      8|                    with_comments, buf);
 1855|      8|    if (ctx == NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 8]
  ------------------
 1856|      0|        xmlC14NErr(NULL, (xmlNodePtr) doc, XML_C14N_CREATE_CTXT,
 1857|      0|		   "xmlC14NExecute: unable to create C14N context\n");
 1858|      0|        return (-1);
 1859|      0|    }
 1860|       |
 1861|       |
 1862|       |
 1863|       |    /*
 1864|       |     * Root Node
 1865|       |     * The root node is the parent of the top-level document element. The
 1866|       |     * result of processing each of its child nodes that is in the node-set
 1867|       |     * in document order. The root node does not generate a byte order mark,
 1868|       |     * XML declaration, nor anything from within the document type
 1869|       |     * declaration.
 1870|       |     */
 1871|      8|    if (doc->children != NULL) {
  ------------------
  |  Branch (1871:9): [True: 8, False: 0]
  ------------------
 1872|      8|        ret = xmlC14NProcessNodeList(ctx, doc->children);
 1873|      8|        if (ret < 0) {
  ------------------
  |  Branch (1873:13): [True: 0, False: 8]
  ------------------
 1874|      0|            xmlC14NFreeCtx(ctx);
 1875|      0|            return (-1);
 1876|      0|        }
 1877|      8|    }
 1878|       |
 1879|       |    /*
 1880|       |     * Flush buffer to get number of bytes written
 1881|       |     */
 1882|      8|    ret = xmlOutputBufferFlush(buf);
 1883|      8|    if (ret < 0) {
  ------------------
  |  Branch (1883:9): [True: 0, False: 8]
  ------------------
 1884|      0|        xmlC14NErr(ctx, NULL, buf->error, "flushing output buffer");
 1885|      0|        xmlC14NFreeCtx(ctx);
 1886|      0|        return (-1);
 1887|      0|    }
 1888|       |
 1889|       |    /*
 1890|       |     * Cleanup
 1891|       |     */
 1892|      8|    xmlC14NFreeCtx(ctx);
 1893|      8|    return (ret);
 1894|      8|}
xmlC14NDocSaveTo:
 1918|      8|                 int with_comments, xmlOutputBuffer *buf) {
 1919|      8|    return(xmlC14NExecute(doc,
 1920|      8|			xmlC14NIsNodeInNodeset,
 1921|      8|			nodes,
 1922|      8|			mode,
 1923|      8|			inclusive_ns_prefixes,
 1924|      8|			with_comments,
 1925|      8|			buf));
 1926|      8|}
xmlC14NDocDumpMemory:
 1952|      8|{
 1953|      8|    int ret;
 1954|      8|    xmlOutputBufferPtr buf;
 1955|       |
 1956|      8|    if (doc_txt_ptr == NULL) {
  ------------------
  |  Branch (1956:9): [True: 0, False: 8]
  ------------------
 1957|      0|        xmlC14NErrParam(NULL);
 1958|      0|        return (-1);
 1959|      0|    }
 1960|       |
 1961|      8|    *doc_txt_ptr = NULL;
 1962|       |
 1963|       |    /*
 1964|       |     * create memory buffer with UTF8 (default) encoding
 1965|       |     */
 1966|      8|    buf = xmlAllocOutputBuffer(NULL);
 1967|      8|    if (buf == NULL) {
  ------------------
  |  Branch (1967:9): [True: 0, False: 8]
  ------------------
 1968|      0|        xmlC14NErrMemory(NULL);
 1969|      0|        return (-1);
 1970|      0|    }
 1971|       |
 1972|       |    /*
 1973|       |     * canonize document and write to buffer
 1974|       |     */
 1975|      8|    ret = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes,
 1976|      8|                           with_comments, buf);
 1977|      8|    if (ret < 0) {
  ------------------
  |  Branch (1977:9): [True: 0, False: 8]
  ------------------
 1978|      0|        (void) xmlOutputBufferClose(buf);
 1979|      0|        return (-1);
 1980|      0|    }
 1981|       |
 1982|      8|    ret = xmlBufUse(buf->buffer);
 1983|      8|    if (ret >= 0) {
  ------------------
  |  Branch (1983:9): [True: 8, False: 0]
  ------------------
 1984|      8|        *doc_txt_ptr = xmlStrndup(xmlBufContent(buf->buffer), ret);
 1985|      8|    }
 1986|      8|    (void) xmlOutputBufferClose(buf);
 1987|       |
 1988|      8|    if ((*doc_txt_ptr == NULL) && (ret >= 0)) {
  ------------------
  |  Branch (1988:9): [True: 0, False: 8]
  |  Branch (1988:35): [True: 0, False: 0]
  ------------------
 1989|      0|        xmlC14NErrMemory(NULL);
 1990|      0|        return (-1);
 1991|      0|    }
 1992|      8|    return (ret);
 1993|      8|}
c14n.c:xmlC14NNewCtx:
 1738|      8|{
 1739|      8|    xmlC14NCtxPtr ctx = NULL;
 1740|       |
 1741|      8|    if ((doc == NULL) || (buf == NULL)) {
  ------------------
  |  Branch (1741:9): [True: 0, False: 8]
  |  Branch (1741:26): [True: 0, False: 8]
  ------------------
 1742|      0|        xmlC14NErrParam(ctx);
 1743|      0|        return (NULL);
 1744|      0|    }
 1745|       |
 1746|       |    /*
 1747|       |     *  Validate the encoding output buffer encoding
 1748|       |     */
 1749|      8|    if (buf->encoder != NULL) {
  ------------------
  |  Branch (1749:9): [True: 0, False: 8]
  ------------------
 1750|      0|        xmlC14NErr(ctx, (xmlNodePtr) doc, XML_C14N_REQUIRES_UTF8,
 1751|      0|"xmlC14NNewCtx: output buffer encoder != NULL but C14N requires UTF8 output\n");
 1752|      0|        return (NULL);
 1753|      0|    }
 1754|       |
 1755|       |    /*
 1756|       |     * Allocate a new xmlC14NCtx and fill the fields.
 1757|       |     */
 1758|      8|    ctx = (xmlC14NCtxPtr) xmlMalloc(sizeof(xmlC14NCtx));
 1759|      8|    if (ctx == NULL) {
  ------------------
  |  Branch (1759:9): [True: 0, False: 8]
  ------------------
 1760|      0|	xmlC14NErrMemory(ctx);
 1761|      0|        return (NULL);
 1762|      0|    }
 1763|      8|    memset(ctx, 0, sizeof(xmlC14NCtx));
 1764|       |
 1765|       |    /*
 1766|       |     * initialize C14N context
 1767|       |     */
 1768|      8|    ctx->doc = doc;
 1769|      8|    ctx->with_comments = with_comments;
 1770|      8|    ctx->is_visible_callback = is_visible_callback;
 1771|      8|    ctx->user_data = user_data;
 1772|      8|    ctx->buf = buf;
 1773|      8|    ctx->parent_is_doc = 1;
 1774|      8|    ctx->pos = XMLC14N_BEFORE_DOCUMENT_ELEMENT;
 1775|      8|    ctx->ns_rendered = xmlC14NVisibleNsStackCreate();
 1776|       |
 1777|      8|    if(ctx->ns_rendered == NULL) {
  ------------------
  |  Branch (1777:8): [True: 0, False: 8]
  ------------------
 1778|      0|        xmlC14NErrMemory(ctx);
 1779|      0|	xmlC14NFreeCtx(ctx);
 1780|      0|        return (NULL);
 1781|      0|    }
 1782|       |
 1783|       |    /*
 1784|       |     * Set "mode" flag and remember list of inclusive prefixes
 1785|       |     * for exclusive c14n
 1786|       |     */
 1787|      8|    ctx->mode = mode;
 1788|      8|    if(xmlC14NIsExclusive(ctx)) {
  ------------------
  |  |  123|      8|    ( (ctx)->mode == XML_C14N_EXCLUSIVE_1_0 )
  |  |  ------------------
  |  |  |  Branch (123:5): [True: 6, False: 2]
  |  |  ------------------
  ------------------
 1789|      6|        ctx->inclusive_ns_prefixes = inclusive_ns_prefixes;
 1790|      6|    }
 1791|       |
 1792|      8|    return (ctx);
 1793|      8|}
c14n.c:xmlC14NVisibleNsStackCreate:
  272|      8|xmlC14NVisibleNsStackCreate(void) {
  273|      8|    xmlC14NVisibleNsStackPtr ret;
  274|       |
  275|      8|    ret = (xmlC14NVisibleNsStackPtr) xmlMalloc(sizeof(xmlC14NVisibleNsStack));
  276|      8|    if (ret == NULL)
  ------------------
  |  Branch (276:9): [True: 0, False: 8]
  ------------------
  277|      0|	return(NULL);
  278|      8|    memset(ret, 0, sizeof(xmlC14NVisibleNsStack));
  279|      8|    return(ret);
  280|      8|}
c14n.c:xmlC14NProcessNodeList:
 1679|     16|{
 1680|     16|    int ret;
 1681|       |
 1682|     16|    if (ctx == NULL) {
  ------------------
  |  Branch (1682:9): [True: 0, False: 16]
  ------------------
 1683|      0|        xmlC14NErrParam(ctx);
 1684|      0|        return (-1);
 1685|      0|    }
 1686|       |
 1687|     32|    for (ret = 0; cur != NULL && ret >= 0; cur = cur->next) {
  ------------------
  |  Branch (1687:19): [True: 16, False: 16]
  |  Branch (1687:34): [True: 16, False: 0]
  ------------------
 1688|     16|        ret = xmlC14NProcessNode(ctx, cur);
 1689|     16|    }
 1690|     16|    return (ret);
 1691|     16|}
c14n.c:xmlC14NProcessNode:
 1493|     16|{
 1494|     16|    int ret = 0;
 1495|     16|    int visible;
 1496|       |
 1497|     16|    if ((ctx == NULL) || (cur == NULL)) {
  ------------------
  |  Branch (1497:9): [True: 0, False: 16]
  |  Branch (1497:26): [True: 0, False: 16]
  ------------------
 1498|      0|        xmlC14NErrParam(ctx);
 1499|      0|        return (-1);
 1500|      0|    }
 1501|       |
 1502|     16|    visible = xmlC14NIsVisible(ctx, cur, cur->parent);
  ------------------
  |  |  118|     16|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:7): [True: 16, False: 0]
  |  |  ------------------
  |  |  119|     16|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|     16|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
 1503|     16|    switch (cur->type) {
 1504|      8|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1504:9): [True: 8, False: 8]
  ------------------
 1505|      8|            ret = xmlC14NProcessElementNode(ctx, cur, visible);
 1506|      8|            break;
 1507|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1507:9): [True: 0, False: 16]
  ------------------
 1508|      8|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1508:9): [True: 8, False: 8]
  ------------------
 1509|       |            /*
 1510|       |             * Text Nodes
 1511|       |             * the string value, except all ampersands are replaced
 1512|       |             * by &amp;, all open angle brackets (<) are replaced by &lt;, all closing
 1513|       |             * angle brackets (>) are replaced by &gt;, and all #xD characters are
 1514|       |             * replaced by &#xD;.
 1515|       |             */
 1516|       |            /* cdata sections are processed as text nodes */
 1517|       |            /* todo: verify that cdata sections are included in XPath nodes set */
 1518|      8|            if ((visible) && (cur->content != NULL)) {
  ------------------
  |  Branch (1518:17): [True: 8, False: 0]
  |  Branch (1518:30): [True: 8, False: 0]
  ------------------
 1519|      8|                xmlChar *buffer;
 1520|       |
 1521|      8|                buffer = xmlC11NNormalizeText(cur->content);
  ------------------
  |  |  115|      8|    xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_TEXT)
  ------------------
 1522|      8|                if (buffer != NULL) {
  ------------------
  |  Branch (1522:21): [True: 8, False: 0]
  ------------------
 1523|      8|                    xmlOutputBufferWriteString(ctx->buf,
 1524|      8|                                               (const char *) buffer);
 1525|      8|                    xmlFree(buffer);
 1526|      8|                } else {
 1527|      0|                    xmlC14NErrMemory(ctx);
 1528|      0|                    return (-1);
 1529|      0|                }
 1530|      8|            }
 1531|      8|            break;
 1532|      8|        case XML_PI_NODE:
  ------------------
  |  Branch (1532:9): [True: 0, False: 16]
  ------------------
 1533|       |            /*
 1534|       |             * Processing Instruction (PI) Nodes-
 1535|       |             * The opening PI symbol (<?), the PI target name of the node,
 1536|       |             * a leading space and the string value if it is not empty, and
 1537|       |             * the closing PI symbol (?>). If the string value is empty,
 1538|       |             * then the leading space is not added. Also, a trailing #xA is
 1539|       |             * rendered after the closing PI symbol for PI children of the
 1540|       |             * root node with a lesser document order than the document
 1541|       |             * element, and a leading #xA is rendered before the opening PI
 1542|       |             * symbol of PI children of the root node with a greater document
 1543|       |             * order than the document element.
 1544|       |             */
 1545|      0|            if (visible) {
  ------------------
  |  Branch (1545:17): [True: 0, False: 0]
  ------------------
 1546|      0|                if (ctx->pos == XMLC14N_AFTER_DOCUMENT_ELEMENT) {
  ------------------
  |  Branch (1546:21): [True: 0, False: 0]
  ------------------
 1547|      0|                    xmlOutputBufferWriteString(ctx->buf, "\x0A<?");
 1548|      0|                } else {
 1549|      0|                    xmlOutputBufferWriteString(ctx->buf, "<?");
 1550|      0|                }
 1551|       |
 1552|      0|                xmlOutputBufferWriteString(ctx->buf,
 1553|      0|                                           (const char *) cur->name);
 1554|      0|                if ((cur->content != NULL) && (*(cur->content) != '\0')) {
  ------------------
  |  Branch (1554:21): [True: 0, False: 0]
  |  Branch (1554:47): [True: 0, False: 0]
  ------------------
 1555|      0|                    xmlChar *buffer;
 1556|       |
 1557|      0|                    xmlOutputBufferWriteString(ctx->buf, " ");
 1558|       |
 1559|       |                    /* todo: do we need to normalize pi? */
 1560|      0|                    buffer = xmlC11NNormalizePI(cur->content);
  ------------------
  |  |  113|      0|    xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_PI)
  ------------------
 1561|      0|                    if (buffer != NULL) {
  ------------------
  |  Branch (1561:25): [True: 0, False: 0]
  ------------------
 1562|      0|                        xmlOutputBufferWriteString(ctx->buf,
 1563|      0|                                                   (const char *) buffer);
 1564|      0|                        xmlFree(buffer);
 1565|      0|                    } else {
 1566|      0|                        xmlC14NErrMemory(ctx);
 1567|      0|                        return (-1);
 1568|      0|                    }
 1569|      0|                }
 1570|       |
 1571|      0|                if (ctx->pos == XMLC14N_BEFORE_DOCUMENT_ELEMENT) {
  ------------------
  |  Branch (1571:21): [True: 0, False: 0]
  ------------------
 1572|      0|                    xmlOutputBufferWriteString(ctx->buf, "?>\x0A");
 1573|      0|                } else {
 1574|      0|                    xmlOutputBufferWriteString(ctx->buf, "?>");
 1575|      0|                }
 1576|      0|            }
 1577|      0|            break;
 1578|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1578:9): [True: 0, False: 16]
  ------------------
 1579|       |            /*
 1580|       |             * Comment Nodes
 1581|       |             * Nothing if generating canonical XML without  comments. For
 1582|       |             * canonical XML with comments, generate the opening comment
 1583|       |             * symbol (<!--), the string value of the node, and the
 1584|       |             * closing comment symbol (-->). Also, a trailing #xA is rendered
 1585|       |             * after the closing comment symbol for comment children of the
 1586|       |             * root node with a lesser document order than the document
 1587|       |             * element, and a leading #xA is rendered before the opening
 1588|       |             * comment symbol of comment children of the root node with a
 1589|       |             * greater document order than the document element. (Comment
 1590|       |             * children of the root node represent comments outside of the
 1591|       |             * top-level document element and outside of the document type
 1592|       |             * declaration).
 1593|       |             */
 1594|      0|            if (visible && ctx->with_comments) {
  ------------------
  |  Branch (1594:17): [True: 0, False: 0]
  |  Branch (1594:28): [True: 0, False: 0]
  ------------------
 1595|      0|                if (ctx->pos == XMLC14N_AFTER_DOCUMENT_ELEMENT) {
  ------------------
  |  Branch (1595:21): [True: 0, False: 0]
  ------------------
 1596|      0|                    xmlOutputBufferWriteString(ctx->buf, "\x0A<!--");
 1597|      0|                } else {
 1598|      0|                    xmlOutputBufferWriteString(ctx->buf, "<!--");
 1599|      0|                }
 1600|       |
 1601|      0|                if (cur->content != NULL) {
  ------------------
  |  Branch (1601:21): [True: 0, False: 0]
  ------------------
 1602|      0|                    xmlChar *buffer;
 1603|       |
 1604|       |                    /* todo: do we need to normalize comment? */
 1605|      0|                    buffer = xmlC11NNormalizeComment(cur->content);
  ------------------
  |  |  111|      0|    xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_COMMENT)
  ------------------
 1606|      0|                    if (buffer != NULL) {
  ------------------
  |  Branch (1606:25): [True: 0, False: 0]
  ------------------
 1607|      0|                        xmlOutputBufferWriteString(ctx->buf,
 1608|      0|                                                   (const char *) buffer);
 1609|      0|                        xmlFree(buffer);
 1610|      0|                    } else {
 1611|      0|                        xmlC14NErrMemory(ctx);
 1612|      0|                        return (-1);
 1613|      0|                    }
 1614|      0|                }
 1615|       |
 1616|      0|                if (ctx->pos == XMLC14N_BEFORE_DOCUMENT_ELEMENT) {
  ------------------
  |  Branch (1616:21): [True: 0, False: 0]
  ------------------
 1617|      0|                    xmlOutputBufferWriteString(ctx->buf, "-->\x0A");
 1618|      0|                } else {
 1619|      0|                    xmlOutputBufferWriteString(ctx->buf, "-->");
 1620|      0|                }
 1621|      0|            }
 1622|      0|            break;
 1623|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1623:9): [True: 0, False: 16]
  ------------------
 1624|      0|        case XML_DOCUMENT_FRAG_NODE:   /* should be processed as document? */
  ------------------
  |  Branch (1624:9): [True: 0, False: 16]
  ------------------
 1625|      0|#ifdef LIBXML_HTML_ENABLED
 1626|      0|        case XML_HTML_DOCUMENT_NODE:   /* should be processed as document? */
  ------------------
  |  Branch (1626:9): [True: 0, False: 16]
  ------------------
 1627|      0|#endif
 1628|      0|            if (cur->children != NULL) {
  ------------------
  |  Branch (1628:17): [True: 0, False: 0]
  ------------------
 1629|      0|                ctx->pos = XMLC14N_BEFORE_DOCUMENT_ELEMENT;
 1630|      0|                ctx->parent_is_doc = 1;
 1631|      0|                ret = xmlC14NProcessNodeList(ctx, cur->children);
 1632|      0|            }
 1633|      0|            break;
 1634|       |
 1635|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1635:9): [True: 0, False: 16]
  ------------------
 1636|      0|            xmlC14NErrInvalidNode(ctx, "XML_ATTRIBUTE_NODE", "processing node");
 1637|      0|            return (-1);
 1638|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1638:9): [True: 0, False: 16]
  ------------------
 1639|      0|            xmlC14NErrInvalidNode(ctx, "XML_NAMESPACE_DECL", "processing node");
 1640|      0|            return (-1);
 1641|      0|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1641:9): [True: 0, False: 16]
  ------------------
 1642|      0|            xmlC14NErrInvalidNode(ctx, "XML_ENTITY_REF_NODE", "processing node");
 1643|      0|            return (-1);
 1644|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (1644:9): [True: 0, False: 16]
  ------------------
 1645|      0|            xmlC14NErrInvalidNode(ctx, "XML_ENTITY_NODE", "processing node");
 1646|      0|            return (-1);
 1647|       |
 1648|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (1648:9): [True: 0, False: 16]
  ------------------
 1649|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (1649:9): [True: 0, False: 16]
  ------------------
 1650|      0|        case XML_DTD_NODE:
  ------------------
  |  Branch (1650:9): [True: 0, False: 16]
  ------------------
 1651|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (1651:9): [True: 0, False: 16]
  ------------------
 1652|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1652:9): [True: 0, False: 16]
  ------------------
 1653|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1653:9): [True: 0, False: 16]
  ------------------
 1654|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 1655|      0|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (1655:9): [True: 0, False: 16]
  ------------------
 1656|      0|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (1656:9): [True: 0, False: 16]
  ------------------
 1657|      0|#endif
 1658|       |            /*
 1659|       |             * should be ignored according to "W3C Canonical XML"
 1660|       |             */
 1661|      0|            break;
 1662|      0|        default:
  ------------------
  |  Branch (1662:9): [True: 0, False: 16]
  ------------------
 1663|      0|            xmlC14NErrUnknownNode(ctx, cur->type, "processing node");
 1664|      0|            return (-1);
 1665|     16|    }
 1666|       |
 1667|     16|    return (ret);
 1668|     16|}
c14n.c:xmlC14NProcessElementNode:
 1396|      8|{
 1397|      8|    int ret;
 1398|      8|    xmlC14NVisibleNsStack state;
 1399|      8|    int parent_is_doc = 0;
 1400|       |
 1401|      8|    if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1401:9): [True: 0, False: 8]
  |  Branch (1401:26): [True: 0, False: 8]
  |  Branch (1401:43): [True: 0, False: 8]
  ------------------
 1402|      0|        xmlC14NErrParam(ctx);
 1403|      0|        return (-1);
 1404|      0|    }
 1405|       |
 1406|       |    /*
 1407|       |     * Check relative relative namespaces:
 1408|       |     * implementations of XML canonicalization MUST report an operation
 1409|       |     * failure on documents containing relative namespace URIs.
 1410|       |     */
 1411|      8|    if (xmlC14NCheckForRelativeNamespaces(ctx, cur) < 0)
  ------------------
  |  Branch (1411:9): [True: 0, False: 8]
  ------------------
 1412|      0|        return (-1);
 1413|       |
 1414|       |    /*
 1415|       |     * Save ns_rendered stack position
 1416|       |     */
 1417|      8|    memset(&state, 0, sizeof(state));
 1418|      8|    xmlC14NVisibleNsStackSave(ctx->ns_rendered, &state);
 1419|       |
 1420|      8|    if (visible) {
  ------------------
  |  Branch (1420:9): [True: 8, False: 0]
  ------------------
 1421|      8|        if (ctx->parent_is_doc) {
  ------------------
  |  Branch (1421:13): [True: 8, False: 0]
  ------------------
 1422|       |	    /* save this flag into the stack */
 1423|      8|	    parent_is_doc = ctx->parent_is_doc;
 1424|      8|	    ctx->parent_is_doc = 0;
 1425|      8|            ctx->pos = XMLC14N_INSIDE_DOCUMENT_ELEMENT;
 1426|      8|        }
 1427|      8|        xmlOutputBufferWriteString(ctx->buf, "<");
 1428|       |
 1429|      8|        if ((cur->ns != NULL) && (xmlStrlen(cur->ns->prefix) > 0)) {
  ------------------
  |  Branch (1429:13): [True: 0, False: 8]
  |  Branch (1429:34): [True: 0, False: 0]
  ------------------
 1430|      0|            xmlOutputBufferWriteString(ctx->buf,
 1431|      0|                                       (const char *) cur->ns->prefix);
 1432|      0|            xmlOutputBufferWriteString(ctx->buf, ":");
 1433|      0|        }
 1434|      8|        xmlOutputBufferWriteString(ctx->buf, (const char *) cur->name);
 1435|      8|    }
 1436|       |
 1437|      8|    if (!xmlC14NIsExclusive(ctx)) {
  ------------------
  |  |  123|      8|    ( (ctx)->mode == XML_C14N_EXCLUSIVE_1_0 )
  ------------------
  |  Branch (1437:9): [True: 2, False: 6]
  ------------------
 1438|      2|        ret = xmlC14NProcessNamespacesAxis(ctx, cur, visible);
 1439|      6|    } else {
 1440|      6|        ret = xmlExcC14NProcessNamespacesAxis(ctx, cur, visible);
 1441|      6|    }
 1442|      8|    if (ret < 0)
  ------------------
  |  Branch (1442:9): [True: 0, False: 8]
  ------------------
 1443|      0|        return (-1);
 1444|       |    /* todo: shouldn't this go to "visible only"? */
 1445|      8|    if(visible) {
  ------------------
  |  Branch (1445:8): [True: 8, False: 0]
  ------------------
 1446|      8|	xmlC14NVisibleNsStackShift(ctx->ns_rendered);
 1447|      8|    }
 1448|       |
 1449|      8|    ret = xmlC14NProcessAttrsAxis(ctx, cur, visible);
 1450|      8|    if (ret < 0)
  ------------------
  |  Branch (1450:9): [True: 0, False: 8]
  ------------------
 1451|      0|	return (-1);
 1452|       |
 1453|      8|    if (visible) {
  ------------------
  |  Branch (1453:9): [True: 8, False: 0]
  ------------------
 1454|      8|        xmlOutputBufferWriteString(ctx->buf, ">");
 1455|      8|    }
 1456|      8|    if (cur->children != NULL) {
  ------------------
  |  Branch (1456:9): [True: 8, False: 0]
  ------------------
 1457|      8|        ret = xmlC14NProcessNodeList(ctx, cur->children);
 1458|      8|        if (ret < 0)
  ------------------
  |  Branch (1458:13): [True: 0, False: 8]
  ------------------
 1459|      0|            return (-1);
 1460|      8|    }
 1461|      8|    if (visible) {
  ------------------
  |  Branch (1461:9): [True: 8, False: 0]
  ------------------
 1462|      8|        xmlOutputBufferWriteString(ctx->buf, "</");
 1463|      8|        if ((cur->ns != NULL) && (xmlStrlen(cur->ns->prefix) > 0)) {
  ------------------
  |  Branch (1463:13): [True: 0, False: 8]
  |  Branch (1463:34): [True: 0, False: 0]
  ------------------
 1464|      0|            xmlOutputBufferWriteString(ctx->buf,
 1465|      0|                                       (const char *) cur->ns->prefix);
 1466|      0|            xmlOutputBufferWriteString(ctx->buf, ":");
 1467|      0|        }
 1468|      8|        xmlOutputBufferWriteString(ctx->buf, (const char *) cur->name);
 1469|      8|        xmlOutputBufferWriteString(ctx->buf, ">");
 1470|      8|        if (parent_is_doc) {
  ------------------
  |  Branch (1470:13): [True: 8, False: 0]
  ------------------
 1471|       |	    /* restore this flag from the stack for next node */
 1472|      8|            ctx->parent_is_doc = parent_is_doc;
 1473|      8|	    ctx->pos = XMLC14N_AFTER_DOCUMENT_ELEMENT;
 1474|      8|        }
 1475|      8|    }
 1476|       |
 1477|       |    /*
 1478|       |     * Restore ns_rendered stack position
 1479|       |     */
 1480|      8|    xmlC14NVisibleNsStackRestore(ctx->ns_rendered, &state);
 1481|      8|    return (0);
 1482|      8|}
c14n.c:xmlC14NCheckForRelativeNamespaces:
 1339|      8|{
 1340|      8|    xmlNsPtr ns;
 1341|       |
 1342|      8|    if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1342:9): [True: 0, False: 8]
  |  Branch (1342:26): [True: 0, False: 8]
  |  Branch (1342:43): [True: 0, False: 8]
  ------------------
 1343|      0|        xmlC14NErrParam(ctx);
 1344|      0|        return (-1);
 1345|      0|    }
 1346|       |
 1347|      8|    ns = cur->nsDef;
 1348|      8|    while (ns != NULL) {
  ------------------
  |  Branch (1348:12): [True: 0, False: 8]
  ------------------
 1349|      0|        if (xmlStrlen(ns->href) > 0) {
  ------------------
  |  Branch (1349:13): [True: 0, False: 0]
  ------------------
 1350|      0|            xmlURIPtr uri;
 1351|      0|            int code;
 1352|       |
 1353|      0|            code = xmlParseURISafe((const char *) ns->href, &uri);
 1354|      0|            if (uri == NULL) {
  ------------------
  |  Branch (1354:17): [True: 0, False: 0]
  ------------------
 1355|      0|                if (code < 0)
  ------------------
  |  Branch (1355:21): [True: 0, False: 0]
  ------------------
 1356|      0|                    xmlC14NErrMemory(ctx);
 1357|      0|                else
 1358|      0|                    xmlC14NErr(ctx, cur, XML_ERR_INVALID_URI,
 1359|      0|                               "parsing namespace uri");
 1360|      0|                return (-1);
 1361|      0|            }
 1362|      0|            if (xmlStrlen((const xmlChar *) uri->scheme) == 0) {
  ------------------
  |  Branch (1362:17): [True: 0, False: 0]
  ------------------
 1363|      0|                xmlC14NErrRelativeNamespace(ctx, uri->scheme);
 1364|      0|                xmlFreeURI(uri);
 1365|      0|                return (-1);
 1366|      0|            }
 1367|      0|            xmlFreeURI(uri);
 1368|      0|        }
 1369|      0|        ns = ns->next;
 1370|      0|    }
 1371|      8|    return (0);
 1372|      8|}
c14n.c:xmlC14NVisibleNsStackSave:
  340|      8|xmlC14NVisibleNsStackSave(xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state) {
  341|      8|    if((cur == NULL) || (state == NULL)) {
  ------------------
  |  Branch (341:8): [True: 0, False: 8]
  |  Branch (341:25): [True: 0, False: 8]
  ------------------
  342|      0|        xmlC14NErrParam(NULL);
  343|      0|	return;
  344|      0|    }
  345|       |
  346|      8|    state->nsCurEnd = cur->nsCurEnd;
  347|      8|    state->nsPrevStart = cur->nsPrevStart;
  348|      8|    state->nsPrevEnd = cur->nsPrevEnd;
  349|      8|}
c14n.c:xmlC14NProcessNamespacesAxis:
  581|      2|{
  582|      2|    xmlNodePtr n;
  583|      2|    xmlNsPtr ns, tmp;
  584|      2|    xmlListPtr list;
  585|      2|    int already_rendered;
  586|      2|    int has_empty_ns = 0;
  587|       |
  588|      2|    if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (588:9): [True: 0, False: 2]
  |  Branch (588:26): [True: 0, False: 2]
  |  Branch (588:43): [True: 0, False: 2]
  ------------------
  589|      0|        xmlC14NErrParam(ctx);
  590|      0|        return (-1);
  591|      0|    }
  592|       |
  593|       |    /*
  594|       |     * Create a sorted list to store element namespaces
  595|       |     */
  596|      2|    list = xmlListCreate(NULL, xmlC14NNsCompare);
  597|      2|    if (list == NULL) {
  ------------------
  |  Branch (597:9): [True: 0, False: 2]
  ------------------
  598|      0|        xmlC14NErrMemory(ctx);
  599|      0|        return (-1);
  600|      0|    }
  601|       |
  602|       |    /* check all namespaces */
  603|      4|    for(n = cur; n != NULL && n->type == XML_ELEMENT_NODE; n = n->parent) {
  ------------------
  |  Branch (603:18): [True: 4, False: 0]
  |  Branch (603:31): [True: 2, False: 2]
  ------------------
  604|      2|	for(ns = n->nsDef; ns != NULL; ns = ns->next) {
  ------------------
  |  Branch (604:21): [True: 0, False: 2]
  ------------------
  605|      0|	    tmp = xmlSearchNs(cur->doc, cur, ns->prefix);
  606|       |
  607|      0|	    if((tmp == ns) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) {
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:6): [True: 0, False: 0]
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
  |  Branch (607:9): [True: 0, False: 0]
  |  Branch (607:24): [True: 0, False: 0]
  ------------------
  608|      0|		already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns);
  609|      0|		if(visible) {
  ------------------
  |  Branch (609:6): [True: 0, False: 0]
  ------------------
  610|      0|	            if (xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur) < 0) {
  ------------------
  |  Branch (610:18): [True: 0, False: 0]
  ------------------
  611|      0|                        xmlC14NErrMemory(ctx);
  612|      0|                        goto error;
  613|      0|                    }
  614|      0|		}
  615|      0|		if(!already_rendered) {
  ------------------
  |  Branch (615:6): [True: 0, False: 0]
  ------------------
  616|      0|		    xmlListInsert(list, ns);
  617|      0|		}
  618|      0|		if(xmlStrlen(ns->prefix) == 0) {
  ------------------
  |  Branch (618:6): [True: 0, False: 0]
  ------------------
  619|      0|		    has_empty_ns = 1;
  620|      0|		}
  621|      0|	    }
  622|      0|	}
  623|      2|    }
  624|       |
  625|       |    /**
  626|       |     * if the first node is not the default namespace node (a node with no
  627|       |     * namespace URI and no local name), then generate a space followed by
  628|       |     * xmlns="" if and only if the following conditions are met:
  629|       |     *  - the element E that owns the axis is in the node-set
  630|       |     *  - the nearest ancestor element of E in the node-set has a default
  631|       |     *     namespace node in the node-set (default namespace nodes always
  632|       |     *     have non-empty values in XPath)
  633|       |     */
  634|      2|    if(visible && !has_empty_ns) {
  ------------------
  |  Branch (634:8): [True: 2, False: 0]
  |  Branch (634:19): [True: 2, False: 0]
  ------------------
  635|      2|        xmlNs ns_default;
  636|       |
  637|      2|        memset(&ns_default, 0, sizeof(ns_default));
  638|      2|        if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) {
  ------------------
  |  Branch (638:12): [True: 0, False: 2]
  ------------------
  639|      0|	    xmlC14NPrintNamespaces(&ns_default, ctx);
  640|      0|	}
  641|      2|    }
  642|       |
  643|       |
  644|       |    /*
  645|       |     * print out all elements from list
  646|       |     */
  647|      2|    xmlListWalk(list, xmlC14NPrintNamespacesWalker, (void *) ctx);
  648|       |
  649|       |    /*
  650|       |     * Cleanup
  651|       |     */
  652|      2|error:
  653|      2|    xmlListDelete(list);
  654|      2|    return (0);
  655|      2|}
c14n.c:xmlC14NVisibleNsStackFind:
  392|      2|{
  393|      2|    int i;
  394|      2|    const xmlChar *prefix;
  395|      2|    const xmlChar *href;
  396|      2|    int has_empty_ns;
  397|       |
  398|      2|    if(cur == NULL) {
  ------------------
  |  Branch (398:8): [True: 0, False: 2]
  ------------------
  399|      0|        xmlC14NErrParam(NULL);
  400|      0|        return (0);
  401|      0|    }
  402|       |
  403|       |    /*
  404|       |     * if the default namespace xmlns="" is not defined yet then
  405|       |     * we do not want to print it out
  406|       |     */
  407|      2|    prefix = ((ns == NULL) || (ns->prefix == NULL)) ? BAD_CAST "" : ns->prefix;
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (407:15): [True: 0, False: 2]
  |  Branch (407:31): [True: 2, False: 0]
  ------------------
  408|      2|    href = ((ns == NULL) || (ns->href == NULL)) ? BAD_CAST "" : ns->href;
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (408:13): [True: 0, False: 2]
  |  Branch (408:29): [True: 2, False: 0]
  ------------------
  409|      2|    has_empty_ns = (xmlC14NStrEqual(prefix, NULL) && xmlC14NStrEqual(href, NULL));
  ------------------
  |  Branch (409:21): [True: 2, False: 0]
  |  Branch (409:54): [True: 2, False: 0]
  ------------------
  410|       |
  411|      2|    if (cur->nsTab != NULL) {
  ------------------
  |  Branch (411:9): [True: 0, False: 2]
  ------------------
  412|      0|	int start = (has_empty_ns) ? 0 : cur->nsPrevStart;
  ------------------
  |  Branch (412:14): [True: 0, False: 0]
  ------------------
  413|      0|        for (i = cur->nsCurEnd - 1; i >= start; --i) {
  ------------------
  |  Branch (413:37): [True: 0, False: 0]
  ------------------
  414|      0|            xmlNsPtr ns1 = cur->nsTab[i];
  415|       |
  416|      0|	    if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) {
  ------------------
  |  Branch (416:9): [True: 0, False: 0]
  |  Branch (416:33): [True: 0, False: 0]
  ------------------
  417|      0|		return(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL));
  ------------------
  |  Branch (417:32): [True: 0, False: 0]
  ------------------
  418|      0|	    }
  419|      0|        }
  420|      0|    }
  421|      2|    return(has_empty_ns);
  422|      2|}
c14n.c:xmlC14NStrEqual:
  373|     16|xmlC14NStrEqual(const xmlChar *str1, const xmlChar *str2) {
  374|     16|    if (str1 == str2) return(1);
  ------------------
  |  Branch (374:9): [True: 0, False: 16]
  ------------------
  375|     16|    if (str1 == NULL) return((*str2) == '\0');
  ------------------
  |  Branch (375:9): [True: 0, False: 16]
  ------------------
  376|     16|    if (str2 == NULL) return((*str1) == '\0');
  ------------------
  |  Branch (376:9): [True: 16, False: 0]
  ------------------
  377|      0|    do {
  378|      0|	if (*str1++ != *str2) return(0);
  ------------------
  |  Branch (378:6): [True: 0, False: 0]
  ------------------
  379|      0|    } while (*str2++);
  ------------------
  |  Branch (379:14): [True: 0, False: 0]
  ------------------
  380|      0|    return(1);
  381|      0|}
c14n.c:xmlExcC14NProcessNamespacesAxis:
  689|      6|{
  690|      6|    xmlNsPtr ns;
  691|      6|    xmlListPtr list;
  692|      6|    xmlAttrPtr attr;
  693|      6|    int already_rendered;
  694|      6|    int has_empty_ns = 0;
  695|      6|    int has_visibly_utilized_empty_ns = 0;
  696|      6|    int has_empty_ns_in_inclusive_list = 0;
  697|       |
  698|      6|    if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (698:9): [True: 0, False: 6]
  |  Branch (698:26): [True: 0, False: 6]
  |  Branch (698:43): [True: 0, False: 6]
  ------------------
  699|      0|        xmlC14NErrParam(ctx);
  700|      0|        return (-1);
  701|      0|    }
  702|       |
  703|      6|    if(!xmlC14NIsExclusive(ctx)) {
  ------------------
  |  |  123|      6|    ( (ctx)->mode == XML_C14N_EXCLUSIVE_1_0 )
  ------------------
  |  Branch (703:8): [True: 0, False: 6]
  ------------------
  704|      0|        xmlC14NErrParam(ctx);
  705|      0|        return (-1);
  706|       |
  707|      0|    }
  708|       |
  709|       |    /*
  710|       |     * Create a sorted list to store element namespaces
  711|       |     */
  712|      6|    list = xmlListCreate(NULL, xmlC14NNsCompare);
  713|      6|    if (list == NULL) {
  ------------------
  |  Branch (713:9): [True: 0, False: 6]
  ------------------
  714|      0|        xmlC14NErrMemory(ctx);
  715|      0|        return (-1);
  716|      0|    }
  717|       |
  718|       |    /*
  719|       |     * process inclusive namespaces:
  720|       |     * All namespace nodes appearing on inclusive ns list are
  721|       |     * handled as provided in Canonical XML
  722|       |     */
  723|      6|    if(ctx->inclusive_ns_prefixes != NULL) {
  ------------------
  |  Branch (723:8): [True: 0, False: 6]
  ------------------
  724|      0|	xmlChar *prefix;
  725|      0|	int i;
  726|       |
  727|      0|	for (i = 0; ctx->inclusive_ns_prefixes[i] != NULL; ++i) {
  ------------------
  |  Branch (727:14): [True: 0, False: 0]
  ------------------
  728|      0|	    prefix = ctx->inclusive_ns_prefixes[i];
  729|       |	    /*
  730|       |	     * Special values for namespace with empty prefix
  731|       |	     */
  732|      0|            if (xmlStrEqual(prefix, BAD_CAST "#default")
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (732:17): [True: 0, False: 0]
  ------------------
  733|      0|                || xmlStrEqual(prefix, BAD_CAST "")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (733:20): [True: 0, False: 0]
  ------------------
  734|      0|                prefix = NULL;
  735|      0|		has_empty_ns_in_inclusive_list = 1;
  736|      0|            }
  737|       |
  738|      0|	    ns = xmlSearchNs(cur->doc, cur, prefix);
  739|      0|	    if((ns != NULL) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) {
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:6): [True: 0, False: 0]
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
  |  Branch (739:9): [True: 0, False: 0]
  |  Branch (739:25): [True: 0, False: 0]
  ------------------
  740|      0|		already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns);
  741|      0|		if(visible) {
  ------------------
  |  Branch (741:6): [True: 0, False: 0]
  ------------------
  742|      0|		    if (xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur) < 0) {
  ------------------
  |  Branch (742:11): [True: 0, False: 0]
  ------------------
  743|      0|                        xmlC14NErrMemory(ctx);
  744|      0|                        goto error;
  745|      0|                    }
  746|      0|		}
  747|      0|		if(!already_rendered) {
  ------------------
  |  Branch (747:6): [True: 0, False: 0]
  ------------------
  748|      0|		    xmlListInsert(list, ns);
  749|      0|		}
  750|      0|		if(xmlStrlen(ns->prefix) == 0) {
  ------------------
  |  Branch (750:6): [True: 0, False: 0]
  ------------------
  751|      0|		    has_empty_ns = 1;
  752|      0|		}
  753|      0|	    }
  754|      0|	}
  755|      0|    }
  756|       |
  757|       |    /* add node namespace */
  758|      6|    if(cur->ns != NULL) {
  ------------------
  |  Branch (758:8): [True: 0, False: 6]
  ------------------
  759|      0|	ns = cur->ns;
  760|      6|    } else {
  761|      6|        ns = xmlSearchNs(cur->doc, cur, NULL);
  762|      6|	has_visibly_utilized_empty_ns = 1;
  763|      6|    }
  764|      6|    if((ns != NULL) && !xmlC14NIsXmlNs(ns)) {
  ------------------
  |  Branch (764:8): [True: 0, False: 6]
  |  Branch (764:24): [True: 0, False: 0]
  ------------------
  765|      0|	if(visible && xmlC14NIsVisible(ctx, ns, cur)) {
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:6): [True: 0, False: 0]
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
  |  Branch (765:5): [True: 0, False: 0]
  ------------------
  766|      0|	    if(!xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, ns, ctx)) {
  ------------------
  |  Branch (766:9): [True: 0, False: 0]
  ------------------
  767|      0|		xmlListInsert(list, ns);
  768|      0|	    }
  769|      0|	}
  770|      0|	if(visible) {
  ------------------
  |  Branch (770:5): [True: 0, False: 0]
  ------------------
  771|      0|	    if (xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur) < 0) {
  ------------------
  |  Branch (771:10): [True: 0, False: 0]
  ------------------
  772|      0|                xmlC14NErrMemory(ctx);
  773|      0|                goto error;
  774|      0|            }
  775|      0|	}
  776|      0|	if(xmlStrlen(ns->prefix) == 0) {
  ------------------
  |  Branch (776:5): [True: 0, False: 0]
  ------------------
  777|      0|	    has_empty_ns = 1;
  778|      0|	}
  779|      0|    }
  780|       |
  781|       |
  782|       |    /* add attributes */
  783|      6|    for(attr = cur->properties; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (783:33): [True: 0, False: 6]
  ------------------
  784|       |        /*
  785|       |         * we need to check that attribute is visible and has non
  786|       |         * default namespace (XML Namespaces: "default namespaces
  787|       |	 * do not apply directly to attributes")
  788|       |         */
  789|      0|	if((attr->ns != NULL) && !xmlC14NIsXmlNs(attr->ns) && xmlC14NIsVisible(ctx, attr, cur)) {
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:6): [True: 0, False: 0]
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
  |  Branch (789:5): [True: 0, False: 0]
  |  Branch (789:27): [True: 0, False: 0]
  ------------------
  790|      0|	    already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, attr->ns, ctx);
  791|      0|	    if (xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur) < 0) {
  ------------------
  |  Branch (791:10): [True: 0, False: 0]
  ------------------
  792|      0|                xmlC14NErrMemory(ctx);
  793|      0|                goto error;
  794|      0|            }
  795|      0|	    if(!already_rendered && visible) {
  ------------------
  |  Branch (795:9): [True: 0, False: 0]
  |  Branch (795:30): [True: 0, False: 0]
  ------------------
  796|      0|		xmlListInsert(list, attr->ns);
  797|      0|	    }
  798|      0|	    if(xmlStrlen(attr->ns->prefix) == 0) {
  ------------------
  |  Branch (798:9): [True: 0, False: 0]
  ------------------
  799|      0|		has_empty_ns = 1;
  800|      0|	    }
  801|      0|	} else if((attr->ns != NULL) && (xmlStrlen(attr->ns->prefix) == 0) && (xmlStrlen(attr->ns->href) == 0)) {
  ------------------
  |  Branch (801:12): [True: 0, False: 0]
  |  Branch (801:34): [True: 0, False: 0]
  |  Branch (801:72): [True: 0, False: 0]
  ------------------
  802|      0|	    has_visibly_utilized_empty_ns = 1;
  803|      0|	}
  804|      0|    }
  805|       |
  806|       |    /*
  807|       |     * Process xmlns=""
  808|       |     */
  809|      6|    if(visible && has_visibly_utilized_empty_ns &&
  ------------------
  |  Branch (809:8): [True: 6, False: 0]
  |  Branch (809:19): [True: 6, False: 0]
  ------------------
  810|      6|	    !has_empty_ns && !has_empty_ns_in_inclusive_list) {
  ------------------
  |  Branch (810:6): [True: 6, False: 0]
  |  Branch (810:23): [True: 6, False: 0]
  ------------------
  811|      6|        xmlNs ns_default;
  812|       |
  813|      6|        memset(&ns_default, 0, sizeof(ns_default));
  814|       |
  815|      6|        already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default, ctx);
  816|      6|	if(!already_rendered) {
  ------------------
  |  Branch (816:5): [True: 0, False: 6]
  ------------------
  817|      0|	    xmlC14NPrintNamespaces(&ns_default, ctx);
  818|      0|	}
  819|      6|    } else if(visible && !has_empty_ns && has_empty_ns_in_inclusive_list) {
  ------------------
  |  Branch (819:15): [True: 0, False: 0]
  |  Branch (819:26): [True: 0, False: 0]
  |  Branch (819:43): [True: 0, False: 0]
  ------------------
  820|      0|        xmlNs ns_default;
  821|       |
  822|      0|        memset(&ns_default, 0, sizeof(ns_default));
  823|      0|        if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) {
  ------------------
  |  Branch (823:12): [True: 0, False: 0]
  ------------------
  824|      0|	    xmlC14NPrintNamespaces(&ns_default, ctx);
  825|      0|	}
  826|      0|    }
  827|       |
  828|       |
  829|       |
  830|       |    /*
  831|       |     * print out all elements from list
  832|       |     */
  833|      6|    xmlListWalk(list, xmlC14NPrintNamespacesWalker, (void *) ctx);
  834|       |
  835|       |    /*
  836|       |     * Cleanup
  837|       |     */
  838|      6|error:
  839|      6|    xmlListDelete(list);
  840|      6|    return (0);
  841|      6|}
c14n.c:xmlExcC14NVisibleNsStackFind:
  425|      6|xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx) {
  426|      6|    int i;
  427|      6|    const xmlChar *prefix;
  428|      6|    const xmlChar *href;
  429|      6|    int has_empty_ns;
  430|       |
  431|      6|    if(cur == NULL) {
  ------------------
  |  Branch (431:8): [True: 0, False: 6]
  ------------------
  432|      0|        xmlC14NErrParam(ctx);
  433|      0|        return (0);
  434|      0|    }
  435|       |
  436|       |    /*
  437|       |     * if the default namespace xmlns="" is not defined yet then
  438|       |     * we do not want to print it out
  439|       |     */
  440|      6|    prefix = ((ns == NULL) || (ns->prefix == NULL)) ? BAD_CAST "" : ns->prefix;
  ------------------
  |  |   34|      6|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (440:15): [True: 0, False: 6]
  |  Branch (440:31): [True: 6, False: 0]
  ------------------
  441|      6|    href = ((ns == NULL) || (ns->href == NULL)) ? BAD_CAST "" : ns->href;
  ------------------
  |  |   34|      6|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (441:13): [True: 0, False: 6]
  |  Branch (441:29): [True: 6, False: 0]
  ------------------
  442|      6|    has_empty_ns = (xmlC14NStrEqual(prefix, NULL) && xmlC14NStrEqual(href, NULL));
  ------------------
  |  Branch (442:21): [True: 6, False: 0]
  |  Branch (442:54): [True: 6, False: 0]
  ------------------
  443|       |
  444|      6|    if (cur->nsTab != NULL) {
  ------------------
  |  Branch (444:9): [True: 0, False: 6]
  ------------------
  445|      0|	int start = 0;
  446|      0|        for (i = cur->nsCurEnd - 1; i >= start; --i) {
  ------------------
  |  Branch (446:37): [True: 0, False: 0]
  ------------------
  447|      0|            xmlNsPtr ns1 = cur->nsTab[i];
  448|       |
  449|      0|	    if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) {
  ------------------
  |  Branch (449:9): [True: 0, False: 0]
  |  Branch (449:33): [True: 0, False: 0]
  ------------------
  450|      0|		if(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)) {
  ------------------
  |  Branch (450:6): [True: 0, False: 0]
  |  Branch (450:28): [True: 0, False: 0]
  ------------------
  451|      0|		    return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i]));
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
  452|      0|		} else {
  453|      0|		    return(0);
  454|      0|		}
  455|      0|	    }
  456|      0|        }
  457|      0|    }
  458|      6|    return(has_empty_ns);
  459|      6|}
c14n.c:xmlC14NVisibleNsStackShift:
  363|      8|xmlC14NVisibleNsStackShift(xmlC14NVisibleNsStackPtr cur) {
  364|      8|    if(cur == NULL) {
  ------------------
  |  Branch (364:8): [True: 0, False: 8]
  ------------------
  365|      0|        xmlC14NErrParam(NULL);
  366|      0|	return;
  367|      0|    }
  368|      8|    cur->nsPrevStart = cur->nsPrevEnd;
  369|      8|    cur->nsPrevEnd = cur->nsCurEnd;
  370|      8|}
c14n.c:xmlC14NProcessAttrsAxis:
 1113|      8|{
 1114|      8|    xmlAttrPtr attr;
 1115|      8|    xmlListPtr list;
 1116|      8|    xmlAttrPtr attrs_to_delete = NULL;
 1117|       |
 1118|       |    /* special processing for 1.1 spec */
 1119|      8|    xmlAttrPtr xml_base_attr = NULL;
 1120|      8|    xmlAttrPtr xml_lang_attr = NULL;
 1121|      8|    xmlAttrPtr xml_space_attr = NULL;
 1122|       |
 1123|      8|    if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1123:9): [True: 0, False: 8]
  |  Branch (1123:26): [True: 0, False: 8]
  |  Branch (1123:43): [True: 0, False: 8]
  ------------------
 1124|      0|        xmlC14NErrParam(ctx);
 1125|      0|        return (-1);
 1126|      0|    }
 1127|       |
 1128|       |    /*
 1129|       |     * Create a sorted list to store element attributes
 1130|       |     */
 1131|      8|    list = xmlListCreate(NULL, xmlC14NAttrsCompare);
 1132|      8|    if (list == NULL) {
  ------------------
  |  Branch (1132:9): [True: 0, False: 8]
  ------------------
 1133|      0|        xmlC14NErrMemory(ctx);
 1134|      0|        return (-1);
 1135|      0|    }
 1136|       |
 1137|      8|    switch(ctx->mode) {
  ------------------
  |  Branch (1137:12): [True: 8, False: 0]
  ------------------
 1138|      0|    case XML_C14N_1_0:
  ------------------
  |  Branch (1138:5): [True: 0, False: 8]
  ------------------
 1139|       |        /* The processing of an element node E MUST be modified slightly when an XPath node-set is
 1140|       |         * given as input and the element's parent is omitted from the node-set. The method for processing
 1141|       |         * the attribute axis of an element E in the node-set is enhanced. All element nodes along E's
 1142|       |         * ancestor axis are examined for nearest occurrences of attributes in the xml namespace, such
 1143|       |         * as xml:lang and xml:space (whether or not they are in the node-set). From this list of attributes,
 1144|       |         * remove any that are in E's attribute axis (whether or not they are in the node-set). Then,
 1145|       |         * lexicographically merge this attribute list with the nodes of E's attribute axis that are in
 1146|       |         * the node-set. The result of visiting the attribute axis is computed by processing the attribute
 1147|       |         * nodes in this merged attribute list.
 1148|       |         */
 1149|       |
 1150|       |        /*
 1151|       |         * Add all visible attributes from current node.
 1152|       |         */
 1153|      0|        attr = cur->properties;
 1154|      0|        while (attr != NULL) {
  ------------------
  |  Branch (1154:16): [True: 0, False: 0]
  ------------------
 1155|       |            /* check that attribute is visible */
 1156|      0|            if (xmlC14NIsVisible(ctx, attr, cur)) {
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:6): [True: 0, False: 0]
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
 1157|      0|                xmlListInsert(list, attr);
 1158|      0|            }
 1159|      0|            attr = attr->next;
 1160|      0|        }
 1161|       |
 1162|       |        /*
 1163|       |         * Handle xml attributes
 1164|       |         */
 1165|      0|        if (parent_visible && (cur->parent != NULL) &&
  ------------------
  |  Branch (1165:13): [True: 0, False: 0]
  |  Branch (1165:31): [True: 0, False: 0]
  ------------------
 1166|      0|            (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent)))
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
  |  Branch (1166:13): [True: 0, False: 0]
  ------------------
 1167|      0|        {
 1168|      0|            xmlNodePtr tmp;
 1169|       |
 1170|       |            /*
 1171|       |             * If XPath node-set is not specified then the parent is always
 1172|       |             * visible!
 1173|       |             */
 1174|      0|            tmp = cur->parent;
 1175|      0|            while (tmp != NULL && tmp->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1175:20): [True: 0, False: 0]
  |  Branch (1175:35): [True: 0, False: 0]
  ------------------
 1176|      0|                attr = tmp->properties;
 1177|      0|                while (attr != NULL) {
  ------------------
  |  Branch (1177:24): [True: 0, False: 0]
  ------------------
 1178|      0|                    if (xmlC14NIsXmlAttr(attr) != 0) {
  ------------------
  |  Branch (1178:25): [True: 0, False: 0]
  ------------------
 1179|      0|                        if (xmlListSearch(list, attr) == NULL) {
  ------------------
  |  Branch (1179:29): [True: 0, False: 0]
  ------------------
 1180|      0|                            xmlListInsert(list, attr);
 1181|      0|                        }
 1182|      0|                    }
 1183|      0|                    attr = attr->next;
 1184|      0|                }
 1185|      0|                tmp = tmp->parent;
 1186|      0|            }
 1187|      0|        }
 1188|       |
 1189|       |        /* done */
 1190|      0|        break;
 1191|      6|    case XML_C14N_EXCLUSIVE_1_0:
  ------------------
  |  Branch (1191:5): [True: 6, False: 2]
  ------------------
 1192|       |        /* attributes in the XML namespace, such as xml:lang and xml:space
 1193|       |         * are not imported into orphan nodes of the document subset
 1194|       |         */
 1195|       |
 1196|       |        /*
 1197|       |         * Add all visible attributes from current node.
 1198|       |         */
 1199|      6|        attr = cur->properties;
 1200|      6|        while (attr != NULL) {
  ------------------
  |  Branch (1200:16): [True: 0, False: 6]
  ------------------
 1201|       |            /* check that attribute is visible */
 1202|      0|            if (xmlC14NIsVisible(ctx, attr, cur)) {
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:6): [True: 0, False: 0]
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
 1203|      0|                xmlListInsert(list, attr);
 1204|      0|            }
 1205|      0|            attr = attr->next;
 1206|      0|        }
 1207|       |
 1208|       |        /* do nothing special for xml attributes */
 1209|      6|        break;
 1210|      2|    case XML_C14N_1_1:
  ------------------
  |  Branch (1210:5): [True: 2, False: 6]
  ------------------
 1211|       |        /* The processing of an element node E MUST be modified slightly when an XPath node-set is
 1212|       |         * given as input and some of the element's ancestors are omitted from the node-set.
 1213|       |         *
 1214|       |         * Simple inheritable attributes are attributes that have a value that requires at most a simple
 1215|       |         * redeclaration. This redeclaration is done by supplying a new value in the child axis. The
 1216|       |         * redeclaration of a simple inheritable attribute A contained in one of E's ancestors is done
 1217|       |         * by supplying a value to an attribute Ae inside E with the same name. Simple inheritable attributes
 1218|       |         * are xml:lang and xml:space.
 1219|       |         *
 1220|       |         * The method for processing the attribute axis of an element E in the node-set is hence enhanced.
 1221|       |         * All element nodes along E's ancestor axis are examined for the nearest occurrences of simple
 1222|       |         * inheritable attributes in the xml namespace, such as xml:lang and xml:space (whether or not they
 1223|       |         * are in the node-set). From this list of attributes, any simple inheritable attributes that are
 1224|       |         * already in E's attribute axis (whether or not they are in the node-set) are removed. Then,
 1225|       |         * lexicographically merge this attribute list with the nodes of E's attribute axis that are in
 1226|       |         * the node-set. The result of visiting the attribute axis is computed by processing the attribute
 1227|       |         * nodes in this merged attribute list.
 1228|       |         *
 1229|       |         * The xml:id attribute is not a simple inheritable attribute and no processing of these attributes is
 1230|       |         * performed.
 1231|       |         *
 1232|       |         * The xml:base attribute is not a simple inheritable attribute and requires special processing beyond
 1233|       |         * a simple redeclaration.
 1234|       |         *
 1235|       |         * Attributes in the XML namespace other than xml:base, xml:id, xml:lang, and xml:space MUST be processed
 1236|       |         * as ordinary attributes.
 1237|       |         */
 1238|       |
 1239|       |        /*
 1240|       |         * Add all visible attributes from current node.
 1241|       |         */
 1242|      2|        attr = cur->properties;
 1243|      2|        while (attr != NULL) {
  ------------------
  |  Branch (1243:16): [True: 0, False: 2]
  ------------------
 1244|       |            /* special processing for XML attribute kiks in only when we have invisible parents */
 1245|      0|            if ((!parent_visible) || (xmlC14NIsXmlAttr(attr) == 0)) {
  ------------------
  |  Branch (1245:17): [True: 0, False: 0]
  |  Branch (1245:38): [True: 0, False: 0]
  ------------------
 1246|       |                /* check that attribute is visible */
 1247|      0|                if (xmlC14NIsVisible(ctx, attr, cur)) {
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:6): [True: 0, False: 0]
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
 1248|      0|                    xmlListInsert(list, attr);
 1249|      0|                }
 1250|      0|            } else {
 1251|      0|                int matched = 0;
 1252|       |
 1253|       |                /* check for simple inheritance attributes */
 1254|      0|                if((!matched) && (xml_lang_attr == NULL) && xmlStrEqual(attr->name, BAD_CAST "lang")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1254:20): [True: 0, False: 0]
  |  Branch (1254:34): [True: 0, False: 0]
  |  Branch (1254:61): [True: 0, False: 0]
  ------------------
 1255|      0|                    xml_lang_attr = attr;
 1256|      0|                    matched = 1;
 1257|      0|                }
 1258|      0|                if((!matched) && (xml_space_attr == NULL) && xmlStrEqual(attr->name, BAD_CAST "space")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1258:20): [True: 0, False: 0]
  |  Branch (1258:34): [True: 0, False: 0]
  |  Branch (1258:62): [True: 0, False: 0]
  ------------------
 1259|      0|                    xml_space_attr = attr;
 1260|      0|                    matched = 1;
 1261|      0|                }
 1262|       |
 1263|       |                /* check for base attr */
 1264|      0|                if((!matched) && (xml_base_attr == NULL) && xmlStrEqual(attr->name, BAD_CAST "base")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1264:20): [True: 0, False: 0]
  |  Branch (1264:34): [True: 0, False: 0]
  |  Branch (1264:61): [True: 0, False: 0]
  ------------------
 1265|      0|                    xml_base_attr = attr;
 1266|      0|                    matched = 1;
 1267|      0|                }
 1268|       |
 1269|       |                /* otherwise, it is a normal attribute, so just check if it is visible */
 1270|      0|                if((!matched) && xmlC14NIsVisible(ctx, attr, cur)) {
  ------------------
  |  |  118|      0|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:6): [True: 0, False: 0]
  |  |  |  Branch (118:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      0|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
  |  Branch (1270:20): [True: 0, False: 0]
  ------------------
 1271|      0|                    xmlListInsert(list, attr);
 1272|      0|                }
 1273|      0|            }
 1274|       |
 1275|       |            /* move to the next one */
 1276|      0|            attr = attr->next;
 1277|      0|        }
 1278|       |
 1279|       |        /* special processing for XML attribute kiks in only when we have invisible parents */
 1280|      2|        if ((parent_visible)) {
  ------------------
  |  Branch (1280:13): [True: 2, False: 0]
  ------------------
 1281|       |
 1282|       |            /* simple inheritance attributes - copy */
 1283|      2|            if(xml_lang_attr == NULL) {
  ------------------
  |  Branch (1283:16): [True: 2, False: 0]
  ------------------
 1284|      2|                xml_lang_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "lang", XML_XML_NAMESPACE);
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
                              xml_lang_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "lang", XML_XML_NAMESPACE);
  ------------------
  |  |  146|      2|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 1285|      2|            }
 1286|      2|            if(xml_lang_attr != NULL) {
  ------------------
  |  Branch (1286:16): [True: 0, False: 2]
  ------------------
 1287|      0|                xmlListInsert(list, xml_lang_attr);
 1288|      0|            }
 1289|      2|            if(xml_space_attr == NULL) {
  ------------------
  |  Branch (1289:16): [True: 2, False: 0]
  ------------------
 1290|      2|                xml_space_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "space", XML_XML_NAMESPACE);
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
                              xml_space_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "space", XML_XML_NAMESPACE);
  ------------------
  |  |  146|      2|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 1291|      2|            }
 1292|      2|            if(xml_space_attr != NULL) {
  ------------------
  |  Branch (1292:16): [True: 0, False: 2]
  ------------------
 1293|      0|                xmlListInsert(list, xml_space_attr);
 1294|      0|            }
 1295|       |
 1296|       |            /* base uri attribute - fix up */
 1297|      2|            if(xml_base_attr == NULL) {
  ------------------
  |  Branch (1297:16): [True: 2, False: 0]
  ------------------
 1298|       |                /* if we don't have base uri attribute, check if we have a "hidden" one above */
 1299|      2|                xml_base_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "base", XML_XML_NAMESPACE);
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
                              xml_base_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "base", XML_XML_NAMESPACE);
  ------------------
  |  |  146|      2|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 1300|      2|            }
 1301|      2|            if(xml_base_attr != NULL) {
  ------------------
  |  Branch (1301:16): [True: 0, False: 2]
  ------------------
 1302|      0|                xml_base_attr = xmlC14NFixupBaseAttr(ctx, xml_base_attr);
 1303|      0|                if(xml_base_attr != NULL) {
  ------------------
  |  Branch (1303:20): [True: 0, False: 0]
  ------------------
 1304|      0|                    xmlListInsert(list, xml_base_attr);
 1305|       |
 1306|       |                    /* note that we MUST delete returned attr node ourselves! */
 1307|      0|                    xml_base_attr->next = attrs_to_delete;
 1308|      0|                    attrs_to_delete = xml_base_attr;
 1309|      0|                }
 1310|      0|            }
 1311|      2|        }
 1312|       |
 1313|       |        /* done */
 1314|      2|        break;
 1315|      8|    }
 1316|       |
 1317|       |    /*
 1318|       |     * print out all elements from list
 1319|       |     */
 1320|      8|    xmlListWalk(list, xmlC14NPrintAttrs, (void *) ctx);
 1321|       |
 1322|       |    /*
 1323|       |     * Cleanup
 1324|       |     */
 1325|      8|    xmlFreePropList(attrs_to_delete);
 1326|      8|    xmlListDelete(list);
 1327|      8|    return (0);
 1328|      8|}
c14n.c:xmlC14NFindHiddenParentAttr:
  966|      6|{
  967|      6|    xmlAttrPtr res;
  968|      6|    while((cur != NULL) && (!xmlC14NIsVisible(ctx, cur, cur->parent))) {
  ------------------
  |  |  118|      6|     (((ctx)->is_visible_callback != NULL) ? \
  |  |  ------------------
  |  |  |  Branch (118:7): [True: 6, False: 0]
  |  |  ------------------
  |  |  119|      6|	(ctx)->is_visible_callback((ctx)->user_data, \
  |  |  120|      6|		(xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1)
  ------------------
  |  Branch (968:11): [True: 6, False: 0]
  |  Branch (968:28): [True: 0, False: 6]
  ------------------
  969|      0|        res = xmlHasNsProp(cur, name, ns);
  970|      0|        if(res != NULL) {
  ------------------
  |  Branch (970:12): [True: 0, False: 0]
  ------------------
  971|      0|            return res;
  972|      0|        }
  973|       |
  974|      0|        cur = cur->parent;
  975|      0|    }
  976|       |
  977|      6|    return NULL;
  978|      6|}
c14n.c:xmlC14NVisibleNsStackRestore:
  352|      8|xmlC14NVisibleNsStackRestore(xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state) {
  353|      8|    if((cur == NULL) || (state == NULL)) {
  ------------------
  |  Branch (353:8): [True: 0, False: 8]
  |  Branch (353:25): [True: 0, False: 8]
  ------------------
  354|      0|        xmlC14NErrParam(NULL);
  355|      0|	return;
  356|      0|    }
  357|      8|    cur->nsCurEnd = state->nsCurEnd;
  358|      8|    cur->nsPrevStart = state->nsPrevStart;
  359|      8|    cur->nsPrevEnd = state->nsPrevEnd;
  360|      8|}
c14n.c:xmlC11NNormalizeString:
 2072|      8|{
 2073|      8|    const xmlChar *cur = input;
 2074|      8|    xmlChar *buffer = NULL;
 2075|      8|    xmlChar *out = NULL;
 2076|      8|    int buffer_size = 0;
 2077|       |
 2078|      8|    if (input == NULL)
  ------------------
  |  Branch (2078:9): [True: 0, False: 8]
  ------------------
 2079|      0|        return (NULL);
 2080|       |
 2081|       |    /*
 2082|       |     * allocate an translation buffer.
 2083|       |     */
 2084|      8|    buffer_size = 1000;
 2085|      8|    buffer = xmlMalloc(buffer_size);
 2086|      8|    if (buffer == NULL)
  ------------------
  |  Branch (2086:9): [True: 0, False: 8]
  ------------------
 2087|      0|        return (NULL);
 2088|      8|    out = buffer;
 2089|       |
 2090|     32|    while (*cur != '\0') {
  ------------------
  |  Branch (2090:12): [True: 24, False: 8]
  ------------------
 2091|     24|        if ((out - buffer) > (buffer_size - 10)) {
  ------------------
  |  Branch (2091:13): [True: 0, False: 24]
  ------------------
 2092|      0|            xmlChar *tmp;
 2093|      0|            int indx = out - buffer;
 2094|      0|            int newSize;
 2095|       |
 2096|      0|            newSize = xmlGrowCapacity(buffer_size, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2097|      0|            if (newSize < 0) {
  ------------------
  |  Branch (2097:17): [True: 0, False: 0]
  ------------------
 2098|      0|                xmlFree(buffer);
 2099|      0|                return(NULL);
 2100|      0|            }
 2101|      0|            tmp = xmlRealloc(buffer, newSize);
 2102|      0|            if (tmp == NULL) {
  ------------------
  |  Branch (2102:17): [True: 0, False: 0]
  ------------------
 2103|      0|                xmlFree(buffer);
 2104|      0|                return(NULL);
 2105|      0|            }
 2106|      0|            buffer = tmp;
 2107|      0|            buffer_size = newSize;
 2108|      0|            out = &buffer[indx];
 2109|      0|        }
 2110|       |
 2111|     24|        if ((*cur == '<') && ((mode == XMLC14N_NORMALIZE_ATTR) ||
  ------------------
  |  Branch (2111:13): [True: 0, False: 24]
  |  Branch (2111:31): [True: 0, False: 0]
  ------------------
 2112|      0|                              (mode == XMLC14N_NORMALIZE_TEXT))) {
  ------------------
  |  Branch (2112:31): [True: 0, False: 0]
  ------------------
 2113|      0|            *out++ = '&';
 2114|      0|            *out++ = 'l';
 2115|      0|            *out++ = 't';
 2116|      0|            *out++ = ';';
 2117|     24|        } else if ((*cur == '>') && (mode == XMLC14N_NORMALIZE_TEXT)) {
  ------------------
  |  Branch (2117:20): [True: 0, False: 24]
  |  Branch (2117:37): [True: 0, False: 0]
  ------------------
 2118|      0|            *out++ = '&';
 2119|      0|            *out++ = 'g';
 2120|      0|            *out++ = 't';
 2121|      0|            *out++ = ';';
 2122|     24|        } else if ((*cur == '&') && ((mode == XMLC14N_NORMALIZE_ATTR) ||
  ------------------
  |  Branch (2122:20): [True: 0, False: 24]
  |  Branch (2122:38): [True: 0, False: 0]
  ------------------
 2123|      0|                                     (mode == XMLC14N_NORMALIZE_TEXT))) {
  ------------------
  |  Branch (2123:38): [True: 0, False: 0]
  ------------------
 2124|      0|            *out++ = '&';
 2125|      0|            *out++ = 'a';
 2126|      0|            *out++ = 'm';
 2127|      0|            *out++ = 'p';
 2128|      0|            *out++ = ';';
 2129|     24|        } else if ((*cur == '"') && (mode == XMLC14N_NORMALIZE_ATTR)) {
  ------------------
  |  Branch (2129:20): [True: 0, False: 24]
  |  Branch (2129:37): [True: 0, False: 0]
  ------------------
 2130|      0|            *out++ = '&';
 2131|      0|            *out++ = 'q';
 2132|      0|            *out++ = 'u';
 2133|      0|            *out++ = 'o';
 2134|      0|            *out++ = 't';
 2135|      0|            *out++ = ';';
 2136|     24|        } else if ((*cur == '\x09') && (mode == XMLC14N_NORMALIZE_ATTR)) {
  ------------------
  |  Branch (2136:20): [True: 0, False: 24]
  |  Branch (2136:40): [True: 0, False: 0]
  ------------------
 2137|      0|            *out++ = '&';
 2138|      0|            *out++ = '#';
 2139|      0|            *out++ = 'x';
 2140|      0|            *out++ = '9';
 2141|      0|            *out++ = ';';
 2142|     24|        } else if ((*cur == '\x0A') && (mode == XMLC14N_NORMALIZE_ATTR)) {
  ------------------
  |  Branch (2142:20): [True: 0, False: 24]
  |  Branch (2142:40): [True: 0, False: 0]
  ------------------
 2143|      0|            *out++ = '&';
 2144|      0|            *out++ = '#';
 2145|      0|            *out++ = 'x';
 2146|      0|            *out++ = 'A';
 2147|      0|            *out++ = ';';
 2148|     24|        } else if ((*cur == '\x0D') && ((mode == XMLC14N_NORMALIZE_ATTR) ||
  ------------------
  |  Branch (2148:20): [True: 0, False: 24]
  |  Branch (2148:41): [True: 0, False: 0]
  ------------------
 2149|      0|                                        (mode == XMLC14N_NORMALIZE_TEXT) ||
  ------------------
  |  Branch (2149:41): [True: 0, False: 0]
  ------------------
 2150|      0|                                        (mode == XMLC14N_NORMALIZE_COMMENT) ||
  ------------------
  |  Branch (2150:41): [True: 0, False: 0]
  ------------------
 2151|      0|					(mode == XMLC14N_NORMALIZE_PI))) {
  ------------------
  |  Branch (2151:6): [True: 0, False: 0]
  ------------------
 2152|      0|            *out++ = '&';
 2153|      0|            *out++ = '#';
 2154|      0|            *out++ = 'x';
 2155|      0|            *out++ = 'D';
 2156|      0|            *out++ = ';';
 2157|     24|        } else {
 2158|       |            /*
 2159|       |             * Works because on UTF-8, all extended sequences cannot
 2160|       |             * result in bytes in the ASCII range.
 2161|       |             */
 2162|     24|            *out++ = *cur;
 2163|     24|        }
 2164|     24|        cur++;
 2165|     24|    }
 2166|      8|    *out = 0;
 2167|      8|    return (buffer);
 2168|      8|}
c14n.c:xmlC14NFreeCtx:
 1702|      8|{
 1703|      8|    if (ctx == NULL) {
  ------------------
  |  Branch (1703:9): [True: 0, False: 8]
  ------------------
 1704|      0|        xmlC14NErrParam(ctx);
 1705|      0|        return;
 1706|      0|    }
 1707|       |
 1708|      8|    if (ctx->ns_rendered != NULL) {
  ------------------
  |  Branch (1708:9): [True: 8, False: 0]
  ------------------
 1709|      8|        xmlC14NVisibleNsStackDestroy(ctx->ns_rendered);
 1710|      8|    }
 1711|      8|    xmlFree(ctx);
 1712|      8|}
c14n.c:xmlC14NVisibleNsStackDestroy:
  283|      8|xmlC14NVisibleNsStackDestroy(xmlC14NVisibleNsStackPtr cur) {
  284|      8|    if(cur == NULL) {
  ------------------
  |  Branch (284:8): [True: 0, False: 8]
  ------------------
  285|      0|        xmlC14NErrParam(NULL);
  286|      0|        return;
  287|      0|    }
  288|      8|    if(cur->nsTab != NULL) {
  ------------------
  |  Branch (288:8): [True: 0, False: 8]
  ------------------
  289|      0|	memset(cur->nsTab, 0, cur->nsMax * sizeof(xmlNsPtr));
  290|      0|	xmlFree(cur->nsTab);
  291|      0|    }
  292|      8|    if(cur->nodeTab != NULL) {
  ------------------
  |  Branch (292:8): [True: 0, False: 8]
  ------------------
  293|      0|	memset(cur->nodeTab, 0, cur->nsMax * sizeof(xmlNodePtr));
  294|      0|	xmlFree(cur->nodeTab);
  295|      0|    }
  296|      8|    memset(cur, 0, sizeof(xmlC14NVisibleNsStack));
  297|      8|    xmlFree(cur);
  298|       |
  299|      8|}
c14n.c:xmlC14NIsNodeInNodeset:
  244|     22|xmlC14NIsNodeInNodeset(void *user_data, xmlNodePtr node, xmlNodePtr parent) {
  245|     22|    xmlNodeSetPtr nodes = (xmlNodeSetPtr) user_data;
  246|     22|    if((nodes != NULL) && (node != NULL)) {
  ------------------
  |  Branch (246:8): [True: 0, False: 22]
  |  Branch (246:27): [True: 0, False: 0]
  ------------------
  247|      0|	if(node->type != XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (247:5): [True: 0, False: 0]
  ------------------
  248|      0|	    return(xmlXPathNodeSetContains(nodes, node));
  249|      0|	} else {
  250|      0|	    xmlNs ns;
  251|       |
  252|      0|	    memcpy(&ns, node, sizeof(ns));
  253|       |
  254|       |	    /* this is a libxml hack! check xpath.c for details */
  255|      0|	    if((parent != NULL) && (parent->type == XML_ATTRIBUTE_NODE)) {
  ------------------
  |  Branch (255:9): [True: 0, False: 0]
  |  Branch (255:29): [True: 0, False: 0]
  ------------------
  256|      0|		ns.next = (xmlNsPtr)parent->parent;
  257|      0|	    } else {
  258|      0|		ns.next = (xmlNsPtr)parent;
  259|      0|	    }
  260|       |
  261|       |	    /*
  262|       |	     * If the input is an XPath node-set, then the node-set must explicitly
  263|       |	     * contain every node to be rendered to the canonical form.
  264|       |	     */
  265|      0|	    return(xmlXPathNodeSetContains(nodes, (xmlNodePtr)&ns));
  266|      0|	}
  267|      0|    }
  268|     22|    return(1);
  269|     22|}

xmlInitCatalogInternal:
 3211|    324|xmlInitCatalogInternal(void) {
 3212|    324|    if (getenv("XML_DEBUG_CATALOG"))
  ------------------
  |  Branch (3212:9): [True: 0, False: 324]
  ------------------
 3213|      0|	xmlDebugCatalogs = 1;
 3214|    324|    xmlInitRMutex(&xmlCatalogMutex);
 3215|    324|}
xmlCatalogCleanup:
 3361|    323|xmlCatalogCleanup(void) {
 3362|    323|    xmlRMutexLock(&xmlCatalogMutex);
 3363|    323|    if (xmlDebugCatalogs)
  ------------------
  |  Branch (3363:9): [True: 0, False: 323]
  ------------------
 3364|      0|	xmlCatalogPrintDebug(
 3365|      0|		"Catalogs cleanup\n");
 3366|    323|    xmlResetCatalogResolveCache();
 3367|    323|    if (xmlCatalogXMLFiles != NULL)
  ------------------
  |  Branch (3367:9): [True: 0, False: 323]
  ------------------
 3368|      0|	xmlHashFree(xmlCatalogXMLFiles, xmlFreeCatalogHashEntryList);
 3369|    323|    xmlCatalogXMLFiles = NULL;
 3370|    323|    if (xmlDefaultCatalog != NULL)
  ------------------
  |  Branch (3370:9): [True: 0, False: 323]
  ------------------
 3371|      0|	xmlFreeCatalog(xmlDefaultCatalog);
 3372|       |    xmlDefaultCatalog = NULL;
 3373|    323|    xmlDebugCatalogs = 0;
 3374|    323|    xmlCatalogInitialized = 0;
 3375|    323|    xmlRMutexUnlock(&xmlCatalogMutex);
 3376|    323|}
xmlCleanupCatalogInternal:
 3382|    323|xmlCleanupCatalogInternal(void) {
 3383|    323|    xmlCleanupRMutex(&xmlCatalogMutex);
 3384|    323|}
xmlCatalogGetDefaults:
 3586|      1|xmlCatalogGetDefaults(void) {
 3587|      1|    return(xmlCatalogDefaultAllow);
 3588|      1|}
xmlCatalogSetDefaults:
 3600|    330|xmlCatalogSetDefaults(xmlCatalogAllow allow) {
 3601|    330|    if (xmlDebugCatalogs) {
  ------------------
  |  Branch (3601:9): [True: 0, False: 330]
  ------------------
 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|    330|    xmlCatalogDefaultAllow = allow;
 3622|    330|}
catalog.c:xmlResetCatalogResolveCache:
  206|    323|{
  207|    323|    xmlRMutexLock(&xmlCatalogMutex);
  208|    323|    if (xmlCatalogResolveCache != NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 323]
  ------------------
  209|      0|        xmlHashFree(xmlCatalogResolveCache, NULL);
  210|       |        xmlCatalogResolveCache = NULL;
  211|      0|    }
  212|    323|    xmlRMutexUnlock(&xmlCatalogMutex);
  213|    323|}

xmlInitDictInternal:
   98|    324|xmlInitDictInternal(void) {
   99|    324|    xmlInitMutex(&xmlDictMutex);
  100|    324|}
xmlCleanupDictInternal:
  116|    323|xmlCleanupDictInternal(void) {
  117|    323|    xmlCleanupMutex(&xmlDictMutex);
  118|    323|}
xmlDictCreate:
  264|    258|xmlDictCreate(void) {
  265|    258|    xmlDictPtr dict;
  266|       |
  267|    258|    xmlInitParser();
  268|       |
  269|    258|    dict = xmlMalloc(sizeof(xmlDict));
  270|    258|    if (dict == NULL)
  ------------------
  |  Branch (270:9): [True: 0, False: 258]
  ------------------
  271|      0|        return(NULL);
  272|    258|    dict->ref_counter = 1;
  273|    258|    dict->limit = 0;
  274|       |
  275|    258|    dict->size = 0;
  276|    258|    dict->nbElems = 0;
  277|    258|    dict->table = NULL;
  278|    258|    dict->strings = NULL;
  279|       |    dict->subdict = NULL;
  280|    258|    dict->seed = xmlRandom();
  281|    258|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  282|    258|    dict->seed = 0;
  283|    258|#endif
  284|    258|    return(dict);
  285|    258|}
xmlDictFree:
  330|    258|xmlDictFree(xmlDict *dict) {
  331|    258|    xmlDictStringsPtr pool, nextp;
  332|       |
  333|    258|    if (dict == NULL)
  ------------------
  |  Branch (333:9): [True: 0, False: 258]
  ------------------
  334|      0|	return;
  335|       |
  336|       |    /* decrement the counter, it may be shared by a parser and docs */
  337|    258|    xmlMutexLock(&xmlDictMutex);
  338|    258|    dict->ref_counter--;
  339|    258|    if (dict->ref_counter > 0) {
  ------------------
  |  Branch (339:9): [True: 0, False: 258]
  ------------------
  340|      0|        xmlMutexUnlock(&xmlDictMutex);
  341|      0|        return;
  342|      0|    }
  343|       |
  344|    258|    xmlMutexUnlock(&xmlDictMutex);
  345|       |
  346|    258|    if (dict->subdict != NULL) {
  ------------------
  |  Branch (346:9): [True: 0, False: 258]
  ------------------
  347|      0|        xmlDictFree(dict->subdict);
  348|      0|    }
  349|       |
  350|    258|    if (dict->table) {
  ------------------
  |  Branch (350:9): [True: 12, False: 246]
  ------------------
  351|     12|	xmlFree(dict->table);
  352|     12|    }
  353|    258|    pool = dict->strings;
  354|    270|    while (pool != NULL) {
  ------------------
  |  Branch (354:12): [True: 12, False: 258]
  ------------------
  355|     12|        nextp = pool->next;
  356|     12|	xmlFree(pool);
  357|     12|	pool = nextp;
  358|     12|    }
  359|    258|    xmlFree(dict);
  360|    258|}
xmlDictSetLimit:
  412|     25|xmlDictSetLimit(xmlDict *dict, size_t limit) {
  413|     25|    size_t ret;
  414|       |
  415|     25|    if (dict == NULL)
  ------------------
  |  Branch (415:9): [True: 0, False: 25]
  ------------------
  416|      0|	return(0);
  417|     25|    ret = dict->limit;
  418|     25|    dict->limit = limit;
  419|     25|    return(ret);
  420|     25|}
xmlDictLookup:
  825|     12|xmlDictLookup(xmlDict *dict, const xmlChar *name, int len) {
  826|     12|    const xmlDictEntry *entry;
  827|       |
  828|     12|    entry = xmlDictLookupInternal(dict, NULL, name, len, 1);
  829|     12|    if (entry == NULL)
  ------------------
  |  Branch (829:9): [True: 0, False: 12]
  ------------------
  830|      0|        return(NULL);
  831|     12|    return(entry->name);
  832|     12|}
xmlInitRandom:
  926|    324|xmlInitRandom(void) {
  927|    324|    xmlInitMutex(&xmlRngMutex);
  928|       |
  929|    324|    {
  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|    324|        int var;
  948|       |
  949|    324|#if HAVE_DECL_GETENTROPY
  950|    324|        while (1) {
  ------------------
  |  Branch (950:16): [True: 324, Folded]
  ------------------
  951|    324|            if (getentropy(globalRngState, sizeof(globalRngState)) == 0)
  ------------------
  |  Branch (951:17): [True: 324, False: 0]
  ------------------
  952|    324|                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|}
xmlCleanupRandom:
  992|    323|xmlCleanupRandom(void) {
  993|    323|    xmlCleanupMutex(&xmlRngMutex);
  994|    323|}
xmlGlobalRandom:
 1017|    648|xmlGlobalRandom(void) {
 1018|    648|    unsigned ret;
 1019|       |
 1020|    648|    xmlMutexLock(&xmlRngMutex);
 1021|    648|    ret = xoroshiro64ss(globalRngState);
 1022|    648|    xmlMutexUnlock(&xmlRngMutex);
 1023|       |
 1024|    648|    return(ret);
 1025|    648|}
xmlRandom:
 1034|    603|xmlRandom(void) {
 1035|    603|    return(xoroshiro64ss(xmlGetLocalRngState()));
 1036|    603|}
dict.c:xmlDictHashName:
  454|     12|                size_t *plen) {
  455|     12|    unsigned h1, h2;
  456|     12|    size_t i;
  457|       |
  458|     12|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|     12|    do { \
  |  |   24|     12|        h1 = seed ^ 0x3b00; \
  |  |   25|     12|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|     12|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|     12|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 12]
  |  |  ------------------
  ------------------
  459|       |
  460|     72|    for (i = 0; i < maxLen && data[i]; i++) {
  ------------------
  |  Branch (460:17): [True: 72, False: 0]
  |  Branch (460:31): [True: 60, False: 12]
  ------------------
  461|     60|        HASH_UPDATE(h1, h2, data[i]);
  ------------------
  |  |   29|     60|    do { \
  |  |   30|     60|        h1 += ch; \
  |  |   31|     60|        h1 += h1 << 3; \
  |  |   32|     60|        h2 += h1; \
  |  |   33|     60|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|     60|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|     60|        h2 += h2 << 2; \
  |  |   35|     60|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 60]
  |  |  ------------------
  ------------------
  462|     60|    }
  463|       |
  464|     12|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|     12|    do { \
  |  |   40|     12|        h1 ^= h2; \
  |  |   41|     12|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|     12|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|     12|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|     12|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|     12|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|     12|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|     12|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|     12|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|     12|        h2 &= 0xFFFFFFFF; \
  |  |   46|     12|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 12]
  |  |  ------------------
  ------------------
  465|       |
  466|     12|    *plen = i;
  467|     12|    return(h2 | MAX_HASH_SIZE);
  ------------------
  |  |   44|     12|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  468|     12|}
dict.c:xmlDictLookupInternal:
  678|     12|                      const xmlChar *name, int maybeLen, int update) {
  679|     12|    xmlDictEntry *entry = NULL;
  680|     12|    const xmlChar *ret;
  681|     12|    unsigned hashValue, newSize;
  682|     12|    size_t maxLen, len, plen, klen;
  683|     12|    int found = 0;
  684|       |
  685|     12|    if ((dict == NULL) || (name == NULL))
  ------------------
  |  Branch (685:9): [True: 0, False: 12]
  |  Branch (685:27): [True: 0, False: 12]
  ------------------
  686|      0|	return(NULL);
  687|       |
  688|     12|    maxLen = (maybeLen < 0) ? SIZE_MAX : (size_t) maybeLen;
  ------------------
  |  Branch (688:14): [True: 12, False: 0]
  ------------------
  689|       |
  690|     12|    if (prefix == NULL) {
  ------------------
  |  Branch (690:9): [True: 12, False: 0]
  ------------------
  691|     12|        hashValue = xmlDictHashName(dict->seed, name, maxLen, &len);
  692|     12|        if (len > INT_MAX / 2)
  ------------------
  |  Branch (692:13): [True: 0, False: 12]
  ------------------
  693|      0|            return(NULL);
  694|     12|        klen = len;
  695|     12|    } else {
  696|      0|        hashValue = xmlDictHashQName(dict->seed, prefix, name, &plen, &len);
  697|      0|        if ((len > INT_MAX / 2) || (plen >= INT_MAX / 2 - len))
  ------------------
  |  Branch (697:13): [True: 0, False: 0]
  |  Branch (697:36): [True: 0, False: 0]
  ------------------
  698|      0|            return(NULL);
  699|      0|        klen = plen + 1 + len;
  700|      0|    }
  701|       |
  702|     12|    if ((dict->limit > 0) && (klen >= dict->limit))
  ------------------
  |  Branch (702:9): [True: 0, False: 12]
  |  Branch (702:30): [True: 0, False: 0]
  ------------------
  703|      0|        return(NULL);
  704|       |
  705|       |    /*
  706|       |     * Check for an existing entry
  707|       |     */
  708|     12|    if (dict->size == 0) {
  ------------------
  |  Branch (708:9): [True: 12, False: 0]
  ------------------
  709|     12|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   43|     12|#define MIN_HASH_SIZE 8
  ------------------
  710|     12|    } else {
  711|      0|        entry = xmlDictFindEntry(dict, prefix, name, klen, hashValue, &found);
  712|      0|        if (found)
  ------------------
  |  Branch (712:13): [True: 0, False: 0]
  ------------------
  713|      0|            return(entry);
  714|       |
  715|      0|        if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   42|      0|#define MAX_FILL_DENOM 8
  ------------------
                      if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   41|      0|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (715:13): [True: 0, False: 0]
  ------------------
  716|      0|            if (dict->size >= MAX_HASH_SIZE)
  ------------------
  |  |   44|      0|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (716:17): [True: 0, False: 0]
  ------------------
  717|      0|                return(NULL);
  718|      0|            newSize = dict->size * 2;
  719|      0|        } else {
  720|      0|            newSize = 0;
  721|      0|        }
  722|      0|    }
  723|       |
  724|     12|    if ((dict->subdict != NULL) && (dict->subdict->size > 0)) {
  ------------------
  |  Branch (724:9): [True: 0, False: 12]
  |  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|     12|    if (!update)
  ------------------
  |  Branch (740:9): [True: 0, False: 12]
  ------------------
  741|      0|        return(NULL);
  742|       |
  743|       |    /*
  744|       |     * Grow the hash table if needed
  745|       |     */
  746|     12|    if (newSize > 0) {
  ------------------
  |  Branch (746:9): [True: 12, False: 0]
  ------------------
  747|     12|        unsigned mask, displ, pos;
  748|       |
  749|     12|        if (xmlDictGrow(dict, newSize) != 0)
  ------------------
  |  Branch (749:13): [True: 0, False: 12]
  ------------------
  750|      0|            return(NULL);
  751|       |
  752|       |        /*
  753|       |         * Find new entry
  754|       |         */
  755|     12|        mask = dict->size - 1;
  756|     12|        displ = 0;
  757|     12|        pos = hashValue & mask;
  758|     12|        entry = &dict->table[pos];
  759|       |
  760|     12|        while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (760:16): [True: 0, False: 12]
  ------------------
  761|      0|               ((pos - entry->hashValue) & mask) >= displ) {
  ------------------
  |  Branch (761:16): [True: 0, False: 0]
  ------------------
  762|      0|            displ++;
  763|      0|            pos++;
  764|      0|            entry++;
  765|      0|            if ((pos & mask) == 0)
  ------------------
  |  Branch (765:17): [True: 0, False: 0]
  ------------------
  766|      0|                entry = dict->table;
  767|      0|        }
  768|     12|    }
  769|       |
  770|     12|    if (prefix == NULL)
  ------------------
  |  Branch (770:9): [True: 12, False: 0]
  ------------------
  771|     12|        ret = xmlDictAddString(dict, name, len);
  772|      0|    else
  773|      0|        ret = xmlDictAddQString(dict, prefix, plen, name, len);
  774|     12|    if (ret == NULL)
  ------------------
  |  Branch (774:9): [True: 0, False: 12]
  ------------------
  775|      0|        return(NULL);
  776|       |
  777|       |    /*
  778|       |     * Shift the remainder of the probe sequence to the right
  779|       |     */
  780|     12|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (780:9): [True: 0, False: 12]
  ------------------
  781|      0|        const xmlDictEntry *end = &dict->table[dict->size];
  782|      0|        const xmlDictEntry *cur = entry;
  783|       |
  784|      0|        do {
  785|      0|            cur++;
  786|      0|            if (cur >= end)
  ------------------
  |  Branch (786:17): [True: 0, False: 0]
  ------------------
  787|      0|                cur = dict->table;
  788|      0|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (788:18): [True: 0, False: 0]
  ------------------
  789|       |
  790|      0|        if (cur < entry) {
  ------------------
  |  Branch (790:13): [True: 0, False: 0]
  ------------------
  791|       |            /*
  792|       |             * If we traversed the end of the buffer, handle the part
  793|       |             * at the start of the buffer.
  794|       |             */
  795|      0|            memmove(&dict->table[1], dict->table,
  796|      0|                    (char *) cur - (char *) dict->table);
  797|      0|            cur = end - 1;
  798|      0|            dict->table[0] = *cur;
  799|      0|        }
  800|       |
  801|      0|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  802|      0|    }
  803|       |
  804|       |    /*
  805|       |     * Populate entry
  806|       |     */
  807|     12|    entry->hashValue = hashValue;
  808|     12|    entry->name = ret;
  809|       |
  810|     12|    dict->nbElems++;
  811|       |
  812|     12|    return(entry);
  813|     12|}
dict.c:xmlDictGrow:
  609|     12|xmlDictGrow(xmlDictPtr dict, unsigned size) {
  610|     12|    const xmlDictEntry *oldentry, *oldend, *end;
  611|     12|    xmlDictEntry *table;
  612|     12|    unsigned oldsize, i;
  613|       |
  614|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  615|     12|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (615:9): [True: 0, False: 12]
  ------------------
  616|      0|        return(-1);
  617|     12|    table = xmlMalloc(size * sizeof(table[0]));
  618|     12|    if (table == NULL)
  ------------------
  |  Branch (618:9): [True: 0, False: 12]
  ------------------
  619|      0|        return(-1);
  620|     12|    memset(table, 0, size * sizeof(table[0]));
  621|       |
  622|     12|    oldsize = dict->size;
  623|     12|    if (oldsize == 0)
  ------------------
  |  Branch (623:9): [True: 12, False: 0]
  ------------------
  624|     12|        goto done;
  625|       |
  626|      0|    oldend = &dict->table[oldsize];
  627|      0|    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|      0|    oldentry = dict->table;
  637|      0|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (637:12): [True: 0, False: 0]
  ------------------
  638|      0|        if (++oldentry >= oldend)
  ------------------
  |  Branch (638:13): [True: 0, False: 0]
  ------------------
  639|      0|            oldentry = dict->table;
  640|      0|    }
  641|       |
  642|      0|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (642:17): [True: 0, False: 0]
  ------------------
  643|      0|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (643:13): [True: 0, False: 0]
  ------------------
  644|      0|            xmlDictEntry *entry = &table[oldentry->hashValue & (size - 1)];
  645|       |
  646|      0|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (646:20): [True: 0, False: 0]
  ------------------
  647|      0|                if (++entry >= end)
  ------------------
  |  Branch (647:21): [True: 0, False: 0]
  ------------------
  648|      0|                    entry = table;
  649|      0|            }
  650|      0|            *entry = *oldentry;
  651|      0|        }
  652|       |
  653|      0|        if (++oldentry >= oldend)
  ------------------
  |  Branch (653:13): [True: 0, False: 0]
  ------------------
  654|      0|            oldentry = dict->table;
  655|      0|    }
  656|       |
  657|      0|    xmlFree(dict->table);
  658|       |
  659|     12|done:
  660|     12|    dict->table = table;
  661|     12|    dict->size = size;
  662|       |
  663|     12|    return(0);
  664|      0|}
dict.c:xmlDictAddString:
  130|     12|xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) {
  131|     12|    xmlDictStringsPtr pool;
  132|     12|    const xmlChar *ret;
  133|     12|    size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
  134|     12|    size_t limit = 0;
  135|       |
  136|     12|    pool = dict->strings;
  137|     12|    while (pool != NULL) {
  ------------------
  |  Branch (137:12): [True: 0, False: 12]
  ------------------
  138|      0|	if ((size_t)(pool->end - pool->free) > namelen)
  ------------------
  |  Branch (138:6): [True: 0, False: 0]
  ------------------
  139|      0|	    goto found_pool;
  140|      0|	if (pool->size > size) size = pool->size;
  ------------------
  |  Branch (140:6): [True: 0, False: 0]
  ------------------
  141|      0|        limit += pool->size;
  142|      0|	pool = pool->next;
  143|      0|    }
  144|       |    /*
  145|       |     * Not found, need to allocate
  146|       |     */
  147|     12|    if (pool == NULL) {
  ------------------
  |  Branch (147:9): [True: 12, False: 0]
  ------------------
  148|     12|        if ((dict->limit > 0) && (limit > dict->limit)) {
  ------------------
  |  Branch (148:13): [True: 0, False: 12]
  |  Branch (148:34): [True: 0, False: 0]
  ------------------
  149|      0|            return(NULL);
  150|      0|        }
  151|       |
  152|     12|        if (size == 0) {
  ------------------
  |  Branch (152:13): [True: 12, False: 0]
  ------------------
  153|     12|            size = 1000;
  154|     12|        } else {
  155|      0|            if (size < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (155:17): [True: 0, False: 0]
  ------------------
  156|      0|                size *= 4; /* exponential growth */
  157|      0|            else
  158|      0|                size = SIZE_MAX - sizeof(xmlDictStrings);
  159|      0|        }
  160|     12|        if (size / 4 < namelen) {
  ------------------
  |  Branch (160:13): [True: 0, False: 12]
  ------------------
  161|      0|            if ((size_t) namelen + 0 < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (161:17): [True: 0, False: 0]
  ------------------
  162|      0|                size = 4 * (size_t) namelen; /* just in case ! */
  163|      0|            else
  164|      0|                return(NULL);
  165|      0|        }
  166|     12|	pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
  167|     12|	if (pool == NULL)
  ------------------
  |  Branch (167:6): [True: 0, False: 12]
  ------------------
  168|      0|	    return(NULL);
  169|     12|	pool->size = size;
  170|     12|	pool->nbStrings = 0;
  171|     12|	pool->free = &pool->array[0];
  172|     12|	pool->end = &pool->array[size];
  173|     12|	pool->next = dict->strings;
  174|     12|	dict->strings = pool;
  175|     12|    }
  176|     12|found_pool:
  177|     12|    ret = pool->free;
  178|     12|    memcpy(pool->free, name, namelen);
  179|     12|    pool->free += namelen;
  180|     12|    *(pool->free++) = 0;
  181|     12|    pool->nbStrings++;
  182|     12|    return(ret);
  183|     12|}
dict.c:xoroshiro64ss:
  998|  1.25k|xoroshiro64ss(unsigned *s) {
  999|  1.25k|    unsigned s0 = s[0];
 1000|  1.25k|    unsigned s1 = s[1];
 1001|  1.25k|    unsigned result = HASH_ROL(s0 * 0x9E3779BB, 5) * 5;
  ------------------
  |  |   12|  1.25k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1002|       |
 1003|  1.25k|    s1 ^= s0;
 1004|  1.25k|    s[0] = HASH_ROL(s0, 26) ^ s1 ^ (s1 << 9);
  ------------------
  |  |   12|  1.25k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1005|  1.25k|    s[1] = HASH_ROL(s1, 13);
  ------------------
  |  |   12|  1.25k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1006|       |
 1007|  1.25k|    return(result & 0xFFFFFFFF);
 1008|  1.25k|}

xmlCleanupEncodingAliases:
  446|    323|xmlCleanupEncodingAliases(void) {
  447|    323|    int i;
  448|       |
  449|    323|    if (xmlCharEncodingAliases == NULL)
  ------------------
  |  Branch (449:9): [True: 323, False: 0]
  ------------------
  450|    323|	return;
  451|       |
  452|      0|    for (i = 0;i < xmlCharEncodingAliasesNb;i++) {
  ------------------
  |  Branch (452:16): [True: 0, False: 0]
  ------------------
  453|      0|	if (xmlCharEncodingAliases[i].name != NULL)
  ------------------
  |  Branch (453:6): [True: 0, False: 0]
  ------------------
  454|      0|	    xmlFree((char *) xmlCharEncodingAliases[i].name);
  455|      0|	if (xmlCharEncodingAliases[i].alias != NULL)
  ------------------
  |  Branch (455:6): [True: 0, False: 0]
  ------------------
  456|      0|	    xmlFree((char *) xmlCharEncodingAliases[i].alias);
  457|      0|    }
  458|      0|    xmlCharEncodingAliasesNb = 0;
  459|      0|    xmlCharEncodingAliasesMax = 0;
  460|      0|    xmlFree(xmlCharEncodingAliases);
  461|       |    xmlCharEncodingAliases = NULL;
  462|      0|}
xmlGetEncodingAlias:
  473|     33|xmlGetEncodingAlias(const char *alias) {
  474|     33|    int i;
  475|     33|    char upper[100];
  476|       |
  477|     33|    if (alias == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 33]
  ------------------
  478|      0|	return(NULL);
  479|       |
  480|     33|    if (xmlCharEncodingAliases == NULL)
  ------------------
  |  Branch (480:9): [True: 33, False: 0]
  ------------------
  481|     33|	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|      8|                           xmlCharEncodingHandler **out) {
  771|      8|    xmlCharEncodingHandler *handler;
  772|       |
  773|      8|    if (out == NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 8]
  ------------------
  774|      0|        return(XML_ERR_ARGUMENT);
  775|       |
  776|      8|    handler = xmlMalloc(sizeof(*handler));
  777|      8|    if (handler == NULL)
  ------------------
  |  Branch (777:9): [True: 0, False: 8]
  ------------------
  778|      0|        goto error;
  779|      8|    memset(handler, 0, sizeof(*handler));
  780|       |
  781|      8|    if (name != NULL) {
  ------------------
  |  Branch (781:9): [True: 8, False: 0]
  ------------------
  782|      8|        handler->name = xmlMemStrdup(name);
  783|      8|        if (handler->name == NULL)
  ------------------
  |  Branch (783:13): [True: 8, False: 0]
  ------------------
  784|      8|            goto error;
  785|      8|    }
  786|       |
  787|      0|    handler->input.func = input;
  788|      0|    handler->output.func = output;
  789|      0|    handler->ctxtDtor = ctxtDtor;
  790|      0|    handler->inputCtxt = inputCtxt;
  791|      0|    handler->outputCtxt = outputCtxt;
  792|       |
  793|      0|    *out = handler;
  794|      0|    return(XML_ERR_OK);
  795|       |
  796|      8|error:
  797|      8|    xmlFree(handler);
  798|       |
  799|      8|    if (ctxtDtor != NULL) {
  ------------------
  |  Branch (799:9): [True: 8, False: 0]
  ------------------
  800|      8|        if (inputCtxt != NULL)
  ------------------
  |  Branch (800:13): [True: 0, False: 8]
  ------------------
  801|      0|            ctxtDtor(inputCtxt);
  802|      8|        if (outputCtxt != NULL)
  ------------------
  |  Branch (802:13): [True: 8, False: 0]
  ------------------
  803|      8|            ctxtDtor(outputCtxt);
  804|      8|    }
  805|       |
  806|      8|    return(XML_ERR_NO_MEMORY);
  807|      8|}
xmlInitEncodingInternal:
  821|    324|xmlInitEncodingInternal(void) {
  822|    324|    unsigned short int tst = 0x1234;
  823|    324|    unsigned char *ptr = (unsigned char *) &tst;
  824|       |
  825|    324|    if (*ptr == 0x12) xmlLittleEndian = 0;
  ------------------
  |  Branch (825:9): [True: 0, False: 324]
  ------------------
  826|    324|    else xmlLittleEndian = 1;
  827|    324|}
xmlCleanupCharEncodingHandlers:
  840|    323|xmlCleanupCharEncodingHandlers(void) {
  841|    323|    xmlCleanupEncodingAliases();
  842|       |
  843|    323|    if (globalHandlers == NULL) return;
  ------------------
  |  Branch (843:9): [True: 323, False: 0]
  ------------------
  844|       |
  845|      0|    for (;nbCharEncodingHandler > 0;) {
  ------------------
  |  Branch (845:11): [True: 0, False: 0]
  ------------------
  846|      0|        xmlCharEncodingHandler *handler;
  847|       |
  848|      0|        nbCharEncodingHandler--;
  849|      0|        handler = globalHandlers[nbCharEncodingHandler];
  850|      0|	if (handler != NULL) {
  ------------------
  |  Branch (850:6): [True: 0, False: 0]
  ------------------
  851|      0|	    if (handler->name != NULL)
  ------------------
  |  Branch (851:10): [True: 0, False: 0]
  ------------------
  852|      0|		xmlFree(handler->name);
  853|      0|	    xmlFree(handler);
  854|      0|	}
  855|      0|    }
  856|      0|    xmlFree(globalHandlers);
  857|       |    globalHandlers = NULL;
  858|      0|    nbCharEncodingHandler = 0;
  859|      0|}
xmlCreateCharEncodingHandler:
 1066|     33|                             xmlCharEncodingHandler **out) {
 1067|     33|    const xmlCharEncodingHandler *handler;
 1068|     33|    const char *norig, *nalias;
 1069|     33|    xmlCharEncoding enc;
 1070|       |
 1071|     33|    if (out == NULL)
  ------------------
  |  Branch (1071:9): [True: 0, False: 33]
  ------------------
 1072|      0|        return(XML_ERR_ARGUMENT);
 1073|     33|    *out = NULL;
 1074|       |
 1075|     33|    if ((name == NULL) || (flags == 0))
  ------------------
  |  Branch (1075:9): [True: 0, False: 33]
  |  Branch (1075:27): [True: 0, False: 33]
  ------------------
 1076|      0|        return(XML_ERR_ARGUMENT);
 1077|       |
 1078|     33|    norig = name;
 1079|     33|    nalias = xmlGetEncodingAlias(name);
 1080|     33|    if (nalias != NULL)
  ------------------
  |  Branch (1080:9): [True: 0, False: 33]
  ------------------
 1081|      0|	name = nalias;
 1082|       |
 1083|     33|    enc = xmlParseCharEncodingInternal(name);
 1084|       |
 1085|       |    /* Return NULL handler for UTF-8 */
 1086|     33|    if (enc == XML_CHAR_ENCODING_UTF8)
  ------------------
  |  Branch (1086:9): [True: 0, False: 33]
  ------------------
 1087|      0|        return(XML_ERR_OK);
 1088|       |
 1089|     33|    if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) {
  ------------------
  |  |  355|      0|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (1089:9): [True: 0, False: 33]
  |  Branch (1089:22): [True: 0, False: 0]
  ------------------
 1090|      0|        if (flags & XML_ENC_HTML) {
  ------------------
  |  Branch (1090:13): [True: 0, False: 0]
  ------------------
 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|      0|        handler = &defaultHandlers[enc];
 1113|      0|        if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) &&
  ------------------
  |  Branch (1113:14): [True: 0, False: 0]
  |  Branch (1113:48): [True: 0, False: 0]
  ------------------
 1114|      0|            (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) {
  ------------------
  |  Branch (1114:14): [True: 0, False: 0]
  |  Branch (1114:49): [True: 0, False: 0]
  ------------------
 1115|      0|            xmlCharEncodingHandler *ret;
 1116|       |
 1117|       |            /*
 1118|       |             * Return a copy of the handler with the original name.
 1119|       |             */
 1120|       |
 1121|      0|            ret = xmlMalloc(sizeof(*ret));
 1122|      0|            if (ret == NULL)
  ------------------
  |  Branch (1122:17): [True: 0, False: 0]
  ------------------
 1123|      0|                return(XML_ERR_NO_MEMORY);
 1124|      0|            memset(ret, 0, sizeof(*ret));
 1125|       |
 1126|      0|            ret->name = xmlMemStrdup(norig);
 1127|      0|            if (ret->name == NULL) {
  ------------------
  |  Branch (1127:17): [True: 0, False: 0]
  ------------------
 1128|      0|                xmlFree(ret);
 1129|      0|                return(XML_ERR_NO_MEMORY);
 1130|      0|            }
 1131|      0|            ret->input = handler->input;
 1132|      0|            ret->output = handler->output;
 1133|      0|            ret->inputCtxt = handler->inputCtxt;
 1134|      0|            ret->outputCtxt = handler->outputCtxt;
 1135|      0|            ret->ctxtDtor = handler->ctxtDtor;
 1136|       |
 1137|      0|            *out = ret;
 1138|      0|            return(XML_ERR_OK);
 1139|      0|        }
 1140|      0|    }
 1141|       |
 1142|     33|    return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out));
 1143|     33|}
xmlOpenCharEncodingHandler:
 1169|     33|                           xmlCharEncodingHandler **out) {
 1170|     33|    xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT;
  ------------------
  |  Branch (1170:29): [True: 33, False: 0]
  ------------------
 1171|       |
 1172|     33|    return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out));
 1173|     33|}
encoding.c:xmlParseCharEncodingInternal:
  618|     33|{
  619|     33|    const xmlEncTableEntry *entry;
  620|       |
  621|     33|    if (name == NULL)
  ------------------
  |  Branch (621:9): [True: 0, False: 33]
  ------------------
  622|      0|       return(XML_CHAR_ENCODING_NONE);
  623|       |
  624|     33|    entry = bsearch(name, xmlEncTable,
  625|     33|                    sizeof(xmlEncTable) / sizeof(xmlEncTable[0]),
  626|     33|                    sizeof(xmlEncTable[0]), xmlCompareEncTableEntries);
  627|     33|    if (entry != NULL)
  ------------------
  |  Branch (627:9): [True: 0, False: 33]
  ------------------
  628|      0|        return(entry->enc);
  629|       |
  630|     33|    return(XML_CHAR_ENCODING_ERROR);
  631|     33|}
encoding.c:xmlCompareEncTableEntries:
  609|    262|xmlCompareEncTableEntries(const void *vkey, const void *ventry) {
  610|    262|    const char *key = vkey;
  611|    262|    const xmlEncTableEntry *entry = ventry;
  612|       |
  613|    262|    return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|    262|#define BAD_CAST (xmlChar *)
  ------------------
                  return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|    262|#define BAD_CAST (xmlChar *)
  ------------------
  614|    262|}
encoding.c:xmlFindExtraHandler:
  908|     33|                    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|     33|    if (impl != NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 33]
  ------------------
  916|      0|        return(impl(implCtxt, norig, flags, out));
  917|       |
  918|       |    /*
  919|       |     * Deprecated
  920|       |     */
  921|     33|    if (globalHandlers != NULL) {
  ------------------
  |  Branch (921:9): [True: 0, False: 33]
  ------------------
  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|     33|#ifdef LIBXML_ICONV_ENABLED
  939|     33|    {
  940|     33|        int ret = xmlCharEncIconv(name, flags, out);
  941|       |
  942|     33|        if (ret == XML_ERR_OK)
  ------------------
  |  Branch (942:13): [True: 0, False: 33]
  ------------------
  943|      0|            return(XML_ERR_OK);
  944|     33|        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (944:13): [True: 8, False: 25]
  ------------------
  945|      8|            return(ret);
  946|     33|    }
  947|     25|#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|     25|    return(XML_ERR_UNSUPPORTED_ENCODING);
  961|     33|}
encoding.c:xmlCharEncIconv:
 1319|     33|                xmlCharEncodingHandler **out) {
 1320|     33|    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
 1321|     33|    xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
 1322|     33|    iconv_t icv_in;
 1323|     33|    iconv_t icv_out;
 1324|     33|    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|     33|    if (strstr(name, "//") != NULL) {
  ------------------
  |  Branch (1353:9): [True: 8, False: 25]
  ------------------
 1354|      8|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1355|      8|        goto error;
 1356|      8|    }
 1357|       |
 1358|     25|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
 1359|     25|    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|     25|    if ((xmlEncodingMatch(name, "TSCII")) ||
  ------------------
  |  Branch (1366:9): [True: 0, False: 25]
  ------------------
 1367|     25|        (xmlEncodingMatch(name, "BIG5-HKSCS"))) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 25]
  ------------------
 1368|      0|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1369|      0|        goto error;
 1370|      0|    }
 1371|     25|#endif
 1372|       |
 1373|     25|    if (flags & XML_ENC_INPUT) {
  ------------------
  |  Branch (1373:9): [True: 0, False: 25]
  ------------------
 1374|      0|        inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1375|      0|        if (inputCtxt == NULL) {
  ------------------
  |  Branch (1375:13): [True: 0, False: 0]
  ------------------
 1376|      0|            ret = XML_ERR_NO_MEMORY;
 1377|      0|            goto error;
 1378|      0|        }
 1379|      0|        inputCtxt->cd = (iconv_t) -1;
 1380|       |
 1381|      0|        icv_in = iconv_open("UTF-8", name);
 1382|      0|        if (icv_in == (iconv_t) -1) {
  ------------------
  |  Branch (1382:13): [True: 0, False: 0]
  ------------------
 1383|      0|            if (errno == EINVAL)
  ------------------
  |  Branch (1383:17): [True: 0, False: 0]
  ------------------
 1384|      0|                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|      0|            goto error;
 1390|      0|        }
 1391|      0|        inputCtxt->cd = icv_in;
 1392|       |
 1393|      0|        inFunc = xmlIconvConvert;
 1394|      0|    }
 1395|       |
 1396|     25|    if (flags & XML_ENC_OUTPUT) {
  ------------------
  |  Branch (1396:9): [True: 25, False: 0]
  ------------------
 1397|     25|        outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1398|     25|        if (outputCtxt == NULL) {
  ------------------
  |  Branch (1398:13): [True: 0, False: 25]
  ------------------
 1399|      0|            ret = XML_ERR_NO_MEMORY;
 1400|      0|            goto error;
 1401|      0|        }
 1402|     25|        outputCtxt->cd = (iconv_t) -1;
 1403|       |
 1404|     25|        icv_out = iconv_open(name, "UTF-8");
 1405|     25|        if (icv_out == (iconv_t) -1) {
  ------------------
  |  Branch (1405:13): [True: 17, False: 8]
  ------------------
 1406|     17|            if (errno == EINVAL)
  ------------------
  |  Branch (1406:17): [True: 17, False: 0]
  ------------------
 1407|     17|                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|     17|            goto error;
 1413|     17|        }
 1414|      8|        outputCtxt->cd = icv_out;
 1415|       |
 1416|      8|        outFunc = xmlIconvConvert;
 1417|      8|    }
 1418|       |
 1419|      8|    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree,
 1420|      8|                                      inputCtxt, outputCtxt, out));
 1421|       |
 1422|     25|error:
 1423|     25|    if (inputCtxt != NULL)
  ------------------
  |  Branch (1423:9): [True: 0, False: 25]
  ------------------
 1424|      0|        xmlIconvFree(inputCtxt);
 1425|     25|    if (outputCtxt != NULL)
  ------------------
  |  Branch (1425:9): [True: 17, False: 8]
  ------------------
 1426|     17|        xmlIconvFree(outputCtxt);
 1427|     25|    return(ret);
 1428|     25|}
encoding.c:xmlEncodingMatch:
 1295|     50|xmlEncodingMatch(const char *name1, const char *name2) {
 1296|       |    /*
 1297|       |     * Fuzzy match for encoding names
 1298|       |     */
 1299|     52|    while (1) {
  ------------------
  |  Branch (1299:12): [True: 52, Folded]
  ------------------
 1300|   434k|        while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1)))
  ------------------
  |  |  222|   434k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 101k, False: 332k]
  |  |  ------------------
  |  |  223|   434k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 52, False: 101k]
  |  |  ------------------
  ------------------
  |  Branch (1300:16): [True: 434k, False: 0]
  ------------------
 1301|   434k|            name1 += 1;
 1302|     52|        while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2)))
  ------------------
  |  |  222|     52|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 52, False: 0]
  |  |  ------------------
  |  |  223|     52|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 52, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1302:16): [True: 52, False: 0]
  ------------------
 1303|      0|            name2 += 1;
 1304|     52|        if ((*name1 == 0) || (*name2 == 0))
  ------------------
  |  Branch (1304:13): [True: 0, False: 52]
  |  Branch (1304:30): [True: 0, False: 52]
  ------------------
 1305|      0|            break;
 1306|     52|        if ((*name1 | 0x20) != (*name2 | 0x20))
  ------------------
  |  Branch (1306:13): [True: 50, False: 2]
  ------------------
 1307|     50|            return(0);
 1308|      2|        name1 += 1;
 1309|      2|        name2 += 1;
 1310|      2|    }
 1311|       |
 1312|       |    /* Only check whether name1 starts with name2 */
 1313|      0|    return(*name2 == 0);
 1314|     50|}
encoding.c:xmlIconvFree:
 1278|     25|xmlIconvFree(void *vctxt) {
 1279|     25|    xmlIconvCtxt *ctxt = vctxt;
 1280|       |
 1281|     25|    if (ctxt == NULL)
  ------------------
  |  Branch (1281:9): [True: 0, False: 25]
  ------------------
 1282|      0|        return;
 1283|       |
 1284|     25|    if (ctxt->cd != (iconv_t) -1)
  ------------------
  |  Branch (1284:9): [True: 8, False: 17]
  ------------------
 1285|      8|        iconv_close(ctxt->cd);
 1286|       |
 1287|     25|    xmlFree(ctxt);
 1288|     25|}

xmlIsCatastrophicError:
   38|      1|xmlIsCatastrophicError(int level, int code) {
   39|      1|    int fatal = 0;
   40|       |
   41|      1|    if (level != XML_ERR_FATAL)
  ------------------
  |  Branch (41:9): [True: 1, False: 0]
  ------------------
   42|      1|        return(0);
   43|       |
   44|      0|    switch (code) {
   45|      0|        case XML_ERR_NO_MEMORY:
  ------------------
  |  Branch (45:9): [True: 0, False: 0]
  ------------------
   46|       |        /* case XML_ERR_RESOURCE_LIMIT: */
   47|      0|        case XML_ERR_SYSTEM:
  ------------------
  |  Branch (47:9): [True: 0, False: 0]
  ------------------
   48|      0|        case XML_ERR_ARGUMENT:
  ------------------
  |  Branch (48:9): [True: 0, False: 0]
  ------------------
   49|      0|        case XML_ERR_INTERNAL_ERROR:
  ------------------
  |  Branch (49:9): [True: 0, False: 0]
  ------------------
   50|      0|            fatal = 1;
   51|      0|            break;
   52|      0|        default:
  ------------------
  |  Branch (52:9): [True: 0, False: 0]
  ------------------
   53|      0|            if ((code >= 1500) && (code <= 1599))
  ------------------
  |  Branch (53:17): [True: 0, False: 0]
  |  Branch (53:35): [True: 0, False: 0]
  ------------------
   54|      0|                fatal = 1;
   55|      0|            break;
   56|      0|    }
   57|       |
   58|      0|    return(fatal);
   59|      0|}
xmlSetGenericErrorFunc:
  272|    330|xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
  273|    330|    xmlGenericErrorContext = ctx;
  ------------------
  |  |  983|    330|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  274|    330|    if (handler != NULL)
  ------------------
  |  Branch (274:9): [True: 330, False: 0]
  ------------------
  275|    330|	xmlGenericError = handler;
  ------------------
  |  |  976|    330|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  276|      0|    else
  277|      0|	xmlGenericError = xmlGenericErrorDefaultFunc;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  278|    330|}
xmlParserPrintFileInfo:
  339|     33|xmlParserPrintFileInfo(struct _xmlParserInput *input) {
  340|     33|    if (input != NULL) {
  ------------------
  |  Branch (340:9): [True: 0, False: 33]
  ------------------
  341|      0|	if (input->filename)
  ------------------
  |  Branch (341:6): [True: 0, False: 0]
  ------------------
  342|      0|	    xmlGenericError(xmlGenericErrorContext,
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
              	    xmlGenericError(xmlGenericErrorContext,
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  343|      0|		    "%s:%d: ", input->filename,
  344|      0|		    input->line);
  345|      0|	else
  346|      0|	    xmlGenericError(xmlGenericErrorContext,
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
              	    xmlGenericError(xmlGenericErrorContext,
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  347|      0|		    "Entity: line %d: ", input->line);
  348|      0|    }
  349|     33|}
xmlParserPrintFileContext:
  396|     33|xmlParserPrintFileContext(struct _xmlParserInput *input) {
  397|     33|   xmlParserPrintFileContextInternal(input, xmlGenericError,
  ------------------
  |  |  976|     33|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  398|     33|                                     xmlGenericErrorContext);
  ------------------
  |  |  983|     33|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  399|     33|}
xmlFormatError:
  414|      1|{
  415|      1|    const char *message;
  416|      1|    const char *file;
  417|      1|    int line;
  418|      1|    int code;
  419|      1|    int domain;
  420|      1|    const xmlChar *name = NULL;
  421|      1|    xmlNodePtr node;
  422|      1|    xmlErrorLevel level;
  423|      1|    xmlParserCtxtPtr ctxt = NULL;
  424|      1|    xmlParserInputPtr input = NULL;
  425|      1|    xmlParserInputPtr cur = NULL;
  426|       |
  427|      1|    if ((err == NULL) || (channel == NULL))
  ------------------
  |  Branch (427:9): [True: 0, False: 1]
  |  Branch (427:26): [True: 0, False: 1]
  ------------------
  428|      0|        return;
  429|       |
  430|      1|    message = err->message;
  431|      1|    file = err->file;
  432|      1|    line = err->line;
  433|      1|    code = err->code;
  434|      1|    domain = err->domain;
  435|      1|    level = err->level;
  436|      1|    node = err->node;
  437|       |
  438|      1|    if (code == XML_ERR_OK)
  ------------------
  |  Branch (438:9): [True: 0, False: 1]
  ------------------
  439|      0|        return;
  440|       |
  441|      1|    if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||
  ------------------
  |  Branch (441:9): [True: 0, False: 1]
  |  Branch (441:40): [True: 0, False: 1]
  ------------------
  442|      1|        (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) ||
  ------------------
  |  Branch (442:9): [True: 0, False: 1]
  |  Branch (442:37): [True: 0, False: 1]
  ------------------
  443|      1|	(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
  ------------------
  |  Branch (443:2): [True: 1, False: 0]
  |  Branch (443:29): [True: 0, False: 0]
  ------------------
  444|      1|	ctxt = err->ctxt;
  445|      1|    }
  446|       |
  447|      1|    if ((node != NULL) && (node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (447:9): [True: 0, False: 1]
  |  Branch (447:27): [True: 0, False: 0]
  ------------------
  448|      0|        (domain != XML_FROM_SCHEMASV))
  ------------------
  |  Branch (448:9): [True: 0, False: 0]
  ------------------
  449|      0|        name = node->name;
  450|       |
  451|       |    /*
  452|       |     * Maintain the compatibility with the legacy error handling
  453|       |     */
  454|      1|    if ((ctxt != NULL) && (ctxt->input != NULL)) {
  ------------------
  |  Branch (454:9): [True: 1, False: 0]
  |  Branch (454:27): [True: 0, False: 1]
  ------------------
  455|      0|        input = ctxt->input;
  456|      0|        if ((input->filename == NULL) &&
  ------------------
  |  Branch (456:13): [True: 0, False: 0]
  ------------------
  457|      0|            (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (457:13): [True: 0, False: 0]
  ------------------
  458|      0|            cur = input;
  459|      0|            input = ctxt->inputTab[ctxt->inputNr - 2];
  460|      0|        }
  461|      0|        if (input->filename)
  ------------------
  |  Branch (461:13): [True: 0, False: 0]
  ------------------
  462|      0|            channel(data, "%s:%d: ", input->filename, input->line);
  463|      0|        else if ((line != 0) && (domain == XML_FROM_PARSER))
  ------------------
  |  Branch (463:18): [True: 0, False: 0]
  |  Branch (463:33): [True: 0, False: 0]
  ------------------
  464|      0|            channel(data, "Entity: line %d: ", input->line);
  465|      1|    } else {
  466|      1|        if (file != NULL)
  ------------------
  |  Branch (466:13): [True: 0, False: 1]
  ------------------
  467|      0|            channel(data, "%s:%d: ", file, line);
  468|      1|        else if ((line != 0) &&
  ------------------
  |  Branch (468:18): [True: 0, False: 1]
  ------------------
  469|      0|	         ((domain == XML_FROM_PARSER) || (domain == XML_FROM_SCHEMASV)||
  ------------------
  |  Branch (469:12): [True: 0, False: 0]
  |  Branch (469:43): [True: 0, False: 0]
  ------------------
  470|      0|		  (domain == XML_FROM_SCHEMASP)||(domain == XML_FROM_DTD) ||
  ------------------
  |  Branch (470:5): [True: 0, False: 0]
  |  Branch (470:36): [True: 0, False: 0]
  ------------------
  471|      0|		  (domain == XML_FROM_RELAXNGP)||(domain == XML_FROM_RELAXNGV)))
  ------------------
  |  Branch (471:5): [True: 0, False: 0]
  |  Branch (471:36): [True: 0, False: 0]
  ------------------
  472|      0|            channel(data, "Entity: line %d: ", line);
  473|      1|    }
  474|      1|    if (name != NULL) {
  ------------------
  |  Branch (474:9): [True: 0, False: 1]
  ------------------
  475|      0|        channel(data, "element %s: ", name);
  476|      0|    }
  477|      1|    switch (domain) {
  478|      0|        case XML_FROM_PARSER:
  ------------------
  |  Branch (478:9): [True: 0, False: 1]
  ------------------
  479|      0|            channel(data, "parser ");
  480|      0|            break;
  481|      0|        case XML_FROM_NAMESPACE:
  ------------------
  |  Branch (481:9): [True: 0, False: 1]
  ------------------
  482|      0|            channel(data, "namespace ");
  483|      0|            break;
  484|      0|        case XML_FROM_DTD:
  ------------------
  |  Branch (484:9): [True: 0, False: 1]
  ------------------
  485|      0|        case XML_FROM_VALID:
  ------------------
  |  Branch (485:9): [True: 0, False: 1]
  ------------------
  486|      0|            channel(data, "validity ");
  487|      0|            break;
  488|      0|        case XML_FROM_HTML:
  ------------------
  |  Branch (488:9): [True: 0, False: 1]
  ------------------
  489|      0|            channel(data, "HTML parser ");
  490|      0|            break;
  491|      0|        case XML_FROM_MEMORY:
  ------------------
  |  Branch (491:9): [True: 0, False: 1]
  ------------------
  492|      0|            channel(data, "memory ");
  493|      0|            break;
  494|      0|        case XML_FROM_OUTPUT:
  ------------------
  |  Branch (494:9): [True: 0, False: 1]
  ------------------
  495|      0|            channel(data, "output ");
  496|      0|            break;
  497|      1|        case XML_FROM_IO:
  ------------------
  |  Branch (497:9): [True: 1, False: 0]
  ------------------
  498|      1|            channel(data, "I/O ");
  499|      1|            break;
  500|      0|        case XML_FROM_XINCLUDE:
  ------------------
  |  Branch (500:9): [True: 0, False: 1]
  ------------------
  501|      0|            channel(data, "XInclude ");
  502|      0|            break;
  503|      0|        case XML_FROM_XPATH:
  ------------------
  |  Branch (503:9): [True: 0, False: 1]
  ------------------
  504|      0|            channel(data, "XPath ");
  505|      0|            break;
  506|      0|        case XML_FROM_XPOINTER:
  ------------------
  |  Branch (506:9): [True: 0, False: 1]
  ------------------
  507|      0|            channel(data, "parser ");
  508|      0|            break;
  509|      0|        case XML_FROM_REGEXP:
  ------------------
  |  Branch (509:9): [True: 0, False: 1]
  ------------------
  510|      0|            channel(data, "regexp ");
  511|      0|            break;
  512|      0|        case XML_FROM_MODULE:
  ------------------
  |  Branch (512:9): [True: 0, False: 1]
  ------------------
  513|      0|            channel(data, "module ");
  514|      0|            break;
  515|      0|        case XML_FROM_SCHEMASV:
  ------------------
  |  Branch (515:9): [True: 0, False: 1]
  ------------------
  516|      0|            channel(data, "Schemas validity ");
  517|      0|            break;
  518|      0|        case XML_FROM_SCHEMASP:
  ------------------
  |  Branch (518:9): [True: 0, False: 1]
  ------------------
  519|      0|            channel(data, "Schemas parser ");
  520|      0|            break;
  521|      0|        case XML_FROM_RELAXNGP:
  ------------------
  |  Branch (521:9): [True: 0, False: 1]
  ------------------
  522|      0|            channel(data, "Relax-NG parser ");
  523|      0|            break;
  524|      0|        case XML_FROM_RELAXNGV:
  ------------------
  |  Branch (524:9): [True: 0, False: 1]
  ------------------
  525|      0|            channel(data, "Relax-NG validity ");
  526|      0|            break;
  527|      0|        case XML_FROM_CATALOG:
  ------------------
  |  Branch (527:9): [True: 0, False: 1]
  ------------------
  528|      0|            channel(data, "Catalog ");
  529|      0|            break;
  530|      0|        case XML_FROM_C14N:
  ------------------
  |  Branch (530:9): [True: 0, False: 1]
  ------------------
  531|      0|            channel(data, "C14N ");
  532|      0|            break;
  533|      0|        case XML_FROM_XSLT:
  ------------------
  |  Branch (533:9): [True: 0, False: 1]
  ------------------
  534|      0|            channel(data, "XSLT ");
  535|      0|            break;
  536|      0|        case XML_FROM_I18N:
  ------------------
  |  Branch (536:9): [True: 0, False: 1]
  ------------------
  537|      0|            channel(data, "encoding ");
  538|      0|            break;
  539|      0|        case XML_FROM_SCHEMATRONV:
  ------------------
  |  Branch (539:9): [True: 0, False: 1]
  ------------------
  540|      0|            channel(data, "schematron ");
  541|      0|            break;
  542|      0|        case XML_FROM_BUFFER:
  ------------------
  |  Branch (542:9): [True: 0, False: 1]
  ------------------
  543|      0|            channel(data, "internal buffer ");
  544|      0|            break;
  545|      0|        case XML_FROM_URI:
  ------------------
  |  Branch (545:9): [True: 0, False: 1]
  ------------------
  546|      0|            channel(data, "URI ");
  547|      0|            break;
  548|      0|        default:
  ------------------
  |  Branch (548:9): [True: 0, False: 1]
  ------------------
  549|      0|            break;
  550|      1|    }
  551|      1|    switch (level) {
  ------------------
  |  Branch (551:13): [True: 1, False: 0]
  ------------------
  552|      0|        case XML_ERR_NONE:
  ------------------
  |  Branch (552:9): [True: 0, False: 1]
  ------------------
  553|      0|            channel(data, ": ");
  554|      0|            break;
  555|      1|        case XML_ERR_WARNING:
  ------------------
  |  Branch (555:9): [True: 1, False: 0]
  ------------------
  556|      1|            channel(data, "warning : ");
  557|      1|            break;
  558|      0|        case XML_ERR_ERROR:
  ------------------
  |  Branch (558:9): [True: 0, False: 1]
  ------------------
  559|      0|            channel(data, "error : ");
  560|      0|            break;
  561|      0|        case XML_ERR_FATAL:
  ------------------
  |  Branch (561:9): [True: 0, False: 1]
  ------------------
  562|      0|            channel(data, "error : ");
  563|      0|            break;
  564|      1|    }
  565|      1|    if (message != NULL) {
  ------------------
  |  Branch (565:9): [True: 1, False: 0]
  ------------------
  566|      1|        int len;
  567|      1|	len = xmlStrlen((const xmlChar *) message);
  568|      1|	if ((len > 0) && (message[len - 1] != '\n'))
  ------------------
  |  Branch (568:6): [True: 1, False: 0]
  |  Branch (568:19): [True: 0, False: 1]
  ------------------
  569|      0|	    channel(data, "%s\n", message);
  570|      1|	else
  571|      1|	    channel(data, "%s", message);
  572|      1|    } else {
  573|      0|        channel(data, "%s\n", "No error message provided");
  574|      0|    }
  575|       |
  576|      1|    if (ctxt != NULL) {
  ------------------
  |  Branch (576:9): [True: 1, False: 0]
  ------------------
  577|      1|        if ((input != NULL) &&
  ------------------
  |  Branch (577:13): [True: 0, False: 1]
  ------------------
  578|      0|            ((input->buf == NULL) || (input->buf->encoder == NULL)) &&
  ------------------
  |  Branch (578:14): [True: 0, False: 0]
  |  Branch (578:38): [True: 0, False: 0]
  ------------------
  579|      0|            (code == XML_ERR_INVALID_ENCODING) &&
  ------------------
  |  Branch (579:13): [True: 0, False: 0]
  ------------------
  580|      0|            (input->cur < input->end)) {
  ------------------
  |  Branch (580:13): [True: 0, False: 0]
  ------------------
  581|      0|            int i;
  582|       |
  583|      0|            channel(data, "Bytes:");
  584|      0|            for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (584:25): [True: 0, False: 0]
  ------------------
  585|      0|                if (input->cur + i >= input->end)
  ------------------
  |  Branch (585:21): [True: 0, False: 0]
  ------------------
  586|      0|                    break;
  587|      0|                channel(data, " 0x%02X", input->cur[i]);
  588|      0|            }
  589|      0|            channel(data, "\n");
  590|      0|        }
  591|       |
  592|      1|        xmlParserPrintFileContextInternal(input, channel, data);
  593|       |
  594|      1|        if (cur != NULL) {
  ------------------
  |  Branch (594:13): [True: 0, False: 1]
  ------------------
  595|      0|            if (cur->filename)
  ------------------
  |  Branch (595:17): [True: 0, False: 0]
  ------------------
  596|      0|                channel(data, "%s:%d: \n", cur->filename, cur->line);
  597|      0|            else if ((line != 0) &&
  ------------------
  |  Branch (597:22): [True: 0, False: 0]
  ------------------
  598|      0|                     ((domain == XML_FROM_PARSER) ||
  ------------------
  |  Branch (598:23): [True: 0, False: 0]
  ------------------
  599|      0|                      (domain == XML_FROM_SCHEMASV) ||
  ------------------
  |  Branch (599:23): [True: 0, False: 0]
  ------------------
  600|      0|                      (domain == XML_FROM_SCHEMASP) ||
  ------------------
  |  Branch (600:23): [True: 0, False: 0]
  ------------------
  601|      0|                      (domain == XML_FROM_DTD) ||
  ------------------
  |  Branch (601:23): [True: 0, False: 0]
  ------------------
  602|      0|                      (domain == XML_FROM_RELAXNGP) ||
  ------------------
  |  Branch (602:23): [True: 0, False: 0]
  ------------------
  603|      0|                      (domain == XML_FROM_RELAXNGV)))
  ------------------
  |  Branch (603:23): [True: 0, False: 0]
  ------------------
  604|      0|                channel(data, "Entity: line %d: \n", cur->line);
  605|      0|            xmlParserPrintFileContextInternal(cur, channel, data);
  606|      0|        }
  607|      1|    }
  608|      1|    if ((domain == XML_FROM_XPATH) && (err->str1 != NULL) &&
  ------------------
  |  Branch (608:9): [True: 0, False: 1]
  |  Branch (608:39): [True: 0, False: 0]
  ------------------
  609|      0|        (err->int1 < 100) &&
  ------------------
  |  Branch (609:9): [True: 0, False: 0]
  ------------------
  610|      0|	(err->int1 < xmlStrlen((const xmlChar *)err->str1))) {
  ------------------
  |  Branch (610:2): [True: 0, False: 0]
  ------------------
  611|      0|	xmlChar buf[150];
  612|      0|	int i;
  613|       |
  614|      0|	channel(data, "%s\n", err->str1);
  615|      0|	for (i=0;i < err->int1;i++)
  ------------------
  |  Branch (615:11): [True: 0, False: 0]
  ------------------
  616|      0|	     buf[i] = ' ';
  617|      0|	buf[i++] = '^';
  618|      0|	buf[i] = 0;
  619|      0|	channel(data, "%s\n", buf);
  620|      0|    }
  621|      1|}
xmlRaiseMemoryError:
  639|   358k|{
  640|   358k|    xmlError *lastError = xmlGetLastErrorInternal();
  641|       |
  642|   358k|    xmlResetLastError();
  643|   358k|    lastError->domain = domain;
  644|   358k|    lastError->code = XML_ERR_NO_MEMORY;
  645|   358k|    lastError->level = XML_ERR_FATAL;
  646|       |
  647|   358k|    if (error != NULL) {
  ------------------
  |  Branch (647:9): [True: 358k, False: 8]
  ------------------
  648|   358k|        xmlResetError(error);
  649|   358k|        error->domain = domain;
  650|   358k|        error->code = XML_ERR_NO_MEMORY;
  651|   358k|        error->level = XML_ERR_FATAL;
  652|   358k|    }
  653|       |
  654|   358k|    if (schannel != NULL) {
  ------------------
  |  Branch (654:9): [True: 0, False: 358k]
  ------------------
  655|      0|        schannel(data, lastError);
  656|   358k|    } else if (xmlStructuredError != NULL) {
  ------------------
  |  |  990|   358k|  #define xmlStructuredError (*__xmlStructuredError())
  ------------------
  |  Branch (656:16): [True: 0, False: 358k]
  ------------------
  657|      0|        xmlStructuredError(xmlStructuredErrorContext, lastError);
  ------------------
  |  |  990|      0|  #define xmlStructuredError (*__xmlStructuredError())
  ------------------
                      xmlStructuredError(xmlStructuredErrorContext, lastError);
  ------------------
  |  |  997|      0|  #define xmlStructuredErrorContext (*__xmlStructuredErrorContext())
  ------------------
  658|   358k|    } else if (channel != NULL) {
  ------------------
  |  Branch (658:16): [True: 33, False: 358k]
  ------------------
  659|     33|        channel(data, "libxml2: out of memory\n");
  660|     33|    }
  661|   358k|}
xmlVRaiseError:
  694|    191|{
  695|    191|    xmlParserCtxtPtr ctxt = NULL;
  696|       |    /* xmlLastError is a macro retrieving the per-thread global. */
  697|    191|    xmlErrorPtr lastError = xmlGetLastErrorInternal();
  698|    191|    xmlErrorPtr to = lastError;
  699|       |
  700|    191|    if (code == XML_ERR_OK)
  ------------------
  |  Branch (700:9): [True: 0, False: 191]
  ------------------
  701|      0|        return(0);
  702|    191|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  703|    191|    if (code == XML_ERR_INTERNAL_ERROR)
  ------------------
  |  Branch (703:9): [True: 0, False: 191]
  ------------------
  704|      0|        xmlAbort("Unexpected internal error: %s\n", msg);
  705|    191|#endif
  706|    191|    if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING))
  ------------------
  |  | 1309|    191|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (706:9): [True: 0, False: 191]
  |  Branch (706:46): [True: 0, False: 0]
  ------------------
  707|      0|        return(0);
  708|       |
  709|    191|    if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||
  ------------------
  |  Branch (709:9): [True: 0, False: 191]
  |  Branch (709:40): [True: 0, False: 191]
  ------------------
  710|    191|        (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) ||
  ------------------
  |  Branch (710:9): [True: 0, False: 191]
  |  Branch (710:37): [True: 0, False: 191]
  ------------------
  711|    191|	(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
  ------------------
  |  Branch (711:2): [True: 1, False: 190]
  |  Branch (711:29): [True: 38, False: 152]
  ------------------
  712|     39|	ctxt = (xmlParserCtxtPtr) ctx;
  713|       |
  714|     39|        if (ctxt != NULL)
  ------------------
  |  Branch (714:13): [True: 1, False: 38]
  ------------------
  715|      1|            to = &ctxt->lastError;
  716|     39|    }
  717|       |
  718|    191|    if (xmlVUpdateError(to, ctxt, node, domain, code, level, file, line,
  ------------------
  |  Branch (718:9): [True: 0, False: 191]
  ------------------
  719|    191|                        str1, str2, str3, int1, col, msg, ap))
  720|      0|        return(-1);
  721|       |
  722|    191|    if (to != lastError) {
  ------------------
  |  Branch (722:9): [True: 1, False: 190]
  ------------------
  723|      1|        if (xmlCopyError(to, lastError) < 0)
  ------------------
  |  Branch (723:13): [True: 0, False: 1]
  ------------------
  724|      0|            return(-1);
  725|      1|    }
  726|       |
  727|    191|    if (schannel != NULL) {
  ------------------
  |  Branch (727:9): [True: 0, False: 191]
  ------------------
  728|      0|	schannel(data, to);
  729|    191|    } else if (xmlStructuredError != NULL) {
  ------------------
  |  |  990|    191|  #define xmlStructuredError (*__xmlStructuredError())
  ------------------
  |  Branch (729:16): [True: 0, False: 191]
  ------------------
  730|      0|        xmlStructuredError(xmlStructuredErrorContext, to);
  ------------------
  |  |  990|      0|  #define xmlStructuredError (*__xmlStructuredError())
  ------------------
                      xmlStructuredError(xmlStructuredErrorContext, to);
  ------------------
  |  |  997|      0|  #define xmlStructuredErrorContext (*__xmlStructuredErrorContext())
  ------------------
  731|    191|    } else if (channel != NULL) {
  ------------------
  |  Branch (731:16): [True: 128, False: 63]
  ------------------
  732|       |        /* Don't invoke legacy error handlers */
  733|    128|        if ((channel == xmlGenericErrorDefaultFunc) ||
  ------------------
  |  Branch (733:13): [True: 0, False: 128]
  ------------------
  734|    128|            (channel == xmlParserError) ||
  ------------------
  |  Branch (734:13): [True: 0, False: 128]
  ------------------
  735|    128|            (channel == xmlParserWarning) ||
  ------------------
  |  Branch (735:13): [True: 1, False: 127]
  ------------------
  736|    127|            (channel == xmlParserValidityError) ||
  ------------------
  |  Branch (736:13): [True: 0, False: 127]
  ------------------
  737|    127|            (channel == xmlParserValidityWarning))
  ------------------
  |  Branch (737:13): [True: 0, False: 127]
  ------------------
  738|      1|            xmlFormatError(to, xmlGenericError, xmlGenericErrorContext);
  ------------------
  |  |  976|      1|  #define xmlGenericError (*__xmlGenericError())
  ------------------
                          xmlFormatError(to, xmlGenericError, xmlGenericErrorContext);
  ------------------
  |  |  983|      1|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  739|    127|        else
  740|    127|	    channel(data, "%s", to->message);
  741|    128|    }
  742|       |
  743|    191|    return(0);
  744|    191|}
xmlRaiseError:
  777|     25|{
  778|     25|    va_list ap;
  779|     25|    int res;
  780|       |
  781|     25|    va_start(ap, msg);
  782|     25|    res = xmlVRaiseError(schannel, channel, data, ctx, node, domain, code,
  783|     25|                         level, file, line, str1, str2, str3, int1, col, msg,
  784|     25|                         ap);
  785|     25|    va_end(ap);
  786|       |
  787|     25|    return(res);
  788|     25|}
xmlParserError:
  842|     33|{
  843|     33|    va_list ap;
  844|       |
  845|     33|    va_start(ap, msg);
  846|     33|    xmlVFormatLegacyError(ctx, "error", msg, ap);
  847|       |    va_end(ap);
  848|     33|}
xmlGetLastError:
  936|      1|{
  937|      1|    const xmlError *error = xmlGetLastErrorInternal();
  938|       |
  939|      1|    if (error->code == XML_ERR_OK)
  ------------------
  |  Branch (939:9): [True: 1, False: 0]
  ------------------
  940|      1|        return(NULL);
  941|      0|    return(error);
  942|      1|}
xmlResetError:
  951|   718k|{
  952|   718k|    if (err == NULL)
  ------------------
  |  Branch (952:9): [True: 0, False: 718k]
  ------------------
  953|      0|        return;
  954|   718k|    if (err->code == XML_ERR_OK)
  ------------------
  |  Branch (954:9): [True: 621, False: 717k]
  ------------------
  955|    621|        return;
  956|   717k|    if (err->message != NULL)
  ------------------
  |  Branch (956:9): [True: 191, False: 717k]
  ------------------
  957|    191|        xmlFree(err->message);
  958|   717k|    if (err->file != NULL)
  ------------------
  |  Branch (958:9): [True: 0, False: 717k]
  ------------------
  959|      0|        xmlFree(err->file);
  960|   717k|    if (err->str1 != NULL)
  ------------------
  |  Branch (960:9): [True: 175, False: 717k]
  ------------------
  961|    175|        xmlFree(err->str1);
  962|   717k|    if (err->str2 != NULL)
  ------------------
  |  Branch (962:9): [True: 0, False: 717k]
  ------------------
  963|      0|        xmlFree(err->str2);
  964|   717k|    if (err->str3 != NULL)
  ------------------
  |  Branch (964:9): [True: 0, False: 717k]
  ------------------
  965|      0|        xmlFree(err->str3);
  966|   717k|    memset(err, 0, sizeof(xmlError));
  967|   717k|    err->code = XML_ERR_OK;
  968|   717k|}
xmlResetLastError:
  975|   358k|{
  976|   358k|    xmlError *error = xmlGetLastErrorInternal();
  977|       |
  978|   358k|    if (error->code != XML_ERR_OK)
  ------------------
  |  Branch (978:9): [True: 358k, False: 115]
  ------------------
  979|   358k|        xmlResetError(error);
  980|   358k|}
xmlCopyError:
  990|      1|xmlCopyError(const xmlError *from, xmlError *to) {
  991|      1|    const char *fmt = NULL;
  992|       |
  993|      1|    if ((from == NULL) || (to == NULL))
  ------------------
  |  Branch (993:9): [True: 0, False: 1]
  |  Branch (993:27): [True: 0, False: 1]
  ------------------
  994|      0|        return(-1);
  995|       |
  996|      1|    if (from->message != NULL)
  ------------------
  |  Branch (996:9): [True: 1, False: 0]
  ------------------
  997|      1|        fmt = "%s";
  998|       |
  999|      1|    return(xmlSetError(to, from->ctxt, from->node,
 1000|      1|                       from->domain, from->code, from->level,
 1001|      1|                       from->file, from->line,
 1002|      1|                       from->str1, from->str2, from->str3,
 1003|      1|                       from->int1, from->int2,
 1004|      1|                       fmt, from->message));
 1005|      1|}
xmlErrString:
 1012|     34|xmlErrString(xmlParserErrors code) {
 1013|     34|    const char *errmsg;
 1014|       |
 1015|     34|    switch (code) {
 1016|      0|        case XML_ERR_INVALID_HEX_CHARREF:
  ------------------
  |  Branch (1016:9): [True: 0, False: 34]
  ------------------
 1017|      0|            errmsg = "CharRef: invalid hexadecimal value";
 1018|      0|            break;
 1019|      0|        case XML_ERR_INVALID_DEC_CHARREF:
  ------------------
  |  Branch (1019:9): [True: 0, False: 34]
  ------------------
 1020|      0|            errmsg = "CharRef: invalid decimal value";
 1021|      0|            break;
 1022|      0|        case XML_ERR_INVALID_CHARREF:
  ------------------
  |  Branch (1022:9): [True: 0, False: 34]
  ------------------
 1023|      0|            errmsg = "CharRef: invalid value";
 1024|      0|            break;
 1025|      0|        case XML_ERR_INTERNAL_ERROR:
  ------------------
  |  Branch (1025:9): [True: 0, False: 34]
  ------------------
 1026|      0|            errmsg = "internal error";
 1027|      0|            break;
 1028|      0|        case XML_ERR_PEREF_AT_EOF:
  ------------------
  |  Branch (1028:9): [True: 0, False: 34]
  ------------------
 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: 34]
  ------------------
 1032|      0|            errmsg = "PEReference in prolog";
 1033|      0|            break;
 1034|      0|        case XML_ERR_PEREF_IN_EPILOG:
  ------------------
  |  Branch (1034:9): [True: 0, False: 34]
  ------------------
 1035|      0|            errmsg = "PEReference in epilog";
 1036|      0|            break;
 1037|      0|        case XML_ERR_PEREF_NO_NAME:
  ------------------
  |  Branch (1037:9): [True: 0, False: 34]
  ------------------
 1038|      0|            errmsg = "PEReference: no name";
 1039|      0|            break;
 1040|      0|        case XML_ERR_PEREF_SEMICOL_MISSING:
  ------------------
  |  Branch (1040:9): [True: 0, False: 34]
  ------------------
 1041|      0|            errmsg = "PEReference: expecting ';'";
 1042|      0|            break;
 1043|      0|        case XML_ERR_ENTITY_LOOP:
  ------------------
  |  Branch (1043:9): [True: 0, False: 34]
  ------------------
 1044|      0|            errmsg = "Detected an entity reference loop";
 1045|      0|            break;
 1046|      0|        case XML_ERR_ENTITY_NOT_STARTED:
  ------------------
  |  Branch (1046:9): [True: 0, False: 34]
  ------------------
 1047|      0|            errmsg = "EntityValue: \" or ' expected";
 1048|      0|            break;
 1049|      0|        case XML_ERR_ENTITY_PE_INTERNAL:
  ------------------
  |  Branch (1049:9): [True: 0, False: 34]
  ------------------
 1050|      0|            errmsg = "PEReferences forbidden in internal subset";
 1051|      0|            break;
 1052|      0|        case XML_ERR_ENTITY_NOT_FINISHED:
  ------------------
  |  Branch (1052:9): [True: 0, False: 34]
  ------------------
 1053|      0|            errmsg = "EntityValue: \" or ' expected";
 1054|      0|            break;
 1055|      0|        case XML_ERR_ATTRIBUTE_NOT_STARTED:
  ------------------
  |  Branch (1055:9): [True: 0, False: 34]
  ------------------
 1056|      0|            errmsg = "AttValue: \" or ' expected";
 1057|      0|            break;
 1058|      0|        case XML_ERR_LT_IN_ATTRIBUTE:
  ------------------
  |  Branch (1058:9): [True: 0, False: 34]
  ------------------
 1059|      0|            errmsg = "Unescaped '<' not allowed in attributes values";
 1060|      0|            break;
 1061|      0|        case XML_ERR_LITERAL_NOT_STARTED:
  ------------------
  |  Branch (1061:9): [True: 0, False: 34]
  ------------------
 1062|      0|            errmsg = "SystemLiteral \" or ' expected";
 1063|      0|            break;
 1064|      0|        case XML_ERR_LITERAL_NOT_FINISHED:
  ------------------
  |  Branch (1064:9): [True: 0, False: 34]
  ------------------
 1065|      0|            errmsg = "Unfinished System or Public ID \" or ' expected";
 1066|      0|            break;
 1067|      0|        case XML_ERR_MISPLACED_CDATA_END:
  ------------------
  |  Branch (1067:9): [True: 0, False: 34]
  ------------------
 1068|      0|            errmsg = "Sequence ']]>' not allowed in content";
 1069|      0|            break;
 1070|      0|        case XML_ERR_URI_REQUIRED:
  ------------------
  |  Branch (1070:9): [True: 0, False: 34]
  ------------------
 1071|      0|            errmsg = "SYSTEM or PUBLIC, the URI is missing";
 1072|      0|            break;
 1073|      0|        case XML_ERR_PUBID_REQUIRED:
  ------------------
  |  Branch (1073:9): [True: 0, False: 34]
  ------------------
 1074|      0|            errmsg = "PUBLIC, the Public Identifier is missing";
 1075|      0|            break;
 1076|      0|        case XML_ERR_HYPHEN_IN_COMMENT:
  ------------------
  |  Branch (1076:9): [True: 0, False: 34]
  ------------------
 1077|      0|            errmsg = "Comment must not contain '--' (double-hyphen)";
 1078|      0|            break;
 1079|      0|        case XML_ERR_PI_NOT_STARTED:
  ------------------
  |  Branch (1079:9): [True: 0, False: 34]
  ------------------
 1080|      0|            errmsg = "xmlParsePI : no target name";
 1081|      0|            break;
 1082|      0|        case XML_ERR_RESERVED_XML_NAME:
  ------------------
  |  Branch (1082:9): [True: 0, False: 34]
  ------------------
 1083|      0|            errmsg = "Invalid PI name";
 1084|      0|            break;
 1085|      0|        case XML_ERR_NOTATION_NOT_STARTED:
  ------------------
  |  Branch (1085:9): [True: 0, False: 34]
  ------------------
 1086|      0|            errmsg = "NOTATION: Name expected here";
 1087|      0|            break;
 1088|      0|        case XML_ERR_NOTATION_NOT_FINISHED:
  ------------------
  |  Branch (1088:9): [True: 0, False: 34]
  ------------------
 1089|      0|            errmsg = "'>' required to close NOTATION declaration";
 1090|      0|            break;
 1091|      0|        case XML_ERR_VALUE_REQUIRED:
  ------------------
  |  Branch (1091:9): [True: 0, False: 34]
  ------------------
 1092|      0|            errmsg = "Entity value required";
 1093|      0|            break;
 1094|      0|        case XML_ERR_URI_FRAGMENT:
  ------------------
  |  Branch (1094:9): [True: 0, False: 34]
  ------------------
 1095|      0|            errmsg = "Fragment not allowed";
 1096|      0|            break;
 1097|      0|        case XML_ERR_ATTLIST_NOT_STARTED:
  ------------------
  |  Branch (1097:9): [True: 0, False: 34]
  ------------------
 1098|      0|            errmsg = "'(' required to start ATTLIST enumeration";
 1099|      0|            break;
 1100|      0|        case XML_ERR_NMTOKEN_REQUIRED:
  ------------------
  |  Branch (1100:9): [True: 0, False: 34]
  ------------------
 1101|      0|            errmsg = "NmToken expected in ATTLIST enumeration";
 1102|      0|            break;
 1103|      0|        case XML_ERR_ATTLIST_NOT_FINISHED:
  ------------------
  |  Branch (1103:9): [True: 0, False: 34]
  ------------------
 1104|      0|            errmsg = "')' required to finish ATTLIST enumeration";
 1105|      0|            break;
 1106|      0|        case XML_ERR_MIXED_NOT_STARTED:
  ------------------
  |  Branch (1106:9): [True: 0, False: 34]
  ------------------
 1107|      0|            errmsg = "MixedContentDecl : '|' or ')*' expected";
 1108|      0|            break;
 1109|      0|        case XML_ERR_PCDATA_REQUIRED:
  ------------------
  |  Branch (1109:9): [True: 0, False: 34]
  ------------------
 1110|      0|            errmsg = "MixedContentDecl : '#PCDATA' expected";
 1111|      0|            break;
 1112|      0|        case XML_ERR_ELEMCONTENT_NOT_STARTED:
  ------------------
  |  Branch (1112:9): [True: 0, False: 34]
  ------------------
 1113|      0|            errmsg = "ContentDecl : Name or '(' expected";
 1114|      0|            break;
 1115|      0|        case XML_ERR_ELEMCONTENT_NOT_FINISHED:
  ------------------
  |  Branch (1115:9): [True: 0, False: 34]
  ------------------
 1116|      0|            errmsg = "ContentDecl : ',' '|' or ')' expected";
 1117|      0|            break;
 1118|      0|        case XML_ERR_PEREF_IN_INT_SUBSET:
  ------------------
  |  Branch (1118:9): [True: 0, False: 34]
  ------------------
 1119|      0|            errmsg =
 1120|      0|                "PEReference: forbidden within markup decl in internal subset";
 1121|      0|            break;
 1122|      0|        case XML_ERR_GT_REQUIRED:
  ------------------
  |  Branch (1122:9): [True: 0, False: 34]
  ------------------
 1123|      0|            errmsg = "expected '>'";
 1124|      0|            break;
 1125|      0|        case XML_ERR_CONDSEC_INVALID:
  ------------------
  |  Branch (1125:9): [True: 0, False: 34]
  ------------------
 1126|      0|            errmsg = "XML conditional section '[' expected";
 1127|      0|            break;
 1128|      0|        case XML_ERR_INT_SUBSET_NOT_FINISHED:
  ------------------
  |  Branch (1128:9): [True: 0, False: 34]
  ------------------
 1129|      0|            errmsg = "Content error in the internal subset";
 1130|      0|            break;
 1131|      0|        case XML_ERR_EXT_SUBSET_NOT_FINISHED:
  ------------------
  |  Branch (1131:9): [True: 0, False: 34]
  ------------------
 1132|      0|            errmsg = "Content error in the external subset";
 1133|      0|            break;
 1134|      0|        case XML_ERR_CONDSEC_INVALID_KEYWORD:
  ------------------
  |  Branch (1134:9): [True: 0, False: 34]
  ------------------
 1135|      0|            errmsg =
 1136|      0|                "conditional section INCLUDE or IGNORE keyword expected";
 1137|      0|            break;
 1138|      0|        case XML_ERR_CONDSEC_NOT_FINISHED:
  ------------------
  |  Branch (1138:9): [True: 0, False: 34]
  ------------------
 1139|      0|            errmsg = "XML conditional section not closed";
 1140|      0|            break;
 1141|      0|        case XML_ERR_XMLDECL_NOT_STARTED:
  ------------------
  |  Branch (1141:9): [True: 0, False: 34]
  ------------------
 1142|      0|            errmsg = "Text declaration '<?xml' required";
 1143|      0|            break;
 1144|      0|        case XML_ERR_XMLDECL_NOT_FINISHED:
  ------------------
  |  Branch (1144:9): [True: 0, False: 34]
  ------------------
 1145|      0|            errmsg = "parsing XML declaration: '?>' expected";
 1146|      0|            break;
 1147|      0|        case XML_ERR_EXT_ENTITY_STANDALONE:
  ------------------
  |  Branch (1147:9): [True: 0, False: 34]
  ------------------
 1148|      0|            errmsg = "external parsed entities cannot be standalone";
 1149|      0|            break;
 1150|      0|        case XML_ERR_ENTITYREF_SEMICOL_MISSING:
  ------------------
  |  Branch (1150:9): [True: 0, False: 34]
  ------------------
 1151|      0|            errmsg = "EntityRef: expecting ';'";
 1152|      0|            break;
 1153|      0|        case XML_ERR_DOCTYPE_NOT_FINISHED:
  ------------------
  |  Branch (1153:9): [True: 0, False: 34]
  ------------------
 1154|      0|            errmsg = "DOCTYPE improperly terminated";
 1155|      0|            break;
 1156|      0|        case XML_ERR_LTSLASH_REQUIRED:
  ------------------
  |  Branch (1156:9): [True: 0, False: 34]
  ------------------
 1157|      0|            errmsg = "EndTag: '</' not found";
 1158|      0|            break;
 1159|      0|        case XML_ERR_EQUAL_REQUIRED:
  ------------------
  |  Branch (1159:9): [True: 0, False: 34]
  ------------------
 1160|      0|            errmsg = "expected '='";
 1161|      0|            break;
 1162|      0|        case XML_ERR_STRING_NOT_CLOSED:
  ------------------
  |  Branch (1162:9): [True: 0, False: 34]
  ------------------
 1163|      0|            errmsg = "String not closed expecting \" or '";
 1164|      0|            break;
 1165|      0|        case XML_ERR_STRING_NOT_STARTED:
  ------------------
  |  Branch (1165:9): [True: 0, False: 34]
  ------------------
 1166|      0|            errmsg = "String not started expecting ' or \"";
 1167|      0|            break;
 1168|      0|        case XML_ERR_ENCODING_NAME:
  ------------------
  |  Branch (1168:9): [True: 0, False: 34]
  ------------------
 1169|      0|            errmsg = "Invalid XML encoding name";
 1170|      0|            break;
 1171|      0|        case XML_ERR_STANDALONE_VALUE:
  ------------------
  |  Branch (1171:9): [True: 0, False: 34]
  ------------------
 1172|      0|            errmsg = "standalone accepts only 'yes' or 'no'";
 1173|      0|            break;
 1174|      0|        case XML_ERR_DOCUMENT_EMPTY:
  ------------------
  |  Branch (1174:9): [True: 0, False: 34]
  ------------------
 1175|      0|            errmsg = "Document is empty";
 1176|      0|            break;
 1177|      0|        case XML_ERR_DOCUMENT_END:
  ------------------
  |  Branch (1177:9): [True: 0, False: 34]
  ------------------
 1178|      0|            errmsg = "Extra content at the end of the document";
 1179|      0|            break;
 1180|      0|        case XML_ERR_NOT_WELL_BALANCED:
  ------------------
  |  Branch (1180:9): [True: 0, False: 34]
  ------------------
 1181|      0|            errmsg = "chunk is not well balanced";
 1182|      0|            break;
 1183|      0|        case XML_ERR_EXTRA_CONTENT:
  ------------------
  |  Branch (1183:9): [True: 0, False: 34]
  ------------------
 1184|      0|            errmsg = "extra content at the end of well balanced chunk";
 1185|      0|            break;
 1186|      0|        case XML_ERR_VERSION_MISSING:
  ------------------
  |  Branch (1186:9): [True: 0, False: 34]
  ------------------
 1187|      0|            errmsg = "Malformed declaration expecting version";
 1188|      0|            break;
 1189|      0|        case XML_ERR_NAME_TOO_LONG:
  ------------------
  |  Branch (1189:9): [True: 0, False: 34]
  ------------------
 1190|      0|            errmsg = "Name too long";
 1191|      0|            break;
 1192|      0|        case XML_ERR_INVALID_ENCODING:
  ------------------
  |  Branch (1192:9): [True: 0, False: 34]
  ------------------
 1193|      0|            errmsg = "Invalid bytes in character encoding";
 1194|      0|            break;
 1195|      0|        case XML_ERR_RESOURCE_LIMIT:
  ------------------
  |  Branch (1195:9): [True: 0, False: 34]
  ------------------
 1196|      0|            errmsg = "Resource limit exceeded";
 1197|      0|            break;
 1198|      0|        case XML_ERR_ARGUMENT:
  ------------------
  |  Branch (1198:9): [True: 0, False: 34]
  ------------------
 1199|      0|            errmsg = "Invalid argument";
 1200|      0|            break;
 1201|      0|        case XML_ERR_SYSTEM:
  ------------------
  |  Branch (1201:9): [True: 0, False: 34]
  ------------------
 1202|      0|            errmsg = "Out of system resources";
 1203|      0|            break;
 1204|      0|        case XML_ERR_REDECL_PREDEF_ENTITY:
  ------------------
  |  Branch (1204:9): [True: 0, False: 34]
  ------------------
 1205|      0|            errmsg = "Invalid redeclaration of predefined entity";
 1206|      0|            break;
 1207|      0|        case XML_ERR_UNSUPPORTED_ENCODING:
  ------------------
  |  Branch (1207:9): [True: 0, False: 34]
  ------------------
 1208|      0|            errmsg = "Unsupported encoding";
 1209|      0|            break;
 1210|      0|        case XML_ERR_INVALID_CHAR:
  ------------------
  |  Branch (1210:9): [True: 0, False: 34]
  ------------------
 1211|      0|            errmsg = "Invalid character";
 1212|      0|            break;
 1213|       |
 1214|      0|        case XML_IO_UNKNOWN:
  ------------------
  |  Branch (1214:9): [True: 0, False: 34]
  ------------------
 1215|      0|            errmsg = "Unknown IO error"; break;
 1216|      0|        case XML_IO_EACCES:
  ------------------
  |  Branch (1216:9): [True: 0, False: 34]
  ------------------
 1217|      0|            errmsg = "Permission denied"; break;
 1218|      0|        case XML_IO_EAGAIN:
  ------------------
  |  Branch (1218:9): [True: 0, False: 34]
  ------------------
 1219|      0|            errmsg = "Resource temporarily unavailable"; break;
 1220|      0|        case XML_IO_EBADF:
  ------------------
  |  Branch (1220:9): [True: 0, False: 34]
  ------------------
 1221|      0|            errmsg = "Bad file descriptor"; break;
 1222|      0|        case XML_IO_EBADMSG:
  ------------------
  |  Branch (1222:9): [True: 0, False: 34]
  ------------------
 1223|      0|            errmsg = "Bad message"; break;
 1224|      0|        case XML_IO_EBUSY:
  ------------------
  |  Branch (1224:9): [True: 0, False: 34]
  ------------------
 1225|      0|            errmsg = "Resource busy"; break;
 1226|      0|        case XML_IO_ECANCELED:
  ------------------
  |  Branch (1226:9): [True: 0, False: 34]
  ------------------
 1227|      0|            errmsg = "Operation canceled"; break;
 1228|      0|        case XML_IO_ECHILD:
  ------------------
  |  Branch (1228:9): [True: 0, False: 34]
  ------------------
 1229|      0|            errmsg = "No child processes"; break;
 1230|      0|        case XML_IO_EDEADLK:
  ------------------
  |  Branch (1230:9): [True: 0, False: 34]
  ------------------
 1231|      0|            errmsg = "Resource deadlock avoided"; break;
 1232|      0|        case XML_IO_EDOM:
  ------------------
  |  Branch (1232:9): [True: 0, False: 34]
  ------------------
 1233|      0|            errmsg = "Domain error"; break;
 1234|      0|        case XML_IO_EEXIST:
  ------------------
  |  Branch (1234:9): [True: 0, False: 34]
  ------------------
 1235|      0|            errmsg = "File exists"; break;
 1236|      0|        case XML_IO_EFAULT:
  ------------------
  |  Branch (1236:9): [True: 0, False: 34]
  ------------------
 1237|      0|            errmsg = "Bad address"; break;
 1238|      0|        case XML_IO_EFBIG:
  ------------------
  |  Branch (1238:9): [True: 0, False: 34]
  ------------------
 1239|      0|            errmsg = "File too large"; break;
 1240|      0|        case XML_IO_EINPROGRESS:
  ------------------
  |  Branch (1240:9): [True: 0, False: 34]
  ------------------
 1241|      0|            errmsg = "Operation in progress"; break;
 1242|      0|        case XML_IO_EINTR:
  ------------------
  |  Branch (1242:9): [True: 0, False: 34]
  ------------------
 1243|      0|            errmsg = "Interrupted function call"; break;
 1244|      0|        case XML_IO_EINVAL:
  ------------------
  |  Branch (1244:9): [True: 0, False: 34]
  ------------------
 1245|      0|            errmsg = "Invalid argument"; break;
 1246|      0|        case XML_IO_EIO:
  ------------------
  |  Branch (1246:9): [True: 0, False: 34]
  ------------------
 1247|      0|            errmsg = "Input/output error"; break;
 1248|      0|        case XML_IO_EISDIR:
  ------------------
  |  Branch (1248:9): [True: 0, False: 34]
  ------------------
 1249|      0|            errmsg = "Is a directory"; break;
 1250|      0|        case XML_IO_EMFILE:
  ------------------
  |  Branch (1250:9): [True: 0, False: 34]
  ------------------
 1251|      0|            errmsg = "Too many open files"; break;
 1252|      0|        case XML_IO_EMLINK:
  ------------------
  |  Branch (1252:9): [True: 0, False: 34]
  ------------------
 1253|      0|            errmsg = "Too many links"; break;
 1254|      0|        case XML_IO_EMSGSIZE:
  ------------------
  |  Branch (1254:9): [True: 0, False: 34]
  ------------------
 1255|      0|            errmsg = "Inappropriate message buffer length"; break;
 1256|      0|        case XML_IO_ENAMETOOLONG:
  ------------------
  |  Branch (1256:9): [True: 0, False: 34]
  ------------------
 1257|      0|            errmsg = "Filename too long"; break;
 1258|      0|        case XML_IO_ENFILE:
  ------------------
  |  Branch (1258:9): [True: 0, False: 34]
  ------------------
 1259|      0|            errmsg = "Too many open files in system"; break;
 1260|      0|        case XML_IO_ENODEV:
  ------------------
  |  Branch (1260:9): [True: 0, False: 34]
  ------------------
 1261|      0|            errmsg = "No such device"; break;
 1262|      1|        case XML_IO_ENOENT:
  ------------------
  |  Branch (1262:9): [True: 1, False: 33]
  ------------------
 1263|      1|            errmsg = "No such file or directory"; break;
 1264|      0|        case XML_IO_ENOEXEC:
  ------------------
  |  Branch (1264:9): [True: 0, False: 34]
  ------------------
 1265|      0|            errmsg = "Exec format error"; break;
 1266|      0|        case XML_IO_ENOLCK:
  ------------------
  |  Branch (1266:9): [True: 0, False: 34]
  ------------------
 1267|      0|            errmsg = "No locks available"; break;
 1268|      0|        case XML_IO_ENOMEM:
  ------------------
  |  Branch (1268:9): [True: 0, False: 34]
  ------------------
 1269|      0|            errmsg = "Not enough space"; break;
 1270|      0|        case XML_IO_ENOSPC:
  ------------------
  |  Branch (1270:9): [True: 0, False: 34]
  ------------------
 1271|      0|            errmsg = "No space left on device"; break;
 1272|      0|        case XML_IO_ENOSYS:
  ------------------
  |  Branch (1272:9): [True: 0, False: 34]
  ------------------
 1273|      0|            errmsg = "Function not implemented"; break;
 1274|      0|        case XML_IO_ENOTDIR:
  ------------------
  |  Branch (1274:9): [True: 0, False: 34]
  ------------------
 1275|      0|            errmsg = "Not a directory"; break;
 1276|      0|        case XML_IO_ENOTEMPTY:
  ------------------
  |  Branch (1276:9): [True: 0, False: 34]
  ------------------
 1277|      0|            errmsg = "Directory not empty"; break;
 1278|      0|        case XML_IO_ENOTSUP:
  ------------------
  |  Branch (1278:9): [True: 0, False: 34]
  ------------------
 1279|      0|            errmsg = "Not supported"; break;
 1280|      0|        case XML_IO_ENOTTY:
  ------------------
  |  Branch (1280:9): [True: 0, False: 34]
  ------------------
 1281|      0|            errmsg = "Inappropriate I/O control operation"; break;
 1282|      0|        case XML_IO_ENXIO:
  ------------------
  |  Branch (1282:9): [True: 0, False: 34]
  ------------------
 1283|      0|            errmsg = "No such device or address"; break;
 1284|      0|        case XML_IO_EPERM:
  ------------------
  |  Branch (1284:9): [True: 0, False: 34]
  ------------------
 1285|      0|            errmsg = "Operation not permitted"; break;
 1286|      0|        case XML_IO_EPIPE:
  ------------------
  |  Branch (1286:9): [True: 0, False: 34]
  ------------------
 1287|      0|            errmsg = "Broken pipe"; break;
 1288|      0|        case XML_IO_ERANGE:
  ------------------
  |  Branch (1288:9): [True: 0, False: 34]
  ------------------
 1289|      0|            errmsg = "Result too large"; break;
 1290|      0|        case XML_IO_EROFS:
  ------------------
  |  Branch (1290:9): [True: 0, False: 34]
  ------------------
 1291|      0|            errmsg = "Read-only file system"; break;
 1292|      0|        case XML_IO_ESPIPE:
  ------------------
  |  Branch (1292:9): [True: 0, False: 34]
  ------------------
 1293|      0|            errmsg = "Invalid seek"; break;
 1294|      0|        case XML_IO_ESRCH:
  ------------------
  |  Branch (1294:9): [True: 0, False: 34]
  ------------------
 1295|      0|            errmsg = "No such process"; break;
 1296|      0|        case XML_IO_ETIMEDOUT:
  ------------------
  |  Branch (1296:9): [True: 0, False: 34]
  ------------------
 1297|      0|            errmsg = "Operation timed out"; break;
 1298|      0|        case XML_IO_EXDEV:
  ------------------
  |  Branch (1298:9): [True: 0, False: 34]
  ------------------
 1299|      0|            errmsg = "Improper link"; break;
 1300|      0|        case XML_IO_NETWORK_ATTEMPT:
  ------------------
  |  Branch (1300:9): [True: 0, False: 34]
  ------------------
 1301|      0|            errmsg = "Attempt to load network entity"; break;
 1302|      0|        case XML_IO_ENCODER:
  ------------------
  |  Branch (1302:9): [True: 0, False: 34]
  ------------------
 1303|      0|            errmsg = "encoder error"; break;
 1304|      0|        case XML_IO_FLUSH:
  ------------------
  |  Branch (1304:9): [True: 0, False: 34]
  ------------------
 1305|      0|            errmsg = "flush error"; break;
 1306|      0|        case XML_IO_WRITE:
  ------------------
  |  Branch (1306:9): [True: 0, False: 34]
  ------------------
 1307|      0|            errmsg = "write error"; break;
 1308|      0|        case XML_IO_NO_INPUT:
  ------------------
  |  Branch (1308:9): [True: 0, False: 34]
  ------------------
 1309|      0|            errmsg = "no input"; break;
 1310|      0|        case XML_IO_BUFFER_FULL:
  ------------------
  |  Branch (1310:9): [True: 0, False: 34]
  ------------------
 1311|      0|            errmsg = "buffer full"; break;
 1312|      0|        case XML_IO_LOAD_ERROR:
  ------------------
  |  Branch (1312:9): [True: 0, False: 34]
  ------------------
 1313|      0|            errmsg = "loading error"; break;
 1314|      0|        case XML_IO_ENOTSOCK:
  ------------------
  |  Branch (1314:9): [True: 0, False: 34]
  ------------------
 1315|      0|            errmsg = "not a socket"; break;
 1316|      0|        case XML_IO_EISCONN:
  ------------------
  |  Branch (1316:9): [True: 0, False: 34]
  ------------------
 1317|      0|            errmsg = "already connected"; break;
 1318|      0|        case XML_IO_ECONNREFUSED:
  ------------------
  |  Branch (1318:9): [True: 0, False: 34]
  ------------------
 1319|      0|            errmsg = "connection refused"; break;
 1320|      0|        case XML_IO_ENETUNREACH:
  ------------------
  |  Branch (1320:9): [True: 0, False: 34]
  ------------------
 1321|      0|            errmsg = "unreachable network"; break;
 1322|      0|        case XML_IO_EADDRINUSE:
  ------------------
  |  Branch (1322:9): [True: 0, False: 34]
  ------------------
 1323|      0|            errmsg = "address in use"; break;
 1324|      0|        case XML_IO_EALREADY:
  ------------------
  |  Branch (1324:9): [True: 0, False: 34]
  ------------------
 1325|      0|            errmsg = "already in use"; break;
 1326|      0|        case XML_IO_EAFNOSUPPORT:
  ------------------
  |  Branch (1326:9): [True: 0, False: 34]
  ------------------
 1327|      0|            errmsg = "unknown address family"; break;
 1328|      0|        case XML_IO_UNSUPPORTED_PROTOCOL:
  ------------------
  |  Branch (1328:9): [True: 0, False: 34]
  ------------------
 1329|      0|            errmsg = "unsupported protocol"; break;
 1330|       |
 1331|     33|        default:
  ------------------
  |  Branch (1331:9): [True: 33, False: 1]
  ------------------
 1332|     33|            errmsg = "Unregistered error message";
 1333|     34|    }
 1334|       |
 1335|     34|    return(errmsg);
 1336|     34|}
error.c:xmlParserPrintFileContextInternal:
  362|     34|		xmlGenericErrorFunc channel, void *data ) {
  363|     34|    const xmlChar *start;
  364|     34|    int n, col;
  365|     34|    xmlChar content[81]; /* space for 80 chars + line terminator */
  366|       |
  367|     34|    if ((input == NULL) || (input->cur == NULL))
  ------------------
  |  Branch (367:9): [True: 34, False: 0]
  |  Branch (367:28): [True: 0, False: 0]
  ------------------
  368|     34|        return;
  369|       |
  370|      0|    n = sizeof(content) - 1;
  371|      0|    xmlParserInputGetWindow(input, &start, &n, &col);
  372|       |
  373|      0|    memcpy(content, start, n);
  374|      0|    content[n] = 0;
  375|       |    /* print out the selected text */
  376|      0|    channel(data ,"%s\n", content);
  377|       |    /* create blank line with problem pointer */
  378|      0|    for (n = 0; n < col; n++) {
  ------------------
  |  Branch (378:17): [True: 0, False: 0]
  ------------------
  379|      0|	if (content[n] != '\t')
  ------------------
  |  Branch (379:6): [True: 0, False: 0]
  ------------------
  380|      0|	    content[n] = ' ';
  381|      0|    }
  382|      0|    content[n++] = '^';
  383|      0|    content[n] = 0;
  384|      0|    channel(data ,"%s\n", content);
  385|      0|}
error.c:xmlVUpdateError:
  180|    191|{
  181|    191|    int res;
  182|       |
  183|       |    /*
  184|       |     * Find first element parent.
  185|       |     */
  186|    191|    if (node != NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 191]
  ------------------
  187|      0|        int i;
  188|       |
  189|      0|        for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (189:21): [True: 0, False: 0]
  ------------------
  190|      0|            if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (190:17): [True: 0, False: 0]
  ------------------
  191|      0|                (node->parent == NULL))
  ------------------
  |  Branch (191:17): [True: 0, False: 0]
  ------------------
  192|      0|                break;
  193|      0|            node = node->parent;
  194|      0|        }
  195|      0|    }
  196|       |
  197|       |    /*
  198|       |     * Get file and line from node.
  199|       |     */
  200|    191|    if (node != NULL) {
  ------------------
  |  Branch (200:9): [True: 0, False: 191]
  ------------------
  201|      0|        if ((file == NULL) && (node->doc != NULL))
  ------------------
  |  Branch (201:13): [True: 0, False: 0]
  |  Branch (201:31): [True: 0, False: 0]
  ------------------
  202|      0|            file = (const char *) node->doc->URL;
  203|       |
  204|      0|        if (line == 0) {
  ------------------
  |  Branch (204:13): [True: 0, False: 0]
  ------------------
  205|      0|            if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (205:17): [True: 0, False: 0]
  ------------------
  206|      0|                line = node->line;
  207|      0|            if ((line == 0) || (line == 65535))
  ------------------
  |  Branch (207:17): [True: 0, False: 0]
  |  Branch (207:32): [True: 0, False: 0]
  ------------------
  208|      0|                line = xmlGetLineNo(node);
  209|      0|        }
  210|      0|    }
  211|       |
  212|    191|    res = xmlVSetError(err, ctxt, node, domain, code, level, file, line,
  213|    191|                       str1, str2, str3, int1, col, fmt, ap);
  214|       |
  215|    191|    return(res);
  216|    191|}
error.c:xmlVSetError:
   75|    192|{
   76|    192|    char *message = NULL;
   77|    192|    char *fileCopy = NULL;
   78|    192|    char *str1Copy = NULL;
   79|    192|    char *str2Copy = NULL;
   80|    192|    char *str3Copy = NULL;
   81|       |
   82|    192|    if (code == XML_ERR_OK) {
  ------------------
  |  Branch (82:9): [True: 0, False: 192]
  ------------------
   83|      0|        xmlResetError(err);
   84|      0|        return(0);
   85|      0|    }
   86|       |
   87|       |    /*
   88|       |     * Formatting the message
   89|       |     */
   90|    192|    if (fmt == NULL) {
  ------------------
  |  Branch (90:9): [True: 0, False: 192]
  ------------------
   91|      0|        message = xmlMemStrdup("No error message provided");
   92|    192|    } else {
   93|    192|        xmlChar *tmp;
   94|    192|        int res;
   95|       |
   96|    192|        res = xmlStrVASPrintf(&tmp, MAX_ERR_MSG_SIZE, fmt, ap);
  ------------------
  |  |    9|    192|#define MAX_ERR_MSG_SIZE 64000
  ------------------
   97|    192|        if (res < 0)
  ------------------
  |  Branch (97:13): [True: 0, False: 192]
  ------------------
   98|      0|            goto err_memory;
   99|    192|        message = (char *) tmp;
  100|    192|    }
  101|    192|    if (message == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 192]
  ------------------
  102|      0|        goto err_memory;
  103|       |
  104|    192|    if (file != NULL) {
  ------------------
  |  Branch (104:9): [True: 0, False: 192]
  ------------------
  105|      0|        fileCopy = (char *) xmlStrdup((const xmlChar *) file);
  106|      0|        if (fileCopy == NULL)
  ------------------
  |  Branch (106:13): [True: 0, False: 0]
  ------------------
  107|      0|            goto err_memory;
  108|      0|    }
  109|    192|    if (str1 != NULL) {
  ------------------
  |  Branch (109:9): [True: 102, False: 90]
  ------------------
  110|    102|        str1Copy = (char *) xmlStrdup((const xmlChar *) str1);
  111|    102|        if (str1Copy == NULL)
  ------------------
  |  Branch (111:13): [True: 0, False: 102]
  ------------------
  112|      0|            goto err_memory;
  113|    102|    }
  114|    192|    if (str2 != NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 192]
  ------------------
  115|      0|        str2Copy = (char *) xmlStrdup((const xmlChar *) str2);
  116|      0|        if (str2Copy == NULL)
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|            goto err_memory;
  118|      0|    }
  119|    192|    if (str3 != NULL) {
  ------------------
  |  Branch (119:9): [True: 0, False: 192]
  ------------------
  120|      0|        str3Copy = (char *) xmlStrdup((const xmlChar *) str3);
  121|      0|        if (str3Copy == NULL)
  ------------------
  |  Branch (121:13): [True: 0, False: 0]
  ------------------
  122|      0|            goto err_memory;
  123|      0|    }
  124|       |
  125|    192|    xmlResetError(err);
  126|       |
  127|    192|    err->domain = domain;
  128|    192|    err->code = code;
  129|    192|    err->message = message;
  130|    192|    err->level = level;
  131|    192|    err->file = fileCopy;
  132|    192|    err->line = line;
  133|    192|    err->str1 = str1Copy;
  134|    192|    err->str2 = str2Copy;
  135|    192|    err->str3 = str3Copy;
  136|    192|    err->int1 = int1;
  137|    192|    err->int2 = col;
  138|    192|    err->node = node;
  139|    192|    err->ctxt = ctxt;
  140|       |
  141|    192|    return(0);
  142|       |
  143|      0|err_memory:
  144|      0|    xmlFree(message);
  145|      0|    xmlFree(fileCopy);
  146|      0|    xmlFree(str1Copy);
  147|      0|    xmlFree(str2Copy);
  148|      0|    xmlFree(str3Copy);
  149|      0|    return(-1);
  150|    192|}
error.c:xmlVFormatLegacyError:
  792|     33|                      const char *fmt, va_list ap) {
  793|     33|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  794|     33|    xmlParserInputPtr input = NULL;
  795|     33|    xmlParserInputPtr cur = NULL;
  796|     33|    xmlChar *str = NULL;
  797|       |
  798|     33|    if (ctxt != NULL) {
  ------------------
  |  Branch (798:9): [True: 33, False: 0]
  ------------------
  799|     33|	input = ctxt->input;
  800|     33|	if ((input != NULL) && (input->filename == NULL) &&
  ------------------
  |  Branch (800:6): [True: 0, False: 33]
  |  Branch (800:25): [True: 0, False: 0]
  ------------------
  801|      0|	    (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (801:6): [True: 0, False: 0]
  ------------------
  802|      0|	    cur = input;
  803|      0|	    input = ctxt->inputTab[ctxt->inputNr - 2];
  804|      0|	}
  805|     33|	xmlParserPrintFileInfo(input);
  806|     33|    }
  807|       |
  808|     33|    xmlGenericError(xmlGenericErrorContext, "%s: ", level);
  ------------------
  |  |  976|     33|  #define xmlGenericError (*__xmlGenericError())
  ------------------
                  xmlGenericError(xmlGenericErrorContext, "%s: ", level);
  ------------------
  |  |  983|     33|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  809|       |
  810|     33|    xmlStrVASPrintf(&str, MAX_ERR_MSG_SIZE, fmt, ap);
  ------------------
  |  |    9|     33|#define MAX_ERR_MSG_SIZE 64000
  ------------------
  811|     33|    if (str != NULL) {
  ------------------
  |  Branch (811:9): [True: 33, False: 0]
  ------------------
  812|     33|        xmlGenericError(xmlGenericErrorContext, "%s", (char *) str);
  ------------------
  |  |  976|     33|  #define xmlGenericError (*__xmlGenericError())
  ------------------
                      xmlGenericError(xmlGenericErrorContext, "%s", (char *) str);
  ------------------
  |  |  983|     33|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  813|     33|	xmlFree(str);
  814|     33|    }
  815|       |
  816|     33|    if (ctxt != NULL) {
  ------------------
  |  Branch (816:9): [True: 33, False: 0]
  ------------------
  817|     33|	xmlParserPrintFileContext(input);
  818|     33|	if (cur != NULL) {
  ------------------
  |  Branch (818:6): [True: 0, False: 33]
  ------------------
  819|      0|	    xmlParserPrintFileInfo(cur);
  820|      0|	    xmlGenericError(xmlGenericErrorContext, "\n");
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
              	    xmlGenericError(xmlGenericErrorContext, "\n");
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  821|      0|	    xmlParserPrintFileContext(cur);
  822|      0|	}
  823|     33|    }
  824|     33|}
error.c:xmlSetError:
  160|      1|{
  161|      1|    va_list ap;
  162|      1|    int res;
  163|       |
  164|      1|    va_start(ap, fmt);
  165|      1|    res = xmlVSetError(err, ctxt, node, domain, code, level, file, line,
  166|      1|                       str1, str2, str3, int1, col, fmt, ap);
  167|      1|    va_end(ap);
  168|       |
  169|      1|    return(res);
  170|      1|}

xmlFuzzErrorFunc:
   59|    196|                 ...) {
   60|    196|}
xmlFuzzDataInit:
  188|    345|xmlFuzzDataInit(const char *data, size_t size) {
  189|    345|    fuzzData.data = data;
  190|    345|    fuzzData.size = size;
  191|    345|    fuzzData.ptr = data;
  192|    345|    fuzzData.remaining = size;
  193|       |
  194|    345|    fuzzData.outBuf = xmlMalloc(size + 1);
  195|    345|    fuzzData.outPtr = fuzzData.outBuf;
  196|       |
  197|    345|    fuzzData.entities = xmlHashCreate(8);
  198|    345|    fuzzData.mainUrl = NULL;
  199|    345|    fuzzData.mainEntity = NULL;
  200|    345|    fuzzData.secondaryUrl = NULL;
  201|       |    fuzzData.secondaryEntity = NULL;
  202|    345|}
xmlFuzzDataCleanup:
  210|    345|xmlFuzzDataCleanup(void) {
  211|    345|    xmlFree(fuzzData.outBuf);
  212|    345|    xmlHashFree(fuzzData.entities, xmlHashDefaultDeallocator);
  213|    345|}
xmlFuzzReadInt:
  246|  1.72k|xmlFuzzReadInt(int size) {
  247|  1.72k|    size_t ret = 0;
  248|       |
  249|  6.55k|    while ((size > 0) && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (249:12): [True: 4.83k, False: 1.72k]
  |  Branch (249:26): [True: 4.83k, False: 0]
  ------------------
  250|  4.83k|        unsigned char c = (unsigned char) *fuzzData.ptr++;
  251|  4.83k|        fuzzData.remaining--;
  252|  4.83k|        ret = (ret << 8) | c;
  253|  4.83k|        size--;
  254|  4.83k|    }
  255|       |
  256|  1.72k|    return ret;
  257|  1.72k|}
xmlFuzzReadString:
  320|  49.8k|xmlFuzzReadString(size_t *size) {
  321|  49.8k|    const char *out = fuzzData.outPtr;
  322|       |
  323|  91.8M|    while (fuzzData.remaining > 0) {
  ------------------
  |  Branch (323:12): [True: 91.8M, False: 698]
  ------------------
  324|  91.8M|        int c = *fuzzData.ptr++;
  325|  91.8M|        fuzzData.remaining--;
  326|       |
  327|  91.8M|        if ((c == '\\') && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (327:13): [True: 129k, False: 91.6M]
  |  Branch (327:28): [True: 129k, False: 6]
  ------------------
  328|   129k|            int c2 = *fuzzData.ptr;
  329|       |
  330|   129k|            if (c2 == '\n') {
  ------------------
  |  Branch (330:17): [True: 49.1k, False: 80.7k]
  ------------------
  331|  49.1k|                fuzzData.ptr++;
  332|  49.1k|                fuzzData.remaining--;
  333|  49.1k|                if (size != NULL)
  ------------------
  |  Branch (333:21): [True: 49.1k, False: 0]
  ------------------
  334|  49.1k|                    *size = fuzzData.outPtr - out;
  335|  49.1k|                *fuzzData.outPtr++ = '\0';
  336|  49.1k|                return(out);
  337|  49.1k|            }
  338|  80.7k|            if (c2 == '\\') {
  ------------------
  |  Branch (338:17): [True: 21.4k, False: 59.3k]
  ------------------
  339|  21.4k|                fuzzData.ptr++;
  340|  21.4k|                fuzzData.remaining--;
  341|  21.4k|            }
  342|  80.7k|        }
  343|       |
  344|  91.7M|        *fuzzData.outPtr++ = c;
  345|  91.7M|    }
  346|       |
  347|    698|    if (fuzzData.outPtr > out) {
  ------------------
  |  Branch (347:9): [True: 341, False: 357]
  ------------------
  348|    341|        if (size != NULL)
  ------------------
  |  Branch (348:13): [True: 341, False: 0]
  ------------------
  349|    341|            *size = fuzzData.outPtr - out;
  350|    341|        *fuzzData.outPtr++ = '\0';
  351|    341|        return(out);
  352|    341|    }
  353|       |
  354|    357|    if (size != NULL)
  ------------------
  |  Branch (354:9): [True: 357, False: 0]
  ------------------
  355|    357|        *size = 0;
  356|       |    return(NULL);
  357|    698|}
xmlFuzzReadEntities:
  366|    345|xmlFuzzReadEntities(void) {
  367|    345|    size_t num = 0;
  368|       |
  369|  24.5k|    while (1) {
  ------------------
  |  Branch (369:12): [True: 24.5k, Folded]
  ------------------
  370|  24.5k|        const char *url, *entity;
  371|  24.5k|        size_t urlSize, entitySize;
  372|  24.5k|        xmlFuzzEntityInfo *entityInfo;
  373|       |
  374|  24.5k|        url = xmlFuzzReadString(&urlSize);
  375|  24.5k|        if (url == NULL) break;
  ------------------
  |  Branch (375:13): [True: 280, False: 24.2k]
  ------------------
  376|       |
  377|  24.2k|        entity = xmlFuzzReadString(&entitySize);
  378|  24.2k|        if (entity == NULL) break;
  ------------------
  |  Branch (378:13): [True: 65, False: 24.2k]
  ------------------
  379|       |
  380|       |        /*
  381|       |         * Cap URL size to avoid quadratic behavior when generating
  382|       |         * error messages or looking up entities.
  383|       |         */
  384|  24.2k|        if (urlSize < 50 &&
  ------------------
  |  Branch (384:13): [True: 23.1k, False: 1.04k]
  ------------------
  385|  23.1k|            xmlHashLookup(fuzzData.entities, (xmlChar *)url) == NULL) {
  ------------------
  |  Branch (385:13): [True: 9.27k, False: 13.8k]
  ------------------
  386|  9.27k|            entityInfo = xmlMalloc(sizeof(xmlFuzzEntityInfo));
  387|  9.27k|            if (entityInfo == NULL)
  ------------------
  |  Branch (387:17): [True: 0, False: 9.27k]
  ------------------
  388|      0|                break;
  389|  9.27k|            entityInfo->data = entity;
  390|  9.27k|            entityInfo->size = entitySize;
  391|       |
  392|  9.27k|            xmlHashAddEntry(fuzzData.entities, (xmlChar *)url, entityInfo);
  393|       |
  394|  9.27k|            if (num == 0) {
  ------------------
  |  Branch (394:17): [True: 332, False: 8.94k]
  ------------------
  395|    332|                fuzzData.mainUrl = url;
  396|    332|                fuzzData.mainEntity = entityInfo;
  397|  8.94k|            } else if (num == 1) {
  ------------------
  |  Branch (397:24): [True: 60, False: 8.88k]
  ------------------
  398|     60|                fuzzData.secondaryUrl = url;
  399|     60|                fuzzData.secondaryEntity = entityInfo;
  400|     60|            }
  401|       |
  402|  9.27k|            num++;
  403|  9.27k|        }
  404|  24.2k|    }
  405|    345|}
xmlFuzzMainUrl:
  413|    345|xmlFuzzMainUrl(void) {
  414|    345|    return(fuzzData.mainUrl);
  415|    345|}
xmlFuzzMainEntity:
  424|    345|xmlFuzzMainEntity(size_t *size) {
  425|    345|    if (fuzzData.mainEntity == NULL)
  ------------------
  |  Branch (425:9): [True: 13, False: 332]
  ------------------
  426|     13|        return(NULL);
  427|    332|    *size = fuzzData.mainEntity->size;
  428|    332|    return(fuzzData.mainEntity->data);
  429|    345|}
xmlFuzzResourceLoader:
  465|     34|                      xmlParserInputPtr *out) {
  466|     34|    xmlParserInputPtr input;
  467|     34|    xmlFuzzEntityInfo *entity;
  468|       |
  469|     34|    entity = xmlHashLookup(fuzzData.entities, (xmlChar *) URL);
  470|     34|    if (entity == NULL)
  ------------------
  |  Branch (470:9): [True: 0, False: 34]
  ------------------
  471|      0|        return(XML_IO_ENOENT);
  472|       |
  473|       |    /* IO failure injection */
  474|     34|    if (xmlFuzzTryIo() < 0)
  ------------------
  |  Branch (474:9): [True: 0, False: 34]
  ------------------
  475|      0|        return(XML_IO_EIO);
  476|       |
  477|     34|    input = xmlNewInputFromMemory(URL, entity->data, entity->size,
  478|     34|                                  XML_INPUT_BUF_STATIC |
  479|     34|                                  XML_INPUT_BUF_ZERO_TERMINATED);
  480|     34|    if (input == NULL)
  ------------------
  |  Branch (480:9): [True: 33, False: 1]
  ------------------
  481|     33|        return(XML_ERR_NO_MEMORY);
  482|       |
  483|      1|    *out = input;
  484|      1|    return(XML_ERR_OK);
  485|     34|}
fuzz.c:xmlFuzzTryIo:
  107|     34|xmlFuzzTryIo(void) {
  108|     34|    if (fuzzFailurePos > 0) {
  ------------------
  |  Branch (108:9): [True: 0, False: 34]
  ------------------
  109|      0|        fuzzNumAttempts += 1;
  110|      0|        if (fuzzNumAttempts == fuzzFailurePos) {
  ------------------
  |  Branch (110:13): [True: 0, False: 0]
  ------------------
  111|       |#if XML_FUZZ_FAILURE_ABORT
  112|       |            abort();
  113|       |#endif
  114|      0|            fuzzIoFailed = 1;
  115|      0|            return -1;
  116|      0|        }
  117|      0|    }
  118|       |
  119|     34|    return 0;
  120|     34|}

LLVMFuzzerInitialize:
  106|      2|                     char ***argv ATTRIBUTE_UNUSED) {
  107|      2|    int fd;
  108|       |
  109|       |    /* Redirect stdout to /dev/null */
  110|      2|    fd = open("/dev/null", O_WRONLY);
  111|      2|    if (fd == -1) {
  ------------------
  |  Branch (111:9): [True: 0, False: 2]
  ------------------
  112|      0|        perror("/dev/null");
  113|      0|        abort();
  114|      0|    }
  115|      2|    if (dup2(fd, STDOUT_FILENO) == -1) {
  ------------------
  |  Branch (115:9): [True: 0, False: 2]
  ------------------
  116|      0|        perror("dup2");
  117|      0|        abort();
  118|      0|    }
  119|      2|    close(fd);
  120|       |
  121|      2|    return 0;
  122|      2|}
LLVMFuzzerTestOneInput:
  125|    345|LLVMFuzzerTestOneInput(const char *data, size_t size) {
  126|    345|    char maxmemBuf[20];
  127|    345|    char maxAmplBuf[20];
  128|    345|    char prettyBuf[20];
  129|    345|    const char *sval, *docBuffer, *docUrl;
  130|    345|    size_t ssize, docSize, i;
  131|    345|    unsigned uval;
  132|    345|    int ival;
  133|       |
  134|    345|    if (xmlMemUsed() != 0) {
  ------------------
  |  Branch (134:9): [True: 0, False: 345]
  ------------------
  135|      0|        fprintf(stderr, "Undetected leak in previous iteration\n");
  136|      0|        abort();
  137|      0|    }
  138|       |
  139|    345|    vars.argv = malloc((numSwitches + 5 + 6 * 2) * sizeof(vars.argv[0]));
  140|    345|    vars.argi = 0;
  141|    345|    pushArg("xmllint"),
  142|    345|    pushArg("--nocatalogs");
  143|       |
  144|    345|    xmlFuzzDataInit(data, size);
  145|       |
  146|  16.5k|    for (i = 0; i < numSwitches; i++) {
  ------------------
  |  Branch (146:17): [True: 16.2k, False: 345]
  ------------------
  147|  16.2k|        if (i % 32 == 0)
  ------------------
  |  Branch (147:13): [True: 690, False: 15.5k]
  ------------------
  148|    690|            uval = xmlFuzzReadInt(4);
  149|  16.2k|        if ((uval & 1) && (switches[i] != NULL))
  ------------------
  |  Branch (149:13): [True: 4.54k, False: 11.6k]
  |  Branch (149:27): [True: 3.95k, False: 590]
  ------------------
  150|  3.95k|            pushArg(switches[i]);
  151|  16.2k|        uval >>= 1;
  152|  16.2k|    }
  153|       |
  154|       |    /*
  155|       |     * Use four main parsing modes with equal probability
  156|       |     */
  157|    345|    switch (uval & 3) {
  ------------------
  |  Branch (157:13): [True: 345, False: 0]
  ------------------
  158|    198|        case 0:
  ------------------
  |  Branch (158:9): [True: 198, False: 147]
  ------------------
  159|       |            /* XML parser */
  160|    198|            break;
  161|     36|        case 1:
  ------------------
  |  Branch (161:9): [True: 36, False: 309]
  ------------------
  162|       |            /* HTML parser */
  163|     36|            pushArg("--html");
  164|     36|            break;
  165|     78|        case 2:
  ------------------
  |  Branch (165:9): [True: 78, False: 267]
  ------------------
  166|       |            /* XML reader */
  167|     78|            pushArg("--stream");
  168|     78|            break;
  169|     33|        case 3:
  ------------------
  |  Branch (169:9): [True: 33, False: 312]
  ------------------
  170|       |            /* SAX parser */
  171|     33|            pushArg("--sax");
  172|     33|            break;
  173|    345|    }
  174|       |
  175|    345|    uval = xmlFuzzReadInt(4);
  176|    345|    if (uval > 0) {
  ------------------
  |  Branch (176:9): [True: 39, False: 306]
  ------------------
  177|     39|        if (size <= (INT_MAX - 2000) / 20)
  ------------------
  |  Branch (177:13): [True: 39, False: 0]
  ------------------
  178|     39|            uval %= size * 20 + 2000;
  179|      0|        else
  180|      0|            uval %= INT_MAX;
  181|     39|        snprintf(maxmemBuf, 20, "%u", uval);
  182|     39|        pushArg("--maxmem");
  183|     39|        pushArg(maxmemBuf);
  184|     39|    }
  185|       |
  186|    345|    ival = xmlFuzzReadInt(1);
  187|    345|    if (ival >= 1 && ival <= 5) {
  ------------------
  |  Branch (187:9): [True: 253, False: 92]
  |  Branch (187:22): [True: 29, False: 224]
  ------------------
  188|     29|        snprintf(maxAmplBuf, 20, "%d", ival);
  189|     29|        pushArg("--max-ampl");
  190|     29|        pushArg(maxAmplBuf);
  191|     29|    }
  192|       |
  193|    345|    ival = xmlFuzzReadInt(1);
  194|    345|    if (ival != 0) {
  ------------------
  |  Branch (194:9): [True: 179, False: 166]
  ------------------
  195|    179|        snprintf(prettyBuf, 20, "%d", ival % 4);
  196|    179|        pushArg("--pretty");
  197|    179|        pushArg(prettyBuf);
  198|    179|    }
  199|       |
  200|    345|    sval = xmlFuzzReadString(&ssize);
  201|    345|    if (ssize > 0) {
  ------------------
  |  Branch (201:9): [True: 158, False: 187]
  ------------------
  202|    158|        pushArg("--encode");
  203|    158|        pushArg(sval);
  204|    158|    }
  205|       |
  206|    345|    sval = xmlFuzzReadString(&ssize);
  207|    345|    if (ssize > 0) {
  ------------------
  |  Branch (207:9): [True: 116, False: 229]
  ------------------
  208|    116|        pushArg("--pattern");
  209|    116|        pushArg(sval);
  210|    116|    }
  211|       |
  212|    345|    sval = xmlFuzzReadString(&ssize);
  213|    345|    if (ssize > 0) {
  ------------------
  |  Branch (213:9): [True: 231, False: 114]
  ------------------
  214|    231|        pushArg("--xpath");
  215|    231|        pushArg(sval);
  216|    231|    }
  217|       |
  218|    345|    xmlFuzzReadEntities();
  219|    345|    docBuffer = xmlFuzzMainEntity(&docSize);
  220|    345|    docUrl = xmlFuzzMainUrl();
  221|    345|    if (docBuffer == NULL || docUrl[0] == '-')
  ------------------
  |  Branch (221:9): [True: 13, False: 332]
  |  Branch (221:30): [True: 2, False: 330]
  ------------------
  222|     15|        goto exit;
  223|    330|    pushArg(docUrl);
  224|       |
  225|    330|    pushArg(NULL);
  226|       |
  227|    330|    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
  228|    330|#ifdef LIBXML_CATALOG_ENABLED
  229|    330|    xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
  230|    330|#endif
  231|       |
  232|    330|    xmllintMain(vars.argi - 1, vars.argv, stdout, xmlFuzzResourceLoader);
  233|       |
  234|    330|    xmlMemSetup(free, malloc, realloc, xmlMemStrdup);
  235|       |
  236|    345|exit:
  237|    345|    xmlFuzzDataCleanup();
  238|    345|    free(vars.argv);
  239|    345|    return(0);
  240|    330|}
lint.c:pushArg:
  100|  6.95k|pushArg(const char *str) {
  101|  6.95k|    vars.argv[vars.argi++] = str;
  102|  6.95k|}

xmlInitGlobalsInternal:
  357|    324|void xmlInitGlobalsInternal(void) {
  358|    324|    xmlInitMutex(&xmlThrDefMutex);
  359|       |
  360|    324|#ifdef HAVE_POSIX_THREADS
  361|    324|    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|    324|}
xmlCleanupGlobalsInternal:
  384|    323|void xmlCleanupGlobalsInternal(void) {
  385|       |    /*
  386|       |     * We assume that all other threads using the library have
  387|       |     * terminated and the last remaining thread calls
  388|       |     * xmlCleanupParser.
  389|       |     */
  390|       |
  391|    323|#ifdef HAVE_POSIX_THREADS
  392|       |    /*
  393|       |     * Free thread-specific data of last thread before calling
  394|       |     * pthread_key_delete.
  395|       |     */
  396|    323|    xmlGlobalState *gs = pthread_getspecific(globalkey);
  397|    323|    if (gs != NULL)
  ------------------
  |  Branch (397:9): [True: 323, False: 0]
  ------------------
  398|    323|        xmlFreeGlobalState(gs);
  399|    323|    pthread_key_delete(globalkey);
  400|       |#elif defined(HAVE_WIN32_THREADS)
  401|       |#if defined(USE_WAIT_DTOR) && !defined(USE_TLS)
  402|       |    if (globalkey != TLS_OUT_OF_INDEXES) {
  403|       |        xmlGlobalState* gs = (xmlGlobalState*)TlsGetValue(globalkey);
  404|       |        if (gs) {
  405|       |            /* Unregister the waiter for the thread to terminate, then go ahead
  406|       |               and free the global state. This avoids false positive reports of
  407|       |               memory leaks in applications where the main thread created the
  408|       |               global state; if the registered callback is waiting for the main
  409|       |               thread to terminate to free the global state, it won't get a
  410|       |               chance to run.
  411|       |            */
  412|       |            if (gs->waitHandle != NULL) {
  413|       |                UnregisterWait(gs->waitHandle);
  414|       |                gs->waitHandle = NULL;
  415|       |            }
  416|       |           
  417|       |            if (gs->threadHandle != NULL) {
  418|       |                CloseHandle(gs->threadHandle);
  419|       |                gs->threadHandle = NULL;
  420|       |            }
  421|       |            
  422|       |            xmlFreeGlobalState(gs);
  423|       |            TlsSetValue(globalkey, NULL);
  424|       |        }
  425|       |        TlsFree(globalkey);
  426|       |        globalkey = TLS_OUT_OF_INDEXES;
  427|       |    }
  428|       |#endif
  429|       |#else /* no thread support */
  430|       |    xmlResetError(&globalState.lastError);
  431|       |#endif
  432|       |
  433|    323|    xmlCleanupMutex(&xmlThrDefMutex);
  434|    323|}
__xmlDoValidityCheckingDefaultValue:
  633|    189|__xmlDoValidityCheckingDefaultValue(void) {
  634|    189|    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
  635|    189|}
__xmlGetWarningsDefaultValue:
  638|    380|__xmlGetWarningsDefaultValue(void) {
  639|    380|    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
  640|    380|}
__xmlKeepBlanksDefaultValue:
  643|    222|__xmlKeepBlanksDefaultValue(void) {
  644|    222|    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
  645|    222|}
__xmlLoadExtDtdDefaultValue:
  653|    189|__xmlLoadExtDtdDefaultValue(void) {
  654|    189|    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
  655|    189|}
__xmlPedanticParserDefaultValue:
  658|    189|__xmlPedanticParserDefaultValue(void) {
  659|    189|    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
  660|    189|}
__xmlSubstituteEntitiesDefaultValue:
  663|    189|__xmlSubstituteEntitiesDefaultValue(void) {
  664|    189|    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
  665|    189|}
__xmlTreeIndentString:
  674|      1|__xmlTreeIndentString(void) {
  675|      1|    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
  676|      1|}
__xmlSaveNoEmptyTags:
  679|      1|__xmlSaveNoEmptyTags(void) {
  680|      1|    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
  681|      1|}
__xmlGenericError:
  685|    557|__xmlGenericError(void) {
  686|    557|    return(&xmlGetThreadLocalStorage(0)->genericError);
  687|    557|}
__xmlGenericErrorContext:
  690|    557|__xmlGenericErrorContext(void) {
  691|    557|    return(&xmlGetThreadLocalStorage(0)->genericErrorContext);
  692|    557|}
__xmlStructuredError:
  695|   358k|__xmlStructuredError(void) {
  696|   358k|    return(&xmlGetThreadLocalStorage(0)->structuredError);
  697|   358k|}
__xmlParserInputBufferCreateFilenameValue:
  715|      1|__xmlParserInputBufferCreateFilenameValue(void) {
  716|      1|    return(&xmlGetThreadLocalStorage(0)->parserInputBufferCreateFilenameValue);
  717|      1|}
xmlGetLocalRngState:
  755|    603|xmlGetLocalRngState(void) {
  756|    603|    return(xmlGetThreadLocalStorage(0)->localRngState);
  757|    603|}
xmlGetLastErrorInternal:
  785|   717k|xmlGetLastErrorInternal(void) {
  786|   717k|    return(&xmlGetThreadLocalStorage(0)->lastError);
  787|   717k|}
globals.c:xmlFreeGlobalState:
  440|    323|{
  441|    323|    xmlGlobalState *gs = (xmlGlobalState *) state;
  442|       |
  443|       |    /*
  444|       |     * Free any memory allocated in the thread's error struct. If it
  445|       |     * weren't for this indirect allocation, we wouldn't need
  446|       |     * a destructor with thread-local storage at all!
  447|       |     */
  448|    323|    xmlResetError(&gs->lastError);
  449|    323|#ifndef USE_TLS
  450|    323|    free(state);
  451|    323|#endif
  452|    323|}
globals.c:xmlGetThreadLocalStorage:
  525|  1.07M|xmlGetThreadLocalStorage(int allowFailure) {
  526|  1.07M|    xmlGlobalState *gs;
  527|       |
  528|  1.07M|    (void) allowFailure;
  529|       |
  530|  1.07M|    xmlInitParser();
  531|       |
  532|       |#ifdef USE_TLS
  533|       |    gs = &globalState;
  534|       |    if (gs->initialized == 0)
  535|       |        xmlInitGlobalState(gs);
  536|       |#elif defined(HAVE_POSIX_THREADS)
  537|       |    gs = (xmlGlobalState *) pthread_getspecific(globalkey);
  538|  1.07M|    if (gs == NULL)
  ------------------
  |  Branch (538:9): [True: 324, False: 1.07M]
  ------------------
  539|    324|        gs = xmlNewGlobalState(allowFailure);
  540|       |#elif defined(HAVE_WIN32_THREADS)
  541|       |    gs = (xmlGlobalState *) TlsGetValue(globalkey);
  542|       |    if (gs == NULL)
  543|       |        gs = xmlNewGlobalState(allowFailure);
  544|       |#else
  545|       |    gs = NULL;
  546|       |#endif
  547|       |
  548|  1.07M|    return(gs);
  549|  1.07M|}
globals.c:xmlNewGlobalState:
  497|    324|{
  498|    324|    xmlGlobalState *gs;
  499|       |
  500|       |    /*
  501|       |     * We use malloc/free to allow accessing globals before setting
  502|       |     * custom memory allocators.
  503|       |     */
  504|    324|    gs = malloc(sizeof(xmlGlobalState));
  505|    324|    if (gs == NULL) {
  ------------------
  |  Branch (505:9): [True: 0, False: 324]
  ------------------
  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|    324|    memset(gs, 0, sizeof(xmlGlobalState));
  519|    324|    xmlInitGlobalState(gs);
  520|    324|    return (gs);
  521|    324|}
globals.c:xmlInitGlobalState:
  561|    324|xmlInitGlobalState(xmlGlobalStatePtr gs) {
  562|    324|    gs->localRngState[0] = xmlGlobalRandom();
  563|    324|    gs->localRngState[1] = xmlGlobalRandom();
  564|       |
  565|    324|    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|    324|    xmlMutexLock(&xmlThrDefMutex);
  577|       |
  578|       |    /* XML_GLOBALS_PARSER */
  579|    324|    gs->doValidityCheckingDefaultValue =
  580|    324|         xmlDoValidityCheckingDefaultValueThrDef;
  581|    324|    gs->getWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef;
  582|    324|    gs->keepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef;
  583|    324|    gs->loadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef;
  584|    324|    gs->pedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
  585|    324|    gs->substituteEntitiesDefaultValue =
  586|    324|        xmlSubstituteEntitiesDefaultValueThrDef;
  587|    324|#ifdef LIBXML_OUTPUT_ENABLED
  588|    324|    gs->indentTreeOutput = xmlIndentTreeOutputThrDef;
  589|    324|    gs->treeIndentString = xmlTreeIndentStringThrDef;
  590|    324|    gs->saveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
  591|    324|#endif
  592|       |
  593|       |    /* XML_GLOBALS_ERROR */
  594|    324|    gs->genericError = xmlGenericErrorThrDef;
  595|    324|    gs->structuredError = xmlStructuredErrorThrDef;
  596|    324|    gs->genericErrorContext = xmlGenericErrorContextThrDef;
  597|    324|    gs->structuredErrorContext = xmlStructuredErrorContextThrDef;
  598|       |
  599|       |    /* XML_GLOBALS_TREE */
  600|    324|    gs->registerNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
  601|    324|    gs->deregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
  602|       |
  603|       |    /* XML_GLOBALS_IO */
  604|    324|    gs->parserInputBufferCreateFilenameValue =
  605|    324|        xmlParserInputBufferCreateFilenameValueThrDef;
  606|    324|    gs->outputBufferCreateFilenameValue =
  607|    324|        xmlOutputBufferCreateFilenameValueThrDef;
  608|       |
  609|    324|    xmlMutexUnlock(&xmlThrDefMutex);
  610|       |
  611|       |#ifdef USE_TLS
  612|       |    gs->initialized = 1;
  613|       |#endif
  614|       |
  615|    324|#ifdef HAVE_POSIX_THREADS
  616|    324|    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|    324|}

xmlHashCreate:
  158|    345|xmlHashCreate(int size) {
  159|    345|    xmlHashTablePtr hash;
  160|       |
  161|    345|    xmlInitParser();
  162|       |
  163|    345|    hash = xmlMalloc(sizeof(*hash));
  164|    345|    if (hash == NULL)
  ------------------
  |  Branch (164:9): [True: 0, False: 345]
  ------------------
  165|      0|        return(NULL);
  166|    345|    hash->dict = NULL;
  167|    345|    hash->size = 0;
  168|    345|    hash->table = NULL;
  169|    345|    hash->nbElems = 0;
  170|    345|    hash->randomSeed = xmlRandom();
  171|    345|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  172|    345|    hash->randomSeed = 0;
  173|    345|#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|    345|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|    345|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (180:9): [True: 0, False: 345]
  ------------------
  181|      0|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|      0|#define MIN_HASH_SIZE 8
  ------------------
  182|       |
  183|      0|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|      0|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (183:16): [True: 0, False: 0]
  |  Branch (183:47): [True: 0, False: 0]
  ------------------
  184|      0|            newSize *= 2;
  185|       |
  186|      0|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (186:13): [True: 0, False: 0]
  ------------------
  187|      0|            xmlFree(hash);
  188|      0|            return(NULL);
  189|      0|        }
  190|      0|    }
  191|       |
  192|    345|    return(hash);
  193|    345|}
xmlHashFree:
  224|    921|xmlHashFree(xmlHashTable *hash, xmlHashDeallocator dealloc) {
  225|    921|    if (hash == NULL)
  ------------------
  |  Branch (225:9): [True: 576, False: 345]
  ------------------
  226|    576|        return;
  227|       |
  228|    345|    if (hash->table) {
  ------------------
  |  Branch (228:9): [True: 332, False: 13]
  ------------------
  229|    332|        const xmlHashEntry *end = &hash->table[hash->size];
  230|    332|        const xmlHashEntry *entry;
  231|       |
  232|  20.5k|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (232:35): [True: 20.1k, False: 332]
  ------------------
  233|  20.1k|            if (entry->hashValue == 0)
  ------------------
  |  Branch (233:17): [True: 10.8k, False: 9.27k]
  ------------------
  234|  10.8k|                continue;
  235|  9.27k|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (235:17): [True: 9.27k, False: 0]
  |  Branch (235:38): [True: 9.27k, False: 0]
  ------------------
  236|  9.27k|                dealloc(entry->payload, entry->key);
  237|  9.27k|            if (hash->dict == NULL) {
  ------------------
  |  Branch (237:17): [True: 9.27k, False: 0]
  ------------------
  238|  9.27k|                if (entry->key)
  ------------------
  |  Branch (238:21): [True: 9.27k, False: 0]
  ------------------
  239|  9.27k|                    xmlFree(entry->key);
  240|  9.27k|                if (entry->key2)
  ------------------
  |  Branch (240:21): [True: 0, False: 9.27k]
  ------------------
  241|      0|                    xmlFree(entry->key2);
  242|  9.27k|                if (entry->key3)
  ------------------
  |  Branch (242:21): [True: 0, False: 9.27k]
  ------------------
  243|      0|                    xmlFree(entry->key3);
  244|  9.27k|            }
  245|  9.27k|        }
  246|       |
  247|    332|        xmlFree(hash->table);
  248|    332|    }
  249|       |
  250|    345|    if (hash->dict)
  ------------------
  |  Branch (250:9): [True: 0, False: 345]
  ------------------
  251|      0|        xmlDictFree(hash->dict);
  252|       |
  253|    345|    xmlFree(hash);
  254|    345|}
xmlHashDefaultDeallocator:
  592|  9.27k|xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
  593|  9.27k|    xmlFree(entry);
  594|  9.27k|}
xmlHashAddEntry:
  669|  9.27k|xmlHashAddEntry(xmlHashTable *hash, const xmlChar *key, void *payload) {
  670|  9.27k|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0);
  671|       |
  672|  9.27k|    if (res == 0)
  ------------------
  |  Branch (672:9): [True: 0, False: 9.27k]
  ------------------
  673|      0|        res = -1;
  674|  9.27k|    else if (res == 1)
  ------------------
  |  Branch (674:14): [True: 9.27k, False: 0]
  ------------------
  675|  9.27k|        res = 0;
  676|       |
  677|  9.27k|    return(res);
  678|  9.27k|}
xmlHashLookup:
  811|  23.1k|xmlHashLookup(xmlHashTable *hash, const xmlChar *key) {
  812|  23.1k|    return(xmlHashLookup3(hash, key, NULL, NULL));
  813|  23.1k|}
xmlHashLookup3:
  871|  23.1k|               const xmlChar *key2, const xmlChar *key3) {
  872|  23.1k|    const xmlHashEntry *entry;
  873|  23.1k|    unsigned hashValue;
  874|  23.1k|    int found;
  875|       |
  876|  23.1k|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (876:9): [True: 0, False: 23.1k]
  |  Branch (876:27): [True: 332, False: 22.8k]
  |  Branch (876:48): [True: 0, False: 22.8k]
  ------------------
  877|    332|        return(NULL);
  878|  22.8k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
  879|  22.8k|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  880|  22.8k|    if (found)
  ------------------
  |  Branch (880:9): [True: 13.9k, False: 8.94k]
  ------------------
  881|  13.9k|        return(entry->payload);
  882|  8.94k|    return(NULL);
  883|  22.8k|}
hash.c:xmlHashGrow:
  345|    425|xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
  346|    425|    const xmlHashEntry *oldentry, *oldend, *end;
  347|    425|    xmlHashEntry *table;
  348|    425|    unsigned oldsize, i;
  349|       |
  350|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  351|    425|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (351:9): [True: 0, False: 425]
  ------------------
  352|      0|        return(-1);
  353|    425|    table = xmlMalloc(size * sizeof(table[0]));
  354|    425|    if (table == NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 425]
  ------------------
  355|      0|        return(-1);
  356|    425|    memset(table, 0, size * sizeof(table[0]));
  357|       |
  358|    425|    oldsize = hash->size;
  359|    425|    if (oldsize == 0)
  ------------------
  |  Branch (359:9): [True: 332, False: 93]
  ------------------
  360|    332|        goto done;
  361|       |
  362|     93|    oldend = &hash->table[oldsize];
  363|     93|    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|     93|    oldentry = hash->table;
  373|  1.00k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (373:12): [True: 909, False: 93]
  ------------------
  374|    909|        if (++oldentry >= oldend)
  ------------------
  |  Branch (374:13): [True: 0, False: 909]
  ------------------
  375|      0|            oldentry = hash->table;
  376|    909|    }
  377|       |
  378|  17.6k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (378:17): [True: 17.5k, False: 93]
  ------------------
  379|  17.5k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (379:13): [True: 15.3k, False: 2.18k]
  ------------------
  380|  15.3k|            xmlHashEntry *entry = &table[oldentry->hashValue & (size - 1)];
  381|       |
  382|  20.7k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (382:20): [True: 5.42k, False: 15.3k]
  ------------------
  383|  5.42k|                if (++entry >= end)
  ------------------
  |  Branch (383:21): [True: 19, False: 5.40k]
  ------------------
  384|     19|                    entry = table;
  385|  5.42k|            }
  386|  15.3k|            *entry = *oldentry;
  387|  15.3k|        }
  388|       |
  389|  17.5k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (389:13): [True: 93, False: 17.4k]
  ------------------
  390|     93|            oldentry = hash->table;
  391|  17.5k|    }
  392|       |
  393|     93|    xmlFree(hash->table);
  394|       |
  395|    425|done:
  396|    425|    hash->table = table;
  397|    425|    hash->size = size;
  398|       |
  399|    425|    return(0);
  400|     93|}
hash.c:xmlHashUpdateInternal:
  417|  9.27k|                      void *payload, xmlHashDeallocator dealloc, int update) {
  418|  9.27k|    xmlChar *copy, *copy2, *copy3;
  419|  9.27k|    xmlHashEntry *entry = NULL;
  420|  9.27k|    size_t lengths[3] = {0, 0, 0};
  421|  9.27k|    unsigned hashValue, newSize;
  422|       |
  423|  9.27k|    if ((hash == NULL) || (key == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 9.27k]
  |  Branch (423:27): [True: 0, False: 9.27k]
  ------------------
  424|      0|        return(-1);
  425|       |
  426|  9.27k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
  427|       |
  428|       |    /*
  429|       |     * Check for an existing entry
  430|       |     */
  431|  9.27k|    if (hash->size == 0) {
  ------------------
  |  Branch (431:9): [True: 332, False: 8.94k]
  ------------------
  432|    332|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   30|    332|#define MIN_HASH_SIZE 8
  ------------------
  433|  8.94k|    } else {
  434|  8.94k|        int found = 0;
  435|       |
  436|  8.94k|        entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  437|       |
  438|  8.94k|        if (found) {
  ------------------
  |  Branch (438:13): [True: 0, False: 8.94k]
  ------------------
  439|      0|            if (update) {
  ------------------
  |  Branch (439:17): [True: 0, False: 0]
  ------------------
  440|      0|                if (dealloc)
  ------------------
  |  Branch (440:21): [True: 0, False: 0]
  ------------------
  441|      0|                    dealloc(entry->payload, entry->key);
  442|      0|                entry->payload = payload;
  443|      0|            }
  444|       |
  445|      0|            return(0);
  446|      0|        }
  447|       |
  448|  8.94k|        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   29|  8.94k|#define MAX_FILL_DENOM 8
  ------------------
                      if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   28|  8.94k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (448:13): [True: 93, False: 8.85k]
  ------------------
  449|       |            /* This guarantees that nbElems < INT_MAX */
  450|     93|            if (hash->size >= MAX_HASH_SIZE)
  ------------------
  |  |   31|     93|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (450:17): [True: 0, False: 93]
  ------------------
  451|      0|                return(-1);
  452|     93|            newSize = hash->size * 2;
  453|  8.85k|        } else {
  454|  8.85k|            newSize = 0;
  455|  8.85k|        }
  456|  8.94k|    }
  457|       |
  458|       |    /*
  459|       |     * Grow the hash table if needed
  460|       |     */
  461|  9.27k|    if (newSize > 0) {
  ------------------
  |  Branch (461:9): [True: 425, False: 8.85k]
  ------------------
  462|    425|        unsigned mask, displ, pos;
  463|       |
  464|    425|        if (xmlHashGrow(hash, newSize) != 0)
  ------------------
  |  Branch (464:13): [True: 0, False: 425]
  ------------------
  465|      0|            return(-1);
  466|       |
  467|       |        /*
  468|       |         * Find new entry
  469|       |         */
  470|    425|        mask = hash->size - 1;
  471|    425|        displ = 0;
  472|    425|        pos = hashValue & mask;
  473|    425|        entry = &hash->table[pos];
  474|       |
  475|    425|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (475:13): [True: 50, False: 375]
  ------------------
  476|     72|            do {
  477|     72|                displ++;
  478|     72|                pos++;
  479|     72|                entry++;
  480|     72|                if ((pos & mask) == 0)
  ------------------
  |  Branch (480:21): [True: 6, False: 66]
  ------------------
  481|      6|                    entry = hash->table;
  482|     72|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (482:22): [True: 43, False: 29]
  ------------------
  483|     43|                     ((pos - entry->hashValue) & mask) >= displ);
  ------------------
  |  Branch (483:22): [True: 22, False: 21]
  ------------------
  484|     50|        }
  485|    425|    }
  486|       |
  487|       |    /*
  488|       |     * Copy keys
  489|       |     */
  490|  9.27k|    if (hash->dict != NULL) {
  ------------------
  |  Branch (490:9): [True: 0, False: 9.27k]
  ------------------
  491|      0|        if (xmlDictOwns(hash->dict, key)) {
  ------------------
  |  Branch (491:13): [True: 0, False: 0]
  ------------------
  492|      0|            copy = (xmlChar *) key;
  493|      0|        } 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|      0|        if ((key2 == NULL) || (xmlDictOwns(hash->dict, key2))) {
  ------------------
  |  Branch (499:13): [True: 0, False: 0]
  |  Branch (499:31): [True: 0, False: 0]
  ------------------
  500|      0|            copy2 = (xmlChar *) key2;
  501|      0|        } else {
  502|      0|            copy2 = (xmlChar *) xmlDictLookup(hash->dict, key2, -1);
  503|      0|            if (copy2 == NULL)
  ------------------
  |  Branch (503:17): [True: 0, False: 0]
  ------------------
  504|      0|                return(-1);
  505|      0|        }
  506|      0|        if ((key3 == NULL) || (xmlDictOwns(hash->dict, key3))) {
  ------------------
  |  Branch (506:13): [True: 0, False: 0]
  |  Branch (506:31): [True: 0, False: 0]
  ------------------
  507|      0|            copy3 = (xmlChar *) key3;
  508|      0|        } 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|  9.27k|    } else {
  514|  9.27k|        copy = xmlMalloc(lengths[0] + 1);
  515|  9.27k|        if (copy == NULL)
  ------------------
  |  Branch (515:13): [True: 0, False: 9.27k]
  ------------------
  516|      0|            return(-1);
  517|  9.27k|        memcpy(copy, key, lengths[0] + 1);
  518|       |
  519|  9.27k|        if (key2 != NULL) {
  ------------------
  |  Branch (519:13): [True: 0, False: 9.27k]
  ------------------
  520|      0|            copy2 = xmlMalloc(lengths[1] + 1);
  521|      0|            if (copy2 == NULL) {
  ------------------
  |  Branch (521:17): [True: 0, False: 0]
  ------------------
  522|      0|                xmlFree(copy);
  523|      0|                return(-1);
  524|      0|            }
  525|      0|            memcpy(copy2, key2, lengths[1] + 1);
  526|  9.27k|        } else {
  527|  9.27k|            copy2 = NULL;
  528|  9.27k|        }
  529|       |
  530|  9.27k|        if (key3 != NULL) {
  ------------------
  |  Branch (530:13): [True: 0, False: 9.27k]
  ------------------
  531|      0|            copy3 = xmlMalloc(lengths[2] + 1);
  532|      0|            if (copy3 == NULL) {
  ------------------
  |  Branch (532:17): [True: 0, False: 0]
  ------------------
  533|      0|                xmlFree(copy);
  534|      0|                xmlFree(copy2);
  535|      0|                return(-1);
  536|      0|            }
  537|      0|            memcpy(copy3, key3, lengths[2] + 1);
  538|  9.27k|        } else {
  539|  9.27k|            copy3 = NULL;
  540|  9.27k|        }
  541|  9.27k|    }
  542|       |
  543|       |    /*
  544|       |     * Shift the remainder of the probe sequence to the right
  545|       |     */
  546|  9.27k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (546:9): [True: 3.62k, False: 5.64k]
  ------------------
  547|  3.62k|        const xmlHashEntry *end = &hash->table[hash->size];
  548|  3.62k|        const xmlHashEntry *cur = entry;
  549|       |
  550|  31.1k|        do {
  551|  31.1k|            cur++;
  552|  31.1k|            if (cur >= end)
  ------------------
  |  Branch (552:17): [True: 82, False: 31.0k]
  ------------------
  553|     82|                cur = hash->table;
  554|  31.1k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (554:18): [True: 27.5k, False: 3.62k]
  ------------------
  555|       |
  556|  3.62k|        if (cur < entry) {
  ------------------
  |  Branch (556:13): [True: 82, False: 3.54k]
  ------------------
  557|       |            /*
  558|       |             * If we traversed the end of the buffer, handle the part
  559|       |             * at the start of the buffer.
  560|       |             */
  561|     82|            memmove(&hash->table[1], hash->table,
  562|     82|                    (char *) cur - (char *) hash->table);
  563|     82|            cur = end - 1;
  564|     82|            hash->table[0] = *cur;
  565|     82|        }
  566|       |
  567|  3.62k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  568|  3.62k|    }
  569|       |
  570|       |    /*
  571|       |     * Populate entry
  572|       |     */
  573|  9.27k|    entry->key = copy;
  574|  9.27k|    entry->key2 = copy2;
  575|  9.27k|    entry->key3 = copy3;
  576|  9.27k|    entry->payload = payload;
  577|       |    /* OR with MAX_HASH_SIZE to make sure that the value is non-zero */
  578|  9.27k|    entry->hashValue = hashValue | MAX_HASH_SIZE;
  ------------------
  |  |   31|  9.27k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  579|       |
  580|  9.27k|    hash->nbElems++;
  581|       |
  582|  9.27k|    return(1);
  583|  9.27k|}
hash.c:xmlHashValue:
   62|  32.1k|             const xmlChar *key3, size_t *lengths) {
   63|  32.1k|    unsigned h1, h2;
   64|  32.1k|    size_t i;
   65|       |
   66|  32.1k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  32.1k|    do { \
  |  |   24|  32.1k|        h1 = seed ^ 0x3b00; \
  |  |   25|  32.1k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  32.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 32.1k]
  |  |  ------------------
  ------------------
   67|       |
   68|   359k|    for (i = 0; key[i] != 0; i++) {
  ------------------
  |  Branch (68:17): [True: 327k, False: 32.1k]
  ------------------
   69|   327k|        HASH_UPDATE(h1, h2, key[i]);
  ------------------
  |  |   29|   327k|    do { \
  |  |   30|   327k|        h1 += ch; \
  |  |   31|   327k|        h1 += h1 << 3; \
  |  |   32|   327k|        h2 += h1; \
  |  |   33|   327k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   327k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   327k|        h2 += h2 << 2; \
  |  |   35|   327k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 327k]
  |  |  ------------------
  ------------------
   70|   327k|    }
   71|  32.1k|    if (lengths)
  ------------------
  |  Branch (71:9): [True: 9.27k, False: 22.8k]
  ------------------
   72|  9.27k|        lengths[0] = i;
   73|       |
   74|  32.1k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  32.1k|    do { \
  |  |   30|  32.1k|        h1 += ch; \
  |  |   31|  32.1k|        h1 += h1 << 3; \
  |  |   32|  32.1k|        h2 += h1; \
  |  |   33|  32.1k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  32.1k|        h2 += h2 << 2; \
  |  |   35|  32.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 32.1k]
  |  |  ------------------
  ------------------
   75|       |
   76|  32.1k|    if (key2 != NULL) {
  ------------------
  |  Branch (76:9): [True: 0, False: 32.1k]
  ------------------
   77|      0|        for (i = 0; key2[i] != 0; i++) {
  ------------------
  |  Branch (77:21): [True: 0, False: 0]
  ------------------
   78|      0|            HASH_UPDATE(h1, h2, key2[i]);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
   79|      0|        }
   80|      0|        if (lengths)
  ------------------
  |  Branch (80:13): [True: 0, False: 0]
  ------------------
   81|      0|            lengths[1] = i;
   82|      0|    }
   83|       |
   84|  32.1k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  32.1k|    do { \
  |  |   30|  32.1k|        h1 += ch; \
  |  |   31|  32.1k|        h1 += h1 << 3; \
  |  |   32|  32.1k|        h2 += h1; \
  |  |   33|  32.1k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  32.1k|        h2 += h2 << 2; \
  |  |   35|  32.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 32.1k]
  |  |  ------------------
  ------------------
   85|       |
   86|  32.1k|    if (key3 != NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 32.1k]
  ------------------
   87|      0|        for (i = 0; key3[i] != 0; i++) {
  ------------------
  |  Branch (87:21): [True: 0, False: 0]
  ------------------
   88|      0|            HASH_UPDATE(h1, h2, key3[i]);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
   89|      0|        }
   90|      0|        if (lengths)
  ------------------
  |  Branch (90:13): [True: 0, False: 0]
  ------------------
   91|      0|            lengths[2] = i;
   92|      0|    }
   93|       |
   94|  32.1k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  32.1k|    do { \
  |  |   40|  32.1k|        h1 ^= h2; \
  |  |   41|  32.1k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  32.1k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  32.1k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  32.1k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  32.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  32.1k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  32.1k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  32.1k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  32.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 32.1k]
  |  |  ------------------
  ------------------
   95|       |
   96|  32.1k|    return(h2);
   97|  32.1k|}
hash.c:xmlHashFindEntry:
  287|  31.8k|                 unsigned hashValue, int *pfound) {
  288|  31.8k|    xmlHashEntry *entry;
  289|  31.8k|    unsigned mask, pos, displ;
  290|  31.8k|    int found = 0;
  291|       |
  292|  31.8k|    mask = hash->size - 1;
  293|  31.8k|    pos = hashValue & mask;
  294|  31.8k|    entry = &hash->table[pos];
  295|       |
  296|  31.8k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (296:9): [True: 25.1k, False: 6.68k]
  ------------------
  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|  25.1k|        displ = 0;
  303|  25.1k|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  25.1k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  304|       |
  305|  47.8k|        do {
  306|  47.8k|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (306:17): [True: 13.9k, False: 33.8k]
  ------------------
  307|  13.9k|                if (hash->dict) {
  ------------------
  |  Branch (307:21): [True: 0, False: 13.9k]
  ------------------
  308|      0|                    if ((entry->key == key) &&
  ------------------
  |  Branch (308:25): [True: 0, False: 0]
  ------------------
  309|      0|                        (entry->key2 == key2) &&
  ------------------
  |  Branch (309:25): [True: 0, False: 0]
  ------------------
  310|      0|                        (entry->key3 == key3)) {
  ------------------
  |  Branch (310:25): [True: 0, False: 0]
  ------------------
  311|      0|                        found = 1;
  312|      0|                        break;
  313|      0|                    }
  314|      0|                }
  315|  13.9k|                if ((strcmp((const char *) entry->key,
  ------------------
  |  Branch (315:21): [True: 13.9k, False: 6]
  ------------------
  316|  13.9k|                            (const char *) key) == 0) &&
  317|  13.9k|                    (xmlFastStrEqual(entry->key2, key2)) &&
  ------------------
  |  Branch (317:21): [True: 13.9k, False: 0]
  ------------------
  318|  13.9k|                    (xmlFastStrEqual(entry->key3, key3))) {
  ------------------
  |  Branch (318:21): [True: 13.9k, False: 0]
  ------------------
  319|  13.9k|                    found = 1;
  320|  13.9k|                    break;
  321|  13.9k|                }
  322|  13.9k|            }
  323|       |
  324|  33.8k|            displ++;
  325|  33.8k|            pos++;
  326|  33.8k|            entry++;
  327|  33.8k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (327:17): [True: 125, False: 33.7k]
  ------------------
  328|    125|                entry = hash->table;
  329|  33.8k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (329:18): [True: 30.0k, False: 3.84k]
  ------------------
  330|  30.0k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (330:18): [True: 22.6k, False: 7.36k]
  ------------------
  331|  25.1k|    }
  332|       |
  333|  31.8k|    *pfound = found;
  334|  31.8k|    return(entry);
  335|  31.8k|}
hash.c:xmlFastStrEqual:
  263|  27.8k|xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
  264|  27.8k|    if (s1 == NULL)
  ------------------
  |  Branch (264:9): [True: 27.8k, False: 0]
  ------------------
  265|  27.8k|        return(s2 == NULL);
  266|      0|    else
  267|      0|        return((s2 != NULL) &&
  ------------------
  |  Branch (267:16): [True: 0, False: 0]
  ------------------
  268|      0|               (strcmp((const char *) s1, (const char *) s2) == 0));
  ------------------
  |  Branch (268:16): [True: 0, False: 0]
  ------------------
  269|  27.8k|}

parser.c:xmlGrowCapacity:
   32|      1|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|      1|    int extra;
   34|       |
   35|      1|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 1]
  ------------------
   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|      1|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1]
  ------------------
   45|      1|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|      1|    extra = (capacity + 1) / 2;
   50|       |
   51|      1|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1]
  ------------------
   52|      0|        return(max);
   53|       |
   54|      1|    return(capacity + extra);
   55|      1|}
HTMLparser.c:xmlGrowCapacity:
   32|      1|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|      1|    int extra;
   34|       |
   35|      1|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 1]
  ------------------
   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|      1|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1]
  ------------------
   45|      1|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|      1|    extra = (capacity + 1) / 2;
   50|       |
   51|      1|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1]
  ------------------
   52|      0|        return(max);
   53|       |
   54|      1|    return(capacity + extra);
   55|      1|}
pattern.c:xmlGrowCapacity:
   32|  5.16k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  5.16k|    int extra;
   34|       |
   35|  5.16k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 720, False: 4.44k]
  ------------------
   36|    720|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|    720|        (void) min;
   38|    720|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|    720|    }
   43|       |
   44|  4.44k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 4.44k]
  ------------------
   45|  4.44k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 4.44k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  4.44k|    extra = (capacity + 1) / 2;
   50|       |
   51|  4.44k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 4.44k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  4.44k|    return(capacity + extra);
   55|  4.44k|}
xpath.c:xmlGrowCapacity:
   32|   673k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|   673k|    int extra;
   34|       |
   35|   673k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 311k, False: 362k]
  ------------------
   36|   311k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   311k|        (void) min;
   38|   311k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   311k|    }
   43|       |
   44|   362k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 358k, False: 4.12k]
  ------------------
   45|  4.12k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 4.12k]
  ------------------
   46|   358k|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  4.12k|    extra = (capacity + 1) / 2;
   50|       |
   51|  4.12k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 36, False: 4.09k]
  ------------------
   52|     36|        return(max);
   53|       |
   54|  4.09k|    return(capacity + extra);
   55|  4.12k|}

xmlListCreate:
  176|     16|{
  177|     16|    xmlListPtr l;
  178|     16|    l = (xmlListPtr)xmlMalloc(sizeof(xmlList));
  179|     16|    if (l == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 16]
  ------------------
  180|      0|        return (NULL);
  181|       |    /* Initialize the list to NULL */
  182|     16|    memset(l, 0, sizeof(xmlList));
  183|       |
  184|       |    /* Add the sentinel */
  185|     16|    l->sentinel = (xmlLinkPtr)xmlMalloc(sizeof(xmlLink));
  186|     16|    if (l->sentinel == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 16]
  ------------------
  187|      0|	xmlFree(l);
  188|      0|        return (NULL);
  189|      0|    }
  190|     16|    l->sentinel->next = l->sentinel;
  191|     16|    l->sentinel->prev = l->sentinel;
  192|     16|    l->sentinel->data = NULL;
  193|       |
  194|       |    /* If there is a link deallocator, use it */
  195|     16|    if (deallocator != NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 16]
  ------------------
  196|      0|        l->linkDeallocator = deallocator;
  197|       |    /* If there is a link comparator, use it */
  198|     16|    if (compare != NULL)
  ------------------
  |  Branch (198:9): [True: 16, False: 0]
  ------------------
  199|     16|        l->linkCompare = compare;
  200|      0|    else /* Use our own */
  201|      0|        l->linkCompare = xmlLinkCompare;
  202|     16|    return l;
  203|     16|}
xmlListDelete:
  303|     16|{
  304|     16|    if (l == NULL)
  ------------------
  |  Branch (304:9): [True: 0, False: 16]
  ------------------
  305|      0|        return;
  306|       |
  307|     16|    xmlListClear(l);
  308|     16|    xmlFree(l->sentinel);
  309|     16|    xmlFree(l);
  310|     16|}
xmlListClear:
  385|     16|{
  386|     16|    xmlLinkPtr  lk;
  387|       |
  388|     16|    if (l == NULL)
  ------------------
  |  Branch (388:9): [True: 0, False: 16]
  ------------------
  389|      0|        return;
  390|     16|    lk = l->sentinel->next;
  391|     16|    while(lk != l->sentinel) {
  ------------------
  |  Branch (391:11): [True: 0, False: 16]
  ------------------
  392|      0|        xmlLinkPtr next = lk->next;
  393|       |
  394|      0|        xmlLinkDeallocator(l, lk);
  395|      0|        lk = next;
  396|      0|    }
  397|     16|}
xmlListWalk:
  614|     16|xmlListWalk(xmlList *l, xmlListWalker walker, void *user) {
  615|     16|    xmlLinkPtr lk;
  616|       |
  617|     16|    if ((l == NULL) || (walker == NULL))
  ------------------
  |  Branch (617:9): [True: 0, False: 16]
  |  Branch (617:24): [True: 0, False: 16]
  ------------------
  618|      0|        return;
  619|     16|    for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) {
  ------------------
  |  Branch (619:33): [True: 0, False: 16]
  ------------------
  620|      0|        if((walker(lk->data, user)) == 0)
  ------------------
  |  Branch (620:12): [True: 0, False: 0]
  ------------------
  621|      0|                break;
  622|      0|    }
  623|     16|}

xmlHasFeature:
  495|  2.01k|{
  496|  2.01k|    switch (feature) {
  497|     84|	case XML_WITH_THREAD:
  ------------------
  |  Branch (497:2): [True: 84, False: 1.93k]
  ------------------
  498|     84|#ifdef LIBXML_THREAD_ENABLED
  499|     84|	    return(1);
  500|       |#else
  501|       |	    return(0);
  502|       |#endif
  503|      0|        case XML_WITH_TREE:
  ------------------
  |  Branch (503:9): [True: 0, False: 2.01k]
  ------------------
  504|      0|            return(1);
  505|     84|        case XML_WITH_OUTPUT:
  ------------------
  |  Branch (505:9): [True: 84, False: 1.93k]
  ------------------
  506|     84|#ifdef LIBXML_OUTPUT_ENABLED
  507|     84|            return(1);
  508|       |#else
  509|       |            return(0);
  510|       |#endif
  511|     84|        case XML_WITH_PUSH:
  ------------------
  |  Branch (511:9): [True: 84, False: 1.93k]
  ------------------
  512|     84|#ifdef LIBXML_PUSH_ENABLED
  513|     84|            return(1);
  514|       |#else
  515|       |            return(0);
  516|       |#endif
  517|     84|        case XML_WITH_READER:
  ------------------
  |  Branch (517:9): [True: 84, False: 1.93k]
  ------------------
  518|     84|#ifdef LIBXML_READER_ENABLED
  519|     84|            return(1);
  520|       |#else
  521|       |            return(0);
  522|       |#endif
  523|     84|        case XML_WITH_PATTERN:
  ------------------
  |  Branch (523:9): [True: 84, False: 1.93k]
  ------------------
  524|     84|#ifdef LIBXML_PATTERN_ENABLED
  525|     84|            return(1);
  526|       |#else
  527|       |            return(0);
  528|       |#endif
  529|     84|        case XML_WITH_WRITER:
  ------------------
  |  Branch (529:9): [True: 84, False: 1.93k]
  ------------------
  530|     84|#ifdef LIBXML_WRITER_ENABLED
  531|     84|            return(1);
  532|       |#else
  533|       |            return(0);
  534|       |#endif
  535|     84|        case XML_WITH_SAX1:
  ------------------
  |  Branch (535:9): [True: 84, False: 1.93k]
  ------------------
  536|     84|#ifdef LIBXML_SAX1_ENABLED
  537|     84|            return(1);
  538|       |#else
  539|       |            return(0);
  540|       |#endif
  541|      0|        case XML_WITH_HTTP:
  ------------------
  |  Branch (541:9): [True: 0, False: 2.01k]
  ------------------
  542|      0|            return(0);
  543|     84|        case XML_WITH_VALID:
  ------------------
  |  Branch (543:9): [True: 84, False: 1.93k]
  ------------------
  544|     84|#ifdef LIBXML_VALID_ENABLED
  545|     84|            return(1);
  546|       |#else
  547|       |            return(0);
  548|       |#endif
  549|     84|        case XML_WITH_HTML:
  ------------------
  |  Branch (549:9): [True: 84, False: 1.93k]
  ------------------
  550|     84|#ifdef LIBXML_HTML_ENABLED
  551|     84|            return(1);
  552|       |#else
  553|       |            return(0);
  554|       |#endif
  555|      0|        case XML_WITH_LEGACY:
  ------------------
  |  Branch (555:9): [True: 0, False: 2.01k]
  ------------------
  556|      0|            return(0);
  557|     84|        case XML_WITH_C14N:
  ------------------
  |  Branch (557:9): [True: 84, False: 1.93k]
  ------------------
  558|     84|#ifdef LIBXML_C14N_ENABLED
  559|     84|            return(1);
  560|       |#else
  561|       |            return(0);
  562|       |#endif
  563|     84|        case XML_WITH_CATALOG:
  ------------------
  |  Branch (563:9): [True: 84, False: 1.93k]
  ------------------
  564|     84|#ifdef LIBXML_CATALOG_ENABLED
  565|     84|            return(1);
  566|       |#else
  567|       |            return(0);
  568|       |#endif
  569|     84|        case XML_WITH_XPATH:
  ------------------
  |  Branch (569:9): [True: 84, False: 1.93k]
  ------------------
  570|     84|#ifdef LIBXML_XPATH_ENABLED
  571|     84|            return(1);
  572|       |#else
  573|       |            return(0);
  574|       |#endif
  575|     84|        case XML_WITH_XPTR:
  ------------------
  |  Branch (575:9): [True: 84, False: 1.93k]
  ------------------
  576|     84|#ifdef LIBXML_XPTR_ENABLED
  577|     84|            return(1);
  578|       |#else
  579|       |            return(0);
  580|       |#endif
  581|     84|        case XML_WITH_XINCLUDE:
  ------------------
  |  Branch (581:9): [True: 84, False: 1.93k]
  ------------------
  582|     84|#ifdef LIBXML_XINCLUDE_ENABLED
  583|     84|            return(1);
  584|       |#else
  585|       |            return(0);
  586|       |#endif
  587|     84|        case XML_WITH_ICONV:
  ------------------
  |  Branch (587:9): [True: 84, False: 1.93k]
  ------------------
  588|     84|#ifdef LIBXML_ICONV_ENABLED
  589|     84|            return(1);
  590|       |#else
  591|       |            return(0);
  592|       |#endif
  593|     84|        case XML_WITH_ISO8859X:
  ------------------
  |  Branch (593:9): [True: 84, False: 1.93k]
  ------------------
  594|     84|#ifdef LIBXML_ISO8859X_ENABLED
  595|     84|            return(1);
  596|       |#else
  597|       |            return(0);
  598|       |#endif
  599|      0|        case XML_WITH_UNICODE:
  ------------------
  |  Branch (599:9): [True: 0, False: 2.01k]
  ------------------
  600|      0|            return(0);
  601|     84|        case XML_WITH_REGEXP:
  ------------------
  |  Branch (601:9): [True: 84, False: 1.93k]
  ------------------
  602|     84|#ifdef LIBXML_REGEXP_ENABLED
  603|     84|            return(1);
  604|       |#else
  605|       |            return(0);
  606|       |#endif
  607|      0|        case XML_WITH_AUTOMATA:
  ------------------
  |  Branch (607:9): [True: 0, False: 2.01k]
  ------------------
  608|      0|#ifdef LIBXML_REGEXP_ENABLED
  609|      0|            return(1);
  610|       |#else
  611|       |            return(0);
  612|       |#endif
  613|      0|        case XML_WITH_EXPR:
  ------------------
  |  Branch (613:9): [True: 0, False: 2.01k]
  ------------------
  614|      0|            return(0);
  615|     84|        case XML_WITH_RELAXNG:
  ------------------
  |  Branch (615:9): [True: 84, False: 1.93k]
  ------------------
  616|     84|#ifdef LIBXML_RELAXNG_ENABLED
  617|     84|            return(1);
  618|       |#else
  619|       |            return(0);
  620|       |#endif
  621|     84|        case XML_WITH_SCHEMAS:
  ------------------
  |  Branch (621:9): [True: 84, False: 1.93k]
  ------------------
  622|     84|#ifdef LIBXML_SCHEMAS_ENABLED
  623|     84|            return(1);
  624|       |#else
  625|       |            return(0);
  626|       |#endif
  627|     84|        case XML_WITH_SCHEMATRON:
  ------------------
  |  Branch (627:9): [True: 84, False: 1.93k]
  ------------------
  628|       |#ifdef LIBXML_SCHEMATRON_ENABLED
  629|       |            return(1);
  630|       |#else
  631|     84|            return(0);
  632|      0|#endif
  633|     84|        case XML_WITH_MODULES:
  ------------------
  |  Branch (633:9): [True: 84, False: 1.93k]
  ------------------
  634|     84|#ifdef LIBXML_MODULES_ENABLED
  635|     84|            return(1);
  636|       |#else
  637|       |            return(0);
  638|       |#endif
  639|     84|        case XML_WITH_DEBUG:
  ------------------
  |  Branch (639:9): [True: 84, False: 1.93k]
  ------------------
  640|       |#ifdef LIBXML_DEBUG_ENABLED
  641|       |            return(1);
  642|       |#else
  643|     84|            return(0);
  644|      0|#endif
  645|      0|        case XML_WITH_DEBUG_MEM:
  ------------------
  |  Branch (645:9): [True: 0, False: 2.01k]
  ------------------
  646|      0|            return(0);
  647|     84|        case XML_WITH_ZLIB:
  ------------------
  |  Branch (647:9): [True: 84, False: 1.93k]
  ------------------
  648|     84|#ifdef LIBXML_ZLIB_ENABLED
  649|     84|            return(1);
  650|       |#else
  651|       |            return(0);
  652|       |#endif
  653|      0|        case XML_WITH_LZMA:
  ------------------
  |  Branch (653:9): [True: 0, False: 2.01k]
  ------------------
  654|      0|            return(0);
  655|     84|        case XML_WITH_ICU:
  ------------------
  |  Branch (655:9): [True: 84, False: 1.93k]
  ------------------
  656|       |#ifdef LIBXML_ICU_ENABLED
  657|       |            return(1);
  658|       |#else
  659|     84|            return(0);
  660|      0|#endif
  661|      0|        default:
  ------------------
  |  Branch (661:9): [True: 0, False: 2.01k]
  ------------------
  662|      0|	    break;
  663|  2.01k|     }
  664|      0|     return(0);
  665|  2.01k|}
xmlParserNsCreate:
 1416|    189|xmlParserNsCreate(void) {
 1417|    189|    xmlParserNsData *nsdb = xmlMalloc(sizeof(*nsdb));
 1418|       |
 1419|    189|    if (nsdb == NULL)
  ------------------
  |  Branch (1419:9): [True: 0, False: 189]
  ------------------
 1420|      0|        return(NULL);
 1421|    189|    memset(nsdb, 0, sizeof(*nsdb));
 1422|    189|    nsdb->defaultNsIndex = INT_MAX;
 1423|       |
 1424|    189|    return(nsdb);
 1425|    189|}
xmlParserNsFree:
 1433|    189|xmlParserNsFree(xmlParserNsData *nsdb) {
 1434|    189|    if (nsdb == NULL)
  ------------------
  |  Branch (1434:9): [True: 0, False: 189]
  ------------------
 1435|      0|        return;
 1436|       |
 1437|    189|    xmlFree(nsdb->extra);
 1438|    189|    xmlFree(nsdb->hash);
 1439|    189|    xmlFree(nsdb);
 1440|    189|}
xmlCtxtPushInput:
 1892|      1|{
 1893|      1|    char *directory = NULL;
 1894|      1|    int maxDepth;
 1895|       |
 1896|      1|    if ((ctxt == NULL) || (value == NULL))
  ------------------
  |  Branch (1896:9): [True: 0, False: 1]
  |  Branch (1896:27): [True: 0, False: 1]
  ------------------
 1897|      0|        return(-1);
 1898|       |
 1899|      1|    maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (1899:16): [True: 1, False: 0]
  ------------------
 1900|       |
 1901|      1|    if (ctxt->inputNr >= ctxt->inputMax) {
  ------------------
  |  Branch (1901:9): [True: 0, False: 1]
  ------------------
 1902|      0|        xmlParserInputPtr *tmp;
 1903|      0|        int newSize;
 1904|       |
 1905|      0|        newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]),
 1906|      0|                                  5, maxDepth);
 1907|      0|        if (newSize < 0) {
  ------------------
  |  Branch (1907:13): [True: 0, False: 0]
  ------------------
 1908|      0|            xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 1909|      0|                           "Maximum entity nesting depth exceeded");
 1910|      0|            return(-1);
 1911|      0|        }
 1912|      0|        tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0]));
 1913|      0|        if (tmp == NULL) {
  ------------------
  |  Branch (1913:13): [True: 0, False: 0]
  ------------------
 1914|      0|            xmlErrMemory(ctxt);
 1915|      0|            return(-1);
 1916|      0|        }
 1917|      0|        ctxt->inputTab = tmp;
 1918|      0|        ctxt->inputMax = newSize;
 1919|      0|    }
 1920|       |
 1921|      1|    if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
  ------------------
  |  Branch (1921:9): [True: 1, False: 0]
  |  Branch (1921:33): [True: 1, False: 0]
  ------------------
 1922|      1|        directory = xmlParserGetDirectory(value->filename);
 1923|      1|        if (directory == NULL) {
  ------------------
  |  Branch (1923:13): [True: 0, False: 1]
  ------------------
 1924|      0|            xmlErrMemory(ctxt);
 1925|      0|            return(-1);
 1926|      0|        }
 1927|      1|    }
 1928|       |
 1929|      1|    if (ctxt->input_id >= INT_MAX) {
  ------------------
  |  Branch (1929:9): [True: 0, False: 1]
  ------------------
 1930|      0|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, "Input ID overflow\n");
 1931|      0|        return(-1);
 1932|      0|    }
 1933|       |
 1934|      1|    ctxt->inputTab[ctxt->inputNr] = value;
 1935|      1|    ctxt->input = value;
 1936|       |
 1937|      1|    if (ctxt->inputNr == 0) {
  ------------------
  |  Branch (1937:9): [True: 1, False: 0]
  ------------------
 1938|      1|        xmlFree(ctxt->directory);
 1939|      1|        ctxt->directory = directory;
 1940|      1|    }
 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|      1|    value->id = ctxt->input_id++;
 1948|       |
 1949|      1|    return(ctxt->inputNr++);
 1950|      1|}
xmlCtxtPopInput:
 1960|    488|{
 1961|    488|    xmlParserInputPtr ret;
 1962|       |
 1963|    488|    if (ctxt == NULL)
  ------------------
  |  Branch (1963:9): [True: 0, False: 488]
  ------------------
 1964|      0|        return(NULL);
 1965|    488|    if (ctxt->inputNr <= 0)
  ------------------
  |  Branch (1965:9): [True: 487, False: 1]
  ------------------
 1966|    487|        return (NULL);
 1967|      1|    ctxt->inputNr--;
 1968|      1|    if (ctxt->inputNr > 0)
  ------------------
  |  Branch (1968:9): [True: 0, False: 1]
  ------------------
 1969|      0|        ctxt->input = ctxt->inputTab[ctxt->inputNr - 1];
 1970|      1|    else
 1971|      1|        ctxt->input = NULL;
 1972|      1|    ret = ctxt->inputTab[ctxt->inputNr];
 1973|       |    ctxt->inputTab[ctxt->inputNr] = NULL;
 1974|      1|    return (ret);
 1975|    488|}
nodePush:
 1988|      2|{
 1989|      2|    if (ctxt == NULL)
  ------------------
  |  Branch (1989:9): [True: 0, False: 2]
  ------------------
 1990|      0|        return(0);
 1991|       |
 1992|      2|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (1992:9): [True: 1, False: 1]
  ------------------
 1993|      1|        int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (1993:24): [True: 1, False: 0]
  ------------------
 1994|      1|        xmlNodePtr *tmp;
 1995|      1|        int newSize;
 1996|       |
 1997|      1|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
 1998|      1|                                  10, maxDepth);
 1999|      1|        if (newSize < 0) {
  ------------------
  |  Branch (1999:13): [True: 0, False: 1]
  ------------------
 2000|      0|            xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 2001|      0|                    "Excessive depth in document: %d,"
 2002|      0|                    " use XML_PARSE_HUGE option\n",
 2003|      0|                    ctxt->nodeNr);
 2004|      0|            return(-1);
 2005|      0|        }
 2006|       |
 2007|      1|	tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
 2008|      1|        if (tmp == NULL) {
  ------------------
  |  Branch (2008:13): [True: 0, False: 1]
  ------------------
 2009|      0|            xmlErrMemory(ctxt);
 2010|      0|            return (-1);
 2011|      0|        }
 2012|      1|        ctxt->nodeTab = tmp;
 2013|      1|	ctxt->nodeMax = newSize;
 2014|      1|    }
 2015|       |
 2016|      2|    ctxt->nodeTab[ctxt->nodeNr] = value;
 2017|      2|    ctxt->node = value;
 2018|      2|    return (ctxt->nodeNr++);
 2019|      2|}
nodePop:
 2031|      2|{
 2032|      2|    xmlNodePtr ret;
 2033|       |
 2034|      2|    if (ctxt == NULL) return(NULL);
  ------------------
  |  Branch (2034:9): [True: 0, False: 2]
  ------------------
 2035|      2|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (2035:9): [True: 0, False: 2]
  ------------------
 2036|      0|        return (NULL);
 2037|      2|    ctxt->nodeNr--;
 2038|      2|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (2038:9): [True: 1, False: 1]
  ------------------
 2039|      1|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
 2040|      1|    else
 2041|      1|        ctxt->node = NULL;
 2042|      2|    ret = ctxt->nodeTab[ctxt->nodeNr];
 2043|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
 2044|      2|    return (ret);
 2045|      2|}
xmlScanName:
 3051|  27.2M|xmlScanName(const xmlChar *ptr, size_t maxSize, int flags) {
 3052|  27.2M|    int stop = flags & XML_SCAN_NC ? ':' : 0;
  ------------------
  |  |   69|  27.2M|#define XML_SCAN_NC         1
  ------------------
  |  Branch (3052:16): [True: 9.58M, False: 17.6M]
  ------------------
 3053|  27.2M|    int old10 = flags & XML_SCAN_OLD10 ? 1 : 0;
  ------------------
  |  |   71|  27.2M|#define XML_SCAN_OLD10      4
  ------------------
  |  Branch (3053:17): [True: 0, False: 27.2M]
  ------------------
 3054|       |
 3055|  37.8M|    while (1) {
  ------------------
  |  Branch (3055:12): [True: 37.8M, Folded]
  ------------------
 3056|  37.8M|        int c, len;
 3057|       |
 3058|  37.8M|        c = *ptr;
 3059|  37.8M|        if (c < 0x80) {
  ------------------
  |  Branch (3059:13): [True: 37.8M, False: 13.0k]
  ------------------
 3060|  37.8M|            if (c == stop)
  ------------------
  |  Branch (3060:17): [True: 13.4k, False: 37.8M]
  ------------------
 3061|  13.4k|                break;
 3062|  37.8M|            len = 1;
 3063|  37.8M|        } else {
 3064|  13.0k|            len = 4;
 3065|  13.0k|            c = xmlGetUTF8Char(ptr, &len);
 3066|  13.0k|            if (c < 0)
  ------------------
  |  Branch (3066:17): [True: 26, False: 13.0k]
  ------------------
 3067|     26|                break;
 3068|  13.0k|        }
 3069|       |
 3070|  37.8M|        if (flags & XML_SCAN_NMTOKEN ?
  ------------------
  |  |   70|  37.8M|#define XML_SCAN_NMTOKEN    2
  ------------------
  |  Branch (3070:13): [True: 10.6M, False: 27.2M]
  |  Branch (3070:13): [True: 27.2M, False: 10.6M]
  ------------------
 3071|  10.6M|                !xmlIsNameChar(c, old10) :
 3072|  37.8M|                !xmlIsNameStartChar(c, old10))
 3073|  27.2M|            break;
 3074|       |
 3075|  10.6M|        if ((size_t) len > maxSize)
  ------------------
  |  Branch (3075:13): [True: 7, False: 10.6M]
  ------------------
 3076|      7|            return(NULL);
 3077|  10.6M|        ptr += len;
 3078|  10.6M|        maxSize -= len;
 3079|  10.6M|        flags |= XML_SCAN_NMTOKEN;
  ------------------
  |  |   70|  10.6M|#define XML_SCAN_NMTOKEN    2
  ------------------
 3080|  10.6M|    }
 3081|       |
 3082|  27.2M|    return(ptr);
 3083|  27.2M|}
xmlCreatePushParserCtxt:
11359|      3|                        const char *chunk, int size, const char *filename) {
11360|      3|    xmlParserCtxtPtr ctxt;
11361|      3|    xmlParserInputPtr input;
11362|       |
11363|      3|    ctxt = xmlNewSAXParserCtxt(sax, user_data);
11364|      3|    if (ctxt == NULL)
  ------------------
  |  Branch (11364:9): [True: 0, False: 3]
  ------------------
11365|      0|	return(NULL);
11366|       |
11367|      3|    ctxt->options &= ~XML_PARSE_NODICT;
11368|      3|    ctxt->dictNames = 1;
11369|       |
11370|      3|    input = xmlNewPushInput(filename, chunk, size);
11371|      3|    if (input == NULL) {
  ------------------
  |  Branch (11371:9): [True: 3, False: 0]
  ------------------
11372|      3|	xmlFreeParserCtxt(ctxt);
11373|      3|	return(NULL);
11374|      3|    }
11375|      0|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (11375:9): [True: 0, False: 0]
  ------------------
11376|      0|        xmlFreeInputStream(input);
11377|      0|        xmlFreeParserCtxt(ctxt);
11378|      0|        return(NULL);
11379|      0|    }
11380|       |
11381|      0|    return(ctxt);
11382|      0|}
xmlSAXParseDTD:
11598|      1|               const xmlChar *systemId) {
11599|      1|    xmlDtdPtr ret = NULL;
11600|      1|    xmlParserCtxtPtr ctxt;
11601|      1|    xmlParserInputPtr input = NULL;
11602|      1|    xmlChar* systemIdCanonic;
11603|       |
11604|      1|    if ((publicId == NULL) && (systemId == NULL)) return(NULL);
  ------------------
  |  Branch (11604:9): [True: 0, False: 1]
  |  Branch (11604:31): [True: 0, False: 0]
  ------------------
11605|       |
11606|      1|    ctxt = xmlNewSAXParserCtxt(sax, NULL);
11607|      1|    if (ctxt == NULL) {
  ------------------
  |  Branch (11607:9): [True: 0, False: 1]
  ------------------
11608|      0|	return(NULL);
11609|      0|    }
11610|      1|    xmlCtxtSetOptions(ctxt, XML_PARSE_DTDLOAD);
11611|       |
11612|       |    /*
11613|       |     * Canonicalise the system ID
11614|       |     */
11615|      1|    systemIdCanonic = xmlCanonicPath(systemId);
11616|      1|    if ((systemId != NULL) && (systemIdCanonic == NULL)) {
  ------------------
  |  Branch (11616:9): [True: 1, False: 0]
  |  Branch (11616:31): [True: 0, False: 1]
  ------------------
11617|      0|	xmlFreeParserCtxt(ctxt);
11618|      0|	return(NULL);
11619|      0|    }
11620|       |
11621|       |    /*
11622|       |     * Ask the Entity resolver to load the damn thing
11623|       |     */
11624|       |
11625|      1|    if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
  ------------------
  |  Branch (11625:9): [True: 1, False: 0]
  |  Branch (11625:32): [True: 1, False: 0]
  ------------------
11626|      1|	input = ctxt->sax->resolveEntity(ctxt->userData, publicId,
11627|      1|	                                 systemIdCanonic);
11628|      1|    if (input == NULL) {
  ------------------
  |  Branch (11628:9): [True: 1, False: 0]
  ------------------
11629|      1|	xmlFreeParserCtxt(ctxt);
11630|      1|	if (systemIdCanonic != NULL)
  ------------------
  |  Branch (11630:6): [True: 1, False: 0]
  ------------------
11631|      1|	    xmlFree(systemIdCanonic);
11632|      1|	return(NULL);
11633|      1|    }
11634|       |
11635|      0|    if (input->filename == NULL)
  ------------------
  |  Branch (11635:9): [True: 0, False: 0]
  ------------------
11636|      0|	input->filename = (char *) systemIdCanonic;
11637|      0|    else
11638|      0|	xmlFree(systemIdCanonic);
11639|       |
11640|      0|    ret = xmlCtxtParseDtd(ctxt, input, publicId, systemId);
11641|       |
11642|      0|    xmlFreeParserCtxt(ctxt);
11643|      0|    return(ret);
11644|      1|}
xmlParseDTD:
11656|      1|xmlParseDTD(const xmlChar *publicId, const xmlChar *systemId) {
11657|       |    return(xmlSAXParseDTD(NULL, publicId, systemId));
11658|      1|}
xmlCtxtReset:
12999|     76|{
13000|     76|    xmlParserInputPtr input;
13001|       |
13002|     76|    if (ctxt == NULL)
  ------------------
  |  Branch (13002:9): [True: 0, False: 76]
  ------------------
13003|      0|        return;
13004|       |
13005|     76|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (13005:12): [True: 0, False: 76]
  ------------------
13006|      0|        xmlFreeInputStream(input);
13007|      0|    }
13008|     76|    ctxt->inputNr = 0;
13009|     76|    ctxt->input = NULL;
13010|       |
13011|     76|    ctxt->spaceNr = 0;
13012|     76|    if (ctxt->spaceTab != NULL) {
  ------------------
  |  Branch (13012:9): [True: 41, False: 35]
  ------------------
13013|     41|	ctxt->spaceTab[0] = -1;
13014|     41|	ctxt->space = &ctxt->spaceTab[0];
13015|     41|    } else {
13016|     35|        ctxt->space = NULL;
13017|     35|    }
13018|       |
13019|       |
13020|     76|    ctxt->nodeNr = 0;
13021|     76|    ctxt->node = NULL;
13022|       |
13023|     76|    ctxt->nameNr = 0;
13024|     76|    ctxt->name = NULL;
13025|       |
13026|     76|    ctxt->nsNr = 0;
13027|     76|    xmlParserNsReset(ctxt->nsdb);
13028|       |
13029|     76|    if (ctxt->version != NULL) {
  ------------------
  |  Branch (13029:9): [True: 0, False: 76]
  ------------------
13030|      0|        xmlFree(ctxt->version);
13031|      0|        ctxt->version = NULL;
13032|      0|    }
13033|     76|    if (ctxt->encoding != NULL) {
  ------------------
  |  Branch (13033:9): [True: 0, False: 76]
  ------------------
13034|      0|        xmlFree(ctxt->encoding);
13035|      0|        ctxt->encoding = NULL;
13036|      0|    }
13037|     76|    if (ctxt->extSubURI != NULL) {
  ------------------
  |  Branch (13037:9): [True: 0, False: 76]
  ------------------
13038|      0|        xmlFree(ctxt->extSubURI);
13039|      0|        ctxt->extSubURI = NULL;
13040|      0|    }
13041|     76|    if (ctxt->extSubSystem != NULL) {
  ------------------
  |  Branch (13041:9): [True: 0, False: 76]
  ------------------
13042|      0|        xmlFree(ctxt->extSubSystem);
13043|      0|        ctxt->extSubSystem = NULL;
13044|      0|    }
13045|     76|    if (ctxt->directory != NULL) {
  ------------------
  |  Branch (13045:9): [True: 0, False: 76]
  ------------------
13046|      0|        xmlFree(ctxt->directory);
13047|      0|        ctxt->directory = NULL;
13048|      0|    }
13049|       |
13050|     76|    if (ctxt->myDoc != NULL)
  ------------------
  |  Branch (13050:9): [True: 0, False: 76]
  ------------------
13051|      0|        xmlFreeDoc(ctxt->myDoc);
13052|     76|    ctxt->myDoc = NULL;
13053|       |
13054|     76|    ctxt->standalone = -1;
13055|     76|    ctxt->hasExternalSubset = 0;
13056|     76|    ctxt->hasPErefs = 0;
13057|     76|    ctxt->html = ctxt->html ? 1 : 0;
  ------------------
  |  Branch (13057:18): [True: 35, False: 41]
  ------------------
13058|     76|    ctxt->instate = XML_PARSER_START;
13059|       |
13060|     76|    ctxt->wellFormed = 1;
13061|     76|    ctxt->nsWellFormed = 1;
13062|     76|    ctxt->disableSAX = 0;
13063|     76|    ctxt->valid = 1;
13064|     76|    ctxt->record_info = 0;
13065|     76|    ctxt->checkIndex = 0;
13066|     76|    ctxt->endCheckState = 0;
13067|     76|    ctxt->inSubset = 0;
13068|     76|    ctxt->errNo = XML_ERR_OK;
13069|     76|    ctxt->depth = 0;
13070|     76|    ctxt->catalogs = NULL;
13071|     76|    ctxt->sizeentities = 0;
13072|     76|    ctxt->sizeentcopy = 0;
13073|     76|    xmlInitNodeInfoSeq(&ctxt->node_seq);
13074|       |
13075|     76|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (13075:9): [True: 0, False: 76]
  ------------------
13076|      0|        xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
13077|      0|        ctxt->attsDefault = NULL;
13078|      0|    }
13079|     76|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (13079:9): [True: 0, False: 76]
  ------------------
13080|      0|        xmlHashFree(ctxt->attsSpecial, NULL);
13081|      0|        ctxt->attsSpecial = NULL;
13082|      0|    }
13083|       |
13084|     76|#ifdef LIBXML_CATALOG_ENABLED
13085|     76|    if (ctxt->catalogs != NULL)
  ------------------
  |  Branch (13085:9): [True: 0, False: 76]
  ------------------
13086|      0|	xmlCatalogFreeLocal(ctxt->catalogs);
13087|     76|#endif
13088|     76|    ctxt->nbErrors = 0;
13089|     76|    ctxt->nbWarnings = 0;
13090|     76|    if (ctxt->lastError.code != XML_ERR_OK)
  ------------------
  |  Branch (13090:9): [True: 1, False: 75]
  ------------------
13091|      1|        xmlResetError(&ctxt->lastError);
13092|     76|}
xmlCtxtSetOptions:
13216|      1|{
13217|      1|#ifdef LIBXML_HTML_ENABLED
13218|      1|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13218:9): [True: 1, False: 0]
  |  Branch (13218:27): [True: 0, False: 1]
  ------------------
13219|      0|        return(htmlCtxtSetOptions(ctxt, options));
13220|      1|#endif
13221|       |
13222|      1|    return(xmlCtxtSetOptionsInternal(ctxt, options, 0));
13223|      1|}
xmlCtxtUseOptions:
13267|    187|{
13268|    187|    int keepMask;
13269|       |
13270|    187|#ifdef LIBXML_HTML_ENABLED
13271|    187|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13271:9): [True: 185, False: 2]
  |  Branch (13271:27): [True: 0, False: 185]
  ------------------
13272|      0|        return(htmlCtxtUseOptions(ctxt, options));
13273|    187|#endif
13274|       |
13275|       |    /*
13276|       |     * For historic reasons, some options can only be enabled.
13277|       |     */
13278|    187|    keepMask = XML_PARSE_NOERROR |
13279|    187|               XML_PARSE_NOWARNING |
13280|    187|               XML_PARSE_NONET |
13281|    187|               XML_PARSE_NSCLEAN |
13282|    187|               XML_PARSE_NOCDATA |
13283|    187|               XML_PARSE_COMPACT |
13284|    187|               XML_PARSE_OLD10 |
13285|    187|               XML_PARSE_HUGE |
13286|    187|               XML_PARSE_OLDSAX |
13287|    187|               XML_PARSE_IGNORE_ENC |
13288|    187|               XML_PARSE_BIG_LINES;
13289|       |
13290|    187|    return(xmlCtxtSetOptionsInternal(ctxt, options, keepMask));
13291|    187|}
xmlCtxtSetMaxAmplification:
13307|     15|{
13308|     15|    if (ctxt == NULL)
  ------------------
  |  Branch (13308:9): [True: 0, False: 15]
  ------------------
13309|      0|        return;
13310|     15|    ctxt->maxAmpl = maxAmpl;
13311|     15|}
parser.c:xmlIsNameChar:
 3031|  10.6M|xmlIsNameChar(int c, int old10) {
 3032|  10.6M|    if (!old10)
  ------------------
  |  Branch (3032:9): [True: 10.6M, False: 0]
  ------------------
 3033|  10.6M|        return(xmlIsNameCharNew(c));
 3034|      0|    else
 3035|      0|        return(xmlIsNameCharOld(c));
 3036|  10.6M|}
parser.c:xmlIsNameCharNew:
 2973|  10.6M|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|  10.6M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2978:9): [True: 10.6M, False: 174]
  |  Branch (2978:23): [True: 10.6M, False: 276]
  |  Branch (2978:37): [True: 4.24M, False: 6.38M]
  ------------------
 2979|  4.24M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2979:11): [True: 1.44M, False: 2.80M]
  |  Branch (2979:25): [True: 1.41M, False: 27.1k]
  ------------------
 2980|  2.82M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2980:11): [True: 100k, False: 2.72M]
  |  Branch (2980:25): [True: 66.2k, False: 33.7k]
  ------------------
 2981|  2.76M|         ((c >= '0') && (c <= '9')) || /* !start */
  ------------------
  |  Branch (2981:11): [True: 117k, False: 2.64M]
  |  Branch (2981:25): [True: 51.8k, False: 65.4k]
  ------------------
 2982|  2.71M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2982:10): [True: 3.10k, False: 2.70M]
  |  Branch (2982:24): [True: 7.54k, False: 2.69M]
  ------------------
 2983|  2.69M|         (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
  ------------------
  |  Branch (2983:10): [True: 75.5k, False: 2.62M]
  |  Branch (2983:24): [True: 31.6k, False: 2.59M]
  |  Branch (2983:38): [True: 32, False: 2.59M]
  ------------------
 2984|  2.59M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2984:11): [True: 11.3k, False: 2.58M]
  |  Branch (2984:26): [True: 0, False: 11.3k]
  ------------------
 2985|  2.59M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2985:11): [True: 11.3k, False: 2.58M]
  |  Branch (2985:26): [True: 0, False: 11.3k]
  ------------------
 2986|  2.59M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2986:11): [True: 11.3k, False: 2.58M]
  |  Branch (2986:26): [True: 5.26k, False: 6.04k]
  ------------------
 2987|  2.58M|         ((c >= 0x300) && (c <= 0x36F)) || /* !start */
  ------------------
  |  Branch (2987:11): [True: 6.04k, False: 2.58M]
  |  Branch (2987:27): [True: 3, False: 6.03k]
  ------------------
 2988|  2.58M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2988:11): [True: 6.03k, False: 2.58M]
  |  Branch (2988:27): [True: 0, False: 6.03k]
  ------------------
 2989|  2.58M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2989:11): [True: 6.03k, False: 2.58M]
  |  Branch (2989:27): [True: 5.92k, False: 110]
  ------------------
 2990|  2.58M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2990:11): [True: 110, False: 2.58M]
  |  Branch (2990:28): [True: 0, False: 110]
  ------------------
 2991|  2.58M|         ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
  ------------------
  |  Branch (2991:11): [True: 110, False: 2.58M]
  |  Branch (2991:28): [True: 0, False: 110]
  ------------------
 2992|  2.58M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2992:11): [True: 110, False: 2.58M]
  |  Branch (2992:28): [True: 0, False: 110]
  ------------------
 2993|  2.58M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (2993:11): [True: 110, False: 2.58M]
  |  Branch (2993:28): [True: 0, False: 110]
  ------------------
 2994|  2.58M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (2994:11): [True: 110, False: 2.58M]
  |  Branch (2994:28): [True: 0, False: 110]
  ------------------
 2995|  2.58M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (2995:11): [True: 110, False: 2.58M]
  |  Branch (2995:28): [True: 0, False: 110]
  ------------------
 2996|  2.58M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (2996:11): [True: 110, False: 2.58M]
  |  Branch (2996:28): [True: 0, False: 110]
  ------------------
 2997|  2.58M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (2997:11): [True: 110, False: 2.58M]
  |  Branch (2997:29): [True: 110, False: 0]
  ------------------
 2998|  1.66M|         return(1);
 2999|  8.96M|    return(0);
 3000|  10.6M|}
parser.c:xmlIsNameStartChar:
 3023|  27.2M|xmlIsNameStartChar(int c, int old10) {
 3024|  27.2M|    if (!old10)
  ------------------
  |  Branch (3024:9): [True: 27.2M, False: 0]
  ------------------
 3025|  27.2M|        return(xmlIsNameStartCharNew(c));
 3026|      0|    else
 3027|      0|        return(xmlIsNameStartCharOld(c));
 3028|  27.2M|}
parser.c:xmlIsNameStartCharNew:
 2947|  27.2M|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|  27.2M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2952:9): [True: 27.2M, False: 0]
  |  Branch (2952:23): [True: 27.2M, False: 0]
  |  Branch (2952:37): [True: 27.2M, False: 7]
  ------------------
 2953|  27.2M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2953:11): [True: 24.3M, False: 2.87M]
  |  Branch (2953:25): [True: 7.85M, False: 16.4M]
  ------------------
 2954|  19.3M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2954:11): [True: 17.6M, False: 1.75M]
  |  Branch (2954:25): [True: 1.12M, False: 16.4M]
  ------------------
 2955|  18.2M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2955:10): [True: 56, False: 18.2M]
  |  Branch (2955:24): [True: 0, False: 18.2M]
  ------------------
 2956|  18.2M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2956:11): [True: 1.68k, False: 18.2M]
  |  Branch (2956:26): [True: 2, False: 1.68k]
  ------------------
 2957|  18.2M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2957:11): [True: 1.68k, False: 18.2M]
  |  Branch (2957:26): [True: 0, False: 1.68k]
  ------------------
 2958|  18.2M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2958:11): [True: 1.68k, False: 18.2M]
  |  Branch (2958:26): [True: 84, False: 1.59k]
  ------------------
 2959|  18.2M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2959:11): [True: 1.59k, False: 18.2M]
  |  Branch (2959:27): [True: 98, False: 1.50k]
  ------------------
 2960|  18.2M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2960:11): [True: 1.50k, False: 18.2M]
  |  Branch (2960:27): [True: 50, False: 1.45k]
  ------------------
 2961|  18.2M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2961:11): [True: 1.45k, False: 18.2M]
  |  Branch (2961:28): [True: 4, False: 1.44k]
  ------------------
 2962|  18.2M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2962:11): [True: 1.44k, False: 18.2M]
  |  Branch (2962:28): [True: 0, False: 1.44k]
  ------------------
 2963|  18.2M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (2963:11): [True: 1.44k, False: 18.2M]
  |  Branch (2963:28): [True: 0, False: 1.44k]
  ------------------
 2964|  18.2M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (2964:11): [True: 1.44k, False: 18.2M]
  |  Branch (2964:28): [True: 266, False: 1.17k]
  ------------------
 2965|  18.2M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (2965:11): [True: 1.17k, False: 18.2M]
  |  Branch (2965:28): [True: 0, False: 1.17k]
  ------------------
 2966|  18.2M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (2966:11): [True: 1.17k, False: 18.2M]
  |  Branch (2966:28): [True: 14, False: 1.16k]
  ------------------
 2967|  18.2M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (2967:11): [True: 1.16k, False: 18.2M]
  |  Branch (2967:29): [True: 1.16k, False: 0]
  ------------------
 2968|  8.98M|        return(1);
 2969|  18.2M|    return(0);
 2970|  27.2M|}
parser.c:xmlParserNsReset:
 1448|     76|xmlParserNsReset(xmlParserNsData *nsdb) {
 1449|     76|    if (nsdb == NULL)
  ------------------
  |  Branch (1449:9): [True: 35, False: 41]
  ------------------
 1450|     35|        return;
 1451|       |
 1452|     41|    nsdb->hashElems = 0;
 1453|     41|    nsdb->elementId = 0;
 1454|     41|    nsdb->defaultNsIndex = INT_MAX;
 1455|       |
 1456|     41|    if (nsdb->hash)
  ------------------
  |  Branch (1456:9): [True: 0, False: 41]
  ------------------
 1457|      0|        memset(nsdb->hash, 0, nsdb->hashSize * sizeof(nsdb->hash[0]));
 1458|     41|}
parser.c:xmlCtxtSetOptionsInternal:
13132|    188|{
13133|    188|    int allMask;
13134|       |
13135|    188|    if (ctxt == NULL)
  ------------------
  |  Branch (13135:9): [True: 2, False: 186]
  ------------------
13136|      2|        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|    186|    allMask = XML_PARSE_RECOVER |
13146|    186|              XML_PARSE_NOENT |
13147|    186|              XML_PARSE_DTDLOAD |
13148|    186|              XML_PARSE_DTDATTR |
13149|    186|              XML_PARSE_DTDVALID |
13150|    186|              XML_PARSE_NOERROR |
13151|    186|              XML_PARSE_NOWARNING |
13152|    186|              XML_PARSE_PEDANTIC |
13153|    186|              XML_PARSE_NOBLANKS |
13154|    186|#ifdef LIBXML_SAX1_ENABLED
13155|    186|              XML_PARSE_SAX1 |
13156|    186|#endif
13157|    186|              XML_PARSE_NONET |
13158|    186|              XML_PARSE_NODICT |
13159|    186|              XML_PARSE_NSCLEAN |
13160|    186|              XML_PARSE_NOCDATA |
13161|    186|              XML_PARSE_COMPACT |
13162|    186|              XML_PARSE_OLD10 |
13163|    186|              XML_PARSE_HUGE |
13164|    186|              XML_PARSE_OLDSAX |
13165|    186|              XML_PARSE_IGNORE_ENC |
13166|    186|              XML_PARSE_BIG_LINES |
13167|    186|              XML_PARSE_NO_XXE |
13168|    186|              XML_PARSE_UNZIP |
13169|    186|              XML_PARSE_NO_SYS_CATALOG |
13170|    186|              XML_PARSE_CATALOG_PI;
13171|       |
13172|    186|    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|    186|    ctxt->recovery = (options & XML_PARSE_RECOVER) ? 1 : 0;
  ------------------
  |  Branch (13188:22): [True: 25, False: 161]
  ------------------
13189|    186|    ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0;
  ------------------
  |  Branch (13189:29): [True: 103, False: 83]
  ------------------
13190|    186|    ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0;
  ------------------
  |  |  208|    111|#define XML_DETECT_IDS		2
  ------------------
  |  Branch (13190:24): [True: 111, False: 75]
  ------------------
13191|    186|    ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0;
  ------------------
  |  |  209|    138|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (13191:25): [True: 138, False: 48]
  ------------------
13192|    186|    ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0;
  ------------------
  |  |  210|      0|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (13192:25): [True: 0, False: 186]
  ------------------
13193|    186|    ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0;
  ------------------
  |  Branch (13193:22): [True: 55, False: 131]
  ------------------
13194|    186|    ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0;
  ------------------
  |  Branch (13194:22): [True: 16, False: 170]
  ------------------
13195|    186|    ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (13195:24): [True: 119, False: 67]
  ------------------
13196|    186|    ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1;
  ------------------
  |  Branch (13196:23): [True: 48, False: 138]
  ------------------
13197|       |
13198|    186|    return(options & ~allMask);
13199|    188|}

xmlCheckVersion:
   72|    323|xmlCheckVersion(int version) {
   73|    323|    int myversion = LIBXML_VERSION;
  ------------------
  |  |   24|    323|#define LIBXML_VERSION 21600
  ------------------
   74|       |
   75|    323|    xmlInitParser();
   76|       |
   77|    323|    if ((myversion / 10000) != (version / 10000)) {
  ------------------
  |  Branch (77:9): [True: 0, False: 323]
  ------------------
   78|      0|	xmlPrintErrorMessage(
   79|      0|		"Fatal: program compiled against libxml %d using libxml %d\n",
   80|      0|		(version / 10000), (myversion / 10000));
   81|    323|    } else if ((myversion / 100) < (version / 100)) {
  ------------------
  |  Branch (81:16): [True: 0, False: 323]
  ------------------
   82|      0|	xmlPrintErrorMessage(
   83|      0|		"Warning: program compiled against libxml %d using older %d\n",
   84|      0|		(version / 100), (myversion / 100));
   85|      0|    }
   86|    323|}
xmlCtxtErrMemory:
  179|     33|{
  180|     33|    xmlStructuredErrorFunc schannel = NULL;
  181|     33|    xmlGenericErrorFunc channel = NULL;
  182|     33|    void *data;
  183|       |
  184|     33|    if (ctxt == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 33]
  ------------------
  185|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  186|      0|        return;
  187|      0|    }
  188|       |
  189|     33|    ctxt->errNo = XML_ERR_NO_MEMORY;
  190|     33|    ctxt->instate = XML_PARSER_EOF; /* TODO: Remove after refactoring */
  191|     33|    ctxt->wellFormed = 0;
  192|     33|    ctxt->disableSAX = 2;
  193|       |
  194|     33|    if (ctxt->errorHandler) {
  ------------------
  |  Branch (194:9): [True: 0, False: 33]
  ------------------
  195|      0|        schannel = ctxt->errorHandler;
  196|      0|        data = ctxt->errorCtxt;
  197|     33|    } else if ((ctxt->sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|     33|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (197:16): [True: 0, False: 33]
  ------------------
  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|     33|    } else {
  202|     33|        channel = ctxt->sax->error;
  203|     33|        data = ctxt->userData;
  204|     33|    }
  205|       |
  206|     33|    xmlRaiseMemoryError(schannel, channel, data, XML_FROM_PARSER,
  207|     33|                        &ctxt->lastError);
  208|     33|}
xmlCtxtErrIO:
  221|     34|{
  222|     34|    const char *errstr, *msg, *str1, *str2;
  223|     34|    xmlErrorLevel level;
  224|       |
  225|     34|    if (ctxt == NULL)
  ------------------
  |  Branch (225:9): [True: 0, False: 34]
  ------------------
  226|      0|        return;
  227|       |
  228|     34|    if (((code == XML_IO_ENOENT) ||
  ------------------
  |  Branch (228:10): [True: 1, False: 33]
  ------------------
  229|     33|         (code == XML_IO_UNKNOWN))) {
  ------------------
  |  Branch (229:10): [True: 0, False: 33]
  ------------------
  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|      1|        if (ctxt->validate == 0)
  ------------------
  |  Branch (236:13): [True: 1, False: 0]
  ------------------
  237|      1|            level = XML_ERR_WARNING;
  238|      0|        else
  239|      0|            level = XML_ERR_ERROR;
  240|     33|    } else if (code == XML_IO_NETWORK_ATTEMPT) {
  ------------------
  |  Branch (240:16): [True: 0, False: 33]
  ------------------
  241|      0|        level = XML_ERR_ERROR;
  242|     33|    } else {
  243|     33|        level = XML_ERR_FATAL;
  244|     33|    }
  245|       |
  246|     34|    errstr = xmlErrString(code);
  247|       |
  248|     34|    if (uri == NULL) {
  ------------------
  |  Branch (248:9): [True: 0, False: 34]
  ------------------
  249|      0|        msg = "%s\n";
  250|      0|        str1 = errstr;
  251|      0|        str2 = NULL;
  252|     34|    } else {
  253|     34|        msg = "failed to load \"%s\": %s\n";
  254|     34|        str1 = uri;
  255|     34|        str2 = errstr;
  256|     34|    }
  257|       |
  258|     34|    xmlCtxtErr(ctxt, NULL, XML_FROM_IO, code, level,
  259|     34|               (const xmlChar *) uri, NULL, NULL, 0,
  260|     34|               msg, str1, str2);
  261|     34|}
xmlCtxtIsCatastrophicError:
  268|      1|xmlCtxtIsCatastrophicError(xmlParserCtxt *ctxt) {
  269|      1|    if (ctxt == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 1]
  ------------------
  270|      0|        return(1);
  271|       |
  272|      1|    return(xmlIsCatastrophicError(ctxt->lastError.level,
  273|      1|                                  ctxt->lastError.code));
  274|      1|}
xmlCtxtVErr:
  296|     34|{
  297|     34|    xmlStructuredErrorFunc schannel = NULL;
  298|     34|    xmlGenericErrorFunc channel = NULL;
  299|     34|    void *data = NULL;
  300|     34|    const char *file = NULL;
  301|     34|    int line = 0;
  302|     34|    int col = 0;
  303|     34|    int res;
  304|       |
  305|     34|    if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (305:9): [True: 33, False: 1]
  ------------------
  306|     33|        xmlCtxtErrMemory(ctxt);
  307|     33|        return;
  308|     33|    }
  309|       |
  310|      1|    if (ctxt == NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 1]
  ------------------
  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|      1|    if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|      1|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  322|      0|	return;
  323|       |
  324|       |    /* Don't overwrite catastrophic errors */
  325|      1|    if (xmlCtxtIsCatastrophicError(ctxt))
  ------------------
  |  Branch (325:9): [True: 0, False: 1]
  ------------------
  326|      0|        return;
  327|       |
  328|      1|    if (level == XML_ERR_WARNING) {
  ------------------
  |  Branch (328:9): [True: 1, False: 0]
  ------------------
  329|      1|        if (ctxt->nbWarnings >= XML_MAX_ERRORS)
  ------------------
  |  |   54|      1|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (329:13): [True: 0, False: 1]
  ------------------
  330|      0|            return;
  331|      1|        ctxt->nbWarnings += 1;
  332|      1|    } 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|      0|        if (xmlIsCatastrophicError(level, code) ||
  ------------------
  |  Branch (341:13): [True: 0, False: 0]
  ------------------
  342|      0|            code == XML_ERR_RESOURCE_LIMIT ||
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  ------------------
  343|      0|            code == XML_ERR_ENTITY_LOOP) {
  ------------------
  |  Branch (343:13): [True: 0, False: 0]
  ------------------
  344|      0|            ctxt->disableSAX = 2; /* really stop parser */
  345|      0|        } else {
  346|       |            /* Report at least one fatal error. */
  347|      0|            if (ctxt->nbErrors >= XML_MAX_ERRORS &&
  ------------------
  |  |   54|      0|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (347:17): [True: 0, False: 0]
  ------------------
  348|      0|                (level < XML_ERR_FATAL || ctxt->wellFormed == 0))
  ------------------
  |  Branch (348:18): [True: 0, False: 0]
  |  Branch (348:43): [True: 0, False: 0]
  ------------------
  349|      0|                return;
  350|       |
  351|      0|            if (level == XML_ERR_FATAL && ctxt->recovery == 0)
  ------------------
  |  Branch (351:17): [True: 0, False: 0]
  |  Branch (351:43): [True: 0, False: 0]
  ------------------
  352|      0|                ctxt->disableSAX = 1;
  353|      0|        }
  354|       |
  355|      0|        if (level == XML_ERR_FATAL)
  ------------------
  |  Branch (355:13): [True: 0, False: 0]
  ------------------
  356|      0|            ctxt->wellFormed = 0;
  357|      0|        ctxt->errNo = code;
  358|      0|        ctxt->nbErrors += 1;
  359|      0|    }
  360|       |
  361|      1|    if (((ctxt->options & XML_PARSE_NOERROR) == 0) &&
  ------------------
  |  Branch (361:9): [True: 1, False: 0]
  ------------------
  362|      1|        ((level != XML_ERR_WARNING) ||
  ------------------
  |  Branch (362:10): [True: 0, False: 1]
  ------------------
  363|      1|         ((ctxt->options & XML_PARSE_NOWARNING) == 0))) {
  ------------------
  |  Branch (363:10): [True: 1, False: 0]
  ------------------
  364|      1|        if (ctxt->errorHandler) {
  ------------------
  |  Branch (364:13): [True: 0, False: 1]
  ------------------
  365|      0|            schannel = ctxt->errorHandler;
  366|      0|            data = ctxt->errorCtxt;
  367|      1|        } else if ((ctxt->sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|      1|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (367:20): [True: 1, False: 0]
  ------------------
  368|      1|            (ctxt->sax->serror != NULL)) {
  ------------------
  |  Branch (368:13): [True: 0, False: 1]
  ------------------
  369|      0|            schannel = ctxt->sax->serror;
  370|      0|            data = ctxt->userData;
  371|      1|        } else if ((domain == XML_FROM_VALID) || (domain == XML_FROM_DTD)) {
  ------------------
  |  Branch (371:20): [True: 0, False: 1]
  |  Branch (371:50): [True: 0, False: 1]
  ------------------
  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|      1|        } else {
  378|      1|            if (level == XML_ERR_WARNING)
  ------------------
  |  Branch (378:17): [True: 1, False: 0]
  ------------------
  379|      1|                channel = ctxt->sax->warning;
  380|      0|            else
  381|      0|                channel = ctxt->sax->error;
  382|      1|            data = ctxt->userData;
  383|      1|        }
  384|      1|    }
  385|       |
  386|      1|    if (ctxt->input != NULL) {
  ------------------
  |  Branch (386:9): [True: 0, False: 1]
  ------------------
  387|      0|        xmlParserInputPtr input = ctxt->input;
  388|       |
  389|      0|        if ((input->filename == NULL) &&
  ------------------
  |  Branch (389:13): [True: 0, False: 0]
  ------------------
  390|      0|            (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (390:13): [True: 0, False: 0]
  ------------------
  391|      0|            input = ctxt->inputTab[ctxt->inputNr - 2];
  392|      0|        }
  393|      0|        file = input->filename;
  394|      0|        line = input->line;
  395|      0|        col = input->col;
  396|      0|    }
  397|       |
  398|      1|    res = xmlVRaiseError(schannel, channel, data, ctxt, node, domain, code,
  399|      1|                         level, file, line, (const char *) str1,
  400|      1|                         (const char *) str2, (const char *) str3, int1, col,
  401|      1|                         msg, ap);
  402|       |
  403|      1|    if (res < 0) {
  ------------------
  |  Branch (403:9): [True: 0, False: 1]
  ------------------
  404|      0|        xmlCtxtErrMemory(ctxt);
  405|      0|        return;
  406|      0|    }
  407|      1|}
xmlCtxtErr:
  429|     34|{
  430|     34|    va_list ap;
  431|       |
  432|     34|    va_start(ap, msg);
  433|     34|    xmlCtxtVErr(ctxt, node, domain, code, level,
  434|     34|                str1, str2, str3, int1, msg, ap);
  435|       |    va_end(ap);
  436|     34|}
xmlParserGrow:
  616|      4|xmlParserGrow(xmlParserCtxt *ctxt) {
  617|      4|    xmlParserInputPtr in = ctxt->input;
  618|      4|    xmlParserInputBufferPtr buf = in->buf;
  619|      4|    size_t curEnd = in->end - in->cur;
  620|      4|    size_t curBase = in->cur - in->base;
  621|      4|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (621:24): [True: 4, False: 0]
  ------------------
  622|      4|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|      4|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
  623|      4|                       XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|      4|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
  624|      4|    int ret;
  625|       |
  626|      4|    if (buf == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 4]
  ------------------
  627|      0|        return(0);
  628|       |    /* Don't grow push parser buffer. */
  629|      4|    if (PARSER_PROGRESSIVE(ctxt))
  ------------------
  |  |   47|      4|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|      4|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  |  |  |  Branch (47:5): [True: 0, False: 4]
  |  |  ------------------
  ------------------
  630|      0|        return(0);
  631|       |    /* Don't grow memory buffers. */
  632|      4|    if ((buf->encoder == NULL) && (buf->readcallback == NULL))
  ------------------
  |  Branch (632:9): [True: 4, False: 0]
  |  Branch (632:35): [True: 4, False: 0]
  ------------------
  633|      4|        return(0);
  634|      0|    if (buf->error != 0)
  ------------------
  |  Branch (634:9): [True: 0, False: 0]
  ------------------
  635|      0|        return(-1);
  636|       |
  637|      0|    if (curBase > maxLength) {
  ------------------
  |  Branch (637:9): [True: 0, False: 0]
  ------------------
  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|      0|    if (curEnd >= INPUT_CHUNK)
  ------------------
  |  |   63|      0|#define INPUT_CHUNK	250
  ------------------
  |  Branch (643:9): [True: 0, False: 0]
  ------------------
  644|      0|        return(0);
  645|       |
  646|      0|    ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
  ------------------
  |  |   63|      0|#define INPUT_CHUNK	250
  ------------------
  647|      0|    xmlBufUpdateInput(buf->buffer, in, curBase);
  648|       |
  649|      0|    if (ret < 0) {
  ------------------
  |  Branch (649:9): [True: 0, False: 0]
  ------------------
  650|      0|        xmlCtxtErrIO(ctxt, buf->error, NULL);
  651|      0|    }
  652|       |
  653|      0|    return(ret);
  654|      0|}
xmlParserCheckEOF:
  664|      1|xmlParserCheckEOF(xmlParserCtxt *ctxt, xmlParserErrors code) {
  665|      1|    xmlParserInputPtr in = ctxt->input;
  666|      1|    xmlParserInputBufferPtr buf;
  667|       |
  668|      1|    if (ctxt->errNo != XML_ERR_OK)
  ------------------
  |  Branch (668:9): [True: 0, False: 1]
  ------------------
  669|      0|        return;
  670|       |
  671|      1|    if (in->cur < in->end) {
  ------------------
  |  Branch (671:9): [True: 0, False: 1]
  ------------------
  672|      0|        xmlFatalErr(ctxt, code, NULL);
  673|      0|        return;
  674|      0|    }
  675|       |
  676|      1|    buf = in->buf;
  677|      1|    if ((buf != NULL) && (buf->encoder != NULL)) {
  ------------------
  |  Branch (677:9): [True: 1, False: 0]
  |  Branch (677:26): [True: 0, False: 1]
  ------------------
  678|      0|        size_t curBase = in->cur - in->base;
  679|      0|        size_t sizeOut = 64;
  680|      0|        xmlCharEncError ret;
  681|       |
  682|       |        /*
  683|       |         * Check for truncated multi-byte sequence
  684|       |         */
  685|      0|        ret = xmlCharEncInput(buf, &sizeOut, /* flush */ 1);
  686|      0|        xmlBufUpdateInput(buf->buffer, in, curBase);
  687|      0|        if (ret != XML_ENC_ERR_SUCCESS) {
  ------------------
  |  Branch (687:13): [True: 0, False: 0]
  ------------------
  688|      0|            xmlCtxtErrIO(ctxt, buf->error, NULL);
  689|      0|            return;
  690|      0|        }
  691|       |
  692|       |        /* Shouldn't happen */
  693|      0|        if (in->cur < in->end)
  ------------------
  |  Branch (693:13): [True: 0, False: 0]
  ------------------
  694|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "expected EOF");
  695|      0|    }
  696|      1|}
xmlDetectEncoding:
 1498|      1|xmlDetectEncoding(xmlParserCtxt *ctxt) {
 1499|      1|    const xmlChar *in;
 1500|      1|    xmlCharEncoding enc;
 1501|      1|    int bomSize;
 1502|      1|    int autoFlag = 0;
 1503|       |
 1504|      1|    if (xmlParserGrow(ctxt) < 0)
  ------------------
  |  Branch (1504:9): [True: 0, False: 1]
  ------------------
 1505|      0|        return;
 1506|      1|    in = ctxt->input->cur;
 1507|      1|    if (ctxt->input->end - in < 4)
  ------------------
  |  Branch (1507:9): [True: 0, False: 1]
  ------------------
 1508|      0|        return;
 1509|       |
 1510|      1|    if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|      1|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1510:9): [True: 0, False: 1]
  ------------------
 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|      1|    enc = XML_CHAR_ENCODING_NONE;
 1523|      1|    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|      1|    switch (in[0]) {
  ------------------
  |  Branch (1531:13): [True: 0, False: 1]
  ------------------
 1532|      0|        case 0x00:
  ------------------
  |  Branch (1532:9): [True: 0, False: 1]
  ------------------
 1533|      0|            if ((!ctxt->html) &&
  ------------------
  |  Branch (1533:17): [True: 0, False: 0]
  ------------------
 1534|      0|                (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) {
  ------------------
  |  Branch (1534:17): [True: 0, False: 0]
  |  Branch (1534:36): [True: 0, False: 0]
  |  Branch (1534:55): [True: 0, False: 0]
  ------------------
 1535|      0|                enc = XML_CHAR_ENCODING_UCS4BE;
 1536|      0|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|      0|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1537|      0|            } else if ((in[1] == 0x3C) && (in[2] == 0x00) && (in[3] == 0x3F)) {
  ------------------
  |  Branch (1537:24): [True: 0, False: 0]
  |  Branch (1537:43): [True: 0, False: 0]
  |  Branch (1537:62): [True: 0, False: 0]
  ------------------
 1538|       |                /*
 1539|       |                 * TODO: The HTML5 spec requires to check that the
 1540|       |                 * next codepoint is an 'x'.
 1541|       |                 */
 1542|      0|                enc = XML_CHAR_ENCODING_UTF16BE;
 1543|      0|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|      0|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1544|      0|            }
 1545|      0|            break;
 1546|       |
 1547|      0|        case 0x3C:
  ------------------
  |  Branch (1547:9): [True: 0, False: 1]
  ------------------
 1548|      0|            if (in[1] == 0x00) {
  ------------------
  |  Branch (1548:17): [True: 0, False: 0]
  ------------------
 1549|      0|                if ((!ctxt->html) &&
  ------------------
  |  Branch (1549:21): [True: 0, False: 0]
  ------------------
 1550|      0|                    (in[2] == 0x00) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1550:21): [True: 0, False: 0]
  |  Branch (1550:40): [True: 0, False: 0]
  ------------------
 1551|      0|                    enc = XML_CHAR_ENCODING_UCS4LE;
 1552|      0|                    autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|      0|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1553|      0|                } else if ((in[2] == 0x3F) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1553:28): [True: 0, False: 0]
  |  Branch (1553:47): [True: 0, False: 0]
  ------------------
 1554|       |                    /*
 1555|       |                     * TODO: The HTML5 spec requires to check that the
 1556|       |                     * next codepoint is an 'x'.
 1557|       |                     */
 1558|      0|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1559|      0|                    autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|      0|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1560|      0|                }
 1561|      0|            }
 1562|      0|            break;
 1563|       |
 1564|      0|        case 0x4C:
  ------------------
  |  Branch (1564:9): [True: 0, False: 1]
  ------------------
 1565|      0|	    if ((!ctxt->html) &&
  ------------------
  |  Branch (1565:10): [True: 0, False: 0]
  ------------------
 1566|      0|                (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) {
  ------------------
  |  Branch (1566:17): [True: 0, False: 0]
  |  Branch (1566:36): [True: 0, False: 0]
  |  Branch (1566:55): [True: 0, False: 0]
  ------------------
 1567|      0|	        enc = XML_CHAR_ENCODING_EBCDIC;
 1568|      0|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|      0|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1569|      0|            }
 1570|      0|            break;
 1571|       |
 1572|      0|        case 0xEF:
  ------------------
  |  Branch (1572:9): [True: 0, False: 1]
  ------------------
 1573|      0|            if ((in[1] == 0xBB) && (in[2] == 0xBF)) {
  ------------------
  |  Branch (1573:17): [True: 0, False: 0]
  |  Branch (1573:36): [True: 0, False: 0]
  ------------------
 1574|      0|                enc = XML_CHAR_ENCODING_UTF8;
 1575|      0|                autoFlag = XML_INPUT_AUTO_UTF8;
  ------------------
  |  |   35|      0|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
 1576|      0|                bomSize = 3;
 1577|      0|            }
 1578|      0|            break;
 1579|       |
 1580|      0|        case 0xFE:
  ------------------
  |  Branch (1580:9): [True: 0, False: 1]
  ------------------
 1581|      0|            if (in[1] == 0xFF) {
  ------------------
  |  Branch (1581:17): [True: 0, False: 0]
  ------------------
 1582|      0|                enc = XML_CHAR_ENCODING_UTF16BE;
 1583|      0|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|      0|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1584|      0|                bomSize = 2;
 1585|      0|            }
 1586|      0|            break;
 1587|       |
 1588|      0|        case 0xFF:
  ------------------
  |  Branch (1588:9): [True: 0, False: 1]
  ------------------
 1589|      0|            if (in[1] == 0xFE) {
  ------------------
  |  Branch (1589:17): [True: 0, False: 0]
  ------------------
 1590|      0|                enc = XML_CHAR_ENCODING_UTF16LE;
 1591|      0|                autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|      0|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1592|      0|                bomSize = 2;
 1593|      0|            }
 1594|      0|            break;
 1595|      1|    }
 1596|       |
 1597|      1|    if (bomSize > 0) {
  ------------------
  |  Branch (1597:9): [True: 0, False: 1]
  ------------------
 1598|      0|        ctxt->input->cur += bomSize;
 1599|      0|    }
 1600|       |
 1601|      1|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1601:9): [True: 0, False: 1]
  ------------------
 1602|      0|        ctxt->input->flags |= autoFlag;
 1603|       |
 1604|      0|        if (enc == XML_CHAR_ENCODING_EBCDIC) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 0]
  ------------------
 1605|      0|            xmlCharEncodingHandlerPtr handler;
 1606|      0|            xmlParserErrors res;
 1607|       |
 1608|      0|            res = xmlDetectEBCDIC(ctxt, &handler);
 1609|      0|            if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1609:17): [True: 0, False: 0]
  ------------------
 1610|      0|                xmlFatalErr(ctxt, res, "detecting EBCDIC\n");
 1611|      0|            } else {
 1612|      0|                xmlSwitchToEncoding(ctxt, handler);
 1613|      0|            }
 1614|      0|        } else {
 1615|      0|            xmlSwitchEncoding(ctxt, enc);
 1616|      0|        }
 1617|      0|    }
 1618|      1|}
xmlGetActualEncoding:
 1740|      1|xmlGetActualEncoding(xmlParserCtxt *ctxt) {
 1741|      1|    const xmlChar *encoding = NULL;
 1742|       |
 1743|      1|    if ((ctxt->input->flags & XML_INPUT_USES_ENC_DECL) ||
  ------------------
  |  |   39|      1|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
  |  Branch (1743:9): [True: 0, False: 1]
  ------------------
 1744|      1|        (ctxt->input->flags & XML_INPUT_AUTO_ENCODING)) {
  ------------------
  |  |   34|      1|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1744:9): [True: 0, False: 1]
  ------------------
 1745|       |        /* Preserve encoding exactly */
 1746|      0|        encoding = ctxt->encoding;
 1747|      1|    } else if ((ctxt->input->buf) && (ctxt->input->buf->encoder)) {
  ------------------
  |  Branch (1747:16): [True: 1, False: 0]
  |  Branch (1747:38): [True: 0, False: 1]
  ------------------
 1748|      0|        encoding = BAD_CAST ctxt->input->buf->encoder->name;
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1749|      1|    } else if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|      1|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1749:16): [True: 0, False: 1]
  ------------------
 1750|      0|        encoding = BAD_CAST "UTF-8";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1751|      0|    }
 1752|       |
 1753|      1|    return(encoding);
 1754|      1|}
xmlFreeInputStream:
 1768|     37|xmlFreeInputStream(xmlParserInput *input) {
 1769|     37|    if (input == NULL) return;
  ------------------
  |  Branch (1769:9): [True: 0, False: 37]
  ------------------
 1770|       |
 1771|     37|    if (input->filename != NULL) xmlFree((char *) input->filename);
  ------------------
  |  Branch (1771:9): [True: 1, False: 36]
  ------------------
 1772|     37|    if (input->version != NULL) xmlFree((char *) input->version);
  ------------------
  |  Branch (1772:9): [True: 0, False: 37]
  ------------------
 1773|     37|    if ((input->free != NULL) && (input->base != NULL))
  ------------------
  |  Branch (1773:9): [True: 0, False: 37]
  |  Branch (1773:34): [True: 0, False: 0]
  ------------------
 1774|      0|        input->free((xmlChar *) input->base);
 1775|     37|    if (input->buf != NULL)
  ------------------
  |  Branch (1775:9): [True: 37, False: 0]
  ------------------
 1776|     37|        xmlFreeParserInputBuffer(input->buf);
 1777|     37|    xmlFree(input);
 1778|     37|}
xmlCtxtNewInputFromUrl:
 1818|     34|                       xmlParserInputFlags flags ATTRIBUTE_UNUSED) {
 1819|     34|    xmlParserInputPtr input;
 1820|       |
 1821|     34|    if ((ctxt == NULL) || (url == NULL))
  ------------------
  |  Branch (1821:9): [True: 0, False: 34]
  |  Branch (1821:27): [True: 0, False: 34]
  ------------------
 1822|      0|	return(NULL);
 1823|       |
 1824|     34|    input = xmlLoadResource(ctxt, url, publicId, XML_RESOURCE_MAIN_DOCUMENT);
 1825|     34|    if (input == NULL)
  ------------------
  |  Branch (1825:9): [True: 33, False: 1]
  ------------------
 1826|     33|        return(NULL);
 1827|       |
 1828|      1|    if (encoding != NULL)
  ------------------
  |  Branch (1828:9): [True: 0, False: 1]
  ------------------
 1829|      0|        xmlSwitchInputEncodingName(ctxt, input, encoding);
 1830|       |
 1831|      1|    return(input);
 1832|     34|}
xmlNewInputFromMemory:
 1892|     34|                      xmlParserInputFlags flags) {
 1893|     34|    xmlParserInputBufferPtr buf;
 1894|       |
 1895|     34|    if (mem == NULL)
  ------------------
  |  Branch (1895:9): [True: 0, False: 34]
  ------------------
 1896|      0|	return(NULL);
 1897|       |
 1898|     34|    buf = xmlNewInputBufferMemory(mem, size, flags, XML_CHAR_ENCODING_NONE);
 1899|     34|    if (buf == NULL)
  ------------------
  |  Branch (1899:9): [True: 0, False: 34]
  ------------------
 1900|      0|        return(NULL);
 1901|       |
 1902|     34|    return(xmlNewInputInternal(buf, url));
 1903|     34|}
xmlNewPushInput:
 2155|      3|xmlNewPushInput(const char *url, const char *chunk, int size) {
 2156|      3|    xmlParserInputBufferPtr buf;
 2157|      3|    xmlParserInputPtr input;
 2158|       |
 2159|      3|    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 2160|      3|    if (buf == NULL)
  ------------------
  |  Branch (2160:9): [True: 0, False: 3]
  ------------------
 2161|      0|        return(NULL);
 2162|       |
 2163|      3|    input = xmlNewInputInternal(buf, url);
 2164|      3|    if (input == NULL)
  ------------------
  |  Branch (2164:9): [True: 3, False: 0]
  ------------------
 2165|      3|	return(NULL);
 2166|       |
 2167|      0|    input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|      0|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
 2168|       |
 2169|      0|    if ((size > 0) && (chunk != NULL)) {
  ------------------
  |  Branch (2169:9): [True: 0, False: 0]
  |  Branch (2169:23): [True: 0, False: 0]
  ------------------
 2170|      0|        int res;
 2171|       |
 2172|      0|	res = xmlParserInputBufferPush(input->buf, size, chunk);
 2173|      0|        xmlBufResetInput(input->buf->buffer, input);
 2174|      0|        if (res < 0) {
  ------------------
  |  Branch (2174:13): [True: 0, False: 0]
  ------------------
 2175|      0|            xmlFreeInputStream(input);
 2176|      0|            return(NULL);
 2177|      0|        }
 2178|      0|    }
 2179|       |
 2180|      0|    return(input);
 2181|      0|}
xmlNewInputFromUrl:
 2447|      1|                   xmlParserInput **out) {
 2448|      1|    char *resource = NULL;
 2449|      1|    xmlParserInputBufferPtr buf;
 2450|      1|    xmlParserInputPtr input;
 2451|      1|    xmlParserErrors code = XML_ERR_OK;
 2452|       |
 2453|      1|    if (out == NULL)
  ------------------
  |  Branch (2453:9): [True: 0, False: 1]
  ------------------
 2454|      0|        return(XML_ERR_ARGUMENT);
 2455|      1|    *out = NULL;
 2456|      1|    if (url == NULL)
  ------------------
  |  Branch (2456:9): [True: 0, False: 1]
  ------------------
 2457|      0|        return(XML_ERR_ARGUMENT);
 2458|       |
 2459|      1|#ifdef LIBXML_CATALOG_ENABLED
 2460|      1|    if (flags & XML_INPUT_USE_SYS_CATALOG) {
  ------------------
  |  Branch (2460:9): [True: 0, False: 1]
  ------------------
 2461|      0|        code = xmlResolveFromCatalog(url, NULL, NULL, 1, &resource);
 2462|      0|        if (code != XML_ERR_OK)
  ------------------
  |  Branch (2462:13): [True: 0, False: 0]
  ------------------
 2463|      0|            return(code);
 2464|      0|        if (resource != NULL)
  ------------------
  |  Branch (2464:13): [True: 0, False: 0]
  ------------------
 2465|      0|            url = resource;
 2466|      0|    }
 2467|      1|#endif
 2468|       |
 2469|      1|    if (xmlParserInputBufferCreateFilenameValue != NULL) {
  ------------------
  |  |  179|      1|    (*__xmlParserInputBufferCreateFilenameValue())
  ------------------
  |  Branch (2469:9): [True: 0, False: 1]
  ------------------
 2470|      0|        buf = xmlParserInputBufferCreateFilenameValue(url,
  ------------------
  |  |  179|      0|    (*__xmlParserInputBufferCreateFilenameValue())
  ------------------
 2471|      0|                XML_CHAR_ENCODING_NONE);
 2472|      0|        if (buf == NULL)
  ------------------
  |  Branch (2472:13): [True: 0, False: 0]
  ------------------
 2473|      0|            code = XML_IO_ENOENT;
 2474|      1|    } else {
 2475|      1|        code = xmlParserInputBufferCreateUrl(url, XML_CHAR_ENCODING_NONE,
 2476|      1|                                             flags, &buf);
 2477|      1|    }
 2478|       |
 2479|      1|    if (code == XML_ERR_OK) {
  ------------------
  |  Branch (2479:9): [True: 0, False: 1]
  ------------------
 2480|      0|        input = xmlNewInputInternal(buf, url);
 2481|      0|        if (input == NULL)
  ------------------
  |  Branch (2481:13): [True: 0, False: 0]
  ------------------
 2482|      0|            code = XML_ERR_NO_MEMORY;
 2483|       |
 2484|      0|        *out = input;
 2485|      0|    }
 2486|       |
 2487|      1|    if (resource != NULL)
  ------------------
  |  Branch (2487:9): [True: 0, False: 1]
  ------------------
 2488|      0|        xmlFree(resource);
 2489|      1|    return(code);
 2490|      1|}
xmlNewInputFromFile:
 2505|      1|xmlNewInputFromFile(xmlParserCtxt *ctxt, const char *filename) {
 2506|      1|    xmlParserInputPtr input;
 2507|      1|    xmlParserInputFlags flags = 0;
 2508|      1|    xmlParserErrors code;
 2509|       |
 2510|      1|    if ((ctxt == NULL) || (filename == NULL))
  ------------------
  |  Branch (2510:9): [True: 0, False: 1]
  |  Branch (2510:27): [True: 0, False: 1]
  ------------------
 2511|      0|        return(NULL);
 2512|       |
 2513|      1|    if (ctxt->options & XML_PARSE_UNZIP)
  ------------------
  |  Branch (2513:9): [True: 0, False: 1]
  ------------------
 2514|      0|        flags |= XML_INPUT_UNZIP;
 2515|      1|    if ((ctxt->options & XML_PARSE_NONET) == 0)
  ------------------
  |  Branch (2515:9): [True: 1, False: 0]
  ------------------
 2516|      1|        flags |= XML_INPUT_NETWORK;
 2517|       |
 2518|      1|    code = xmlNewInputFromUrl(filename, flags, &input);
 2519|      1|    if (code != XML_ERR_OK) {
  ------------------
  |  Branch (2519:9): [True: 1, False: 0]
  ------------------
 2520|      1|        xmlCtxtErrIO(ctxt, code, filename);
 2521|      1|        return(NULL);
 2522|      1|    }
 2523|       |
 2524|      0|    return(input);
 2525|      1|}
xmlCtxtSetResourceLoader:
 2645|    218|                         void *vctxt) {
 2646|    218|    if (ctxt == NULL)
  ------------------
  |  Branch (2646:9): [True: 0, False: 218]
  ------------------
 2647|      0|        return;
 2648|       |
 2649|    218|    ctxt->resourceLoader = loader;
 2650|    218|    ctxt->resourceCtxt = vctxt;
 2651|    218|}
xmlLoadResource:
 2662|     35|                xmlResourceType type) {
 2663|     35|    char *canonicFilename;
 2664|     35|    xmlParserInputPtr ret;
 2665|       |
 2666|     35|    if (url == NULL)
  ------------------
  |  Branch (2666:9): [True: 0, False: 35]
  ------------------
 2667|      0|        return(NULL);
 2668|       |
 2669|     35|    if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) {
  ------------------
  |  Branch (2669:9): [True: 35, False: 0]
  |  Branch (2669:27): [True: 34, False: 1]
  ------------------
 2670|     34|        char *resource = NULL;
 2671|     34|        void *userData;
 2672|     34|        xmlParserInputFlags flags = 0;
 2673|     34|        int code;
 2674|       |
 2675|     34|#ifdef LIBXML_CATALOG_ENABLED
 2676|     34|        resource = xmlCtxtResolveFromCatalog(ctxt, url, publicId);
 2677|     34|        if (resource != NULL)
  ------------------
  |  Branch (2677:13): [True: 0, False: 34]
  ------------------
 2678|      0|            url = resource;
 2679|     34|#endif
 2680|       |
 2681|     34|        if (ctxt->options & XML_PARSE_UNZIP)
  ------------------
  |  Branch (2681:13): [True: 0, False: 34]
  ------------------
 2682|      0|            flags |= XML_INPUT_UNZIP;
 2683|     34|        if ((ctxt->options & XML_PARSE_NONET) == 0)
  ------------------
  |  Branch (2683:13): [True: 34, False: 0]
  ------------------
 2684|     34|            flags |= XML_INPUT_NETWORK;
 2685|       |
 2686|     34|        userData = ctxt->resourceCtxt;
 2687|     34|        if (userData == NULL)
  ------------------
  |  Branch (2687:13): [True: 0, False: 34]
  ------------------
 2688|      0|            userData = ctxt;
 2689|       |
 2690|     34|        code = ctxt->resourceLoader(userData, url, publicId, type,
 2691|     34|                                    flags, &ret);
 2692|     34|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (2692:13): [True: 33, False: 1]
  ------------------
 2693|     33|            xmlCtxtErrIO(ctxt, code, url);
 2694|     33|            ret = NULL;
 2695|     33|        }
 2696|     34|        if (resource != NULL)
  ------------------
  |  Branch (2696:13): [True: 0, False: 34]
  ------------------
 2697|      0|            xmlFree(resource);
 2698|     34|        return(ret);
 2699|     34|    }
 2700|       |
 2701|      1|    canonicFilename = (char *) xmlCanonicPath((const xmlChar *) url);
 2702|      1|    if (canonicFilename == NULL) {
  ------------------
  |  Branch (2702:9): [True: 0, False: 1]
  ------------------
 2703|      0|        xmlCtxtErrMemory(ctxt);
 2704|      0|        return(NULL);
 2705|      0|    }
 2706|       |
 2707|      1|    ret = xmlCurrentExternalEntityLoader(canonicFilename, publicId, ctxt);
 2708|      1|    xmlFree(canonicFilename);
 2709|      1|    return(ret);
 2710|      1|}
xmlFreeParserCtxt:
 2947|    222|{
 2948|    222|    xmlParserInputPtr input;
 2949|       |
 2950|    222|    if (ctxt == NULL) return;
  ------------------
  |  Branch (2950:9): [True: 0, False: 222]
  ------------------
 2951|       |
 2952|    222|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2952:12): [True: 0, False: 222]
  ------------------
 2953|      0|        xmlFreeInputStream(input);
 2954|      0|    }
 2955|    222|    if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
  ------------------
  |  Branch (2955:9): [True: 189, False: 33]
  ------------------
 2956|    222|    if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
  ------------------
  |  Branch (2956:9): [True: 222, False: 0]
  ------------------
 2957|    222|    if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
  ------------------
  |  Branch (2957:9): [True: 222, False: 0]
  ------------------
 2958|    222|    if (ctxt->nodeInfoTab != NULL) xmlFree(ctxt->nodeInfoTab);
  ------------------
  |  Branch (2958:9): [True: 0, False: 222]
  ------------------
 2959|    222|    if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
  ------------------
  |  Branch (2959:9): [True: 222, False: 0]
  ------------------
 2960|    222|    if (ctxt->version != NULL) xmlFree(ctxt->version);
  ------------------
  |  Branch (2960:9): [True: 0, False: 222]
  ------------------
 2961|    222|    if (ctxt->encoding != NULL) xmlFree(ctxt->encoding);
  ------------------
  |  Branch (2961:9): [True: 0, False: 222]
  ------------------
 2962|    222|    if (ctxt->extSubURI != NULL) xmlFree(ctxt->extSubURI);
  ------------------
  |  Branch (2962:9): [True: 0, False: 222]
  ------------------
 2963|    222|    if (ctxt->extSubSystem != NULL) xmlFree(ctxt->extSubSystem);
  ------------------
  |  Branch (2963:9): [True: 0, False: 222]
  ------------------
 2964|    222|#ifdef LIBXML_SAX1_ENABLED
 2965|    222|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (2965:9): [True: 222, False: 0]
  ------------------
 2966|    222|        (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler))
  ------------------
  |  Branch (2966:9): [True: 222, False: 0]
  ------------------
 2967|       |#else
 2968|       |    if (ctxt->sax != NULL)
 2969|       |#endif /* LIBXML_SAX1_ENABLED */
 2970|    222|        xmlFree(ctxt->sax);
 2971|    222|    if (ctxt->directory != NULL) xmlFree(ctxt->directory);
  ------------------
  |  Branch (2971:9): [True: 1, False: 221]
  ------------------
 2972|    222|    if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
  ------------------
  |  Branch (2972:9): [True: 0, False: 222]
  ------------------
 2973|    222|    if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
  ------------------
  |  Branch (2973:9): [True: 0, False: 222]
  ------------------
 2974|    222|    if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  ------------------
  |  Branch (2974:9): [True: 222, False: 0]
  ------------------
 2975|    222|    if (ctxt->nsTab != NULL) xmlFree(ctxt->nsTab);
  ------------------
  |  Branch (2975:9): [True: 0, False: 222]
  ------------------
 2976|    222|    if (ctxt->nsdb != NULL) xmlParserNsFree(ctxt->nsdb);
  ------------------
  |  Branch (2976:9): [True: 189, False: 33]
  ------------------
 2977|    222|    if (ctxt->attrHash != NULL) xmlFree(ctxt->attrHash);
  ------------------
  |  Branch (2977:9): [True: 0, False: 222]
  ------------------
 2978|    222|    if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab);
  ------------------
  |  Branch (2978:9): [True: 0, False: 222]
  ------------------
 2979|    222|    if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs);
  ------------------
  |  Branch (2979:9): [True: 0, False: 222]
  ------------------
 2980|    222|    if (ctxt->attsDefault != NULL)
  ------------------
  |  Branch (2980:9): [True: 0, False: 222]
  ------------------
 2981|      0|        xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
 2982|    222|    if (ctxt->attsSpecial != NULL)
  ------------------
  |  Branch (2982:9): [True: 0, False: 222]
  ------------------
 2983|      0|        xmlHashFree(ctxt->attsSpecial, NULL);
 2984|    222|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2984:9): [True: 0, False: 222]
  ------------------
 2985|      0|        xmlNodePtr cur, next;
 2986|       |
 2987|      0|	cur = ctxt->freeElems;
 2988|      0|	while (cur != NULL) {
  ------------------
  |  Branch (2988:9): [True: 0, False: 0]
  ------------------
 2989|      0|	    next = cur->next;
 2990|      0|	    xmlFree(cur);
 2991|      0|	    cur = next;
 2992|      0|	}
 2993|      0|    }
 2994|    222|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (2994:9): [True: 0, False: 222]
  ------------------
 2995|      0|        xmlAttrPtr cur, next;
 2996|       |
 2997|      0|	cur = ctxt->freeAttrs;
 2998|      0|	while (cur != NULL) {
  ------------------
  |  Branch (2998:9): [True: 0, False: 0]
  ------------------
 2999|      0|	    next = cur->next;
 3000|      0|	    xmlFree(cur);
 3001|      0|	    cur = next;
 3002|      0|	}
 3003|      0|    }
 3004|       |    /*
 3005|       |     * cleanup the error strings
 3006|       |     */
 3007|    222|    if (ctxt->lastError.message != NULL)
  ------------------
  |  Branch (3007:9): [True: 1, False: 221]
  ------------------
 3008|      1|        xmlFree(ctxt->lastError.message);
 3009|    222|    if (ctxt->lastError.file != NULL)
  ------------------
  |  Branch (3009:9): [True: 0, False: 222]
  ------------------
 3010|      0|        xmlFree(ctxt->lastError.file);
 3011|    222|    if (ctxt->lastError.str1 != NULL)
  ------------------
  |  Branch (3011:9): [True: 1, False: 221]
  ------------------
 3012|      1|        xmlFree(ctxt->lastError.str1);
 3013|    222|    if (ctxt->lastError.str2 != NULL)
  ------------------
  |  Branch (3013:9): [True: 0, False: 222]
  ------------------
 3014|      0|        xmlFree(ctxt->lastError.str2);
 3015|    222|    if (ctxt->lastError.str3 != NULL)
  ------------------
  |  Branch (3015:9): [True: 0, False: 222]
  ------------------
 3016|      0|        xmlFree(ctxt->lastError.str3);
 3017|       |
 3018|    222|#ifdef LIBXML_CATALOG_ENABLED
 3019|    222|    if (ctxt->catalogs != NULL)
  ------------------
  |  Branch (3019:9): [True: 0, False: 222]
  ------------------
 3020|      0|	xmlCatalogFreeLocal(ctxt->catalogs);
 3021|    222|#endif
 3022|    222|    xmlFree(ctxt);
 3023|    222|}
xmlNewParserCtxt:
 3033|    185|{
 3034|    185|    return(xmlNewSAXParserCtxt(NULL, NULL));
 3035|    185|}
xmlNewSAXParserCtxt:
 3054|    189|{
 3055|    189|    xmlParserCtxtPtr ctxt;
 3056|       |
 3057|    189|    xmlInitParser();
 3058|       |
 3059|    189|    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
 3060|    189|    if (ctxt == NULL)
  ------------------
  |  Branch (3060:9): [True: 0, False: 189]
  ------------------
 3061|      0|	return(NULL);
 3062|    189|    memset(ctxt, 0, sizeof(xmlParserCtxt));
 3063|    189|    if (xmlInitSAXParserCtxt(ctxt, sax, userData) < 0) {
  ------------------
  |  Branch (3063:9): [True: 0, False: 189]
  ------------------
 3064|      0|        xmlFreeParserCtxt(ctxt);
 3065|      0|	return(NULL);
 3066|      0|    }
 3067|    189|    return(ctxt);
 3068|    189|}
xmlCtxtGetDocument:
 3216|      1|xmlCtxtGetDocument(xmlParserCtxt *ctxt) {
 3217|      1|    xmlDocPtr doc;
 3218|       |
 3219|      1|    if (ctxt == NULL)
  ------------------
  |  Branch (3219:9): [True: 0, False: 1]
  ------------------
 3220|      0|        return(NULL);
 3221|       |
 3222|      1|    if ((ctxt->wellFormed) ||
  ------------------
  |  Branch (3222:9): [True: 1, False: 0]
  ------------------
 3223|      0|        (((ctxt->recovery) || (ctxt->html)) &&
  ------------------
  |  Branch (3223:11): [True: 0, False: 0]
  |  Branch (3223:31): [True: 0, False: 0]
  ------------------
 3224|      1|         (!xmlCtxtIsCatastrophicError(ctxt)))) {
  ------------------
  |  Branch (3224:10): [True: 0, False: 0]
  ------------------
 3225|      1|        doc = ctxt->myDoc;
 3226|      1|    } else {
 3227|      0|        if (ctxt->errNo == XML_ERR_OK)
  ------------------
  |  Branch (3227:13): [True: 0, False: 0]
  ------------------
 3228|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "unknown error");
 3229|      0|        doc = NULL;
 3230|      0|        xmlFreeDoc(ctxt->myDoc);
 3231|      0|    }
 3232|      1|    ctxt->myDoc = NULL;
 3233|       |
 3234|      1|    return(doc);
 3235|      1|}
xmlInitNodeInfoSeq:
 3547|    298|{
 3548|    298|    if (seq == NULL)
  ------------------
  |  Branch (3548:9): [True: 0, False: 298]
  ------------------
 3549|      0|        return;
 3550|    298|    seq->length = 0;
 3551|    298|    seq->maximum = 0;
 3552|       |    seq->buffer = NULL;
 3553|    298|}
parserInternals.c:xmlNewInputInternal:
 1842|     37|xmlNewInputInternal(xmlParserInputBufferPtr buf, const char *filename) {
 1843|     37|    xmlParserInputPtr input;
 1844|       |
 1845|     37|    input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput));
 1846|     37|    if (input == NULL) {
  ------------------
  |  Branch (1846:9): [True: 0, False: 37]
  ------------------
 1847|      0|	xmlFreeParserInputBuffer(buf);
 1848|      0|	return(NULL);
 1849|      0|    }
 1850|     37|    memset(input, 0, sizeof(xmlParserInput));
 1851|     37|    input->line = 1;
 1852|     37|    input->col = 1;
 1853|       |
 1854|     37|    input->buf = buf;
 1855|     37|    xmlBufResetInput(input->buf->buffer, input);
 1856|       |
 1857|     37|    if (filename != NULL) {
  ------------------
  |  Branch (1857:9): [True: 37, False: 0]
  ------------------
 1858|     37|        input->filename = xmlMemStrdup(filename);
 1859|     37|        if (input->filename == NULL) {
  ------------------
  |  Branch (1859:13): [True: 36, False: 1]
  ------------------
 1860|     36|            xmlFreeInputStream(input);
 1861|     36|            return(NULL);
 1862|     36|        }
 1863|     37|    }
 1864|       |
 1865|      1|    return(input);
 1866|     37|}
parserInternals.c:xmlDefaultExternalEntityLoader:
 2538|      1|{
 2539|      1|    xmlParserInputPtr input = NULL;
 2540|      1|    char *resource = NULL;
 2541|       |
 2542|      1|    (void) publicId;
 2543|       |
 2544|      1|    if (url == NULL)
  ------------------
  |  Branch (2544:9): [True: 0, False: 1]
  ------------------
 2545|      0|        return(NULL);
 2546|       |
 2547|      1|#ifdef LIBXML_CATALOG_ENABLED
 2548|      1|    resource = xmlCtxtResolveFromCatalog(ctxt, url, publicId);
 2549|      1|    if (resource != NULL)
  ------------------
  |  Branch (2549:9): [True: 0, False: 1]
  ------------------
 2550|      0|	url = resource;
 2551|      1|#endif
 2552|       |
 2553|       |    /*
 2554|       |     * Several downstream test suites expect this error whenever
 2555|       |     * an http URI is passed and NONET is set.
 2556|       |     */
 2557|      1|    if ((ctxt != NULL) &&
  ------------------
  |  Branch (2557:9): [True: 1, False: 0]
  ------------------
 2558|      1|        (ctxt->options & XML_PARSE_NONET) &&
  ------------------
  |  Branch (2558:9): [True: 0, False: 1]
  ------------------
 2559|      0|        (xmlStrncasecmp(BAD_CAST url, BAD_CAST "http://", 7) == 0)) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
                      (xmlStrncasecmp(BAD_CAST url, BAD_CAST "http://", 7) == 0)) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2559:9): [True: 0, False: 0]
  ------------------
 2560|      0|        xmlCtxtErrIO(ctxt, XML_IO_NETWORK_ATTEMPT, url);
 2561|      1|    } else {
 2562|      1|        input = xmlNewInputFromFile(ctxt, url);
 2563|      1|    }
 2564|       |
 2565|      1|    if (resource != NULL)
  ------------------
  |  Branch (2565:9): [True: 0, False: 1]
  ------------------
 2566|      0|	xmlFree(resource);
 2567|      1|    return(input);
 2568|      1|}
parserInternals.c:xmlCtxtResolveFromCatalog:
 2363|     35|                          const char *publicId) {
 2364|     35|    char *resource;
 2365|     35|    void *localCatalogs = NULL;
 2366|     35|    int allowGlobal = 1;
 2367|     35|    xmlParserErrors code;
 2368|       |
 2369|     35|    if (ctxt != NULL) {
  ------------------
  |  Branch (2369:9): [True: 35, False: 0]
  ------------------
 2370|       |        /*
 2371|       |         * Loading of HTML documents shouldn't use XML catalogs.
 2372|       |         */
 2373|     35|        if (ctxt->html)
  ------------------
  |  Branch (2373:13): [True: 34, False: 1]
  ------------------
 2374|     34|            return(NULL);
 2375|       |
 2376|      1|        localCatalogs = ctxt->catalogs;
 2377|       |
 2378|      1|        if (ctxt->options & XML_PARSE_NO_SYS_CATALOG)
  ------------------
  |  Branch (2378:13): [True: 0, False: 1]
  ------------------
 2379|      0|            allowGlobal = 0;
 2380|      1|    }
 2381|       |
 2382|      1|    switch (xmlCatalogGetDefaults()) {
  ------------------
  |  Branch (2382:13): [True: 1, False: 0]
  ------------------
 2383|      1|        case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (2383:9): [True: 1, False: 0]
  ------------------
 2384|      1|            return(NULL);
 2385|      0|        case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (2385:9): [True: 0, False: 1]
  ------------------
 2386|      0|            allowGlobal = 0;
 2387|      0|            break;
 2388|      0|        case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (2388:9): [True: 0, False: 1]
  ------------------
 2389|      0|            localCatalogs = NULL;
 2390|      0|            break;
 2391|      0|        case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (2391:9): [True: 0, False: 1]
  ------------------
 2392|      0|            break;
 2393|      1|    }
 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|      1|}
parserInternals.c:xmlInitSAXParserCtxt:
 2766|    189|{
 2767|    189|    xmlParserInputPtr input;
 2768|    189|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2769|    189|    size_t initialNodeTabSize = 1;
 2770|       |#else
 2771|       |    size_t initialNodeTabSize = 10;
 2772|       |#endif
 2773|       |
 2774|    189|    if (ctxt == NULL)
  ------------------
  |  Branch (2774:9): [True: 0, False: 189]
  ------------------
 2775|      0|        return(-1);
 2776|       |
 2777|    189|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2777:9): [True: 189, False: 0]
  ------------------
 2778|    189|	ctxt->dict = xmlDictCreate();
 2779|    189|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2779:9): [True: 0, False: 189]
  ------------------
 2780|      0|	return(-1);
 2781|       |
 2782|    189|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2782:9): [True: 189, False: 0]
  ------------------
 2783|    189|	ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2784|    189|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2784:9): [True: 0, False: 189]
  ------------------
 2785|      0|	return(-1);
 2786|    189|    if (sax == NULL) {
  ------------------
  |  Branch (2786:9): [True: 188, False: 1]
  ------------------
 2787|    188|	memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2788|    188|        xmlSAXVersion(ctxt->sax, 2);
 2789|    188|        ctxt->userData = ctxt;
 2790|    188|    } else {
 2791|      1|	if (sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|      1|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2791:6): [True: 1, False: 0]
  ------------------
 2792|      1|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
 2793|      1|        } else {
 2794|      0|	    memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2795|      0|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
 2796|      0|        }
 2797|      1|        ctxt->userData = userData ? userData : ctxt;
  ------------------
  |  Branch (2797:26): [True: 0, False: 1]
  ------------------
 2798|      1|    }
 2799|       |
 2800|    189|    ctxt->maxatts = 0;
 2801|    189|    ctxt->atts = NULL;
 2802|       |    /* Allocate the Input stack */
 2803|    189|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (2803:9): [True: 189, False: 0]
  ------------------
 2804|    189|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2805|    189|        size_t initialSize = 1;
 2806|       |#else
 2807|       |        size_t initialSize = 5;
 2808|       |#endif
 2809|       |
 2810|    189|	ctxt->inputTab = xmlMalloc(initialSize * sizeof(xmlParserInputPtr));
 2811|    189|	ctxt->inputMax = initialSize;
 2812|    189|    }
 2813|    189|    if (ctxt->inputTab == NULL)
  ------------------
  |  Branch (2813:9): [True: 0, False: 189]
  ------------------
 2814|      0|	return(-1);
 2815|    189|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2815:12): [True: 0, False: 189]
  ------------------
 2816|      0|        xmlFreeInputStream(input);
 2817|      0|    }
 2818|    189|    ctxt->inputNr = 0;
 2819|    189|    ctxt->input = NULL;
 2820|       |
 2821|    189|    ctxt->version = NULL;
 2822|    189|    ctxt->encoding = NULL;
 2823|    189|    ctxt->standalone = -1;
 2824|    189|    ctxt->hasExternalSubset = 0;
 2825|    189|    ctxt->hasPErefs = 0;
 2826|    189|    ctxt->html = 0;
 2827|    189|    ctxt->instate = XML_PARSER_START;
 2828|       |
 2829|       |    /* Allocate the Node stack */
 2830|    189|    if (ctxt->nodeTab == NULL) {
  ------------------
  |  Branch (2830:9): [True: 189, False: 0]
  ------------------
 2831|    189|	ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(xmlNodePtr));
 2832|    189|	ctxt->nodeMax = initialNodeTabSize;
 2833|    189|    }
 2834|    189|    if (ctxt->nodeTab == NULL)
  ------------------
  |  Branch (2834:9): [True: 0, False: 189]
  ------------------
 2835|      0|	return(-1);
 2836|    189|    ctxt->nodeNr = 0;
 2837|    189|    ctxt->node = NULL;
 2838|       |
 2839|       |    /* Allocate the Name stack */
 2840|    189|    if (ctxt->nameTab == NULL) {
  ------------------
  |  Branch (2840:9): [True: 189, False: 0]
  ------------------
 2841|    189|	ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
 2842|    189|	ctxt->nameMax = initialNodeTabSize;
 2843|    189|    }
 2844|    189|    if (ctxt->nameTab == NULL)
  ------------------
  |  Branch (2844:9): [True: 0, False: 189]
  ------------------
 2845|      0|	return(-1);
 2846|    189|    ctxt->nameNr = 0;
 2847|    189|    ctxt->name = NULL;
 2848|       |
 2849|       |    /* Allocate the space stack */
 2850|    189|    if (ctxt->spaceTab == NULL) {
  ------------------
  |  Branch (2850:9): [True: 189, False: 0]
  ------------------
 2851|    189|	ctxt->spaceTab = xmlMalloc(initialNodeTabSize * sizeof(int));
 2852|    189|	ctxt->spaceMax = initialNodeTabSize;
 2853|    189|    }
 2854|    189|    if (ctxt->spaceTab == NULL)
  ------------------
  |  Branch (2854:9): [True: 0, False: 189]
  ------------------
 2855|      0|	return(-1);
 2856|    189|    ctxt->spaceNr = 1;
 2857|    189|    ctxt->spaceTab[0] = -1;
 2858|    189|    ctxt->space = &ctxt->spaceTab[0];
 2859|    189|    ctxt->myDoc = NULL;
 2860|    189|    ctxt->wellFormed = 1;
 2861|    189|    ctxt->nsWellFormed = 1;
 2862|    189|    ctxt->valid = 1;
 2863|       |
 2864|    189|    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|    189|    ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
  ------------------
  |  | 1331|    189|  #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
  ------------------
 2873|    189|    if (ctxt->loadsubset) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 189]
  ------------------
 2874|      0|        ctxt->options |= XML_PARSE_DTDLOAD;
 2875|      0|    }
 2876|    189|    ctxt->validate = xmlDoValidityCheckingDefaultValue;
  ------------------
  |  | 1302|    189|    (*__xmlDoValidityCheckingDefaultValue())
  ------------------
 2877|    189|    if (ctxt->validate) {
  ------------------
  |  Branch (2877:9): [True: 0, False: 189]
  ------------------
 2878|      0|        ctxt->options |= XML_PARSE_DTDVALID;
 2879|      0|    }
 2880|    189|    ctxt->pedantic = xmlPedanticParserDefaultValue;
  ------------------
  |  | 1339|    189|    (*__xmlPedanticParserDefaultValue())
  ------------------
 2881|    189|    if (ctxt->pedantic) {
  ------------------
  |  Branch (2881:9): [True: 0, False: 189]
  ------------------
 2882|      0|        ctxt->options |= XML_PARSE_PEDANTIC;
 2883|      0|    }
 2884|    189|    ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
  ------------------
  |  | 1316|    189|  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
  ------------------
 2885|    189|    if (ctxt->keepBlanks == 0) {
  ------------------
  |  Branch (2885:9): [True: 0, False: 189]
  ------------------
 2886|      0|	ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 2887|      0|	ctxt->options |= XML_PARSE_NOBLANKS;
 2888|      0|    }
 2889|    189|    ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
  ------------------
  |  | 1347|    189|    (*__xmlSubstituteEntitiesDefaultValue())
  ------------------
 2890|    189|    if (ctxt->replaceEntities) {
  ------------------
  |  Branch (2890:9): [True: 0, False: 189]
  ------------------
 2891|      0|        ctxt->options |= XML_PARSE_NOENT;
 2892|      0|    }
 2893|    189|    if (xmlGetWarningsDefaultValue == 0)
  ------------------
  |  | 1309|    189|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (2893:9): [True: 0, False: 189]
  ------------------
 2894|      0|        ctxt->options |= XML_PARSE_NOWARNING;
 2895|       |
 2896|    189|    ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
  ------------------
  |  |   20|    189|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
 2897|    189|    ctxt->vctxt.userData = ctxt;
 2898|    189|    ctxt->vctxt.error = xmlParserValidityError;
 2899|    189|    ctxt->vctxt.warning = xmlParserValidityWarning;
 2900|       |
 2901|    189|    ctxt->record_info = 0;
 2902|    189|    ctxt->checkIndex = 0;
 2903|    189|    ctxt->inSubset = 0;
 2904|    189|    ctxt->errNo = XML_ERR_OK;
 2905|    189|    ctxt->depth = 0;
 2906|    189|    ctxt->catalogs = NULL;
 2907|    189|    ctxt->sizeentities = 0;
 2908|    189|    ctxt->sizeentcopy = 0;
 2909|    189|    ctxt->input_id = 1;
 2910|    189|    ctxt->maxAmpl = XML_MAX_AMPLIFICATION_DEFAULT;
  ------------------
  |  |   60|    189|#define XML_MAX_AMPLIFICATION_DEFAULT 5
  ------------------
 2911|    189|    xmlInitNodeInfoSeq(&ctxt->node_seq);
 2912|       |
 2913|    189|    if (ctxt->nsdb == NULL) {
  ------------------
  |  Branch (2913:9): [True: 189, False: 0]
  ------------------
 2914|    189|        ctxt->nsdb = xmlParserNsCreate();
 2915|    189|        if (ctxt->nsdb == NULL)
  ------------------
  |  Branch (2915:13): [True: 0, False: 189]
  ------------------
 2916|      0|            return(-1);
 2917|    189|    }
 2918|       |
 2919|    189|    return(0);
 2920|    189|}

xmlFreePattern:
  222|    100|xmlFreePattern(xmlPattern *comp) {
  223|    100|    xmlFreePatternList(comp);
  224|    100|}
xmlFreePatternList:
  262|    100|xmlFreePatternList(xmlPattern *comp) {
  263|    100|    xmlPatternPtr cur;
  264|       |
  265|    677|    while (comp != NULL) {
  ------------------
  |  Branch (265:12): [True: 577, False: 100]
  ------------------
  266|    577|	cur = comp;
  267|    577|	comp = comp->next;
  268|       |	cur->next = NULL;
  269|    577|	xmlFreePatternInternal(cur);
  270|    577|    }
  271|    100|}
xmlFreeStreamCtxt:
 1548|     13|xmlFreeStreamCtxt(xmlStreamCtxt *stream) {
 1549|     13|    xmlStreamCtxtPtr next;
 1550|       |
 1551|    192|    while (stream != NULL) {
  ------------------
  |  Branch (1551:12): [True: 179, False: 13]
  ------------------
 1552|    179|        next = stream->next;
 1553|    179|        if (stream->states != NULL)
  ------------------
  |  Branch (1553:13): [True: 147, False: 32]
  ------------------
 1554|    147|	    xmlFree(stream->states);
 1555|    179|        xmlFree(stream);
 1556|    179|	stream = next;
 1557|    179|    }
 1558|     13|}
xmlStreamPush:
 1941|     26|              const xmlChar *name, const xmlChar *ns) {
 1942|     26|    return (xmlStreamPushInternal(stream, name, ns, XML_ELEMENT_NODE));
 1943|     26|}
xmlStreamPop:
 2001|     13|xmlStreamPop(xmlStreamCtxt *stream) {
 2002|     13|    int i, lev;
 2003|       |
 2004|     13|    if (stream == NULL)
  ------------------
  |  Branch (2004:9): [True: 0, False: 13]
  ------------------
 2005|      0|        return(-1);
 2006|    192|    while (stream != NULL) {
  ------------------
  |  Branch (2006:12): [True: 179, False: 13]
  ------------------
 2007|       |	/*
 2008|       |	* Reset block-level.
 2009|       |	*/
 2010|    179|	if (stream->blockLevel == stream->level)
  ------------------
  |  Branch (2010:6): [True: 140, False: 39]
  ------------------
 2011|    140|	    stream->blockLevel = -1;
 2012|       |
 2013|       |	/*
 2014|       |	 *  stream->level can be zero when XML_FINAL_IS_ANY_NODE is set
 2015|       |	 *  (see the thread at
 2016|       |	 *  http://mail.gnome.org/archives/xslt/2008-July/msg00027.html)
 2017|       |	 */
 2018|    179|	if (stream->level)
  ------------------
  |  Branch (2018:6): [True: 179, False: 0]
  ------------------
 2019|    179|	    stream->level--;
 2020|       |	/*
 2021|       |	 * Check evolution of existing states
 2022|       |	 */
 2023|    179|	for (i = stream->nbState -1; i >= 0; i--) {
  ------------------
  |  Branch (2023:31): [True: 147, False: 32]
  ------------------
 2024|       |	    /* discard obsoleted states */
 2025|    147|	    lev = stream->states[(2 * i) + 1];
 2026|    147|	    if (lev > stream->level)
  ------------------
  |  Branch (2026:10): [True: 0, False: 147]
  ------------------
 2027|      0|		stream->nbState--;
 2028|    147|	    if (lev <= stream->level)
  ------------------
  |  Branch (2028:10): [True: 147, False: 0]
  ------------------
 2029|    147|		break;
 2030|    147|	}
 2031|    179|	stream = stream->next;
 2032|    179|    }
 2033|     13|    return(0);
 2034|     13|}
xmlPatternCompileSafe:
 2079|    107|                      const xmlChar **namespaces, xmlPattern **patternOut) {
 2080|    107|    xmlPatternPtr ret = NULL, cur;
 2081|    107|    xmlPatParserContextPtr ctxt = NULL;
 2082|    107|    const xmlChar *or, *start;
 2083|    107|    xmlChar *tmp = NULL;
 2084|    107|    int type = 0;
 2085|    107|    int streamable = 1;
 2086|    107|    int error;
 2087|       |
 2088|    107|    if (patternOut == NULL)
  ------------------
  |  Branch (2088:9): [True: 0, False: 107]
  ------------------
 2089|      0|        return(1);
 2090|       |
 2091|    107|    if (pattern == NULL) {
  ------------------
  |  Branch (2091:9): [True: 0, False: 107]
  ------------------
 2092|      0|        error = 1;
 2093|      0|        goto error;
 2094|      0|    }
 2095|       |
 2096|    107|    start = pattern;
 2097|    107|    or = start;
 2098|    643|    while (*or != 0) {
  ------------------
  |  Branch (2098:12): [True: 581, False: 62]
  ------------------
 2099|    581|	tmp = NULL;
 2100|  25.3M|	while ((*or != 0) && (*or != '|')) or++;
  ------------------
  |  Branch (2100:9): [True: 25.3M, False: 90]
  |  Branch (2100:23): [True: 25.3M, False: 491]
  ------------------
 2101|    581|        if (*or == 0)
  ------------------
  |  Branch (2101:13): [True: 90, False: 491]
  ------------------
 2102|     90|	    ctxt = xmlNewPatParserContext(start, dict, namespaces);
 2103|    491|	else {
 2104|    491|	    tmp = xmlStrndup(start, or - start);
 2105|    491|	    if (tmp != NULL) {
  ------------------
  |  Branch (2105:10): [True: 487, False: 4]
  ------------------
 2106|    487|		ctxt = xmlNewPatParserContext(tmp, dict, namespaces);
 2107|    487|	    }
 2108|    491|	    or++;
 2109|    491|	}
 2110|    581|	if (ctxt == NULL) {
  ------------------
  |  Branch (2110:6): [True: 4, False: 577]
  ------------------
 2111|      4|            error = -1;
 2112|      4|            goto error;
 2113|      4|        }
 2114|    577|	cur = xmlNewPattern();
 2115|    577|	if (cur == NULL) {
  ------------------
  |  Branch (2115:6): [True: 0, False: 577]
  ------------------
 2116|      0|            error = -1;
 2117|      0|            goto error;
 2118|      0|        }
 2119|       |	/*
 2120|       |	* Assign string dict.
 2121|       |	*/
 2122|    577|	if (dict) {
  ------------------
  |  Branch (2122:6): [True: 0, False: 577]
  ------------------
 2123|      0|	    cur->dict = dict;
 2124|      0|	    xmlDictReference(dict);
 2125|      0|	}
 2126|    577|	if (ret == NULL)
  ------------------
  |  Branch (2126:6): [True: 100, False: 477]
  ------------------
 2127|    100|	    ret = cur;
 2128|    477|	else {
 2129|    477|	    cur->next = ret->next;
 2130|    477|	    ret->next = cur;
 2131|    477|	}
 2132|    577|	cur->flags = flags;
 2133|    577|	ctxt->comp = cur;
 2134|       |
 2135|    577|	if (XML_STREAM_XS_IDC(cur))
  ------------------
  |  |   75|    577|#define XML_STREAM_XS_IDC(c) ((c)->flags & \
  |  |  ------------------
  |  |  |  Branch (75:30): [True: 0, False: 577]
  |  |  ------------------
  |  |   76|    577|    (XML_PATTERN_XSSEL | XML_PATTERN_XSFIELD))
  ------------------
 2136|      0|	    xmlCompileIDCXPathPath(ctxt);
 2137|    577|	else
 2138|    577|	    xmlCompilePathPattern(ctxt);
 2139|    577|	if (ctxt->error != 0) {
  ------------------
  |  Branch (2139:6): [True: 41, False: 536]
  ------------------
 2140|     41|            error = ctxt->error;
 2141|     41|	    goto error;
 2142|     41|        }
 2143|    536|	xmlFreePatParserContext(ctxt);
 2144|    536|	ctxt = NULL;
 2145|       |
 2146|       |
 2147|    536|        if (streamable) {
  ------------------
  |  Branch (2147:13): [True: 533, False: 3]
  ------------------
 2148|    533|	    if (type == 0) {
  ------------------
  |  Branch (2148:10): [True: 235, False: 298]
  ------------------
 2149|    235|	        type = cur->flags & (PAT_FROM_ROOT | PAT_FROM_CUR);
  ------------------
  |  |  161|    235|#define PAT_FROM_ROOT	(1<<8)
  ------------------
              	        type = cur->flags & (PAT_FROM_ROOT | PAT_FROM_CUR);
  ------------------
  |  |  162|    235|#define PAT_FROM_CUR	(1<<9)
  ------------------
 2150|    298|	    } else if (type == PAT_FROM_ROOT) {
  ------------------
  |  |  161|    298|#define PAT_FROM_ROOT	(1<<8)
  ------------------
  |  Branch (2150:17): [True: 284, False: 14]
  ------------------
 2151|    284|	        if (cur->flags & PAT_FROM_CUR)
  ------------------
  |  |  162|    284|#define PAT_FROM_CUR	(1<<9)
  ------------------
  |  Branch (2151:14): [True: 3, False: 281]
  ------------------
 2152|      3|		    streamable = 0;
 2153|    284|	    } else if (type == PAT_FROM_CUR) {
  ------------------
  |  |  162|     14|#define PAT_FROM_CUR	(1<<9)
  ------------------
  |  Branch (2153:17): [True: 14, False: 0]
  ------------------
 2154|     14|	        if (cur->flags & PAT_FROM_ROOT)
  ------------------
  |  |  161|     14|#define PAT_FROM_ROOT	(1<<8)
  ------------------
  |  Branch (2154:14): [True: 0, False: 14]
  ------------------
 2155|      0|		    streamable = 0;
 2156|     14|	    }
 2157|    533|	}
 2158|    536|	if (streamable) {
  ------------------
  |  Branch (2158:6): [True: 530, False: 6]
  ------------------
 2159|    530|	    error = xmlStreamCompile(cur);
 2160|    530|            if (error != 0)
  ------------------
  |  Branch (2160:17): [True: 0, False: 530]
  ------------------
 2161|      0|                goto error;
 2162|    530|        }
 2163|    536|	error = xmlReversePattern(cur);
 2164|    536|        if (error != 0)
  ------------------
  |  Branch (2164:13): [True: 0, False: 536]
  ------------------
 2165|      0|	    goto error;
 2166|    536|	if (tmp != NULL) {
  ------------------
  |  Branch (2166:6): [True: 477, False: 59]
  ------------------
 2167|    477|	    xmlFree(tmp);
 2168|    477|	    tmp = NULL;
 2169|    477|	}
 2170|    536|	start = or;
 2171|    536|    }
 2172|     62|    if (streamable == 0) {
  ------------------
  |  Branch (2172:9): [True: 3, False: 59]
  ------------------
 2173|      3|        cur = ret;
 2174|     15|	while (cur != NULL) {
  ------------------
  |  Branch (2174:9): [True: 12, False: 3]
  ------------------
 2175|     12|	    if (cur->stream != NULL) {
  ------------------
  |  Branch (2175:10): [True: 6, False: 6]
  ------------------
 2176|      6|		xmlFreeStreamComp(cur->stream);
 2177|      6|		cur->stream = NULL;
 2178|      6|	    }
 2179|     12|	    cur = cur->next;
 2180|     12|	}
 2181|      3|    }
 2182|       |
 2183|     62|    *patternOut = ret;
 2184|     62|    return(0);
 2185|     45|error:
 2186|     45|    if (ctxt != NULL) xmlFreePatParserContext(ctxt);
  ------------------
  |  Branch (2186:9): [True: 41, False: 4]
  ------------------
 2187|     45|    if (ret != NULL) xmlFreePattern(ret);
  ------------------
  |  Branch (2187:9): [True: 41, False: 4]
  ------------------
 2188|     45|    if (tmp != NULL) xmlFree(tmp);
  ------------------
  |  Branch (2188:9): [True: 10, False: 35]
  ------------------
 2189|       |    *patternOut = NULL;
 2190|     45|    return(error);
 2191|    107|}
xmlPatternMatch:
 2219|     13|{
 2220|     13|    int ret = 0;
 2221|       |
 2222|     13|    if ((comp == NULL) || (node == NULL))
  ------------------
  |  Branch (2222:9): [True: 0, False: 13]
  |  Branch (2222:27): [True: 0, False: 13]
  ------------------
 2223|      0|        return(-1);
 2224|       |
 2225|     27|    while (comp != NULL) {
  ------------------
  |  Branch (2225:12): [True: 19, False: 8]
  ------------------
 2226|     19|        ret = xmlPatMatch(comp, node);
 2227|     19|	if (ret != 0)
  ------------------
  |  Branch (2227:6): [True: 5, False: 14]
  ------------------
 2228|      5|	    return(ret);
 2229|     14|	comp = comp->next;
 2230|     14|    }
 2231|      8|    return(ret);
 2232|     13|}
xmlPatternGetStreamCtxt:
 2243|     13|{
 2244|     13|    xmlStreamCtxtPtr ret = NULL, cur;
 2245|       |
 2246|     13|    if ((comp == NULL) || (comp->stream == NULL))
  ------------------
  |  Branch (2246:9): [True: 0, False: 13]
  |  Branch (2246:27): [True: 0, False: 13]
  ------------------
 2247|      0|        return(NULL);
 2248|       |
 2249|    192|    while (comp != NULL) {
  ------------------
  |  Branch (2249:12): [True: 179, False: 13]
  ------------------
 2250|    179|        if (comp->stream == NULL)
  ------------------
  |  Branch (2250:13): [True: 0, False: 179]
  ------------------
 2251|      0|	    goto failed;
 2252|    179|	cur = xmlNewStreamCtxt(comp->stream);
 2253|    179|	if (cur == NULL)
  ------------------
  |  Branch (2253:6): [True: 0, False: 179]
  ------------------
 2254|      0|	    goto failed;
 2255|    179|	if (ret == NULL)
  ------------------
  |  Branch (2255:6): [True: 13, False: 166]
  ------------------
 2256|     13|	    ret = cur;
 2257|    166|	else {
 2258|    166|	    cur->next = ret->next;
 2259|    166|	    ret->next = cur;
 2260|    166|	}
 2261|    179|	cur->flags = comp->flags;
 2262|    179|	comp = comp->next;
 2263|    179|    }
 2264|     13|    return(ret);
 2265|      0|failed:
 2266|      0|    xmlFreeStreamCtxt(ret);
 2267|       |    return(NULL);
 2268|     13|}
pattern.c:xmlFreePatternInternal:
  227|    577|xmlFreePatternInternal(xmlPatternPtr comp) {
  228|    577|    xmlStepOpPtr op;
  229|    577|    int i;
  230|       |
  231|    577|    if (comp == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 577]
  ------------------
  232|      0|	return;
  233|    577|    if (comp->stream != NULL)
  ------------------
  |  Branch (233:9): [True: 510, False: 67]
  ------------------
  234|    510|        xmlFreeStreamComp(comp->stream);
  235|    577|    if (comp->pattern != NULL)
  ------------------
  |  Branch (235:9): [True: 0, False: 577]
  ------------------
  236|      0|	xmlFree((xmlChar *)comp->pattern);
  237|    577|    if (comp->steps != NULL) {
  ------------------
  |  Branch (237:9): [True: 573, False: 4]
  ------------------
  238|    573|        if (comp->dict == NULL) {
  ------------------
  |  Branch (238:13): [True: 573, False: 0]
  ------------------
  239|  22.0M|	    for (i = 0;i < comp->nbStep;i++) {
  ------------------
  |  Branch (239:17): [True: 22.0M, False: 573]
  ------------------
  240|  22.0M|		op = &comp->steps[i];
  241|  22.0M|		if (op->value != NULL)
  ------------------
  |  Branch (241:7): [True: 6.64M, False: 15.4M]
  ------------------
  242|  6.64M|		    xmlFree((xmlChar *) op->value);
  243|  22.0M|		if (op->value2 != NULL)
  ------------------
  |  Branch (243:7): [True: 2.69k, False: 22.0M]
  ------------------
  244|  2.69k|		    xmlFree((xmlChar *) op->value2);
  245|  22.0M|	    }
  246|    573|	}
  247|    573|	xmlFree(comp->steps);
  248|    573|    }
  249|    577|    if (comp->dict != NULL)
  ------------------
  |  Branch (249:9): [True: 0, False: 577]
  ------------------
  250|      0|        xmlDictFree(comp->dict);
  251|       |
  252|    577|    memset(comp, -1, sizeof(xmlPattern));
  253|    577|    xmlFree(comp);
  254|    577|}
pattern.c:xmlStreamPushInternal:
 1620|     26|		      int nodeType) {
 1621|     26|    int ret = 0, final = 0, tmp, i, m, match, stepNr, desc;
 1622|     26|    xmlStreamCompPtr comp;
 1623|     26|    xmlStreamStep step;
 1624|       |
 1625|     26|    if ((stream == NULL) || (stream->nbState < 0))
  ------------------
  |  Branch (1625:9): [True: 0, False: 26]
  |  Branch (1625:29): [True: 0, False: 26]
  ------------------
 1626|      0|        return(-1);
 1627|       |
 1628|    384|    while (stream != NULL) {
  ------------------
  |  Branch (1628:12): [True: 358, False: 26]
  ------------------
 1629|    358|	comp = stream->comp;
 1630|       |
 1631|    358|	if ((nodeType == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1631:6): [True: 358, False: 0]
  ------------------
 1632|    358|	    (name == NULL) && (ns == NULL)) {
  ------------------
  |  Branch (1632:6): [True: 179, False: 179]
  |  Branch (1632:24): [True: 179, False: 0]
  ------------------
 1633|       |	    /* We have a document node here (or a reset). */
 1634|    179|	    stream->nbState = 0;
 1635|    179|	    stream->level = 0;
 1636|    179|	    stream->blockLevel = -1;
 1637|    179|	    if (comp->flags & XML_STREAM_FROM_ROOT) {
  ------------------
  |  |   62|    179|#define XML_STREAM_FROM_ROOT 1<<15
  ------------------
  |  Branch (1637:10): [True: 163, False: 16]
  ------------------
 1638|    163|		if (comp->nbStep == 0) {
  ------------------
  |  Branch (1638:7): [True: 0, False: 163]
  ------------------
 1639|       |		    /* TODO: We have a "/." here? */
 1640|      0|		    ret = 1;
 1641|    163|		} else {
 1642|    163|		    if ((comp->nbStep == 1) &&
  ------------------
  |  Branch (1642:11): [True: 150, False: 13]
  ------------------
 1643|    150|			(comp->steps[0].nodeType == XML_STREAM_ANY_NODE) &&
  ------------------
  |  |   69|    150|#define XML_STREAM_ANY_NODE 100
  ------------------
  |  Branch (1643:4): [True: 0, False: 150]
  ------------------
 1644|      0|			(comp->steps[0].flags & XML_STREAM_STEP_DESC))
  ------------------
  |  |   48|      0|#define XML_STREAM_STEP_DESC	1
  ------------------
  |  Branch (1644:4): [True: 0, False: 0]
  ------------------
 1645|      0|		    {
 1646|       |			/*
 1647|       |			* In the case of "//." the document node will match
 1648|       |			* as well.
 1649|       |			*/
 1650|      0|			ret = 1;
 1651|    163|		    } else if (comp->steps[0].flags & XML_STREAM_STEP_ROOT) {
  ------------------
  |  |   50|    163|#define XML_STREAM_STEP_ROOT	4
  ------------------
  |  Branch (1651:18): [True: 147, False: 16]
  ------------------
 1652|    147|			if (xmlStreamCtxtAddState(stream, 0, 0) < 0)
  ------------------
  |  Branch (1652:8): [True: 0, False: 147]
  ------------------
 1653|      0|                            return(-1);
 1654|    147|		    }
 1655|    163|		}
 1656|    163|	    }
 1657|    179|	    stream = stream->next;
 1658|    179|	    continue; /* while */
 1659|    179|	}
 1660|       |
 1661|       |	/*
 1662|       |	* Fast check for ".".
 1663|       |	*/
 1664|    179|	if (comp->nbStep == 0) {
  ------------------
  |  Branch (1664:6): [True: 0, False: 179]
  ------------------
 1665|       |	    /*
 1666|       |	     * / and . are handled at the XPath node set creation
 1667|       |	     * level by checking min depth
 1668|       |	     */
 1669|      0|	    if (stream->flags & XML_PATTERN_XPATH) {
  ------------------
  |  Branch (1669:10): [True: 0, False: 0]
  ------------------
 1670|      0|		stream = stream->next;
 1671|      0|		continue; /* while */
 1672|      0|	    }
 1673|       |	    /*
 1674|       |	    * For non-pattern like evaluation like XML Schema IDCs
 1675|       |	    * or traditional XPath expressions, this will match if
 1676|       |	    * we are at the first level only, otherwise on every level.
 1677|       |	    */
 1678|      0|	    if ((nodeType != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (1678:10): [True: 0, False: 0]
  ------------------
 1679|      0|		(((stream->flags & XML_PATTERN_NOTPATTERN) == 0) ||
  ------------------
  |  |   71|      0|#define XML_PATTERN_NOTPATTERN  (XML_PATTERN_XPATH | \
  |  |   72|      0|				 XML_PATTERN_XSSEL | \
  |  |   73|      0|				 XML_PATTERN_XSFIELD)
  ------------------
  |  Branch (1679:4): [True: 0, False: 0]
  ------------------
 1680|      0|		(stream->level == 0))) {
  ------------------
  |  Branch (1680:3): [True: 0, False: 0]
  ------------------
 1681|      0|		    ret = 1;
 1682|      0|	    }
 1683|      0|	    stream->level++;
 1684|      0|	    goto stream_next;
 1685|      0|	}
 1686|    179|	if (stream->blockLevel != -1) {
  ------------------
  |  Branch (1686:6): [True: 0, False: 179]
  ------------------
 1687|       |	    /*
 1688|       |	    * Skip blocked expressions.
 1689|       |	    */
 1690|      0|	    stream->level++;
 1691|      0|	    goto stream_next;
 1692|      0|	}
 1693|       |
 1694|    179|	if ((nodeType != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1694:6): [True: 0, False: 179]
  ------------------
 1695|      0|	    (nodeType != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (1695:6): [True: 0, False: 0]
  ------------------
 1696|      0|	    ((comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) == 0)) {
  ------------------
  |  |   61|      0|#define XML_STREAM_FINAL_IS_ANY_NODE 1<<14
  ------------------
  |  Branch (1696:6): [True: 0, False: 0]
  ------------------
 1697|       |	    /*
 1698|       |	    * No need to process nodes of other types if we don't
 1699|       |	    * resolve to those types.
 1700|       |	    * TODO: Do we need to block the context here?
 1701|       |	    */
 1702|      0|	    stream->level++;
 1703|      0|	    goto stream_next;
 1704|      0|	}
 1705|       |
 1706|       |	/*
 1707|       |	 * Check evolution of existing states
 1708|       |	 */
 1709|    179|	i = 0;
 1710|    179|	m = stream->nbState;
 1711|    326|	while (i < m) {
  ------------------
  |  Branch (1711:9): [True: 147, False: 179]
  ------------------
 1712|    147|	    if ((comp->flags & XML_STREAM_DESC) == 0) {
  ------------------
  |  |   63|    147|#define XML_STREAM_DESC 1<<16
  ------------------
  |  Branch (1712:10): [True: 140, False: 7]
  ------------------
 1713|       |		/*
 1714|       |		* If there is no "//", then only the last
 1715|       |		* added state is of interest.
 1716|       |		*/
 1717|    140|		stepNr = stream->states[2 * (stream->nbState -1)];
 1718|       |		/*
 1719|       |		* TODO: Security check, should not happen, remove it.
 1720|       |		*/
 1721|    140|		if (stream->states[(2 * (stream->nbState -1)) + 1] <
  ------------------
  |  Branch (1721:7): [True: 0, False: 140]
  ------------------
 1722|    140|		    stream->level) {
 1723|      0|		    return (-1);
 1724|      0|		}
 1725|    140|		desc = 0;
 1726|       |		/* loop-stopper */
 1727|    140|		i = m;
 1728|    140|	    } else {
 1729|       |		/*
 1730|       |		* If there are "//", then we need to process every "//"
 1731|       |		* occurring in the states, plus any other state for this
 1732|       |		* level.
 1733|       |		*/
 1734|      7|		stepNr = stream->states[2 * i];
 1735|       |
 1736|       |		/* TODO: should not happen anymore: dead states */
 1737|      7|		if (stepNr < 0)
  ------------------
  |  Branch (1737:7): [True: 0, False: 7]
  ------------------
 1738|      0|		    goto next_state;
 1739|       |
 1740|      7|		tmp = stream->states[(2 * i) + 1];
 1741|       |
 1742|       |		/* skip new states just added */
 1743|      7|		if (tmp > stream->level)
  ------------------
  |  Branch (1743:7): [True: 0, False: 7]
  ------------------
 1744|      0|		    goto next_state;
 1745|       |
 1746|       |		/* skip states at ancestor levels, except if "//" */
 1747|      7|		desc = comp->steps[stepNr].flags & XML_STREAM_STEP_DESC;
  ------------------
  |  |   48|      7|#define XML_STREAM_STEP_DESC	1
  ------------------
 1748|      7|		if ((tmp < stream->level) && (!desc))
  ------------------
  |  Branch (1748:7): [True: 0, False: 7]
  |  Branch (1748:32): [True: 0, False: 0]
  ------------------
 1749|      0|		    goto next_state;
 1750|      7|	    }
 1751|       |	    /*
 1752|       |	    * Check for correct node-type.
 1753|       |	    */
 1754|    147|	    step = comp->steps[stepNr];
 1755|    147|	    if (step.nodeType != nodeType) {
  ------------------
  |  Branch (1755:10): [True: 0, False: 147]
  ------------------
 1756|      0|		if (step.nodeType == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (1756:7): [True: 0, False: 0]
  ------------------
 1757|       |		    /*
 1758|       |		    * Block this expression for deeper evaluation.
 1759|       |		    */
 1760|      0|		    if ((comp->flags & XML_STREAM_DESC) == 0)
  ------------------
  |  |   63|      0|#define XML_STREAM_DESC 1<<16
  ------------------
  |  Branch (1760:11): [True: 0, False: 0]
  ------------------
 1761|      0|			stream->blockLevel = stream->level +1;
 1762|      0|		    goto next_state;
 1763|      0|		} else if (step.nodeType != XML_STREAM_ANY_NODE)
  ------------------
  |  |   69|      0|#define XML_STREAM_ANY_NODE 100
  ------------------
  |  Branch (1763:14): [True: 0, False: 0]
  ------------------
 1764|      0|		    goto next_state;
 1765|      0|	    }
 1766|       |	    /*
 1767|       |	    * Compare local/namespace-name.
 1768|       |	    */
 1769|    147|	    match = 0;
 1770|    147|	    if (step.nodeType == XML_STREAM_ANY_NODE) {
  ------------------
  |  |   69|    147|#define XML_STREAM_ANY_NODE 100
  ------------------
  |  Branch (1770:10): [True: 0, False: 147]
  ------------------
 1771|      0|		match = 1;
 1772|    147|	    } else if (step.name == NULL) {
  ------------------
  |  Branch (1772:17): [True: 140, False: 7]
  ------------------
 1773|    140|		if (step.ns == NULL) {
  ------------------
  |  Branch (1773:7): [True: 140, False: 0]
  ------------------
 1774|       |		    /*
 1775|       |		    * This lets through all elements/attributes.
 1776|       |		    */
 1777|    140|		    match = 1;
 1778|    140|		} else if (ns != NULL)
  ------------------
  |  Branch (1778:14): [True: 0, False: 0]
  ------------------
 1779|      0|		    match = xmlStrEqual(step.ns, ns);
 1780|    140|	    } else if (((step.ns != NULL) == (ns != NULL)) &&
  ------------------
  |  Branch (1780:17): [True: 7, False: 0]
  ------------------
 1781|      7|		(name != NULL) &&
  ------------------
  |  Branch (1781:3): [True: 7, False: 0]
  ------------------
 1782|      7|		(step.name[0] == name[0]) &&
  ------------------
  |  Branch (1782:3): [True: 0, False: 7]
  ------------------
 1783|      0|		xmlStrEqual(step.name, name) &&
  ------------------
  |  Branch (1783:3): [True: 0, False: 0]
  ------------------
 1784|      0|		((step.ns == ns) || xmlStrEqual(step.ns, ns)))
  ------------------
  |  Branch (1784:4): [True: 0, False: 0]
  |  Branch (1784:23): [True: 0, False: 0]
  ------------------
 1785|      0|	    {
 1786|      0|		match = 1;
 1787|      0|	    }
 1788|    147|	    if (match) {
  ------------------
  |  Branch (1788:10): [True: 140, False: 7]
  ------------------
 1789|    140|		final = step.flags & XML_STREAM_STEP_FINAL;
  ------------------
  |  |   49|    140|#define XML_STREAM_STEP_FINAL	2
  ------------------
 1790|    140|                if (final) {
  ------------------
  |  Branch (1790:21): [True: 140, False: 0]
  ------------------
 1791|    140|                    ret = 1;
 1792|    140|                } else if (xmlStreamCtxtAddState(stream, stepNr + 1,
  ------------------
  |  Branch (1792:28): [True: 0, False: 0]
  ------------------
 1793|      0|                                                 stream->level + 1) < 0) {
 1794|      0|                    return(-1);
 1795|      0|                }
 1796|    140|		if ((ret != 1) && (step.flags & XML_STREAM_STEP_IN_SET)) {
  ------------------
  |  |   53|      0|#define XML_STREAM_STEP_IN_SET	32
  ------------------
  |  Branch (1796:7): [True: 0, False: 140]
  |  Branch (1796:21): [True: 0, False: 0]
  ------------------
 1797|       |		    /*
 1798|       |		    * Check if we have a special case like "foo/bar//.", where
 1799|       |		    * "foo" is selected as well.
 1800|       |		    */
 1801|      0|		    ret = 1;
 1802|      0|		}
 1803|    140|	    }
 1804|    147|	    if (((comp->flags & XML_STREAM_DESC) == 0) &&
  ------------------
  |  |   63|    147|#define XML_STREAM_DESC 1<<16
  ------------------
  |  Branch (1804:10): [True: 140, False: 7]
  ------------------
 1805|    140|		((! match) || final))  {
  ------------------
  |  Branch (1805:4): [True: 0, False: 140]
  |  Branch (1805:17): [True: 140, False: 0]
  ------------------
 1806|       |		/*
 1807|       |		* Mark this expression as blocked for any evaluation at
 1808|       |		* deeper levels. Note that this includes "/foo"
 1809|       |		* expressions if the *pattern* behaviour is used.
 1810|       |		*/
 1811|    140|		stream->blockLevel = stream->level +1;
 1812|    140|	    }
 1813|    147|next_state:
 1814|    147|	    i++;
 1815|    147|	}
 1816|       |
 1817|    179|	stream->level++;
 1818|       |
 1819|       |	/*
 1820|       |	* Re/enter the expression.
 1821|       |	* Don't reenter if it's an absolute expression like "/foo",
 1822|       |	*   except "//foo".
 1823|       |	*/
 1824|    179|	step = comp->steps[0];
 1825|    179|	if (step.flags & XML_STREAM_STEP_ROOT)
  ------------------
  |  |   50|    179|#define XML_STREAM_STEP_ROOT	4
  ------------------
  |  Branch (1825:6): [True: 147, False: 32]
  ------------------
 1826|    147|	    goto stream_next;
 1827|       |
 1828|     32|	desc = step.flags & XML_STREAM_STEP_DESC;
  ------------------
  |  |   48|     32|#define XML_STREAM_STEP_DESC	1
  ------------------
 1829|     32|	if (stream->flags & XML_PATTERN_NOTPATTERN) {
  ------------------
  |  |   71|     32|#define XML_PATTERN_NOTPATTERN  (XML_PATTERN_XPATH | \
  |  |   72|     32|				 XML_PATTERN_XSSEL | \
  |  |   73|     32|				 XML_PATTERN_XSFIELD)
  ------------------
  |  Branch (1829:6): [True: 0, False: 32]
  ------------------
 1830|       |	    /*
 1831|       |	    * Re/enter the expression if it is a "descendant" one,
 1832|       |	    * or if we are at the 1st level of evaluation.
 1833|       |	    */
 1834|       |
 1835|      0|	    if (stream->level == 1) {
  ------------------
  |  Branch (1835:10): [True: 0, False: 0]
  ------------------
 1836|      0|		if (XML_STREAM_XS_IDC(stream)) {
  ------------------
  |  |   75|      0|#define XML_STREAM_XS_IDC(c) ((c)->flags & \
  |  |  ------------------
  |  |  |  Branch (75:30): [True: 0, False: 0]
  |  |  ------------------
  |  |   76|      0|    (XML_PATTERN_XSSEL | XML_PATTERN_XSFIELD))
  ------------------
 1837|       |		    /*
 1838|       |		    * XS-IDC: The missing "self::node()" will always
 1839|       |		    * match the first given node.
 1840|       |		    */
 1841|      0|		    goto stream_next;
 1842|      0|		} else
 1843|      0|		    goto compare;
 1844|      0|	    }
 1845|       |	    /*
 1846|       |	    * A "//" is always reentrant.
 1847|       |	    */
 1848|      0|	    if (desc)
  ------------------
  |  Branch (1848:10): [True: 0, False: 0]
  ------------------
 1849|      0|		goto compare;
 1850|       |
 1851|       |	    /*
 1852|       |	    * XS-IDC: Process the 2nd level, since the missing
 1853|       |	    * "self::node()" is responsible for the 2nd level being
 1854|       |	    * the real start level.
 1855|       |	    */
 1856|      0|	    if ((stream->level == 2) && XML_STREAM_XS_IDC(stream))
  ------------------
  |  |   75|      0|#define XML_STREAM_XS_IDC(c) ((c)->flags & \
  |  |  ------------------
  |  |  |  Branch (75:30): [True: 0, False: 0]
  |  |  ------------------
  |  |   76|      0|    (XML_PATTERN_XSSEL | XML_PATTERN_XSFIELD))
  ------------------
  |  Branch (1856:10): [True: 0, False: 0]
  ------------------
 1857|      0|		goto compare;
 1858|       |
 1859|      0|	    goto stream_next;
 1860|      0|	}
 1861|       |
 1862|     32|compare:
 1863|       |	/*
 1864|       |	* Check expected node-type.
 1865|       |	*/
 1866|     32|	if (step.nodeType != nodeType) {
  ------------------
  |  Branch (1866:6): [True: 0, False: 32]
  ------------------
 1867|      0|	    if (nodeType == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (1867:10): [True: 0, False: 0]
  ------------------
 1868|      0|		goto stream_next;
 1869|      0|	    else if (step.nodeType != XML_STREAM_ANY_NODE)
  ------------------
  |  |   69|      0|#define XML_STREAM_ANY_NODE 100
  ------------------
  |  Branch (1869:15): [True: 0, False: 0]
  ------------------
 1870|      0|		goto stream_next;
 1871|      0|	}
 1872|       |	/*
 1873|       |	* Compare local/namespace-name.
 1874|       |	*/
 1875|     32|	match = 0;
 1876|     32|	if (step.nodeType == XML_STREAM_ANY_NODE) {
  ------------------
  |  |   69|     32|#define XML_STREAM_ANY_NODE 100
  ------------------
  |  Branch (1876:6): [True: 0, False: 32]
  ------------------
 1877|      0|	    match = 1;
 1878|     32|	} else if (step.name == NULL) {
  ------------------
  |  Branch (1878:13): [True: 20, False: 12]
  ------------------
 1879|     20|	    if (step.ns == NULL) {
  ------------------
  |  Branch (1879:10): [True: 20, False: 0]
  ------------------
 1880|       |		/*
 1881|       |		* This lets through all elements/attributes.
 1882|       |		*/
 1883|     20|		match = 1;
 1884|     20|	    } else if (ns != NULL)
  ------------------
  |  Branch (1884:17): [True: 0, False: 0]
  ------------------
 1885|      0|		match = xmlStrEqual(step.ns, ns);
 1886|     20|	} else if (((step.ns != NULL) == (ns != NULL)) &&
  ------------------
  |  Branch (1886:13): [True: 12, False: 0]
  ------------------
 1887|     12|	    (name != NULL) &&
  ------------------
  |  Branch (1887:6): [True: 12, False: 0]
  ------------------
 1888|     12|	    (step.name[0] == name[0]) &&
  ------------------
  |  Branch (1888:6): [True: 0, False: 12]
  ------------------
 1889|      0|	    xmlStrEqual(step.name, name) &&
  ------------------
  |  Branch (1889:6): [True: 0, False: 0]
  ------------------
 1890|      0|	    ((step.ns == ns) || xmlStrEqual(step.ns, ns)))
  ------------------
  |  Branch (1890:7): [True: 0, False: 0]
  |  Branch (1890:26): [True: 0, False: 0]
  ------------------
 1891|      0|	{
 1892|      0|	    match = 1;
 1893|      0|	}
 1894|     32|	final = step.flags & XML_STREAM_STEP_FINAL;
  ------------------
  |  |   49|     32|#define XML_STREAM_STEP_FINAL	2
  ------------------
 1895|     32|	if (match) {
  ------------------
  |  Branch (1895:6): [True: 20, False: 12]
  ------------------
 1896|     20|	    if (final) {
  ------------------
  |  Branch (1896:10): [True: 20, False: 0]
  ------------------
 1897|     20|		ret = 1;
 1898|     20|            } else if (xmlStreamCtxtAddState(stream, 1, stream->level) < 0) {
  ------------------
  |  Branch (1898:24): [True: 0, False: 0]
  ------------------
 1899|      0|                return(-1);
 1900|      0|            }
 1901|     20|	    if ((ret != 1) && (step.flags & XML_STREAM_STEP_IN_SET)) {
  ------------------
  |  |   53|      0|#define XML_STREAM_STEP_IN_SET	32
  ------------------
  |  Branch (1901:10): [True: 0, False: 20]
  |  Branch (1901:24): [True: 0, False: 0]
  ------------------
 1902|       |		/*
 1903|       |		* Check if we have a special case like "foo//.", where
 1904|       |		* "foo" is selected as well.
 1905|       |		*/
 1906|      0|		ret = 1;
 1907|      0|	    }
 1908|     20|	}
 1909|     32|	if (((comp->flags & XML_STREAM_DESC) == 0) &&
  ------------------
  |  |   63|     32|#define XML_STREAM_DESC 1<<16
  ------------------
  |  Branch (1909:6): [True: 0, False: 32]
  ------------------
 1910|      0|	    ((! match) || final))  {
  ------------------
  |  Branch (1910:7): [True: 0, False: 0]
  |  Branch (1910:20): [True: 0, False: 0]
  ------------------
 1911|       |	    /*
 1912|       |	    * Mark this expression as blocked for any evaluation at
 1913|       |	    * deeper levels.
 1914|       |	    */
 1915|      0|	    stream->blockLevel = stream->level;
 1916|      0|	}
 1917|       |
 1918|    179|stream_next:
 1919|    179|        stream = stream->next;
 1920|    179|    } /* while stream != NULL */
 1921|       |
 1922|     26|    return(ret);
 1923|     26|}
pattern.c:xmlStreamCtxtAddState:
 1569|    147|xmlStreamCtxtAddState(xmlStreamCtxtPtr comp, int idx, int level) {
 1570|    147|    int i;
 1571|    147|    for (i = 0;i < comp->nbState;i++) {
  ------------------
  |  Branch (1571:16): [True: 0, False: 147]
  ------------------
 1572|      0|        if (comp->states[2 * i] < 0) {
  ------------------
  |  Branch (1572:13): [True: 0, False: 0]
  ------------------
 1573|      0|	    comp->states[2 * i] = idx;
 1574|      0|	    comp->states[2 * i + 1] = level;
 1575|      0|	    return(i);
 1576|      0|	}
 1577|      0|    }
 1578|    147|    if (comp->nbState >= comp->maxState) {
  ------------------
  |  Branch (1578:9): [True: 147, False: 0]
  ------------------
 1579|    147|        int *tmp;
 1580|    147|        int newSize;
 1581|       |
 1582|    147|        newSize = xmlGrowCapacity(comp->maxState, sizeof(tmp[0]) * 2,
 1583|    147|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|    147|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1584|    147|        if (newSize < 0) {
  ------------------
  |  Branch (1584:13): [True: 0, False: 147]
  ------------------
 1585|      0|	    ERROR(NULL, NULL, NULL,
 1586|      0|		  "xmlNewStreamCtxt: growCapacity failed\n");
 1587|      0|	    return(-1);
 1588|      0|        }
 1589|    147|	tmp = xmlRealloc(comp->states, newSize * sizeof(tmp[0]) * 2);
 1590|    147|	if (tmp == NULL) {
  ------------------
  |  Branch (1590:6): [True: 0, False: 147]
  ------------------
 1591|      0|	    ERROR(NULL, NULL, NULL,
 1592|      0|		  "xmlNewStreamCtxt: malloc failed\n");
 1593|      0|	    return(-1);
 1594|      0|	}
 1595|    147|	comp->states = tmp;
 1596|    147|        comp->maxState = newSize;
 1597|    147|    }
 1598|    147|    comp->states[2 * comp->nbState] = idx;
 1599|    147|    comp->states[2 * comp->nbState++ + 1] = level;
 1600|    147|    return(comp->nbState - 1);
 1601|    147|}
pattern.c:xmlNewPatParserContext:
  284|    577|                       const xmlChar **namespaces) {
  285|    577|    xmlPatParserContextPtr cur;
  286|       |
  287|    577|    if (pattern == NULL)
  ------------------
  |  Branch (287:9): [True: 0, False: 577]
  ------------------
  288|      0|        return(NULL);
  289|       |
  290|    577|    cur = (xmlPatParserContextPtr) xmlMalloc(sizeof(xmlPatParserContext));
  291|    577|    if (cur == NULL) {
  ------------------
  |  Branch (291:9): [True: 0, False: 577]
  ------------------
  292|      0|	ERROR(NULL, NULL, NULL,
  293|      0|		"xmlNewPatParserContext : malloc failed\n");
  294|      0|	return(NULL);
  295|      0|    }
  296|    577|    memset(cur, 0, sizeof(xmlPatParserContext));
  297|    577|    cur->dict = dict;
  298|    577|    cur->cur = pattern;
  299|    577|    cur->base = pattern;
  300|    577|    if (namespaces != NULL) {
  ------------------
  |  Branch (300:9): [True: 283, False: 294]
  ------------------
  301|    283|        int i;
  302|    283|        for (i = 0;namespaces[2 * i] != NULL;i++)
  ------------------
  |  Branch (302:20): [True: 0, False: 283]
  ------------------
  303|      0|            ;
  304|    283|        cur->nb_namespaces = i;
  305|    294|    } else {
  306|    294|        cur->nb_namespaces = 0;
  307|    294|    }
  308|    577|    cur->namespaces = namespaces;
  309|    577|    return(cur);
  310|    577|}
pattern.c:xmlNewPattern:
  201|    577|xmlNewPattern(void) {
  202|    577|    xmlPatternPtr cur;
  203|       |
  204|    577|    cur = (xmlPatternPtr) xmlMalloc(sizeof(xmlPattern));
  205|    577|    if (cur == NULL) {
  ------------------
  |  Branch (205:9): [True: 0, False: 577]
  ------------------
  206|      0|	ERROR(NULL, NULL, NULL,
  207|      0|		"xmlNewPattern : malloc failed\n");
  208|      0|	return(NULL);
  209|      0|    }
  210|    577|    memset(cur, 0, sizeof(xmlPattern));
  211|       |    cur->steps = NULL;
  212|    577|    cur->maxStep = 0;
  213|    577|    return(cur);
  214|    577|}
pattern.c:xmlPatternAdd:
  356|  22.0M|{
  357|  22.0M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (357:9): [True: 4.79k, False: 22.0M]
  ------------------
  358|  4.79k|        if (xmlPatternGrow(comp) < 0) {
  ------------------
  |  Branch (358:13): [True: 0, False: 4.79k]
  ------------------
  359|      0|            ctxt->error = -1;
  360|      0|            return(-1);
  361|      0|        }
  362|  4.79k|    }
  363|  22.0M|    comp->steps[comp->nbStep].op = op;
  364|  22.0M|    comp->steps[comp->nbStep].value = value;
  365|  22.0M|    comp->steps[comp->nbStep].value2 = value2;
  366|  22.0M|    comp->nbStep++;
  367|  22.0M|    return(0);
  368|  22.0M|}
pattern.c:xmlPatternGrow:
  326|  5.02k|xmlPatternGrow(xmlPatternPtr comp) {
  327|  5.02k|    xmlStepOpPtr temp;
  328|  5.02k|    int newSize;
  329|       |
  330|  5.02k|    newSize = xmlGrowCapacity(comp->maxStep, sizeof(temp[0]),
  331|  5.02k|                              10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  5.02k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  332|  5.02k|    if (newSize < 0)
  ------------------
  |  Branch (332:9): [True: 0, False: 5.02k]
  ------------------
  333|      0|        return(-1);
  334|  5.02k|    temp = xmlRealloc(comp->steps, newSize * sizeof(temp[0]));
  335|  5.02k|    if (temp == NULL)
  ------------------
  |  Branch (335:9): [True: 0, False: 5.02k]
  ------------------
  336|      0|        return(-1);
  337|  5.02k|    comp->steps = temp;
  338|  5.02k|    comp->maxStep = newSize;
  339|       |
  340|  5.02k|    return(0);
  341|  5.02k|}
pattern.c:xmlCompileStepPattern:
  834|  11.0M|xmlCompileStepPattern(xmlPatParserContextPtr ctxt) {
  835|  11.0M|    xmlChar *token = NULL;
  836|  11.0M|    xmlChar *name = NULL;
  837|  11.0M|    xmlChar *URL = NULL;
  838|  11.0M|    int hasBlanks = 0;
  839|       |
  840|  11.0M|    SKIP_BLANKS;
  ------------------
  |  |  665|  11.0M|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|     13|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  841|  11.0M|    if (CUR == '.') {
  ------------------
  |  |  658|  11.0M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (841:9): [True: 2.64M, False: 8.39M]
  ------------------
  842|       |	/*
  843|       |	* Context node.
  844|       |	*/
  845|  2.64M|	NEXT;
  ------------------
  |  |  668|  2.64M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 2.64M, False: 0]
  |  |  ------------------
  ------------------
  846|  2.64M|	PUSH(XML_OP_ELEM, NULL, NULL);
  ------------------
  |  |  672|  2.64M|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 2.64M]
  |  |  ------------------
  ------------------
  847|  2.64M|	return;
  848|  2.64M|    }
  849|  8.39M|    if (CUR == '@') {
  ------------------
  |  |  658|  8.39M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (849:9): [True: 14.5k, False: 8.37M]
  ------------------
  850|       |	/*
  851|       |	* Attribute test.
  852|       |	*/
  853|  14.5k|	if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) {
  ------------------
  |  |   78|  14.5k|#define XML_STREAM_XS_IDC_SEL(c) ((c)->flags & XML_PATTERN_XSSEL)
  |  |  ------------------
  |  |  |  Branch (78:34): [True: 0, False: 14.5k]
  |  |  ------------------
  ------------------
  854|      0|	    ERROR5(NULL, NULL, NULL,
  855|      0|		"Unexpected attribute axis in '%s'.\n", ctxt->base);
  856|      0|	    ctxt->error = 1;
  857|      0|	    return;
  858|      0|	}
  859|  14.5k|	NEXT;
  ------------------
  |  |  668|  14.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 14.5k, False: 0]
  |  |  ------------------
  ------------------
  860|  14.5k|	xmlCompileAttributeTest(ctxt);
  861|  14.5k|	if (ctxt->error != 0)
  ------------------
  |  Branch (861:6): [True: 1, False: 14.5k]
  ------------------
  862|      1|	    goto error;
  863|  14.5k|	return;
  864|  14.5k|    }
  865|  8.37M|    name = xmlPatScanNCName(ctxt);
  866|  8.37M|    if (ctxt->error < 0)
  ------------------
  |  Branch (866:9): [True: 0, False: 8.37M]
  ------------------
  867|      0|        return;
  868|  8.37M|    if (name == NULL) {
  ------------------
  |  Branch (868:9): [True: 1.74M, False: 6.63M]
  ------------------
  869|  1.74M|	if (CUR == '*') {
  ------------------
  |  |  658|  1.74M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (869:6): [True: 1.74M, False: 11]
  ------------------
  870|  1.74M|	    NEXT;
  ------------------
  |  |  668|  1.74M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 1.74M, False: 0]
  |  |  ------------------
  ------------------
  871|  1.74M|	    PUSH(XML_OP_ALL, NULL, NULL);
  ------------------
  |  |  672|  1.74M|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 1.74M]
  |  |  ------------------
  ------------------
  872|  1.74M|	    return;
  873|  1.74M|	} else {
  874|     11|	    ERROR(NULL, NULL, NULL,
  875|     11|		    "xmlCompileStepPattern : Name expected\n");
  876|     11|	    ctxt->error = 1;
  877|     11|	    return;
  878|     11|	}
  879|  1.74M|    }
  880|  6.63M|    if (IS_BLANK_CH(CUR)) {
  ------------------
  |  |  137|  6.63M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  6.63M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 0, False: 6.63M]
  |  |  |  |  ------------------
  |  |  |  |   91|  6.63M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 6.63M, False: 136]
  |  |  |  |  |  Branch (91:23): [True: 281k, False: 6.35M]
  |  |  |  |  ------------------
  |  |  |  |   92|  6.63M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 6.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  881|   281k|	hasBlanks = 1;
  882|   281k|	SKIP_BLANKS;
  ------------------
  |  |  665|   314k|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|   314k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 314k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  883|   281k|    }
  884|  6.63M|    if (CUR == ':') {
  ------------------
  |  |  658|  6.63M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (884:9): [True: 1.60k, False: 6.63M]
  ------------------
  885|  1.60k|	NEXT;
  ------------------
  |  |  668|  1.60k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 1.60k, False: 0]
  |  |  ------------------
  ------------------
  886|  1.60k|	if (CUR != ':') {
  ------------------
  |  |  658|  1.60k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (886:6): [True: 1.60k, False: 1]
  ------------------
  887|  1.60k|	    xmlChar *prefix = name;
  888|  1.60k|	    int i;
  889|       |
  890|  1.60k|	    if (hasBlanks || IS_BLANK_CH(CUR)) {
  ------------------
  |  |  137|  1.60k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.60k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 0, False: 1.60k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.60k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.60k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 0, False: 1.60k]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.60k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 1.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (890:10): [True: 0, False: 1.60k]
  ------------------
  891|      0|		ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL);
  892|      0|		ctxt->error = 1;
  893|      0|		goto error;
  894|      0|	    }
  895|       |	    /*
  896|       |	     * This is a namespace match
  897|       |	     */
  898|  1.60k|	    token = xmlPatScanName(ctxt);
  899|  1.60k|	    if ((prefix[0] == 'x') &&
  ------------------
  |  Branch (899:10): [True: 1.60k, False: 0]
  ------------------
  900|  1.60k|		(prefix[1] == 'm') &&
  ------------------
  |  Branch (900:3): [True: 1.60k, False: 0]
  ------------------
  901|  1.60k|		(prefix[2] == 'l') &&
  ------------------
  |  Branch (901:3): [True: 1.60k, False: 0]
  ------------------
  902|  1.60k|		(prefix[3] == 0))
  ------------------
  |  Branch (902:3): [True: 1.60k, False: 0]
  ------------------
  903|  1.60k|	    {
  904|  1.60k|		XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE)
  ------------------
  |  |   83|  1.60k|    if ((c)->comp->dict) \
  |  |  ------------------
  |  |  |  Branch (83:9): [True: 0, False: 1.60k]
  |  |  ------------------
  |  |   84|  1.60k|	r = (xmlChar *) xmlDictLookup((c)->comp->dict, BAD_CAST nsname, -1); \
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  |   85|  1.60k|    else r = xmlStrdup(BAD_CAST nsname);
  |  |  ------------------
  |  |  |  |   34|  1.60k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  905|  1.60k|	    } else {
  906|      0|		for (i = 0;i < ctxt->nb_namespaces;i++) {
  ------------------
  |  Branch (906:14): [True: 0, False: 0]
  ------------------
  907|      0|		    if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
  ------------------
  |  Branch (907:11): [True: 0, False: 0]
  ------------------
  908|      0|			XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
  ------------------
  |  |   83|      0|    if ((c)->comp->dict) \
  |  |  ------------------
  |  |  |  Branch (83:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   84|      0|	r = (xmlChar *) xmlDictLookup((c)->comp->dict, BAD_CAST nsname, -1); \
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  |   85|      0|    else r = xmlStrdup(BAD_CAST nsname);
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  909|      0|			break;
  910|      0|		    }
  911|      0|		}
  912|      0|		if (i >= ctxt->nb_namespaces) {
  ------------------
  |  Branch (912:7): [True: 0, False: 0]
  ------------------
  913|      0|		    ERROR5(NULL, NULL, NULL,
  914|      0|			"xmlCompileStepPattern : no namespace bound to prefix %s\n",
  915|      0|			prefix);
  916|      0|		    ctxt->error = 1;
  917|      0|		    goto error;
  918|      0|		}
  919|      0|	    }
  920|  1.60k|	    XML_PAT_FREE_STRING(ctxt, prefix);
  ------------------
  |  |   87|  1.60k|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 1.60k, False: 0]
  |  |  ------------------
  ------------------
  921|  1.60k|	    name = NULL;
  922|  1.60k|	    if (token == NULL) {
  ------------------
  |  Branch (922:10): [True: 1.60k, False: 0]
  ------------------
  923|  1.60k|		if (CUR == '*') {
  ------------------
  |  |  658|  1.60k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (923:7): [True: 1.60k, False: 1]
  ------------------
  924|  1.60k|		    NEXT;
  ------------------
  |  |  668|  1.60k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 1.60k, False: 0]
  |  |  ------------------
  ------------------
  925|  1.60k|		    PUSH(XML_OP_NS, URL, NULL);
  ------------------
  |  |  672|  1.60k|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 1.60k]
  |  |  ------------------
  ------------------
  926|  1.60k|		} else {
  927|      1|		    ERROR(NULL, NULL, NULL,
  928|      1|			    "xmlCompileStepPattern : Name expected\n");
  929|      1|		    ctxt->error = 1;
  930|      1|		    goto error;
  931|      1|		}
  932|  1.60k|	    } else {
  933|      0|		PUSH(XML_OP_ELEM, token, URL);
  ------------------
  |  |  672|      0|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  934|      0|	    }
  935|  1.60k|	} else {
  936|      1|	    NEXT;
  ------------------
  |  |  668|      1|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  937|      1|	    if (xmlStrEqual(name, (const xmlChar *) "child")) {
  ------------------
  |  Branch (937:10): [True: 0, False: 1]
  ------------------
  938|      0|		XML_PAT_FREE_STRING(ctxt, name);
  ------------------
  |  |   87|      0|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  939|      0|		name = xmlPatScanName(ctxt);
  940|      0|		if (name == NULL) {
  ------------------
  |  Branch (940:7): [True: 0, False: 0]
  ------------------
  941|      0|		    if (CUR == '*') {
  ------------------
  |  |  658|      0|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (941:11): [True: 0, False: 0]
  ------------------
  942|      0|			NEXT;
  ------------------
  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  943|      0|			PUSH(XML_OP_ALL, NULL, NULL);
  ------------------
  |  |  672|      0|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  944|      0|			return;
  945|      0|		    } else {
  946|      0|			ERROR(NULL, NULL, NULL,
  947|      0|			    "xmlCompileStepPattern : QName expected\n");
  948|      0|			ctxt->error = 1;
  949|      0|			goto error;
  950|      0|		    }
  951|      0|		}
  952|      0|		if (CUR == ':') {
  ------------------
  |  |  658|      0|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (952:7): [True: 0, False: 0]
  ------------------
  953|      0|		    xmlChar *prefix = name;
  954|      0|		    int i;
  955|       |
  956|      0|		    NEXT;
  ------------------
  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  957|      0|		    if (IS_BLANK_CH(CUR)) {
  ------------------
  |  |  137|      0|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|      0|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   92|      0|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  958|      0|			ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL);
  959|      0|			ctxt->error = 1;
  960|      0|			goto error;
  961|      0|		    }
  962|       |		    /*
  963|       |		    * This is a namespace match
  964|       |		    */
  965|      0|		    token = xmlPatScanName(ctxt);
  966|      0|		    if ((prefix[0] == 'x') &&
  ------------------
  |  Branch (966:11): [True: 0, False: 0]
  ------------------
  967|      0|			(prefix[1] == 'm') &&
  ------------------
  |  Branch (967:4): [True: 0, False: 0]
  ------------------
  968|      0|			(prefix[2] == 'l') &&
  ------------------
  |  Branch (968:4): [True: 0, False: 0]
  ------------------
  969|      0|			(prefix[3] == 0))
  ------------------
  |  Branch (969:4): [True: 0, False: 0]
  ------------------
  970|      0|		    {
  971|      0|			XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE)
  ------------------
  |  |   83|      0|    if ((c)->comp->dict) \
  |  |  ------------------
  |  |  |  Branch (83:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   84|      0|	r = (xmlChar *) xmlDictLookup((c)->comp->dict, BAD_CAST nsname, -1); \
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  |   85|      0|    else r = xmlStrdup(BAD_CAST nsname);
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  972|      0|		    } else {
  973|      0|			for (i = 0;i < ctxt->nb_namespaces;i++) {
  ------------------
  |  Branch (973:15): [True: 0, False: 0]
  ------------------
  974|      0|			    if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
  ------------------
  |  Branch (974:12): [True: 0, False: 0]
  ------------------
  975|      0|				XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
  ------------------
  |  |   83|      0|    if ((c)->comp->dict) \
  |  |  ------------------
  |  |  |  Branch (83:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   84|      0|	r = (xmlChar *) xmlDictLookup((c)->comp->dict, BAD_CAST nsname, -1); \
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  |   85|      0|    else r = xmlStrdup(BAD_CAST nsname);
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  976|      0|				break;
  977|      0|			    }
  978|      0|			}
  979|      0|			if (i >= ctxt->nb_namespaces) {
  ------------------
  |  Branch (979:8): [True: 0, False: 0]
  ------------------
  980|      0|			    ERROR5(NULL, NULL, NULL,
  981|      0|				"xmlCompileStepPattern : no namespace bound "
  982|      0|				"to prefix %s\n", prefix);
  983|      0|			    ctxt->error = 1;
  984|      0|			    goto error;
  985|      0|			}
  986|      0|		    }
  987|      0|		    XML_PAT_FREE_STRING(ctxt, prefix);
  ------------------
  |  |   87|      0|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  988|      0|		    name = NULL;
  989|      0|		    if (token == NULL) {
  ------------------
  |  Branch (989:11): [True: 0, False: 0]
  ------------------
  990|      0|			if (CUR == '*') {
  ------------------
  |  |  658|      0|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (990:8): [True: 0, False: 0]
  ------------------
  991|      0|			    NEXT;
  ------------------
  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  992|      0|			    PUSH(XML_OP_NS, URL, NULL);
  ------------------
  |  |  672|      0|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  993|      0|			} else {
  994|      0|			    ERROR(NULL, NULL, NULL,
  995|      0|				"xmlCompileStepPattern : Name expected\n");
  996|      0|			    ctxt->error = 1;
  997|      0|			    goto error;
  998|      0|			}
  999|      0|		    } else {
 1000|      0|			PUSH(XML_OP_ELEM, token, URL);
  ------------------
  |  |  672|      0|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1001|      0|		    }
 1002|      0|		} else
 1003|      0|		    PUSH(XML_OP_ELEM, name, NULL);
  ------------------
  |  |  672|      0|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1004|      0|		return;
 1005|      1|	    } else if (xmlStrEqual(name, (const xmlChar *) "attribute")) {
  ------------------
  |  Branch (1005:17): [True: 1, False: 0]
  ------------------
 1006|      1|		XML_PAT_FREE_STRING(ctxt, name)
  ------------------
  |  |   87|      1|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1007|      1|		name = NULL;
 1008|      1|		if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) {
  ------------------
  |  |   78|      1|#define XML_STREAM_XS_IDC_SEL(c) ((c)->flags & XML_PATTERN_XSSEL)
  |  |  ------------------
  |  |  |  Branch (78:34): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 1009|      0|		    ERROR5(NULL, NULL, NULL,
 1010|      0|			"Unexpected attribute axis in '%s'.\n", ctxt->base);
 1011|      0|		    ctxt->error = 1;
 1012|      0|		    goto error;
 1013|      0|		}
 1014|      1|		xmlCompileAttributeTest(ctxt);
 1015|      1|		if (ctxt->error != 0)
  ------------------
  |  Branch (1015:7): [True: 0, False: 1]
  ------------------
 1016|      0|		    goto error;
 1017|      1|		return;
 1018|      1|	    } else {
 1019|      0|		ERROR5(NULL, NULL, NULL,
 1020|      0|		    "The 'element' or 'attribute' axis is expected.\n", NULL);
 1021|      0|		ctxt->error = 1;
 1022|      0|		goto error;
 1023|      0|	    }
 1024|      1|	}
 1025|  6.63M|    } else if (CUR == '*') {
  ------------------
  |  |  658|  6.63M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1025:16): [True: 0, False: 6.63M]
  ------------------
 1026|      0|        if (name != NULL) {
  ------------------
  |  Branch (1026:13): [True: 0, False: 0]
  ------------------
 1027|      0|	    ctxt->error = 1;
 1028|      0|	    goto error;
 1029|      0|	}
 1030|      0|	NEXT;
  ------------------
  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1031|      0|	PUSH(XML_OP_ALL, token, NULL);
  ------------------
  |  |  672|      0|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1032|  6.63M|    } else {
 1033|  6.63M|	PUSH(XML_OP_ELEM, name, NULL);
  ------------------
  |  |  672|  6.63M|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 6.63M]
  |  |  ------------------
  ------------------
 1034|  6.63M|    }
 1035|  6.63M|    return;
 1036|  6.63M|error:
 1037|      2|    if (URL != NULL)
  ------------------
  |  Branch (1037:9): [True: 1, False: 1]
  ------------------
 1038|      1|	XML_PAT_FREE_STRING(ctxt, URL)
  ------------------
  |  |   87|      1|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1039|      2|    if (token != NULL)
  ------------------
  |  Branch (1039:9): [True: 0, False: 2]
  ------------------
 1040|      0|	XML_PAT_FREE_STRING(ctxt, token)
  ------------------
  |  |   87|      0|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1041|      2|    if (name != NULL)
  ------------------
  |  Branch (1041:9): [True: 0, False: 2]
  ------------------
 1042|       |	XML_PAT_FREE_STRING(ctxt, name)
  ------------------
  |  |   87|      0|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1043|      2|}
pattern.c:xmlCompileAttributeTest:
  739|  14.5k|xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) {
  740|  14.5k|    xmlChar *token = NULL;
  741|  14.5k|    xmlChar *name = NULL;
  742|  14.5k|    xmlChar *URL = NULL;
  743|       |
  744|  14.5k|    SKIP_BLANKS;
  ------------------
  |  |  665|  14.5k|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  14.5k|    name = xmlPatScanNCName(ctxt);
  746|  14.5k|    if (ctxt->error < 0)
  ------------------
  |  Branch (746:9): [True: 0, False: 14.5k]
  ------------------
  747|      0|        return;
  748|  14.5k|    if (name == NULL) {
  ------------------
  |  Branch (748:9): [True: 57, False: 14.5k]
  ------------------
  749|     57|	if (CUR == '*') {
  ------------------
  |  |  658|     57|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (749:6): [True: 57, False: 0]
  ------------------
  750|     57|	    PUSH(XML_OP_ATTR, NULL, NULL);
  ------------------
  |  |  672|     57|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 57]
  |  |  ------------------
  ------------------
  751|     57|	    NEXT;
  ------------------
  |  |  668|     57|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 57, False: 0]
  |  |  ------------------
  ------------------
  752|     57|	} else {
  753|      0|	    ERROR(NULL, NULL, NULL,
  754|      0|		"xmlCompileAttributeTest : Name expected\n");
  755|      0|	    ctxt->error = 1;
  756|      0|	}
  757|     57|	return;
  758|     57|    }
  759|  14.5k|    if (CUR == ':') {
  ------------------
  |  |  658|  14.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (759:9): [True: 2.69k, False: 11.8k]
  ------------------
  760|  2.69k|	int i;
  761|  2.69k|	xmlChar *prefix = name;
  762|       |
  763|  2.69k|	NEXT;
  ------------------
  |  |  668|  2.69k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 2.69k, False: 0]
  |  |  ------------------
  ------------------
  764|       |
  765|  2.69k|	if (IS_BLANK_CH(CUR)) {
  ------------------
  |  |  137|  2.69k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.69k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 0, False: 2.69k]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.69k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.69k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 0, False: 2.69k]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.69k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 2.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|      0|	    ERROR5(NULL, NULL, NULL, "Invalid QName.\n", NULL);
  767|      0|	    ctxt->error = 1;
  768|      0|	    goto error;
  769|      0|	}
  770|       |	/*
  771|       |	* This is a namespace match
  772|       |	*/
  773|  2.69k|	token = xmlPatScanName(ctxt);
  774|  2.69k|	if ((prefix[0] == 'x') &&
  ------------------
  |  Branch (774:6): [True: 2.69k, False: 0]
  ------------------
  775|  2.69k|	    (prefix[1] == 'm') &&
  ------------------
  |  Branch (775:6): [True: 2.69k, False: 0]
  ------------------
  776|  2.69k|	    (prefix[2] == 'l') &&
  ------------------
  |  Branch (776:6): [True: 2.69k, False: 0]
  ------------------
  777|  2.69k|	    (prefix[3] == 0))
  ------------------
  |  Branch (777:6): [True: 2.69k, False: 0]
  ------------------
  778|  2.69k|	{
  779|  2.69k|	    XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE);
  ------------------
  |  |   83|  2.69k|    if ((c)->comp->dict) \
  |  |  ------------------
  |  |  |  Branch (83:9): [True: 0, False: 2.69k]
  |  |  ------------------
  |  |   84|  2.69k|	r = (xmlChar *) xmlDictLookup((c)->comp->dict, BAD_CAST nsname, -1); \
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  |   85|  2.69k|    else r = xmlStrdup(BAD_CAST nsname);
  |  |  ------------------
  |  |  |  |   34|  2.69k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  780|  2.69k|	} else {
  781|      0|	    for (i = 0;i < ctxt->nb_namespaces;i++) {
  ------------------
  |  Branch (781:17): [True: 0, False: 0]
  ------------------
  782|      0|		if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
  ------------------
  |  Branch (782:7): [True: 0, False: 0]
  ------------------
  783|      0|		    XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
  ------------------
  |  |   83|      0|    if ((c)->comp->dict) \
  |  |  ------------------
  |  |  |  Branch (83:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   84|      0|	r = (xmlChar *) xmlDictLookup((c)->comp->dict, BAD_CAST nsname, -1); \
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  |   85|      0|    else r = xmlStrdup(BAD_CAST nsname);
  |  |  ------------------
  |  |  |  |   34|      0|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  784|      0|		    break;
  785|      0|		}
  786|      0|	    }
  787|      0|	    if (i >= ctxt->nb_namespaces) {
  ------------------
  |  Branch (787:10): [True: 0, False: 0]
  ------------------
  788|      0|		ERROR5(NULL, NULL, NULL,
  789|      0|		    "xmlCompileAttributeTest : no namespace bound to prefix %s\n",
  790|      0|		    prefix);
  791|      0|		ctxt->error = 1;
  792|      0|		goto error;
  793|      0|	    }
  794|      0|	}
  795|  2.69k|        XML_PAT_FREE_STRING(ctxt, name);
  ------------------
  |  |   87|  2.69k|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 2.69k, False: 0]
  |  |  ------------------
  ------------------
  796|  2.69k|        name = NULL;
  797|  2.69k|	if (token == NULL) {
  ------------------
  |  Branch (797:6): [True: 1.00k, False: 1.68k]
  ------------------
  798|  1.00k|	    if (CUR == '*') {
  ------------------
  |  |  658|  1.00k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (798:10): [True: 1.00k, False: 1]
  ------------------
  799|  1.00k|		NEXT;
  ------------------
  |  |  668|  1.00k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 1.00k, False: 0]
  |  |  ------------------
  ------------------
  800|  1.00k|		PUSH(XML_OP_ATTR, NULL, URL);
  ------------------
  |  |  672|  1.00k|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 1.00k]
  |  |  ------------------
  ------------------
  801|  1.00k|	    } else {
  802|      1|		ERROR(NULL, NULL, NULL,
  803|      1|		    "xmlCompileAttributeTest : Name expected\n");
  804|      1|		ctxt->error = 1;
  805|      1|		goto error;
  806|      1|	    }
  807|  1.68k|	} else {
  808|  1.68k|	    PUSH(XML_OP_ATTR, token, URL);
  ------------------
  |  |  672|  1.68k|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 1.68k]
  |  |  ------------------
  ------------------
  809|  1.68k|	}
  810|  11.8k|    } else {
  811|  11.8k|	PUSH(XML_OP_ATTR, name, NULL);
  ------------------
  |  |  672|  11.8k|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 11.8k]
  |  |  ------------------
  ------------------
  812|  11.8k|    }
  813|  14.4k|    return;
  814|  14.4k|error:
  815|      1|    if (name != NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 1]
  ------------------
  816|      0|	XML_PAT_FREE_STRING(ctxt, name);
  ------------------
  |  |   87|      0|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  817|      1|    if (URL != NULL)
  ------------------
  |  Branch (817:9): [True: 1, False: 0]
  ------------------
  818|      1|	XML_PAT_FREE_STRING(ctxt, URL)
  ------------------
  |  |   87|      1|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  819|      1|    if (token != NULL)
  ------------------
  |  Branch (819:9): [True: 0, False: 1]
  ------------------
  820|       |	XML_PAT_FREE_STRING(ctxt, token);
  ------------------
  |  |   87|      0|#define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
  |  |  ------------------
  |  |  |  Branch (87:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  821|      1|}
pattern.c:xmlPatScanNCName:
  713|  8.39M|xmlPatScanNCName(xmlPatParserContextPtr ctxt) {
  714|  8.39M|    const xmlChar *q, *cur;
  715|  8.39M|    xmlChar *ret = NULL;
  716|       |
  717|  8.39M|    SKIP_BLANKS;
  ------------------
  |  |  665|  8.39M|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|       |
  719|  8.39M|    q = CUR_PTR;
  ------------------
  |  |  662|  8.39M|#define CUR_PTR ctxt->cur
  ------------------
  720|  8.39M|    cur = xmlScanName(q, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|  8.39M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  cur = xmlScanName(q, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|  8.39M|#define XML_SCAN_NC         1
  ------------------
  721|  8.39M|    if ((cur == NULL) || (cur == q))
  ------------------
  |  Branch (721:9): [True: 2, False: 8.39M]
  |  Branch (721:26): [True: 1.74M, False: 6.64M]
  ------------------
  722|  1.74M|        return(NULL);
  723|  6.64M|    if (ctxt->dict)
  ------------------
  |  Branch (723:9): [True: 0, False: 6.64M]
  ------------------
  724|      0|	ret = (xmlChar *) xmlDictLookup(ctxt->dict, q, cur - q);
  725|  6.64M|    else
  726|  6.64M|	ret = xmlStrndup(q, cur - q);
  727|  6.64M|    if (ret == NULL)
  ------------------
  |  Branch (727:9): [True: 0, False: 6.64M]
  ------------------
  728|      0|        ctxt->error = -1;
  729|  6.64M|    CUR_PTR = cur;
  ------------------
  |  |  662|  6.64M|#define CUR_PTR ctxt->cur
  ------------------
  730|  6.64M|    return(ret);
  731|  8.39M|}
pattern.c:xmlPatScanName:
  687|  4.29k|xmlPatScanName(xmlPatParserContextPtr ctxt) {
  688|  4.29k|    const xmlChar *q, *cur;
  689|  4.29k|    xmlChar *ret = NULL;
  690|       |
  691|  4.29k|    SKIP_BLANKS;
  ------------------
  |  |  665|  4.29k|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|       |
  693|  4.29k|    q = CUR_PTR;
  ------------------
  |  |  662|  4.29k|#define CUR_PTR ctxt->cur
  ------------------
  694|  4.29k|    cur = xmlScanName(q, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  4.29k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
  695|  4.29k|    if ((cur == NULL) || (cur == q))
  ------------------
  |  Branch (695:9): [True: 2, False: 4.29k]
  |  Branch (695:26): [True: 2.61k, False: 1.68k]
  ------------------
  696|  2.61k|        return(NULL);
  697|  1.68k|    if (ctxt->dict)
  ------------------
  |  Branch (697:9): [True: 0, False: 1.68k]
  ------------------
  698|      0|	ret = (xmlChar *) xmlDictLookup(ctxt->dict, q, cur - q);
  699|  1.68k|    else
  700|  1.68k|	ret = xmlStrndup(q, cur - q);
  701|  1.68k|    CUR_PTR = cur;
  ------------------
  |  |  662|  1.68k|#define CUR_PTR ctxt->cur
  ------------------
  702|  1.68k|    return(ret);
  703|  4.29k|}
pattern.c:xmlCompilePathPattern:
 1054|    577|xmlCompilePathPattern(xmlPatParserContextPtr ctxt) {
 1055|    577|    SKIP_BLANKS;
  ------------------
  |  |  665|    577|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|     51|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 51, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1056|    577|    if (CUR == '/') {
  ------------------
  |  |  658|    577|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1056:9): [True: 302, False: 275]
  ------------------
 1057|    302|        ctxt->comp->flags |= PAT_FROM_ROOT;
  ------------------
  |  |  161|    302|#define PAT_FROM_ROOT	(1<<8)
  ------------------
 1058|    302|    } else if ((CUR == '.') || (ctxt->comp->flags & XML_PATTERN_NOTPATTERN)) {
  ------------------
  |  |  658|    275|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '.') || (ctxt->comp->flags & XML_PATTERN_NOTPATTERN)) {
  ------------------
  |  |   71|    240|#define XML_PATTERN_NOTPATTERN  (XML_PATTERN_XPATH | \
  |  |   72|    240|				 XML_PATTERN_XSSEL | \
  |  |   73|    240|				 XML_PATTERN_XSFIELD)
  ------------------
  |  Branch (1058:16): [True: 35, False: 240]
  |  Branch (1058:32): [True: 0, False: 240]
  ------------------
 1059|     35|        ctxt->comp->flags |= PAT_FROM_CUR;
  ------------------
  |  |  162|     35|#define PAT_FROM_CUR	(1<<9)
  ------------------
 1060|     35|    }
 1061|       |
 1062|    577|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  |  658|    577|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  |  660|    302|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (1062:9): [True: 302, False: 275]
  |  Branch (1062:25): [True: 42, False: 260]
  ------------------
 1063|     42|	PUSH(XML_OP_ANCESTOR, NULL, NULL);
  ------------------
  |  |  672|     42|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 42]
  |  |  ------------------
  ------------------
 1064|     42|	NEXT;
  ------------------
  |  |  668|     42|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 42, False: 0]
  |  |  ------------------
  ------------------
 1065|     42|	NEXT;
  ------------------
  |  |  668|     42|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 42, False: 0]
  |  |  ------------------
  ------------------
 1066|    535|    } else if ((CUR == '.') && (NXT(1) == '/') && (NXT(2) == '/')) {
  ------------------
  |  |  658|    535|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '.') && (NXT(1) == '/') && (NXT(2) == '/')) {
  ------------------
  |  |  660|     35|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  } else if ((CUR == '.') && (NXT(1) == '/') && (NXT(2) == '/')) {
  ------------------
  |  |  660|     35|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (1066:16): [True: 35, False: 500]
  |  Branch (1066:32): [True: 35, False: 0]
  |  Branch (1066:51): [True: 34, False: 1]
  ------------------
 1067|     34|	PUSH(XML_OP_ANCESTOR, NULL, NULL);
  ------------------
  |  |  672|     34|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 34]
  |  |  ------------------
  ------------------
 1068|     34|	NEXT;
  ------------------
  |  |  668|     34|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 34, False: 0]
  |  |  ------------------
  ------------------
 1069|     34|	NEXT;
  ------------------
  |  |  668|     34|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 34, False: 0]
  |  |  ------------------
  ------------------
 1070|     34|	NEXT;
  ------------------
  |  |  668|     34|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 34, False: 0]
  |  |  ------------------
  ------------------
 1071|       |	/* Check for incompleteness. */
 1072|     34|	SKIP_BLANKS;
  ------------------
  |  |  665|     34|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|     34|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1073|     34|	if (CUR == 0) {
  ------------------
  |  |  658|     34|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1073:6): [True: 0, False: 34]
  ------------------
 1074|      0|	    ERROR5(NULL, NULL, NULL,
 1075|      0|	       "Incomplete expression '%s'.\n", ctxt->base);
 1076|      0|	    ctxt->error = 1;
 1077|      0|	    goto error;
 1078|      0|	}
 1079|     34|    }
 1080|    577|    if (CUR == '@') {
  ------------------
  |  |  658|    577|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1080:9): [True: 0, False: 577]
  ------------------
 1081|      0|	NEXT;
  ------------------
  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1082|      0|	xmlCompileAttributeTest(ctxt);
 1083|      0|        if (ctxt->error != 0)
  ------------------
  |  Branch (1083:13): [True: 0, False: 0]
  ------------------
 1084|      0|            goto error;
 1085|      0|	SKIP_BLANKS;
  ------------------
  |  |  665|      0|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1086|       |	/* TODO: check for incompleteness */
 1087|      0|	if (CUR != 0) {
  ------------------
  |  |  658|      0|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1087:6): [True: 0, False: 0]
  ------------------
 1088|      0|	    xmlCompileStepPattern(ctxt);
 1089|      0|	    if (ctxt->error != 0)
  ------------------
  |  Branch (1089:10): [True: 0, False: 0]
  ------------------
 1090|      0|		goto error;
 1091|      0|	}
 1092|    577|    } else {
 1093|    577|        if (CUR == '/') {
  ------------------
  |  |  658|    577|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1093:13): [True: 277, False: 300]
  ------------------
 1094|    277|	    PUSH(XML_OP_ROOT, NULL, NULL);
  ------------------
  |  |  672|    277|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 277]
  |  |  ------------------
  ------------------
 1095|    277|	    NEXT;
  ------------------
  |  |  668|    277|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 277, False: 0]
  |  |  ------------------
  ------------------
 1096|       |	    /* Check for incompleteness. */
 1097|    277|	    SKIP_BLANKS;
  ------------------
  |  |  665|    277|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|    292|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1098|    277|	    if (CUR == 0) {
  ------------------
  |  |  658|    277|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1098:10): [True: 0, False: 277]
  ------------------
 1099|      0|		ERROR5(NULL, NULL, NULL,
 1100|      0|		    "Incomplete expression '%s'.\n", ctxt->base);
 1101|      0|		ctxt->error = 1;
 1102|      0|		goto error;
 1103|      0|	    }
 1104|    277|	}
 1105|    577|	xmlCompileStepPattern(ctxt);
 1106|    577|	if (ctxt->error != 0)
  ------------------
  |  Branch (1106:6): [True: 4, False: 573]
  ------------------
 1107|      4|	    goto error;
 1108|    573|	SKIP_BLANKS;
  ------------------
  |  |  665|    573|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|    577|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1109|  11.0M|	while (CUR == '/') {
  ------------------
  |  |  658|  11.0M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1109:9): [True: 11.0M, False: 564]
  ------------------
 1110|  11.0M|	    if (NXT(1) == '/') {
  ------------------
  |  |  660|  11.0M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (1110:10): [True: 595k, False: 10.4M]
  ------------------
 1111|   595k|	        PUSH(XML_OP_ANCESTOR, NULL, NULL);
  ------------------
  |  |  672|   595k|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 595k]
  |  |  ------------------
  ------------------
 1112|   595k|		NEXT;
  ------------------
  |  |  668|   595k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 595k, False: 0]
  |  |  ------------------
  ------------------
 1113|   595k|		NEXT;
  ------------------
  |  |  668|   595k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 595k, False: 0]
  |  |  ------------------
  ------------------
 1114|   595k|		SKIP_BLANKS;
  ------------------
  |  |  665|   595k|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|   595k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1115|   595k|		xmlCompileStepPattern(ctxt);
 1116|   595k|		if (ctxt->error != 0)
  ------------------
  |  Branch (1116:7): [True: 1, False: 595k]
  ------------------
 1117|      1|		    goto error;
 1118|  10.4M|	    } else {
 1119|  10.4M|	        PUSH(XML_OP_PARENT, NULL, NULL);
  ------------------
  |  |  672|  10.4M|    if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
  |  |  ------------------
  |  |  |  Branch (672:9): [True: 0, False: 10.4M]
  |  |  ------------------
  ------------------
 1120|  10.4M|		NEXT;
  ------------------
  |  |  668|  10.4M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (668:15): [True: 10.4M, False: 0]
  |  |  ------------------
  ------------------
 1121|  10.4M|		SKIP_BLANKS;
  ------------------
  |  |  665|  10.4M|    while (IS_BLANK_CH(CUR)) NEXT
  |  |  ------------------
  |  |  |  |  668|  10.4M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (668:15): [True: 19.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1122|  10.4M|		if (CUR == 0) {
  ------------------
  |  |  658|  10.4M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1122:7): [True: 0, False: 10.4M]
  ------------------
 1123|      0|		    ERROR5(NULL, NULL, NULL,
 1124|      0|		    "Incomplete expression '%s'.\n", ctxt->base);
 1125|      0|		    ctxt->error = 1;
 1126|      0|		    goto error;
 1127|      0|		}
 1128|  10.4M|		xmlCompileStepPattern(ctxt);
 1129|  10.4M|		if (ctxt->error != 0)
  ------------------
  |  Branch (1129:7): [True: 8, False: 10.4M]
  ------------------
 1130|      8|		    goto error;
 1131|  10.4M|	    }
 1132|  11.0M|	}
 1133|    573|    }
 1134|    564|    if (CUR != 0) {
  ------------------
  |  |  658|    564|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (1134:9): [True: 28, False: 536]
  ------------------
 1135|     28|	ERROR5(NULL, NULL, NULL,
 1136|     28|	       "Failed to compile pattern %s\n", ctxt->base);
 1137|     28|	ctxt->error = 1;
 1138|     28|    }
 1139|    577|error:
 1140|    577|    return;
 1141|    564|}
pattern.c:xmlFreePatParserContext:
  318|    577|xmlFreePatParserContext(xmlPatParserContextPtr ctxt) {
  319|    577|    if (ctxt == NULL)
  ------------------
  |  Branch (319:9): [True: 0, False: 577]
  ------------------
  320|      0|	return;
  321|    577|    memset(ctxt, -1, sizeof(xmlPatParserContext));
  322|    577|    xmlFree(ctxt);
  323|    577|}
pattern.c:xmlStreamCompile:
 1346|    530|xmlStreamCompile(xmlPatternPtr comp) {
 1347|    530|    xmlStreamCompPtr stream;
 1348|    530|    int i, s = 0, root = 0, flags = 0, prevs = -1;
 1349|    530|    xmlStepOp step;
 1350|       |
 1351|    530|    if ((comp == NULL) || (comp->steps == NULL))
  ------------------
  |  Branch (1351:9): [True: 0, False: 530]
  |  Branch (1351:27): [True: 0, False: 530]
  ------------------
 1352|      0|        return(-1);
 1353|       |    /*
 1354|       |     * special case for .
 1355|       |     */
 1356|    530|    if ((comp->nbStep == 1) &&
  ------------------
  |  Branch (1356:9): [True: 27, False: 503]
  ------------------
 1357|     27|        (comp->steps[0].op == XML_OP_ELEM) &&
  ------------------
  |  Branch (1357:9): [True: 17, False: 10]
  ------------------
 1358|     17|	(comp->steps[0].value == NULL) &&
  ------------------
  |  Branch (1358:2): [True: 0, False: 17]
  ------------------
 1359|      0|	(comp->steps[0].value2 == NULL)) {
  ------------------
  |  Branch (1359:2): [True: 0, False: 0]
  ------------------
 1360|      0|	stream = xmlNewStreamComp(0);
 1361|      0|	if (stream == NULL)
  ------------------
  |  Branch (1361:6): [True: 0, False: 0]
  ------------------
 1362|      0|	    return(-1);
 1363|       |	/* Note that the stream will have no steps in this case. */
 1364|      0|	stream->flags |= XML_STREAM_FINAL_IS_ANY_NODE;
  ------------------
  |  |   61|      0|#define XML_STREAM_FINAL_IS_ANY_NODE 1<<14
  ------------------
 1365|      0|	comp->stream = stream;
 1366|      0|	return(0);
 1367|      0|    }
 1368|       |
 1369|    530|    stream = xmlNewStreamComp((comp->nbStep / 2) + 1);
 1370|    530|    if (stream == NULL)
  ------------------
  |  Branch (1370:9): [True: 0, False: 530]
  ------------------
 1371|      0|        return(-1);
 1372|    530|    if (comp->dict != NULL) {
  ------------------
  |  Branch (1372:9): [True: 0, False: 530]
  ------------------
 1373|      0|        stream->dict = comp->dict;
 1374|      0|	xmlDictReference(stream->dict);
 1375|      0|    }
 1376|       |
 1377|    530|    i = 0;
 1378|    530|    if (comp->flags & PAT_FROM_ROOT)
  ------------------
  |  |  161|    530|#define PAT_FROM_ROOT	(1<<8)
  ------------------
  |  Branch (1378:9): [True: 293, False: 237]
  ------------------
 1379|    293|	stream->flags |= XML_STREAM_FROM_ROOT;
  ------------------
  |  |   62|    293|#define XML_STREAM_FROM_ROOT 1<<15
  ------------------
 1380|       |
 1381|  17.5M|    for (;i < comp->nbStep;i++) {
  ------------------
  |  Branch (1381:11): [True: 17.5M, False: 516]
  ------------------
 1382|  17.5M|	step = comp->steps[i];
 1383|  17.5M|        switch (step.op) {
  ------------------
  |  Branch (1383:17): [True: 17.5M, False: 0]
  ------------------
 1384|      0|	    case XML_OP_END:
  ------------------
  |  Branch (1384:6): [True: 0, False: 17.5M]
  ------------------
 1385|      0|	        break;
 1386|    271|	    case XML_OP_ROOT:
  ------------------
  |  Branch (1386:6): [True: 271, False: 17.5M]
  ------------------
 1387|    271|	        if (i != 0)
  ------------------
  |  Branch (1387:14): [True: 14, False: 257]
  ------------------
 1388|     14|		    goto error;
 1389|    257|		root = 1;
 1390|    257|		break;
 1391|  1.38k|	    case XML_OP_NS:
  ------------------
  |  Branch (1391:6): [True: 1.38k, False: 17.5M]
  ------------------
 1392|  1.38k|		s = xmlStreamCompAddStep(stream, NULL, step.value,
 1393|  1.38k|		    XML_ELEMENT_NODE, flags);
 1394|  1.38k|		if (s < 0)
  ------------------
  |  Branch (1394:7): [True: 0, False: 1.38k]
  ------------------
 1395|      0|		    goto error;
 1396|  1.38k|		prevs = s;
 1397|  1.38k|		flags = 0;
 1398|  1.38k|		break;
 1399|  9.34k|	    case XML_OP_ATTR:
  ------------------
  |  Branch (1399:6): [True: 9.34k, False: 17.5M]
  ------------------
 1400|  9.34k|		flags |= XML_STREAM_STEP_ATTR;
  ------------------
  |  |   51|  9.34k|#define XML_STREAM_STEP_ATTR	8
  ------------------
 1401|  9.34k|		prevs = -1;
 1402|  9.34k|		s = xmlStreamCompAddStep(stream,
 1403|  9.34k|		    step.value, step.value2, XML_ATTRIBUTE_NODE, flags);
 1404|  9.34k|		flags = 0;
 1405|  9.34k|		if (s < 0)
  ------------------
  |  Branch (1405:7): [True: 0, False: 9.34k]
  ------------------
 1406|      0|		    goto error;
 1407|  9.34k|		break;
 1408|  7.36M|	    case XML_OP_ELEM:
  ------------------
  |  Branch (1408:6): [True: 7.36M, False: 10.1M]
  ------------------
 1409|  7.36M|	        if ((step.value == NULL) && (step.value2 == NULL)) {
  ------------------
  |  Branch (1409:14): [True: 2.05M, False: 5.30M]
  |  Branch (1409:38): [True: 2.05M, False: 0]
  ------------------
 1410|       |		    /*
 1411|       |		    * We have a "." or "self::node()" here.
 1412|       |		    * Eliminate redundant self::node() tests like in "/./."
 1413|       |		    * or "//./"
 1414|       |		    * The only case we won't eliminate is "//.", i.e. if
 1415|       |		    * self::node() is the last node test and we had
 1416|       |		    * continuation somewhere beforehand.
 1417|       |		    */
 1418|  2.05M|		    if ((comp->nbStep == i + 1) &&
  ------------------
  |  Branch (1418:11): [True: 163, False: 2.05M]
  ------------------
 1419|    163|			(flags & XML_STREAM_STEP_DESC)) {
  ------------------
  |  |   48|    163|#define XML_STREAM_STEP_DESC	1
  ------------------
  |  Branch (1419:4): [True: 102, False: 61]
  ------------------
 1420|       |			/*
 1421|       |			* Mark the special case where the expression resolves
 1422|       |			* to any type of node.
 1423|       |			*/
 1424|    102|			if (comp->nbStep == i + 1) {
  ------------------
  |  Branch (1424:8): [True: 102, False: 0]
  ------------------
 1425|    102|			    stream->flags |= XML_STREAM_FINAL_IS_ANY_NODE;
  ------------------
  |  |   61|    102|#define XML_STREAM_FINAL_IS_ANY_NODE 1<<14
  ------------------
 1426|    102|			}
 1427|    102|			flags |= XML_STREAM_STEP_NODE;
  ------------------
  |  |   52|    102|#define XML_STREAM_STEP_NODE	16
  ------------------
 1428|    102|			s = xmlStreamCompAddStep(stream, NULL, NULL,
 1429|    102|			    XML_STREAM_ANY_NODE, flags);
  ------------------
  |  |   69|    102|#define XML_STREAM_ANY_NODE 100
  ------------------
 1430|    102|			if (s < 0)
  ------------------
  |  Branch (1430:8): [True: 0, False: 102]
  ------------------
 1431|      0|			    goto error;
 1432|    102|			flags = 0;
 1433|       |			/*
 1434|       |			* If there was a previous step, mark it to be added to
 1435|       |			* the result node-set; this is needed since only
 1436|       |			* the last step will be marked as "final" and only
 1437|       |			* "final" nodes are added to the resulting set.
 1438|       |			*/
 1439|    102|			if (prevs != -1) {
  ------------------
  |  Branch (1439:8): [True: 88, False: 14]
  ------------------
 1440|     88|			    stream->steps[prevs].flags |= XML_STREAM_STEP_IN_SET;
  ------------------
  |  |   53|     88|#define XML_STREAM_STEP_IN_SET	32
  ------------------
 1441|     88|			    prevs = -1;
 1442|     88|			}
 1443|    102|			break;
 1444|       |
 1445|  2.05M|		    } else {
 1446|       |			/* Just skip this one. */
 1447|  2.05M|			continue;
 1448|  2.05M|		    }
 1449|  2.05M|		}
 1450|       |		/* An element node. */
 1451|  5.30M|	        s = xmlStreamCompAddStep(stream, step.value, step.value2,
 1452|  5.30M|		    XML_ELEMENT_NODE, flags);
 1453|  5.30M|		if (s < 0)
  ------------------
  |  Branch (1453:7): [True: 0, False: 5.30M]
  ------------------
 1454|      0|		    goto error;
 1455|  5.30M|		prevs = s;
 1456|  5.30M|		flags = 0;
 1457|  5.30M|		break;
 1458|      0|	    case XML_OP_CHILD:
  ------------------
  |  Branch (1458:6): [True: 0, False: 17.5M]
  ------------------
 1459|       |		/* An element node child. */
 1460|      0|	        s = xmlStreamCompAddStep(stream, step.value, step.value2,
 1461|      0|		    XML_ELEMENT_NODE, flags);
 1462|      0|		if (s < 0)
  ------------------
  |  Branch (1462:7): [True: 0, False: 0]
  ------------------
 1463|      0|		    goto error;
 1464|      0|		prevs = s;
 1465|      0|		flags = 0;
 1466|      0|		break;
 1467|  1.37M|	    case XML_OP_ALL:
  ------------------
  |  Branch (1467:6): [True: 1.37M, False: 16.1M]
  ------------------
 1468|  1.37M|	        s = xmlStreamCompAddStep(stream, NULL, NULL,
 1469|  1.37M|		    XML_ELEMENT_NODE, flags);
 1470|  1.37M|		if (s < 0)
  ------------------
  |  Branch (1470:7): [True: 0, False: 1.37M]
  ------------------
 1471|      0|		    goto error;
 1472|  1.37M|		prevs = s;
 1473|  1.37M|		flags = 0;
 1474|  1.37M|		break;
 1475|  8.29M|	    case XML_OP_PARENT:
  ------------------
  |  Branch (1475:6): [True: 8.29M, False: 9.21M]
  ------------------
 1476|  8.29M|	        break;
 1477|   456k|	    case XML_OP_ANCESTOR:
  ------------------
  |  Branch (1477:6): [True: 456k, False: 17.0M]
  ------------------
 1478|       |		/* Skip redundant continuations. */
 1479|   456k|		if (flags & XML_STREAM_STEP_DESC)
  ------------------
  |  |   48|   456k|#define XML_STREAM_STEP_DESC	1
  ------------------
  |  Branch (1479:7): [True: 44, False: 455k]
  ------------------
 1480|     44|		    break;
 1481|   455k|	        flags |= XML_STREAM_STEP_DESC;
  ------------------
  |  |   48|   455k|#define XML_STREAM_STEP_DESC	1
  ------------------
 1482|       |		/*
 1483|       |		* Mark the expression as having "//".
 1484|       |		*/
 1485|   455k|		if ((stream->flags & XML_STREAM_DESC) == 0)
  ------------------
  |  |   63|   455k|#define XML_STREAM_DESC 1<<16
  ------------------
  |  Branch (1485:7): [True: 251, False: 455k]
  ------------------
 1486|    251|		    stream->flags |= XML_STREAM_DESC;
  ------------------
  |  |   63|    251|#define XML_STREAM_DESC 1<<16
  ------------------
 1487|   455k|		break;
 1488|  17.5M|	}
 1489|  17.5M|    }
 1490|    516|    if ((! root) && (comp->flags & XML_PATTERN_NOTPATTERN) == 0) {
  ------------------
  |  |   71|    259|#define XML_PATTERN_NOTPATTERN  (XML_PATTERN_XPATH | \
  |  |   72|    259|				 XML_PATTERN_XSSEL | \
  |  |   73|    259|				 XML_PATTERN_XSFIELD)
  ------------------
  |  Branch (1490:9): [True: 259, False: 257]
  |  Branch (1490:21): [True: 259, False: 0]
  ------------------
 1491|       |	/*
 1492|       |	* If this should behave like a real pattern, we will mark
 1493|       |	* the first step as having "//", to be reentrant on every
 1494|       |	* tree level.
 1495|       |	*/
 1496|    259|	if ((stream->flags & XML_STREAM_DESC) == 0)
  ------------------
  |  |   63|    259|#define XML_STREAM_DESC 1<<16
  ------------------
  |  Branch (1496:6): [True: 99, False: 160]
  ------------------
 1497|     99|	    stream->flags |= XML_STREAM_DESC;
  ------------------
  |  |   63|     99|#define XML_STREAM_DESC 1<<16
  ------------------
 1498|       |
 1499|    259|	if (stream->nbStep > 0) {
  ------------------
  |  Branch (1499:6): [True: 259, False: 0]
  ------------------
 1500|    259|	    if ((stream->steps[0].flags & XML_STREAM_STEP_DESC) == 0)
  ------------------
  |  |   48|    259|#define XML_STREAM_STEP_DESC	1
  ------------------
  |  Branch (1500:10): [True: 209, False: 50]
  ------------------
 1501|    209|		stream->steps[0].flags |= XML_STREAM_STEP_DESC;
  ------------------
  |  |   48|    209|#define XML_STREAM_STEP_DESC	1
  ------------------
 1502|    259|	}
 1503|    259|    }
 1504|    516|    if (stream->nbStep <= s)
  ------------------
  |  Branch (1504:9): [True: 0, False: 516]
  ------------------
 1505|      0|	goto error;
 1506|    516|    stream->steps[s].flags |= XML_STREAM_STEP_FINAL;
  ------------------
  |  |   49|    516|#define XML_STREAM_STEP_FINAL	2
  ------------------
 1507|    516|    if (root)
  ------------------
  |  Branch (1507:9): [True: 257, False: 259]
  ------------------
 1508|    257|	stream->steps[0].flags |= XML_STREAM_STEP_ROOT;
  ------------------
  |  |   50|    257|#define XML_STREAM_STEP_ROOT	4
  ------------------
 1509|    516|    comp->stream = stream;
 1510|    516|    return(0);
 1511|     14|error:
 1512|     14|    xmlFreeStreamComp(stream);
 1513|     14|    return(0);
 1514|    516|}
pattern.c:xmlNewStreamComp:
 1255|    530|xmlNewStreamComp(int size) {
 1256|    530|    xmlStreamCompPtr cur;
 1257|       |
 1258|    530|    if (size < 4)
  ------------------
  |  Branch (1258:9): [True: 261, False: 269]
  ------------------
 1259|    261|        size  = 4;
 1260|       |
 1261|    530|    cur = (xmlStreamCompPtr) xmlMalloc(sizeof(xmlStreamComp));
 1262|    530|    if (cur == NULL) {
  ------------------
  |  Branch (1262:9): [True: 0, False: 530]
  ------------------
 1263|      0|	ERROR(NULL, NULL, NULL,
 1264|      0|		"xmlNewStreamComp: malloc failed\n");
 1265|      0|	return(NULL);
 1266|      0|    }
 1267|    530|    memset(cur, 0, sizeof(xmlStreamComp));
 1268|    530|    cur->steps = (xmlStreamStepPtr) xmlMalloc(size * sizeof(xmlStreamStep));
 1269|    530|    if (cur->steps == NULL) {
  ------------------
  |  Branch (1269:9): [True: 0, False: 530]
  ------------------
 1270|      0|	xmlFree(cur);
 1271|      0|	ERROR(NULL, NULL, NULL,
 1272|      0|	      "xmlNewStreamComp: malloc failed\n");
 1273|      0|	return(NULL);
 1274|      0|    }
 1275|    530|    cur->nbStep = 0;
 1276|    530|    cur->maxStep = size;
 1277|    530|    return(cur);
 1278|    530|}
pattern.c:xmlStreamCompAddStep:
 1308|  6.69M|                     const xmlChar *ns, int nodeType, int flags) {
 1309|  6.69M|    xmlStreamStepPtr cur;
 1310|       |
 1311|  6.69M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1311:9): [True: 0, False: 6.69M]
  ------------------
 1312|      0|        xmlStreamStepPtr tmp;
 1313|      0|        int newSize;
 1314|       |
 1315|      0|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(tmp[0]),
 1316|      0|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1317|      0|        if (newSize < 0) {
  ------------------
  |  Branch (1317:13): [True: 0, False: 0]
  ------------------
 1318|      0|	    ERROR(NULL, NULL, NULL,
 1319|      0|		  "xmlNewStreamComp: growCapacity failed\n");
 1320|      0|	    return(-1);
 1321|      0|        }
 1322|      0|	cur = xmlRealloc(comp->steps, newSize * sizeof(tmp[0]));
 1323|      0|	if (cur == NULL) {
  ------------------
  |  Branch (1323:6): [True: 0, False: 0]
  ------------------
 1324|      0|	    ERROR(NULL, NULL, NULL,
 1325|      0|		  "xmlNewStreamComp: malloc failed\n");
 1326|      0|	    return(-1);
 1327|      0|	}
 1328|      0|	comp->steps = cur;
 1329|      0|        comp->maxStep = newSize;
 1330|      0|    }
 1331|  6.69M|    cur = &comp->steps[comp->nbStep++];
 1332|  6.69M|    cur->flags = flags;
 1333|  6.69M|    cur->name = name;
 1334|  6.69M|    cur->ns = ns;
 1335|  6.69M|    cur->nodeType = nodeType;
 1336|  6.69M|    return(comp->nbStep - 1);
 1337|  6.69M|}
pattern.c:xmlReversePattern:
  377|    536|xmlReversePattern(xmlPatternPtr comp) {
  378|    536|    int i, j;
  379|       |
  380|       |    /*
  381|       |     * remove the leading // for //a or .//a
  382|       |     */
  383|    536|    if ((comp->nbStep > 0) && (comp->steps[0].op == XML_OP_ANCESTOR)) {
  ------------------
  |  Branch (383:9): [True: 536, False: 0]
  |  Branch (383:31): [True: 70, False: 466]
  ------------------
  384|  5.60M|        for (i = 0, j = 1;j < comp->nbStep;i++,j++) {
  ------------------
  |  Branch (384:27): [True: 5.60M, False: 70]
  ------------------
  385|  5.60M|	    comp->steps[i].value = comp->steps[j].value;
  386|  5.60M|	    comp->steps[i].value2 = comp->steps[j].value2;
  387|  5.60M|	    comp->steps[i].op = comp->steps[j].op;
  388|  5.60M|	}
  389|     70|	comp->nbStep--;
  390|     70|    }
  391|       |
  392|       |    /*
  393|       |     * Grow to add OP_END later
  394|       |     */
  395|    536|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (395:9): [True: 231, False: 305]
  ------------------
  396|    231|        if (xmlPatternGrow(comp) < 0)
  ------------------
  |  Branch (396:13): [True: 0, False: 231]
  ------------------
  397|      0|            return(-1);
  398|    231|    }
  399|       |
  400|    536|    i = 0;
  401|    536|    j = comp->nbStep - 1;
  402|  8.75M|    while (j > i) {
  ------------------
  |  Branch (402:12): [True: 8.75M, False: 536]
  ------------------
  403|  8.75M|	register const xmlChar *tmp;
  404|  8.75M|	register xmlPatOp op;
  405|  8.75M|	tmp = comp->steps[i].value;
  406|  8.75M|	comp->steps[i].value = comp->steps[j].value;
  407|  8.75M|	comp->steps[j].value = tmp;
  408|  8.75M|	tmp = comp->steps[i].value2;
  409|  8.75M|	comp->steps[i].value2 = comp->steps[j].value2;
  410|  8.75M|	comp->steps[j].value2 = tmp;
  411|  8.75M|	op = comp->steps[i].op;
  412|  8.75M|	comp->steps[i].op = comp->steps[j].op;
  413|  8.75M|	comp->steps[j].op = op;
  414|  8.75M|	j--;
  415|  8.75M|	i++;
  416|  8.75M|    }
  417|       |
  418|    536|    comp->steps[comp->nbStep].value = NULL;
  419|       |    comp->steps[comp->nbStep].value2 = NULL;
  420|    536|    comp->steps[comp->nbStep++].op = XML_OP_END;
  421|    536|    return(0);
  422|    536|}
pattern.c:xmlFreeStreamComp:
 1286|    530|xmlFreeStreamComp(xmlStreamCompPtr comp) {
 1287|    530|    if (comp != NULL) {
  ------------------
  |  Branch (1287:9): [True: 530, False: 0]
  ------------------
 1288|    530|        if (comp->steps != NULL)
  ------------------
  |  Branch (1288:13): [True: 530, False: 0]
  ------------------
 1289|    530|	    xmlFree(comp->steps);
 1290|    530|	if (comp->dict != NULL)
  ------------------
  |  Branch (1290:6): [True: 0, False: 530]
  ------------------
 1291|      0|	    xmlDictFree(comp->dict);
 1292|    530|        xmlFree(comp);
 1293|    530|    }
 1294|    530|}
pattern.c:xmlPatMatch:
  459|     19|xmlPatMatch(xmlPatternPtr comp, xmlNodePtr node) {
  460|     19|    int i;
  461|     19|    xmlStepOpPtr step;
  462|     19|    xmlStepStates states = {0, 0, NULL}; /* // may require backtrack */
  463|       |
  464|     19|    if ((comp == NULL) || (node == NULL)) return(-1);
  ------------------
  |  Branch (464:9): [True: 0, False: 19]
  |  Branch (464:27): [True: 0, False: 19]
  ------------------
  465|     19|    i = 0;
  466|     19|restart:
  467|     32|    for (;i < comp->nbStep;i++) {
  ------------------
  |  Branch (467:11): [True: 32, False: 0]
  ------------------
  468|     32|	step = &comp->steps[i];
  469|     32|	switch (step->op) {
  ------------------
  |  Branch (469:10): [True: 32, False: 0]
  ------------------
  470|      5|            case XML_OP_END:
  ------------------
  |  Branch (470:13): [True: 5, False: 27]
  ------------------
  471|      5|		goto found;
  472|      5|            case XML_OP_ROOT:
  ------------------
  |  Branch (472:13): [True: 5, False: 27]
  ------------------
  473|      5|		if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (473:7): [True: 0, False: 5]
  ------------------
  474|      0|		    goto rollback;
  475|      5|		node = node->parent;
  476|      5|		if ((node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (476:7): [True: 5, False: 0]
  ------------------
  477|      0|		    (node->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (477:7): [True: 0, False: 0]
  ------------------
  478|      5|		    continue;
  479|      0|		goto rollback;
  480|      8|            case XML_OP_ELEM:
  ------------------
  |  Branch (480:13): [True: 8, False: 24]
  ------------------
  481|      8|		if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (481:7): [True: 0, False: 8]
  ------------------
  482|      0|		    goto rollback;
  483|      8|		if (step->value == NULL)
  ------------------
  |  Branch (483:7): [True: 3, False: 5]
  ------------------
  484|      3|		    continue;
  485|      5|		if (step->value[0] != node->name[0])
  ------------------
  |  Branch (485:7): [True: 5, False: 0]
  ------------------
  486|      5|		    goto rollback;
  487|      0|		if (!xmlStrEqual(step->value, node->name))
  ------------------
  |  Branch (487:7): [True: 0, False: 0]
  ------------------
  488|      0|		    goto rollback;
  489|       |
  490|       |		/* Namespace test */
  491|      0|		if (node->ns == NULL) {
  ------------------
  |  Branch (491:7): [True: 0, False: 0]
  ------------------
  492|      0|		    if (step->value2 != NULL)
  ------------------
  |  Branch (492:11): [True: 0, False: 0]
  ------------------
  493|      0|			goto rollback;
  494|      0|		} else if (node->ns->href != NULL) {
  ------------------
  |  Branch (494:14): [True: 0, False: 0]
  ------------------
  495|      0|		    if (step->value2 == NULL)
  ------------------
  |  Branch (495:11): [True: 0, False: 0]
  ------------------
  496|      0|			goto rollback;
  497|      0|		    if (!xmlStrEqual(step->value2, node->ns->href))
  ------------------
  |  Branch (497:11): [True: 0, False: 0]
  ------------------
  498|      0|			goto rollback;
  499|      0|		}
  500|      0|		continue;
  501|      0|            case XML_OP_CHILD: {
  ------------------
  |  Branch (501:13): [True: 0, False: 32]
  ------------------
  502|      0|		xmlNodePtr lst;
  503|       |
  504|      0|		if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (504:7): [True: 0, False: 0]
  ------------------
  505|      0|		    (node->type != XML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (505:7): [True: 0, False: 0]
  ------------------
  506|      0|		    (node->type != XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (506:7): [True: 0, False: 0]
  ------------------
  507|      0|		    goto rollback;
  508|       |
  509|      0|		lst = node->children;
  510|       |
  511|      0|		if (step->value != NULL) {
  ------------------
  |  Branch (511:7): [True: 0, False: 0]
  ------------------
  512|      0|		    while (lst != NULL) {
  ------------------
  |  Branch (512:14): [True: 0, False: 0]
  ------------------
  513|      0|			if ((lst->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (513:8): [True: 0, False: 0]
  ------------------
  514|      0|			    (step->value[0] == lst->name[0]) &&
  ------------------
  |  Branch (514:8): [True: 0, False: 0]
  ------------------
  515|      0|			    (xmlStrEqual(step->value, lst->name)))
  ------------------
  |  Branch (515:8): [True: 0, False: 0]
  ------------------
  516|      0|			    break;
  517|      0|			lst = lst->next;
  518|      0|		    }
  519|      0|		    if (lst != NULL)
  ------------------
  |  Branch (519:11): [True: 0, False: 0]
  ------------------
  520|      0|			continue;
  521|      0|		}
  522|      0|		goto rollback;
  523|      0|	    }
  524|      6|            case XML_OP_ATTR:
  ------------------
  |  Branch (524:13): [True: 6, False: 26]
  ------------------
  525|      6|		if (node->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (525:7): [True: 6, False: 0]
  ------------------
  526|      6|		    goto rollback;
  527|      0|		if (step->value != NULL) {
  ------------------
  |  Branch (527:7): [True: 0, False: 0]
  ------------------
  528|      0|		    if (step->value[0] != node->name[0])
  ------------------
  |  Branch (528:11): [True: 0, False: 0]
  ------------------
  529|      0|			goto rollback;
  530|      0|		    if (!xmlStrEqual(step->value, node->name))
  ------------------
  |  Branch (530:11): [True: 0, False: 0]
  ------------------
  531|      0|			goto rollback;
  532|      0|		}
  533|       |		/* Namespace test */
  534|      0|		if (node->ns == NULL) {
  ------------------
  |  Branch (534:7): [True: 0, False: 0]
  ------------------
  535|      0|		    if (step->value2 != NULL)
  ------------------
  |  Branch (535:11): [True: 0, False: 0]
  ------------------
  536|      0|			goto rollback;
  537|      0|		} else if (step->value2 != NULL) {
  ------------------
  |  Branch (537:14): [True: 0, False: 0]
  ------------------
  538|      0|		    if (!xmlStrEqual(step->value2, node->ns->href))
  ------------------
  |  Branch (538:11): [True: 0, False: 0]
  ------------------
  539|      0|			goto rollback;
  540|      0|		}
  541|      0|		continue;
  542|      0|            case XML_OP_PARENT:
  ------------------
  |  Branch (542:13): [True: 0, False: 32]
  ------------------
  543|      0|		if ((node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (543:7): [True: 0, False: 0]
  ------------------
  544|      0|		    (node->type == XML_HTML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (544:7): [True: 0, False: 0]
  ------------------
  545|      0|		    (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (545:7): [True: 0, False: 0]
  ------------------
  546|      0|		    goto rollback;
  547|      0|		node = node->parent;
  548|      0|		if (node == NULL)
  ------------------
  |  Branch (548:7): [True: 0, False: 0]
  ------------------
  549|      0|		    goto rollback;
  550|      0|		if (step->value == NULL)
  ------------------
  |  Branch (550:7): [True: 0, False: 0]
  ------------------
  551|      0|		    continue;
  552|      0|		if (step->value[0] != node->name[0])
  ------------------
  |  Branch (552:7): [True: 0, False: 0]
  ------------------
  553|      0|		    goto rollback;
  554|      0|		if (!xmlStrEqual(step->value, node->name))
  ------------------
  |  Branch (554:7): [True: 0, False: 0]
  ------------------
  555|      0|		    goto rollback;
  556|       |		/* Namespace test */
  557|      0|		if (node->ns == NULL) {
  ------------------
  |  Branch (557:7): [True: 0, False: 0]
  ------------------
  558|      0|		    if (step->value2 != NULL)
  ------------------
  |  Branch (558:11): [True: 0, False: 0]
  ------------------
  559|      0|			goto rollback;
  560|      0|		} else if (node->ns->href != NULL) {
  ------------------
  |  Branch (560:14): [True: 0, False: 0]
  ------------------
  561|      0|		    if (step->value2 == NULL)
  ------------------
  |  Branch (561:11): [True: 0, False: 0]
  ------------------
  562|      0|			goto rollback;
  563|      0|		    if (!xmlStrEqual(step->value2, node->ns->href))
  ------------------
  |  Branch (563:11): [True: 0, False: 0]
  ------------------
  564|      0|			goto rollback;
  565|      0|		}
  566|      0|		continue;
  567|      3|            case XML_OP_ANCESTOR:
  ------------------
  |  Branch (567:13): [True: 3, False: 29]
  ------------------
  568|       |		/* TODO: implement coalescing of ANCESTOR/NODE ops */
  569|      3|		if (step->value == NULL) {
  ------------------
  |  Branch (569:7): [True: 3, False: 0]
  ------------------
  570|      3|		    i++;
  571|      3|		    step = &comp->steps[i];
  572|      3|		    if (step->op == XML_OP_ROOT)
  ------------------
  |  Branch (572:11): [True: 0, False: 3]
  ------------------
  573|      0|			goto found;
  574|      3|		    if (step->op != XML_OP_ELEM)
  ------------------
  |  Branch (574:11): [True: 0, False: 3]
  ------------------
  575|      0|			goto rollback;
  576|      3|		    if (step->value == NULL)
  ------------------
  |  Branch (576:11): [True: 0, False: 3]
  ------------------
  577|      0|			return(-1);
  578|      3|		}
  579|      3|		if (node == NULL)
  ------------------
  |  Branch (579:7): [True: 0, False: 3]
  ------------------
  580|      0|		    goto rollback;
  581|      3|		if ((node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (581:7): [True: 0, False: 3]
  ------------------
  582|      3|		    (node->type == XML_HTML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (582:7): [True: 0, False: 3]
  ------------------
  583|      3|		    (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (583:7): [True: 0, False: 3]
  ------------------
  584|      0|		    goto rollback;
  585|      3|		node = node->parent;
  586|      6|		while (node != NULL) {
  ------------------
  |  Branch (586:10): [True: 3, False: 3]
  ------------------
  587|      3|		    if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (587:11): [True: 0, False: 3]
  ------------------
  588|      0|			(step->value[0] == node->name[0]) &&
  ------------------
  |  Branch (588:4): [True: 0, False: 0]
  ------------------
  589|      0|			(xmlStrEqual(step->value, node->name))) {
  ------------------
  |  Branch (589:4): [True: 0, False: 0]
  ------------------
  590|       |			/* Namespace test */
  591|      0|			if (node->ns == NULL) {
  ------------------
  |  Branch (591:8): [True: 0, False: 0]
  ------------------
  592|      0|			    if (step->value2 == NULL)
  ------------------
  |  Branch (592:12): [True: 0, False: 0]
  ------------------
  593|      0|				break;
  594|      0|			} else if (node->ns->href != NULL) {
  ------------------
  |  Branch (594:15): [True: 0, False: 0]
  ------------------
  595|      0|			    if ((step->value2 != NULL) &&
  ------------------
  |  Branch (595:12): [True: 0, False: 0]
  ------------------
  596|      0|			        (xmlStrEqual(step->value2, node->ns->href)))
  ------------------
  |  Branch (596:12): [True: 0, False: 0]
  ------------------
  597|      0|				break;
  598|      0|			}
  599|      0|		    }
  600|      3|		    node = node->parent;
  601|      3|		}
  602|      3|		if (node == NULL)
  ------------------
  |  Branch (602:7): [True: 3, False: 0]
  ------------------
  603|      3|		    goto rollback;
  604|       |		/*
  605|       |		 * prepare a potential rollback from here
  606|       |		 * for ancestors of that node.
  607|       |		 */
  608|      0|		if (step->op == XML_OP_ANCESTOR)
  ------------------
  |  Branch (608:7): [True: 0, False: 0]
  ------------------
  609|      0|		    xmlPatPushState(&states, i, node);
  610|      0|		else
  611|      0|		    xmlPatPushState(&states, i - 1, node);
  612|      0|		continue;
  613|      0|            case XML_OP_NS:
  ------------------
  |  Branch (613:13): [True: 0, False: 32]
  ------------------
  614|      0|		if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (614:7): [True: 0, False: 0]
  ------------------
  615|      0|		    goto rollback;
  616|      0|		if (node->ns == NULL) {
  ------------------
  |  Branch (616:7): [True: 0, False: 0]
  ------------------
  617|      0|		    if (step->value != NULL)
  ------------------
  |  Branch (617:11): [True: 0, False: 0]
  ------------------
  618|      0|			goto rollback;
  619|      0|		} else if (node->ns->href != NULL) {
  ------------------
  |  Branch (619:14): [True: 0, False: 0]
  ------------------
  620|      0|		    if (step->value == NULL)
  ------------------
  |  Branch (620:11): [True: 0, False: 0]
  ------------------
  621|      0|			goto rollback;
  622|      0|		    if (!xmlStrEqual(step->value, node->ns->href))
  ------------------
  |  Branch (622:11): [True: 0, False: 0]
  ------------------
  623|      0|			goto rollback;
  624|      0|		}
  625|      0|		break;
  626|      5|            case XML_OP_ALL:
  ------------------
  |  Branch (626:13): [True: 5, False: 27]
  ------------------
  627|      5|		if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (627:7): [True: 0, False: 5]
  ------------------
  628|      0|		    goto rollback;
  629|      5|		break;
  630|     32|	}
  631|     32|    }
  632|      5|found:
  633|      5|    if (states.states != NULL) {
  ------------------
  |  Branch (633:9): [True: 0, False: 5]
  ------------------
  634|       |        /* Free the rollback states */
  635|      0|	xmlFree(states.states);
  636|      0|    }
  637|      5|    return(1);
  638|     14|rollback:
  639|       |    /* got an error try to rollback */
  640|     14|    if (states.states == NULL)
  ------------------
  |  Branch (640:9): [True: 14, False: 0]
  ------------------
  641|     14|	return(0);
  642|      0|    if (states.nbstates <= 0) {
  ------------------
  |  Branch (642:9): [True: 0, False: 0]
  ------------------
  643|      0|	xmlFree(states.states);
  644|      0|	return(0);
  645|      0|    }
  646|      0|    states.nbstates--;
  647|      0|    i = states.states[states.nbstates].step;
  648|      0|    node = states.states[states.nbstates].node;
  649|      0|    goto restart;
  650|      0|}
pattern.c:xmlNewStreamCtxt:
 1523|    179|xmlNewStreamCtxt(xmlStreamCompPtr stream) {
 1524|    179|    xmlStreamCtxtPtr cur;
 1525|       |
 1526|    179|    cur = (xmlStreamCtxtPtr) xmlMalloc(sizeof(xmlStreamCtxt));
 1527|    179|    if (cur == NULL) {
  ------------------
  |  Branch (1527:9): [True: 0, False: 179]
  ------------------
 1528|      0|	ERROR(NULL, NULL, NULL,
 1529|      0|		"xmlNewStreamCtxt: malloc failed\n");
 1530|      0|	return(NULL);
 1531|      0|    }
 1532|    179|    memset(cur, 0, sizeof(xmlStreamCtxt));
 1533|       |    cur->states = NULL;
 1534|    179|    cur->nbState = 0;
 1535|    179|    cur->maxState = 0;
 1536|    179|    cur->level = 0;
 1537|    179|    cur->comp = stream;
 1538|    179|    cur->blockLevel = -1;
 1539|    179|    return(cur);
 1540|    179|}

xmlInitRelaxNGInternal:
 2719|    324|{
 2720|    324|    xmlInitMutex(&xmlRelaxNGMutex);
 2721|    324|}
xmlCleanupRelaxNGInternal:
 2725|    323|{
 2726|    323|    xmlCleanupMutex(&xmlRelaxNGMutex);
 2727|    323|}
xmlRelaxNGCleanupTypes:
 2778|    323|{
 2779|    323|    xmlSchemaCleanupTypes();
 2780|    323|    xmlMutexLock(&xmlRelaxNGMutex);
 2781|    323|    if (xmlRelaxNGTypeInitialized == 0) {
  ------------------
  |  Branch (2781:9): [True: 323, False: 0]
  ------------------
 2782|    323|        xmlMutexUnlock(&xmlRelaxNGMutex);
 2783|    323|        return;
 2784|    323|    }
 2785|      0|    xmlHashFree(xmlRelaxNGRegisteredTypes, xmlRelaxNGFreeTypeLibrary);
 2786|      0|    xmlRelaxNGTypeInitialized = 0;
 2787|      0|    xmlMutexUnlock(&xmlRelaxNGMutex);
 2788|      0|}

xmlInitMutex:
   57|  1.94k|{
   58|  1.94k|#ifdef HAVE_POSIX_THREADS
   59|  1.94k|    pthread_mutex_init(&mutex->lock, NULL);
   60|       |#elif defined HAVE_WIN32_THREADS
   61|       |    InitializeCriticalSection(&mutex->cs);
   62|       |#else
   63|       |    (void) mutex;
   64|       |#endif
   65|  1.94k|}
xmlCleanupMutex:
   92|  1.93k|{
   93|  1.93k|#ifdef HAVE_POSIX_THREADS
   94|  1.93k|    pthread_mutex_destroy(&mutex->lock);
   95|       |#elif defined HAVE_WIN32_THREADS
   96|       |    DeleteCriticalSection(&mutex->cs);
   97|       |#else
   98|       |    (void) mutex;
   99|       |#endif
  100|  1.93k|}
xmlMutexLock:
  124|  25.9k|{
  125|  25.9k|    if (tok == NULL)
  ------------------
  |  Branch (125:9): [True: 0, False: 25.9k]
  ------------------
  126|      0|        return;
  127|  25.9k|#ifdef HAVE_POSIX_THREADS
  128|       |    /*
  129|       |     * This assumes that __libc_single_threaded won't change while the
  130|       |     * lock is held.
  131|       |     */
  132|  25.9k|    pthread_mutex_lock(&tok->lock);
  133|       |#elif defined HAVE_WIN32_THREADS
  134|       |    EnterCriticalSection(&tok->cs);
  135|       |#endif
  136|       |
  137|  25.9k|}
xmlMutexUnlock:
  146|  25.9k|{
  147|  25.9k|    if (tok == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 25.9k]
  ------------------
  148|      0|        return;
  149|  25.9k|#ifdef HAVE_POSIX_THREADS
  150|  25.9k|    pthread_mutex_unlock(&tok->lock);
  151|       |#elif defined HAVE_WIN32_THREADS
  152|       |    LeaveCriticalSection(&tok->cs);
  153|       |#endif
  154|  25.9k|}
xmlInitRMutex:
  162|    648|xmlInitRMutex(xmlRMutex *tok) {
  163|    648|    (void) tok;
  164|       |
  165|    648|#ifdef HAVE_POSIX_THREADS
  166|    648|    pthread_mutex_init(&tok->lock, NULL);
  167|    648|    tok->held = 0;
  168|    648|    tok->waiters = 0;
  169|    648|    pthread_cond_init(&tok->cv, NULL);
  170|       |#elif defined HAVE_WIN32_THREADS
  171|       |    InitializeCriticalSection(&tok->cs);
  172|       |#endif
  173|    648|}
xmlCleanupRMutex:
  201|    646|xmlCleanupRMutex(xmlRMutex *tok) {
  202|    646|    (void) tok;
  203|       |
  204|    646|#ifdef HAVE_POSIX_THREADS
  205|    646|    pthread_mutex_destroy(&tok->lock);
  206|    646|    pthread_cond_destroy(&tok->cv);
  207|       |#elif defined HAVE_WIN32_THREADS
  208|       |    DeleteCriticalSection(&tok->cs);
  209|       |#endif
  210|    646|}
xmlRMutexLock:
  234|    646|{
  235|    646|    if (tok == NULL)
  ------------------
  |  Branch (235:9): [True: 0, False: 646]
  ------------------
  236|      0|        return;
  237|    646|#ifdef HAVE_POSIX_THREADS
  238|    646|    pthread_mutex_lock(&tok->lock);
  239|    646|    if (tok->held) {
  ------------------
  |  Branch (239:9): [True: 323, False: 323]
  ------------------
  240|    323|        if (pthread_equal(tok->tid, pthread_self())) {
  ------------------
  |  Branch (240:13): [True: 323, False: 0]
  ------------------
  241|    323|            tok->held++;
  242|    323|            pthread_mutex_unlock(&tok->lock);
  243|    323|            return;
  244|    323|        } 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|    323|    }
  251|    323|    tok->tid = pthread_self();
  252|    323|    tok->held = 1;
  253|    323|    pthread_mutex_unlock(&tok->lock);
  254|       |#elif defined HAVE_WIN32_THREADS
  255|       |    EnterCriticalSection(&tok->cs);
  256|       |#endif
  257|    323|}
xmlRMutexUnlock:
  266|    646|{
  267|    646|    if (tok == NULL)
  ------------------
  |  Branch (267:9): [True: 0, False: 646]
  ------------------
  268|      0|        return;
  269|    646|#ifdef HAVE_POSIX_THREADS
  270|    646|    pthread_mutex_lock(&tok->lock);
  271|    646|    tok->held--;
  272|    646|    if (tok->held == 0) {
  ------------------
  |  Branch (272:9): [True: 323, False: 323]
  ------------------
  273|    323|        if (tok->waiters)
  ------------------
  |  Branch (273:13): [True: 0, False: 323]
  ------------------
  274|      0|            pthread_cond_signal(&tok->cv);
  275|    323|        memset(&tok->tid, 0, sizeof(tok->tid));
  276|    323|    }
  277|    646|    pthread_mutex_unlock(&tok->lock);
  278|       |#elif defined HAVE_WIN32_THREADS
  279|       |    LeaveCriticalSection(&tok->cs);
  280|       |#endif
  281|    646|}
xmlInitParser:
  404|  1.09M|xmlInitParser(void) {
  405|  1.09M|#ifdef HAVE_POSIX_THREADS
  406|  1.09M|    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|  1.09M|}
xmlCleanupParser:
  443|    323|xmlCleanupParser(void) {
  444|       |    /*
  445|       |     * Unfortunately, some users call this function to fix memory
  446|       |     * leaks on unload with versions before 2.9.11. This can result
  447|       |     * in the library being reinitialized, so this use case must
  448|       |     * be supported.
  449|       |     */
  450|    323|    if (!xmlParserInitialized)
  ------------------
  |  Branch (450:9): [True: 0, False: 323]
  ------------------
  451|      0|        return;
  452|       |
  453|    323|    xmlCleanupCharEncodingHandlers();
  454|    323|#ifdef LIBXML_CATALOG_ENABLED
  455|    323|    xmlCatalogCleanup();
  456|    323|    xmlCleanupCatalogInternal();
  457|    323|#endif
  458|    323|#ifdef LIBXML_SCHEMAS_ENABLED
  459|    323|    xmlSchemaCleanupTypes();
  460|    323|#endif
  461|    323|#ifdef LIBXML_RELAXNG_ENABLED
  462|    323|    xmlRelaxNGCleanupTypes();
  463|    323|#endif
  464|       |
  465|    323|#ifdef LIBXML_SCHEMAS_ENABLED
  466|       |    /* Must be after xmlRelaxNGCleanupTypes */
  467|    323|    xmlCleanupSchemasTypesInternal();
  468|    323|#endif
  469|    323|#ifdef LIBXML_RELAXNG_ENABLED
  470|    323|    xmlCleanupRelaxNGInternal();
  471|    323|#endif
  472|       |
  473|    323|    xmlCleanupDictInternal();
  474|    323|    xmlCleanupRandom();
  475|    323|    xmlCleanupGlobalsInternal();
  476|    323|    xmlCleanupThreadsInternal();
  477|       |
  478|       |    /*
  479|       |     * Must come after all cleanup functions that call xmlFree which
  480|       |     * uses xmlMemMutex in debug mode.
  481|       |     */
  482|    323|    xmlCleanupMemoryInternal();
  483|       |
  484|    323|    xmlParserInitialized = 0;
  485|       |
  486|       |    /*
  487|       |     * This is a bit sketchy but should make reinitialization work.
  488|       |     */
  489|    323|#ifdef HAVE_POSIX_THREADS
  490|    323|    {
  491|    323|        pthread_once_t tmp = PTHREAD_ONCE_INIT;
  492|    323|        memcpy(&onceControl, &tmp, sizeof(tmp));
  493|    323|    }
  494|       |#elif defined(HAVE_WIN32_THREADS)
  495|       |    {
  496|       |        INIT_ONCE tmp = INIT_ONCE_STATIC_INIT;
  497|       |        memcpy(&onceControl, &tmp, sizeof(tmp));
  498|       |    }
  499|       |#else
  500|       |    onceControl = 0;
  501|       |#endif
  502|    323|}
threads.c:xmlInitParserInternal:
  356|    324|xmlInitParserInternal(void) {
  357|       |    /*
  358|       |     * Note that the initialization code must not make memory allocations.
  359|       |     */
  360|    324|    xmlInitRandom(); /* Required by xmlInitGlobalsInternal */
  361|    324|    xmlInitMemoryInternal();
  362|    324|    xmlInitThreadsInternal();
  363|    324|    xmlInitGlobalsInternal();
  364|    324|    xmlInitDictInternal();
  365|    324|    xmlInitEncodingInternal();
  366|    324|#if defined(LIBXML_XPATH_ENABLED)
  367|    324|    xmlInitXPathInternal();
  368|    324|#endif
  369|    324|    xmlInitIOCallbacks();
  370|    324|#ifdef LIBXML_CATALOG_ENABLED
  371|    324|    xmlInitCatalogInternal();
  372|    324|#endif
  373|    324|#ifdef LIBXML_SCHEMAS_ENABLED
  374|    324|    xmlInitSchemasTypesInternal();
  375|    324|#endif
  376|    324|#ifdef LIBXML_RELAXNG_ENABLED
  377|    324|    xmlInitRelaxNGInternal();
  378|    324|#endif
  379|       |
  380|    324|    xmlParserInitialized = 1;
  381|    324|}
threads.c:xmlInitThreadsInternal:
  330|    324|xmlInitThreadsInternal(void) {
  331|    324|    xmlInitRMutex(&xmlLibraryLock);
  332|    324|}
threads.c:xmlCleanupThreadsInternal:
  335|    323|xmlCleanupThreadsInternal(void) {
  336|    323|    xmlCleanupRMutex(&xmlLibraryLock);
  337|    323|}

libxml_domnode_binary_insertion_sort:
  249|     85|void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) {
  250|       |  /* don't bother sorting an array of size <= 1 */
  251|     85|  if (size <= 1) {
  ------------------
  |  Branch (251:7): [True: 0, False: 85]
  ------------------
  252|      0|    return;
  253|      0|  }
  254|       |
  255|     85|  BINARY_INSERTION_SORT_START(dst, 1, size);
  ------------------
  |  |  149|     85|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|     85|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|     85|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|     85|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|     85|}
libxml_domnode_tim_sort:
  533|     85|void TIM_SORT(SORT_TYPE *dst, const size_t size) {
  534|     85|  size_t minrun;
  535|     85|  TEMP_STORAGE_T _store, *store;
  536|     85|  TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE];
  537|     85|  size_t stack_curr = 0;
  538|     85|  size_t curr = 0;
  539|       |
  540|       |  /* don't bother sorting an array of size 1 */
  541|     85|  if (size <= 1) {
  ------------------
  |  Branch (541:7): [True: 0, False: 85]
  ------------------
  542|      0|    return;
  543|      0|  }
  544|       |
  545|     85|  if (size < 64) {
  ------------------
  |  Branch (545:7): [True: 85, False: 0]
  ------------------
  546|     85|    BINARY_INSERTION_SORT(dst, size);
  ------------------
  |  |  150|     85|#define BINARY_INSERTION_SORT          SORT_MAKE_STR(binary_insertion_sort)
  |  |  ------------------
  |  |  |  |  146|     85|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|     85|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|     85|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|     85|    return;
  548|     85|  }
  549|       |
  550|       |  /* compute the minimum run length */
  551|      0|  minrun = compute_minrun(size);
  552|       |  /* temporary storage for merges */
  553|      0|  store = &_store;
  554|      0|  store->alloc = 0;
  555|      0|  store->storage = NULL;
  556|       |
  557|      0|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (557:7): [True: 0, False: 0]
  ------------------
  558|      0|    return;
  559|      0|  }
  560|       |
  561|      0|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (561:7): [True: 0, False: 0]
  ------------------
  562|      0|    return;
  563|      0|  }
  564|       |
  565|      0|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (565:7): [True: 0, False: 0]
  ------------------
  566|      0|    return;
  567|      0|  }
  568|       |
  569|      0|  while (1) {
  ------------------
  |  Branch (569:10): [True: 0, Folded]
  ------------------
  570|      0|    if (!CHECK_INVARIANT(run_stack, stack_curr)) {
  ------------------
  |  |  153|      0|#define CHECK_INVARIANT                SORT_MAKE_STR(check_invariant)
  |  |  ------------------
  |  |  |  |  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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (570:9): [True: 0, False: 0]
  ------------------
  571|      0|      stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size);
  ------------------
  |  |  157|      0|#define TIM_SORT_COLLAPSE              SORT_MAKE_STR(tim_sort_collapse)
  |  |  ------------------
  |  |  |  |  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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|      0|      continue;
  573|      0|    }
  574|       |
  575|      0|    if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (575:9): [True: 0, False: 0]
  ------------------
  576|      0|      return;
  577|      0|    }
  578|      0|  }
  579|      0|}
xpath.c:libxml_domnode_binary_insertion_sort_start:
  219|     85|static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) {
  220|     85|  size_t i;
  221|       |
  222|    170|  for (i = start; i < size; i++) {
  ------------------
  |  Branch (222:19): [True: 85, False: 85]
  ------------------
  223|     85|    size_t j;
  224|     85|    SORT_TYPE x;
  ------------------
  |  |  593|     85|#define SORT_TYPE xmlNodePtr
  ------------------
  225|     85|    size_t location;
  226|       |
  227|       |    /* If this entry is already correct, just move along */
  228|     85|    if (SORT_CMP(dst[i - 1], dst[i]) <= 0) {
  ------------------
  |  |  617|     85|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (228:9): [True: 85, False: 0]
  ------------------
  229|     85|      continue;
  230|     85|    }
  231|       |
  232|       |    /* Else we need to find the right place, shift everything over, and squeeze in */
  233|      0|    x = dst[i];
  234|      0|    location = BINARY_INSERTION_FIND(dst, x, i);
  ------------------
  |  |  148|      0|#define BINARY_INSERTION_FIND          SORT_MAKE_STR(binary_insertion_find)
  |  |  ------------------
  |  |  |  |  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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|       |
  236|      0|    for (j = i - 1; j >= location; j--) {
  ------------------
  |  Branch (236:21): [True: 0, False: 0]
  ------------------
  237|      0|      dst[j + 1] = dst[j];
  238|       |
  239|      0|      if (j == 0) { /* check edge case because j is unsigned */
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        break;
  241|      0|      }
  242|      0|    }
  243|       |
  244|      0|    dst[location] = x;
  245|      0|  }
  246|     85|}

xmlGetIntSubset:
  691|     46|xmlGetIntSubset(const xmlDoc *doc) {
  692|     46|    xmlNodePtr cur;
  693|       |
  694|     46|    if (doc == NULL)
  ------------------
  |  Branch (694:9): [True: 0, False: 46]
  ------------------
  695|      0|	return(NULL);
  696|     46|    cur = doc->children;
  697|     92|    while (cur != NULL) {
  ------------------
  |  Branch (697:12): [True: 46, False: 46]
  ------------------
  698|     46|	if (cur->type == XML_DTD_NODE)
  ------------------
  |  Branch (698:6): [True: 0, False: 46]
  ------------------
  699|      0|	    return((xmlDtdPtr) cur);
  700|     46|	cur = cur->next;
  701|     46|    }
  702|     46|    return((xmlDtdPtr) doc->intSubset);
  703|     46|}
xmlCreateIntSubset:
  722|      1|                   const xmlChar *systemId) {
  723|      1|    xmlDtdPtr cur;
  724|       |
  725|      1|    if (doc != NULL) {
  ------------------
  |  Branch (725:9): [True: 1, False: 0]
  ------------------
  726|      1|        cur = xmlGetIntSubset(doc);
  727|      1|        if (cur != NULL)
  ------------------
  |  Branch (727:13): [True: 0, False: 1]
  ------------------
  728|      0|            return(cur);
  729|      1|    }
  730|       |
  731|       |    /*
  732|       |     * Allocate a new DTD and fill the fields.
  733|       |     */
  734|      1|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  735|      1|    if (cur == NULL)
  ------------------
  |  Branch (735:9): [True: 0, False: 1]
  ------------------
  736|      0|	return(NULL);
  737|      1|    memset(cur, 0, sizeof(xmlDtd));
  738|      1|    cur->type = XML_DTD_NODE;
  739|       |
  740|      1|    if (name != NULL) {
  ------------------
  |  Branch (740:9): [True: 1, False: 0]
  ------------------
  741|      1|	cur->name = xmlStrdup(name);
  742|      1|	if (cur->name == NULL)
  ------------------
  |  Branch (742:6): [True: 0, False: 1]
  ------------------
  743|      0|            goto error;
  744|      1|    }
  745|      1|    if (publicId != NULL) {
  ------------------
  |  Branch (745:9): [True: 1, False: 0]
  ------------------
  746|      1|	cur->ExternalID = xmlStrdup(publicId);
  747|      1|	if (cur->ExternalID  == NULL)
  ------------------
  |  Branch (747:6): [True: 0, False: 1]
  ------------------
  748|      0|            goto error;
  749|      1|    }
  750|      1|    if (systemId != NULL) {
  ------------------
  |  Branch (750:9): [True: 1, False: 0]
  ------------------
  751|      1|	cur->SystemID = xmlStrdup(systemId);
  752|      1|	if (cur->SystemID == NULL)
  ------------------
  |  Branch (752:6): [True: 0, False: 1]
  ------------------
  753|      0|            goto error;
  754|      1|    }
  755|      1|    if (doc != NULL) {
  ------------------
  |  Branch (755:9): [True: 1, False: 0]
  ------------------
  756|      1|	doc->intSubset = cur;
  757|      1|	cur->parent = doc;
  758|      1|	cur->doc = doc;
  759|      1|	if (doc->children == NULL) {
  ------------------
  |  Branch (759:6): [True: 0, False: 1]
  ------------------
  760|      0|	    doc->children = (xmlNodePtr) cur;
  761|      0|	    doc->last = (xmlNodePtr) cur;
  762|      1|	} else {
  763|      1|	    if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (763:10): [True: 1, False: 0]
  ------------------
  764|      1|		xmlNodePtr prev;
  765|       |
  766|      1|		prev = doc->children;
  767|      1|		prev->prev = (xmlNodePtr) cur;
  768|      1|		cur->next = prev;
  769|      1|		doc->children = (xmlNodePtr) cur;
  770|      1|	    } else {
  771|      0|		xmlNodePtr next;
  772|       |
  773|      0|		next = doc->children;
  774|      0|		while ((next != NULL) && (next->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (774:10): [True: 0, False: 0]
  |  Branch (774:28): [True: 0, False: 0]
  ------------------
  775|      0|		    next = next->next;
  776|      0|		if (next == NULL) {
  ------------------
  |  Branch (776:7): [True: 0, False: 0]
  ------------------
  777|      0|		    cur->prev = doc->last;
  778|      0|		    cur->prev->next = (xmlNodePtr) cur;
  779|      0|		    cur->next = NULL;
  780|      0|		    doc->last = (xmlNodePtr) cur;
  781|      0|		} else {
  782|      0|		    cur->next = next;
  783|      0|		    cur->prev = next->prev;
  784|      0|		    if (cur->prev == NULL)
  ------------------
  |  Branch (784:11): [True: 0, False: 0]
  ------------------
  785|      0|			doc->children = (xmlNodePtr) cur;
  786|      0|		    else
  787|      0|			cur->prev->next = (xmlNodePtr) cur;
  788|      0|		    next->prev = (xmlNodePtr) cur;
  789|      0|		}
  790|      0|	    }
  791|      1|	}
  792|      1|    }
  793|       |
  794|      1|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (794:9): [True: 0, False: 1]
  |  Branch (794:35): [True: 0, False: 0]
  ------------------
  795|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  796|      1|    return(cur);
  797|       |
  798|      0|error:
  799|      0|    xmlFreeDtd(cur);
  800|       |    return(NULL);
  801|      1|}
xmlFreeDtd:
  820|      1|xmlFreeDtd(xmlDtd *cur) {
  821|      1|    xmlDictPtr dict = NULL;
  822|       |
  823|      1|    if (cur == NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 1]
  ------------------
  824|      0|	return;
  825|      0|    }
  826|      1|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (826:9): [True: 1, False: 0]
  ------------------
  827|       |
  828|      1|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (828:9): [True: 0, False: 1]
  |  Branch (828:35): [True: 0, False: 0]
  ------------------
  829|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  830|       |
  831|      1|    if (cur->children != NULL) {
  ------------------
  |  Branch (831:9): [True: 0, False: 1]
  ------------------
  832|      0|	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|      0|        while (c != NULL) {
  ------------------
  |  Branch (838:16): [True: 0, False: 0]
  ------------------
  839|      0|	    next = c->next;
  840|      0|	    if ((c->type != XML_ELEMENT_DECL) &&
  ------------------
  |  Branch (840:10): [True: 0, False: 0]
  ------------------
  841|      0|		(c->type != XML_ATTRIBUTE_DECL) &&
  ------------------
  |  Branch (841:3): [True: 0, False: 0]
  ------------------
  842|      0|		(c->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (842:3): [True: 0, False: 0]
  ------------------
  843|      0|		xmlUnlinkNodeInternal(c);
  844|      0|		xmlFreeNode(c);
  845|      0|	    }
  846|      0|	    c = next;
  847|      0|	}
  848|      0|    }
  849|       |
  850|      1|    DICT_FREE(cur->name)
  ------------------
  |  |  810|      1|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 1, False: 0]
  |  |  |  Branch (810:16): [True: 1, False: 0]
  |  |  ------------------
  |  |  811|      1|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|      1|	    xmlFree((char *)(str));
  ------------------
  851|       |
  852|      1|    if (cur->SystemID != NULL)
  ------------------
  |  Branch (852:9): [True: 1, False: 0]
  ------------------
  853|      1|        xmlFree(cur->SystemID);
  854|      1|    if (cur->ExternalID != NULL)
  ------------------
  |  Branch (854:9): [True: 1, False: 0]
  ------------------
  855|      1|        xmlFree(cur->ExternalID);
  856|       |
  857|       |    /* TODO !!! */
  858|      1|    if (cur->notations != NULL)
  ------------------
  |  Branch (858:9): [True: 0, False: 1]
  ------------------
  859|      0|        xmlFreeNotationTable((xmlNotationTablePtr) cur->notations);
  860|       |
  861|      1|    if (cur->elements != NULL)
  ------------------
  |  Branch (861:9): [True: 0, False: 1]
  ------------------
  862|      0|        xmlFreeElementTable((xmlElementTablePtr) cur->elements);
  863|      1|    if (cur->attributes != NULL)
  ------------------
  |  Branch (863:9): [True: 0, False: 1]
  ------------------
  864|      0|        xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes);
  865|      1|    if (cur->entities != NULL)
  ------------------
  |  Branch (865:9): [True: 0, False: 1]
  ------------------
  866|      0|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities);
  867|      1|    if (cur->pentities != NULL)
  ------------------
  |  Branch (867:9): [True: 0, False: 1]
  ------------------
  868|      0|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities);
  869|       |
  870|      1|    xmlFree(cur);
  871|      1|}
xmlNewDoc:
  880|    299|xmlNewDoc(const xmlChar *version) {
  881|    299|    xmlDocPtr cur;
  882|       |
  883|    299|    if (version == NULL)
  ------------------
  |  Branch (883:9): [True: 0, False: 299]
  ------------------
  884|      0|	version = (const xmlChar *) "1.0";
  885|       |
  886|       |    /*
  887|       |     * Allocate a new document and fill the fields.
  888|       |     */
  889|    299|    cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc));
  890|    299|    if (cur == NULL)
  ------------------
  |  Branch (890:9): [True: 0, False: 299]
  ------------------
  891|      0|	return(NULL);
  892|    299|    memset(cur, 0, sizeof(xmlDoc));
  893|    299|    cur->type = XML_DOCUMENT_NODE;
  894|       |
  895|    299|    cur->version = xmlStrdup(version);
  896|    299|    if (cur->version == NULL) {
  ------------------
  |  Branch (896:9): [True: 0, False: 299]
  ------------------
  897|      0|	xmlFree(cur);
  898|      0|	return(NULL);
  899|      0|    }
  900|    299|    cur->standalone = -1;
  901|    299|    cur->compression = -1; /* not initialized */
  902|    299|    cur->doc = cur;
  903|    299|    cur->parseFlags = 0;
  904|    299|    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|    299|    cur->charset = XML_CHAR_ENCODING_UTF8;
  911|       |
  912|    299|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (912:9): [True: 0, False: 299]
  |  Branch (912:35): [True: 0, False: 0]
  ------------------
  913|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  914|    299|    return(cur);
  915|    299|}
xmlFreeDoc:
  923|    300|xmlFreeDoc(xmlDoc *cur) {
  924|    300|    xmlDtdPtr extSubset, intSubset;
  925|    300|    xmlDictPtr dict = NULL;
  926|       |
  927|    300|    if (cur == NULL) {
  ------------------
  |  Branch (927:9): [True: 0, False: 300]
  ------------------
  928|      0|	return;
  929|      0|    }
  930|       |
  931|    300|    dict = cur->dict;
  932|       |
  933|    300|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (933:9): [True: 0, False: 300]
  |  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|    300|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (939:9): [True: 0, False: 300]
  ------------------
  940|    300|    cur->ids = NULL;
  941|    300|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (941:9): [True: 0, False: 300]
  ------------------
  942|    300|    cur->refs = NULL;
  943|    300|    extSubset = cur->extSubset;
  944|    300|    intSubset = cur->intSubset;
  945|    300|    if (intSubset == extSubset)
  ------------------
  |  Branch (945:9): [True: 299, False: 1]
  ------------------
  946|    299|	extSubset = NULL;
  947|    300|    if (extSubset != NULL) {
  ------------------
  |  Branch (947:9): [True: 0, False: 300]
  ------------------
  948|      0|	xmlUnlinkNodeInternal((xmlNodePtr) cur->extSubset);
  949|      0|	cur->extSubset = NULL;
  950|      0|	xmlFreeDtd(extSubset);
  951|      0|    }
  952|    300|    if (intSubset != NULL) {
  ------------------
  |  Branch (952:9): [True: 1, False: 299]
  ------------------
  953|      1|	xmlUnlinkNodeInternal((xmlNodePtr) cur->intSubset);
  954|      1|	cur->intSubset = NULL;
  955|      1|	xmlFreeDtd(intSubset);
  956|      1|    }
  957|       |
  958|    300|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (958:9): [True: 300, False: 0]
  ------------------
  959|    300|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (959:9): [True: 0, False: 300]
  ------------------
  960|       |
  961|    300|    DICT_FREE(cur->name)
  ------------------
  |  |  810|    300|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 0, False: 300]
  |  |  |  Branch (810:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  811|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|    300|	    xmlFree((char *)(str));
  ------------------
  962|       |
  963|    300|    if (cur->version != NULL)
  ------------------
  |  Branch (963:9): [True: 299, False: 1]
  ------------------
  964|    299|        xmlFree(cur->version);
  965|    300|    if (cur->encoding != NULL)
  ------------------
  |  Branch (965:9): [True: 0, False: 300]
  ------------------
  966|      0|        xmlFree(cur->encoding);
  967|    300|    if (cur->URL != NULL)
  ------------------
  |  Branch (967:9): [True: 1, False: 299]
  ------------------
  968|      1|        xmlFree(cur->URL);
  969|       |
  970|    300|    xmlFree(cur);
  971|    300|    if (dict) xmlDictFree(dict);
  ------------------
  |  Branch (971:9): [True: 0, False: 300]
  ------------------
  972|    300|}
xmlNodeParseAttValue:
  998|    247|                     const xmlChar *value, size_t len, xmlNode **listPtr) {
  999|    247|    xmlNodePtr head = NULL, last = NULL;
 1000|    247|    xmlNodePtr node;
 1001|    247|    xmlChar *val = NULL;
 1002|    247|    const xmlChar *cur;
 1003|    247|    const xmlChar *q;
 1004|    247|    xmlEntityPtr ent;
 1005|    247|    xmlBufPtr buf;
 1006|    247|    size_t remaining = len;
 1007|       |
 1008|    247|    if (listPtr != NULL)
  ------------------
  |  Branch (1008:9): [True: 0, False: 247]
  ------------------
 1009|      0|        *listPtr = NULL;
 1010|       |
 1011|    247|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (1011:9): [True: 0, False: 247]
  |  Branch (1011:28): [True: 0, False: 247]
  ------------------
 1012|      0|        goto done;
 1013|       |
 1014|    247|    cur = value;
 1015|       |
 1016|    247|    buf = xmlBufCreate(50);
 1017|    247|    if (buf == NULL)
  ------------------
  |  Branch (1017:9): [True: 0, False: 247]
  ------------------
 1018|      0|        return(-1);
 1019|       |
 1020|    247|    q = cur;
 1021|    988|    while ((remaining > 0) && (*cur != 0)) {
  ------------------
  |  Branch (1021:12): [True: 988, False: 0]
  |  Branch (1021:31): [True: 741, False: 247]
  ------------------
 1022|    741|	if (cur[0] == '&') {
  ------------------
  |  Branch (1022:6): [True: 0, False: 741]
  ------------------
 1023|      0|	    int charval = 0;
 1024|       |
 1025|       |	    /*
 1026|       |	     * Save the current text.
 1027|       |	     */
 1028|      0|            if (cur != q) {
  ------------------
  |  Branch (1028:17): [True: 0, False: 0]
  ------------------
 1029|      0|		if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1029:7): [True: 0, False: 0]
  ------------------
 1030|      0|		    goto out;
 1031|      0|	        q = cur;
 1032|      0|	    }
 1033|       |
 1034|      0|	    if ((remaining > 2) && (cur[1] == '#') && (cur[2] == 'x')) {
  ------------------
  |  Branch (1034:10): [True: 0, False: 0]
  |  Branch (1034:29): [True: 0, False: 0]
  |  Branch (1034:48): [True: 0, False: 0]
  ------------------
 1035|      0|	        int tmp = 0;
 1036|       |
 1037|      0|		cur += 3;
 1038|      0|                remaining -= 3;
 1039|      0|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1039:10): [True: 0, False: 0]
  |  Branch (1039:29): [True: 0, False: 0]
  ------------------
 1040|      0|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1040:11): [True: 0, False: 0]
  |  Branch (1040:27): [True: 0, False: 0]
  ------------------
 1041|      0|			charval = charval * 16 + (tmp - '0');
 1042|      0|		    else if ((tmp >= 'a') && (tmp <= 'f'))
  ------------------
  |  Branch (1042:16): [True: 0, False: 0]
  |  Branch (1042:32): [True: 0, False: 0]
  ------------------
 1043|      0|			charval = charval * 16 + (tmp - 'a') + 10;
 1044|      0|		    else if ((tmp >= 'A') && (tmp <= 'F'))
  ------------------
  |  Branch (1044:16): [True: 0, False: 0]
  |  Branch (1044:32): [True: 0, False: 0]
  ------------------
 1045|      0|			charval = charval * 16 + (tmp - 'A') + 10;
 1046|      0|		    else {
 1047|      0|			charval = 0;
 1048|      0|			break;
 1049|      0|		    }
 1050|      0|                    if (charval > 0x110000)
  ------------------
  |  Branch (1050:25): [True: 0, False: 0]
  ------------------
 1051|      0|                        charval = 0x110000;
 1052|      0|		    cur++;
 1053|      0|                    remaining--;
 1054|      0|		}
 1055|      0|		if (tmp == ';') {
  ------------------
  |  Branch (1055:7): [True: 0, False: 0]
  ------------------
 1056|      0|		    cur++;
 1057|      0|                    remaining--;
 1058|      0|                }
 1059|      0|		q = cur;
 1060|      0|	    } else if ((remaining > 1) && (cur[1] == '#')) {
  ------------------
  |  Branch (1060:17): [True: 0, False: 0]
  |  Branch (1060:36): [True: 0, False: 0]
  ------------------
 1061|      0|	        int tmp = 0;
 1062|       |
 1063|      0|		cur += 2;
 1064|      0|                remaining -= 2;
 1065|      0|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1065:10): [True: 0, False: 0]
  |  Branch (1065:29): [True: 0, False: 0]
  ------------------
 1066|      0|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1066:11): [True: 0, False: 0]
  |  Branch (1066:27): [True: 0, False: 0]
  ------------------
 1067|      0|			charval = charval * 10 + (tmp - '0');
 1068|      0|		    else {
 1069|      0|			charval = 0;
 1070|      0|			break;
 1071|      0|		    }
 1072|      0|                    if (charval > 0x110000)
  ------------------
  |  Branch (1072:25): [True: 0, False: 0]
  ------------------
 1073|      0|                        charval = 0x110000;
 1074|      0|		    cur++;
 1075|      0|                    remaining--;
 1076|      0|		}
 1077|      0|		if (tmp == ';') {
  ------------------
  |  Branch (1077:7): [True: 0, False: 0]
  ------------------
 1078|      0|		    cur++;
 1079|      0|                    remaining--;
 1080|      0|                }
 1081|      0|		q = cur;
 1082|      0|	    } else {
 1083|       |		/*
 1084|       |		 * Read the entity string
 1085|       |		 */
 1086|      0|		cur++;
 1087|      0|                remaining--;
 1088|      0|		q = cur;
 1089|      0|		while ((remaining > 0) && (*cur != 0) && (*cur != ';')) {
  ------------------
  |  Branch (1089:10): [True: 0, False: 0]
  |  Branch (1089:29): [True: 0, False: 0]
  |  Branch (1089:44): [True: 0, False: 0]
  ------------------
 1090|      0|                    cur++;
 1091|      0|                    remaining--;
 1092|      0|                }
 1093|      0|		if ((remaining <= 0) || (*cur == 0))
  ------------------
  |  Branch (1093:7): [True: 0, False: 0]
  |  Branch (1093:27): [True: 0, False: 0]
  ------------------
 1094|      0|		    break;
 1095|      0|		if (cur != q) {
  ------------------
  |  Branch (1095:7): [True: 0, False: 0]
  ------------------
 1096|      0|		    val = xmlStrndup(q, cur - q);
 1097|      0|                    if (val == NULL)
  ------------------
  |  Branch (1097:25): [True: 0, False: 0]
  ------------------
 1098|      0|                        goto out;
 1099|      0|		    ent = xmlGetDocEntity(doc, val);
 1100|      0|		    if ((ent != NULL) &&
  ------------------
  |  Branch (1100:11): [True: 0, False: 0]
  ------------------
 1101|      0|			(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (1101:4): [True: 0, False: 0]
  ------------------
 1102|       |                        /*
 1103|       |                         * Predefined entities don't generate nodes
 1104|       |                         */
 1105|      0|			if (xmlBufCat(buf, ent->content))
  ------------------
  |  Branch (1105:8): [True: 0, False: 0]
  ------------------
 1106|      0|			    goto out;
 1107|      0|                    } else if (ent == NULL ||
  ------------------
  |  Branch (1107:32): [True: 0, False: 0]
  ------------------
 1108|      0|                               (ent->flags & XML_ENT_EXPANDING) == 0) {
  ------------------
  |  |   22|      0|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (1108:32): [True: 0, False: 0]
  ------------------
 1109|       |			/*
 1110|       |			 * Flush buffer so far
 1111|       |			 */
 1112|      0|			if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1112:8): [True: 0, False: 0]
  ------------------
 1113|      0|			    node = xmlNewDocText(doc, NULL);
 1114|      0|			    if (node == NULL)
  ------------------
  |  Branch (1114:12): [True: 0, False: 0]
  ------------------
 1115|      0|				goto out;
 1116|      0|			    node->content = xmlBufDetach(buf);
 1117|      0|                            node->parent = (xmlNode *) attr;
 1118|       |
 1119|      0|			    if (last == NULL) {
  ------------------
  |  Branch (1119:12): [True: 0, False: 0]
  ------------------
 1120|      0|				head = node;
 1121|      0|			    } else {
 1122|      0|                                last->next = node;
 1123|      0|                                node->prev = last;
 1124|      0|			    }
 1125|      0|                            last = node;
 1126|      0|			}
 1127|       |
 1128|      0|			if ((ent != NULL) &&
  ------------------
  |  Branch (1128:8): [True: 0, False: 0]
  ------------------
 1129|      0|                            ((ent->flags & XML_ENT_PARSED) == 0) &&
  ------------------
  |  |   19|      0|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (1129:29): [True: 0, False: 0]
  ------------------
 1130|      0|                            (ent->content != NULL)) {
  ------------------
  |  Branch (1130:29): [True: 0, False: 0]
  ------------------
 1131|      0|                            int res;
 1132|       |
 1133|      0|                            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|      0|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1134|      0|                            res = xmlNodeParseAttValue(doc, (xmlAttr *) ent,
 1135|      0|                                                       ent->content, SIZE_MAX,
 1136|      0|                                                       NULL);
 1137|      0|                            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|      0|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1138|      0|                            if (res < 0)
  ------------------
  |  Branch (1138:33): [True: 0, False: 0]
  ------------------
 1139|      0|                                goto out;
 1140|      0|                            ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|      0|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 1141|      0|			}
 1142|       |
 1143|       |			/*
 1144|       |			 * Create a new REFERENCE_REF node
 1145|       |			 */
 1146|      0|			node = xmlNewEntityRef((xmlDocPtr) doc, val);
 1147|      0|                        val = NULL;
 1148|      0|			if (node == NULL)
  ------------------
  |  Branch (1148:8): [True: 0, False: 0]
  ------------------
 1149|      0|			    goto out;
 1150|      0|                        node->parent = (xmlNode *) attr;
 1151|      0|                        node->last = (xmlNodePtr) ent;
 1152|      0|                        if (ent != NULL) {
  ------------------
  |  Branch (1152:29): [True: 0, False: 0]
  ------------------
 1153|      0|                            node->children = (xmlNodePtr) ent;
 1154|      0|                            node->content = ent->content;
 1155|      0|                        }
 1156|       |
 1157|      0|			if (last == NULL) {
  ------------------
  |  Branch (1157:8): [True: 0, False: 0]
  ------------------
 1158|      0|			    head = node;
 1159|      0|			} else {
 1160|      0|                            last->next = node;
 1161|      0|                            node->prev = last;
 1162|      0|			}
 1163|      0|                        last = node;
 1164|      0|		    }
 1165|      0|		    xmlFree(val);
 1166|      0|                    val = NULL;
 1167|      0|		}
 1168|      0|		cur++;
 1169|      0|                remaining--;
 1170|      0|		q = cur;
 1171|      0|	    }
 1172|      0|	    if (charval != 0) {
  ------------------
  |  Branch (1172:10): [True: 0, False: 0]
  ------------------
 1173|      0|		xmlChar buffer[10];
 1174|      0|		int l;
 1175|       |
 1176|      0|                if (charval >= 0x110000)
  ------------------
  |  Branch (1176:21): [True: 0, False: 0]
  ------------------
 1177|      0|                    charval = 0xFFFD; /* replacement character */
 1178|       |
 1179|      0|		l = xmlCopyCharMultiByte(buffer, charval);
 1180|      0|		buffer[l] = 0;
 1181|       |
 1182|      0|		if (xmlBufCat(buf, buffer))
  ------------------
  |  Branch (1182:7): [True: 0, False: 0]
  ------------------
 1183|      0|		    goto out;
 1184|      0|	    }
 1185|    741|	} else {
 1186|    741|	    cur++;
 1187|    741|            remaining--;
 1188|    741|        }
 1189|    741|    }
 1190|       |
 1191|    247|    if (cur != q) {
  ------------------
  |  Branch (1191:9): [True: 247, False: 0]
  ------------------
 1192|       |        /*
 1193|       |	 * Handle the last piece of text.
 1194|       |	 */
 1195|    247|	if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1195:6): [True: 0, False: 247]
  ------------------
 1196|      0|	    goto out;
 1197|    247|    }
 1198|       |
 1199|    247|    if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1199:9): [True: 247, False: 0]
  ------------------
 1200|    247|	node = xmlNewDocText(doc, NULL);
 1201|    247|	if (node == NULL)
  ------------------
  |  Branch (1201:6): [True: 0, False: 247]
  ------------------
 1202|      0|            goto out;
 1203|    247|        node->parent = (xmlNode *) attr;
 1204|    247|	node->content = xmlBufDetach(buf);
 1205|       |
 1206|    247|	if (last == NULL) {
  ------------------
  |  Branch (1206:6): [True: 247, False: 0]
  ------------------
 1207|    247|	    head = node;
 1208|    247|	} else {
 1209|      0|            last->next = node;
 1210|      0|            node->prev = last;
 1211|      0|	}
 1212|    247|        last = node;
 1213|    247|    } else if (head == NULL) {
  ------------------
  |  Branch (1213:16): [True: 0, False: 0]
  ------------------
 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|    247|    xmlBufFree(buf);
 1222|       |
 1223|    247|done:
 1224|    247|    if (attr != NULL) {
  ------------------
  |  Branch (1224:9): [True: 247, False: 0]
  ------------------
 1225|    247|        if (attr->children != NULL)
  ------------------
  |  Branch (1225:13): [True: 0, False: 247]
  ------------------
 1226|      0|            xmlFreeNodeList(attr->children);
 1227|    247|        attr->children = head;
 1228|    247|        attr->last = last;
 1229|    247|    }
 1230|       |
 1231|    247|    if (listPtr != NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 247]
  ------------------
 1232|      0|        *listPtr = head;
 1233|       |
 1234|    247|    return(0);
 1235|       |
 1236|      0|out:
 1237|      0|    xmlBufFree(buf);
 1238|      0|    if (val != NULL)
  ------------------
  |  Branch (1238:9): [True: 0, False: 0]
  ------------------
 1239|      0|        xmlFree(val);
 1240|      0|    if (head != NULL)
  ------------------
  |  Branch (1240:9): [True: 0, False: 0]
  ------------------
 1241|      0|        xmlFreeNodeList(head);
 1242|      0|    return(-1);
 1243|    247|}
xmlFreePropList:
 1668|      8|xmlFreePropList(xmlAttr *cur) {
 1669|      8|    xmlAttrPtr next;
 1670|      8|    if (cur == NULL) return;
  ------------------
  |  Branch (1670:9): [True: 8, False: 0]
  ------------------
 1671|      0|    while (cur != NULL) {
  ------------------
  |  Branch (1671:12): [True: 0, False: 0]
  ------------------
 1672|      0|        next = cur->next;
 1673|      0|        xmlFreeProp(cur);
 1674|      0|	cur = next;
 1675|      0|    }
 1676|      0|}
xmlNewDocNode:
 1900|    249|              const xmlChar *name, const xmlChar *content) {
 1901|    249|    xmlNodePtr cur;
 1902|    249|    xmlChar *copy;
 1903|       |
 1904|    249|    if (name == NULL)
  ------------------
  |  Branch (1904:9): [True: 0, False: 249]
  ------------------
 1905|      0|        return(NULL);
 1906|       |
 1907|    249|    if ((doc != NULL) && (doc->dict != NULL)) {
  ------------------
  |  Branch (1907:9): [True: 249, False: 0]
  |  Branch (1907:26): [True: 0, False: 249]
  ------------------
 1908|      0|        const xmlChar *dictName = xmlDictLookup(doc->dict, name, -1);
 1909|       |
 1910|      0|        if (dictName == NULL)
  ------------------
  |  Branch (1910:13): [True: 0, False: 0]
  ------------------
 1911|      0|            return(NULL);
 1912|      0|        return(xmlNewElem(doc, ns, dictName, content));
 1913|      0|    }
 1914|       |
 1915|    249|    copy = xmlStrdup(name);
 1916|    249|    if (copy == NULL)
  ------------------
  |  Branch (1916:9): [True: 0, False: 249]
  ------------------
 1917|      0|        return(NULL);
 1918|       |
 1919|    249|    cur = xmlNewElem(doc, ns, copy, content);
 1920|    249|    if (cur == NULL) {
  ------------------
  |  Branch (1920:9): [True: 0, False: 249]
  ------------------
 1921|      0|        xmlFree(copy);
 1922|      0|        return(NULL);
 1923|      0|    }
 1924|       |
 1925|    249|    return(cur);
 1926|    249|}
xmlNewText:
 2037|    247|xmlNewText(const xmlChar *content) {
 2038|    247|    xmlNodePtr cur;
 2039|       |
 2040|       |    /*
 2041|       |     * Allocate a new node and fill the fields.
 2042|       |     */
 2043|    247|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2044|    247|    if (cur == NULL)
  ------------------
  |  Branch (2044:9): [True: 0, False: 247]
  ------------------
 2045|      0|	return(NULL);
 2046|    247|    memset(cur, 0, sizeof(xmlNode));
 2047|    247|    cur->type = XML_TEXT_NODE;
 2048|       |
 2049|    247|    cur->name = xmlStringText;
 2050|    247|    if (content != NULL) {
  ------------------
  |  Branch (2050:9): [True: 0, False: 247]
  ------------------
 2051|      0|	cur->content = xmlStrdup(content);
 2052|      0|        if (cur->content == NULL)
  ------------------
  |  Branch (2052:13): [True: 0, False: 0]
  ------------------
 2053|      0|            goto error;
 2054|      0|    }
 2055|       |
 2056|    247|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2056:9): [True: 0, False: 247]
  |  Branch (2056:35): [True: 0, False: 0]
  ------------------
 2057|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2058|    247|    return(cur);
 2059|       |
 2060|      0|error:
 2061|      0|    xmlFreeNode(cur);
 2062|       |    return(NULL);
 2063|    247|}
xmlNewDocText:
 2269|    247|xmlNewDocText(const xmlDoc *doc, const xmlChar *content) {
 2270|    247|    xmlNodePtr cur;
 2271|       |
 2272|    247|    cur = xmlNewText(content);
 2273|    247|    if (cur != NULL) cur->doc = (xmlDoc *)doc;
  ------------------
  |  Branch (2273:9): [True: 247, False: 0]
  ------------------
 2274|    247|    return(cur);
 2275|    247|}
xmlSetTreeDoc:
 2587|    247|xmlSetTreeDoc(xmlNode *tree, xmlDoc *doc) {
 2588|    247|    int ret = 0;
 2589|       |
 2590|    247|    if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2590:9): [True: 0, False: 247]
  |  Branch (2590:27): [True: 0, False: 247]
  ------------------
 2591|      0|	return(0);
 2592|    247|    if (tree->doc == doc)
  ------------------
  |  Branch (2592:9): [True: 247, False: 0]
  ------------------
 2593|    247|        return(0);
 2594|       |
 2595|      0|    if (tree->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (2595:9): [True: 0, False: 0]
  ------------------
 2596|      0|        xmlAttrPtr prop = tree->properties;
 2597|       |
 2598|      0|        while (prop != NULL) {
  ------------------
  |  Branch (2598:16): [True: 0, False: 0]
  ------------------
 2599|      0|            if (prop->children != NULL) {
  ------------------
  |  Branch (2599:17): [True: 0, False: 0]
  ------------------
 2600|      0|                if (xmlSetListDoc(prop->children, doc) < 0)
  ------------------
  |  Branch (2600:21): [True: 0, False: 0]
  ------------------
 2601|      0|                    ret = -1;
 2602|      0|            }
 2603|       |
 2604|      0|            if (xmlNodeSetDoc((xmlNodePtr) prop, doc) < 0)
  ------------------
  |  Branch (2604:17): [True: 0, False: 0]
  ------------------
 2605|      0|                ret = -1;
 2606|       |
 2607|      0|            prop = prop->next;
 2608|      0|        }
 2609|      0|    }
 2610|       |
 2611|      0|    if ((tree->children != NULL) &&
  ------------------
  |  Branch (2611:9): [True: 0, False: 0]
  ------------------
 2612|      0|        (tree->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (2612:9): [True: 0, False: 0]
  ------------------
 2613|      0|        if (xmlSetListDoc(tree->children, doc) < 0)
  ------------------
  |  Branch (2613:13): [True: 0, False: 0]
  ------------------
 2614|      0|            ret = -1;
 2615|      0|    }
 2616|       |
 2617|      0|    if (xmlNodeSetDoc(tree, doc) < 0)
  ------------------
  |  Branch (2617:9): [True: 0, False: 0]
  ------------------
 2618|      0|        ret = -1;
 2619|       |
 2620|      0|    return(ret);
 2621|    247|}
xmlFreeNodeList:
 3328|    300|xmlFreeNodeList(xmlNode *cur) {
 3329|    300|    xmlNodePtr next;
 3330|    300|    xmlNodePtr parent;
 3331|    300|    xmlDictPtr dict = NULL;
 3332|    300|    size_t depth = 0;
 3333|       |
 3334|    300|    if (cur == NULL) return;
  ------------------
  |  Branch (3334:9): [True: 0, False: 300]
  ------------------
 3335|    300|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3335:9): [True: 0, False: 300]
  ------------------
 3336|      0|	xmlFreeNsList((xmlNsPtr) cur);
 3337|      0|	return;
 3338|      0|    }
 3339|    300|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3339:9): [True: 300, False: 0]
  ------------------
 3340|    601|    while (1) {
  ------------------
  |  Branch (3340:12): [True: 601, Folded]
  ------------------
 3341|    902|        while ((cur->children != NULL) &&
  ------------------
  |  Branch (3341:16): [True: 301, False: 601]
  ------------------
 3342|    301|               (cur->type != XML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3342:16): [True: 301, False: 0]
  ------------------
 3343|    301|               (cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3343:16): [True: 301, False: 0]
  ------------------
 3344|    301|               (cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (3344:16): [True: 301, False: 0]
  ------------------
 3345|    301|               (cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (3345:16): [True: 301, False: 0]
  ------------------
 3346|    301|            cur = cur->children;
 3347|    301|            depth += 1;
 3348|    301|        }
 3349|       |
 3350|    601|        next = cur->next;
 3351|    601|        parent = cur->parent;
 3352|    601|	if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (3352:6): [True: 0, False: 601]
  ------------------
 3353|    601|            (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (3353:13): [True: 0, False: 601]
  ------------------
 3354|      0|            xmlFreeDoc((xmlDocPtr) cur);
 3355|    601|        } else if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3355:20): [True: 0, False: 601]
  ------------------
 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|    601|        } else {
 3363|    601|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3363:10): [True: 0, False: 601]
  |  Branch (3363:36): [True: 0, False: 0]
  ------------------
 3364|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3365|       |
 3366|    601|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3366:11): [True: 301, False: 300]
  ------------------
 3367|    300|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3367:4): [True: 0, False: 300]
  ------------------
 3368|    300|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3368:4): [True: 0, False: 300]
  ------------------
 3369|    301|		(cur->properties != NULL))
  ------------------
  |  Branch (3369:3): [True: 0, False: 301]
  ------------------
 3370|      0|		xmlFreePropList(cur->properties);
 3371|    601|	    if ((cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3371:10): [True: 300, False: 301]
  ------------------
 3372|    300|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (3372:3): [True: 300, False: 0]
  ------------------
 3373|    300|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3373:3): [True: 300, False: 0]
  ------------------
 3374|    300|		(cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3374:3): [True: 300, False: 0]
  ------------------
 3375|    300|		(cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3375:3): [True: 300, False: 0]
  ------------------
 3376|    300|		DICT_FREE(cur->content)
  ------------------
  |  |  810|    300|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 300, False: 0]
  |  |  |  Branch (810:16): [True: 300, False: 0]
  |  |  ------------------
  |  |  811|    300|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|    300|	    xmlFree((char *)(str));
  ------------------
 3377|    300|	    }
 3378|    601|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3378:11): [True: 301, False: 300]
  ------------------
 3379|    300|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3379:11): [True: 0, False: 300]
  ------------------
 3380|    300|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3380:4): [True: 0, False: 300]
  ------------------
 3381|    301|		(cur->nsDef != NULL))
  ------------------
  |  Branch (3381:3): [True: 0, False: 301]
  ------------------
 3382|      0|		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|    601|	    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3390:10): [True: 601, False: 0]
  ------------------
 3391|    601|		(cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3391:3): [True: 301, False: 300]
  ------------------
 3392|    301|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3392:3): [True: 301, False: 0]
  ------------------
 3393|    301|		DICT_FREE(cur->name)
  ------------------
  |  |  810|    301|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 301, False: 0]
  |  |  |  Branch (810:16): [True: 301, False: 0]
  |  |  ------------------
  |  |  811|    301|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|    301|	    xmlFree((char *)(str));
  ------------------
 3394|    601|	    xmlFree(cur);
 3395|    601|	}
 3396|       |
 3397|    601|        if (next != NULL) {
  ------------------
  |  Branch (3397:13): [True: 0, False: 601]
  ------------------
 3398|      0|	    cur = next;
 3399|    601|        } else {
 3400|    601|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (3400:17): [True: 300, False: 301]
  |  Branch (3400:33): [True: 0, False: 301]
  ------------------
 3401|    300|                break;
 3402|    301|            depth -= 1;
 3403|    301|            cur = parent;
 3404|       |            cur->children = NULL;
 3405|    301|        }
 3406|    601|    }
 3407|    300|}
xmlStaticCopyNode:
 3861|    104|                  int extended) {
 3862|    104|    xmlNodePtr ret;
 3863|       |
 3864|    104|    if (node == NULL) return(NULL);
  ------------------
  |  Branch (3864:9): [True: 0, False: 104]
  ------------------
 3865|    104|    switch (node->type) {
 3866|     52|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3866:9): [True: 52, False: 52]
  ------------------
 3867|     52|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3867:9): [True: 0, False: 104]
  ------------------
 3868|    104|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3868:9): [True: 52, False: 52]
  ------------------
 3869|    104|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3869:9): [True: 0, False: 104]
  ------------------
 3870|    104|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3870:9): [True: 0, False: 104]
  ------------------
 3871|    104|        case XML_PI_NODE:
  ------------------
  |  Branch (3871:9): [True: 0, False: 104]
  ------------------
 3872|    104|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3872:9): [True: 0, False: 104]
  ------------------
 3873|    104|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3873:9): [True: 0, False: 104]
  ------------------
 3874|    104|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3874:9): [True: 0, False: 104]
  ------------------
 3875|    104|	    break;
 3876|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3876:9): [True: 0, False: 104]
  ------------------
 3877|      0|		return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
 3878|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3878:9): [True: 0, False: 104]
  ------------------
 3879|      0|	    return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
 3880|      0|        case XML_DTD_NODE:
  ------------------
  |  Branch (3880:9): [True: 0, False: 104]
  ------------------
 3881|      0|            return((xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node));
 3882|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3882:9): [True: 0, False: 104]
  ------------------
 3883|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3883:9): [True: 0, False: 104]
  ------------------
 3884|      0|	    return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, extended));
 3885|      0|        default:
  ------------------
  |  Branch (3885:9): [True: 0, False: 104]
  ------------------
 3886|      0|            return(NULL);
 3887|    104|    }
 3888|       |
 3889|       |    /*
 3890|       |     * Allocate a new node and fill the fields.
 3891|       |     */
 3892|    104|    ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 3893|    104|    if (ret == NULL)
  ------------------
  |  Branch (3893:9): [True: 0, False: 104]
  ------------------
 3894|      0|	return(NULL);
 3895|    104|    memset(ret, 0, sizeof(xmlNode));
 3896|    104|    ret->type = node->type;
 3897|       |
 3898|    104|    ret->doc = doc;
 3899|    104|    ret->parent = parent;
 3900|    104|    if (node->name == xmlStringText)
  ------------------
  |  Branch (3900:9): [True: 52, False: 52]
  ------------------
 3901|     52|	ret->name = xmlStringText;
 3902|     52|    else if (node->name == xmlStringTextNoenc)
  ------------------
  |  Branch (3902:14): [True: 0, False: 52]
  ------------------
 3903|      0|	ret->name = xmlStringTextNoenc;
 3904|     52|    else if (node->name == xmlStringComment)
  ------------------
  |  Branch (3904:14): [True: 0, False: 52]
  ------------------
 3905|      0|	ret->name = xmlStringComment;
 3906|     52|    else if (node->name != NULL) {
  ------------------
  |  Branch (3906:14): [True: 52, False: 0]
  ------------------
 3907|     52|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (3907:13): [True: 52, False: 0]
  |  Branch (3907:30): [True: 0, False: 52]
  ------------------
 3908|      0|	    ret->name = xmlDictLookup(doc->dict, node->name, -1);
 3909|     52|	else
 3910|     52|	    ret->name = xmlStrdup(node->name);
 3911|     52|        if (ret->name == NULL)
  ------------------
  |  Branch (3911:13): [True: 0, False: 52]
  ------------------
 3912|      0|            goto error;
 3913|     52|    }
 3914|    104|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3914:9): [True: 52, False: 52]
  ------------------
 3915|     52|	(node->content != NULL) &&
  ------------------
  |  Branch (3915:2): [True: 52, False: 0]
  ------------------
 3916|     52|	(node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3916:2): [True: 52, False: 0]
  ------------------
 3917|     52|	(node->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3917:2): [True: 52, False: 0]
  ------------------
 3918|     52|	(node->type != XML_XINCLUDE_START)) {
  ------------------
  |  Branch (3918:2): [True: 52, False: 0]
  ------------------
 3919|     52|	ret->content = xmlStrdup(node->content);
 3920|     52|        if (ret->content == NULL)
  ------------------
  |  Branch (3920:13): [True: 0, False: 52]
  ------------------
 3921|      0|            goto error;
 3922|     52|    }else{
 3923|     52|      if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3923:11): [True: 52, False: 0]
  ------------------
 3924|     52|        ret->line = node->line;
 3925|     52|    }
 3926|       |
 3927|    104|    if (!extended)
  ------------------
  |  Branch (3927:9): [True: 0, False: 104]
  ------------------
 3928|      0|	goto out;
 3929|    104|    if (((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3929:10): [True: 52, False: 52]
  ------------------
 3930|     52|         (node->type == XML_XINCLUDE_START)) && (node->nsDef != NULL)) {
  ------------------
  |  Branch (3930:10): [True: 0, False: 52]
  |  Branch (3930:49): [True: 0, False: 52]
  ------------------
 3931|      0|        ret->nsDef = xmlCopyNamespaceList(node->nsDef);
 3932|      0|        if (ret->nsDef == NULL)
  ------------------
  |  Branch (3932:13): [True: 0, False: 0]
  ------------------
 3933|      0|            goto error;
 3934|      0|    }
 3935|       |
 3936|    104|    if ((node->type == XML_ELEMENT_NODE) && (node->ns != NULL)) {
  ------------------
  |  Branch (3936:9): [True: 52, False: 52]
  |  Branch (3936:45): [True: 0, False: 52]
  ------------------
 3937|      0|        xmlNsPtr ns = NULL;
 3938|      0|        int res;
 3939|       |
 3940|      0|	res = xmlSearchNsSafe(ret, node->ns->prefix, &ns);
 3941|      0|        if (res < 0)
  ------------------
  |  Branch (3941:13): [True: 0, False: 0]
  ------------------
 3942|      0|            goto error;
 3943|      0|	if (ns == NULL) {
  ------------------
  |  Branch (3943:6): [True: 0, False: 0]
  ------------------
 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|      0|	    res = xmlSearchNsSafe(node, node->ns->prefix, &ns);
 3953|      0|            if (res < 0)
  ------------------
  |  Branch (3953:17): [True: 0, False: 0]
  ------------------
 3954|      0|                goto error;
 3955|      0|	    if (ns != NULL) {
  ------------------
  |  Branch (3955:10): [True: 0, False: 0]
  ------------------
 3956|      0|	        xmlNodePtr root = ret;
 3957|       |
 3958|      0|		while (root->parent != NULL) root = root->parent;
  ------------------
  |  Branch (3958:10): [True: 0, False: 0]
  ------------------
 3959|      0|		ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3960|      0|            } else {
 3961|      0|                ret->ns = xmlNewReconciledNs(ret, node->ns);
 3962|      0|	    }
 3963|      0|            if (ret->ns == NULL)
  ------------------
  |  Branch (3963:17): [True: 0, False: 0]
  ------------------
 3964|      0|                goto error;
 3965|      0|	} else {
 3966|       |	    /*
 3967|       |	     * reference the existing namespace definition in our own tree.
 3968|       |	     */
 3969|      0|	    ret->ns = ns;
 3970|      0|	}
 3971|      0|    }
 3972|    104|    if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL)) {
  ------------------
  |  Branch (3972:9): [True: 52, False: 52]
  |  Branch (3972:45): [True: 0, False: 52]
  ------------------
 3973|      0|        ret->properties = xmlCopyPropList(ret, node->properties);
 3974|      0|        if (ret->properties == NULL)
  ------------------
  |  Branch (3974:13): [True: 0, False: 0]
  ------------------
 3975|      0|            goto error;
 3976|      0|    }
 3977|    104|    if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (3977:9): [True: 0, False: 104]
  ------------------
 3978|      0|	if ((doc == NULL) || (node->doc != doc)) {
  ------------------
  |  Branch (3978:6): [True: 0, False: 0]
  |  Branch (3978:23): [True: 0, False: 0]
  ------------------
 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|      0|	    ret->children = (xmlNodePtr) xmlGetDocEntity(doc, ret->name);
 3986|      0|	} else {
 3987|      0|            ret->children = node->children;
 3988|      0|	}
 3989|      0|	ret->last = ret->children;
 3990|    104|    } else if ((node->children != NULL) && (extended != 2)) {
  ------------------
  |  Branch (3990:16): [True: 52, False: 52]
  |  Branch (3990:44): [True: 52, False: 0]
  ------------------
 3991|     52|        xmlNodePtr cur, insert;
 3992|       |
 3993|     52|        cur = node->children;
 3994|     52|        insert = ret;
 3995|    104|        while (cur != NULL) {
  ------------------
  |  Branch (3995:16): [True: 52, False: 52]
  ------------------
 3996|     52|            xmlNodePtr copy = xmlStaticCopyNode(cur, doc, insert, 2);
 3997|     52|            if (copy == NULL)
  ------------------
  |  Branch (3997:17): [True: 0, False: 52]
  ------------------
 3998|      0|                goto error;
 3999|       |
 4000|       |            /* Check for coalesced text nodes */
 4001|     52|            if (insert->last != copy) {
  ------------------
  |  Branch (4001:17): [True: 52, False: 0]
  ------------------
 4002|     52|                if (insert->last == NULL) {
  ------------------
  |  Branch (4002:21): [True: 52, False: 0]
  ------------------
 4003|     52|                    insert->children = copy;
 4004|     52|                } else {
 4005|      0|                    copy->prev = insert->last;
 4006|      0|                    insert->last->next = copy;
 4007|      0|                }
 4008|     52|                insert->last = copy;
 4009|     52|            }
 4010|       |
 4011|     52|            if ((cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4011:17): [True: 52, False: 0]
  ------------------
 4012|     52|                (cur->children != NULL)) {
  ------------------
  |  Branch (4012:17): [True: 0, False: 52]
  ------------------
 4013|      0|                cur = cur->children;
 4014|      0|                insert = copy;
 4015|      0|                continue;
 4016|      0|            }
 4017|       |
 4018|     52|            while (1) {
  ------------------
  |  Branch (4018:20): [True: 52, Folded]
  ------------------
 4019|     52|                if (cur->next != NULL) {
  ------------------
  |  Branch (4019:21): [True: 0, False: 52]
  ------------------
 4020|      0|                    cur = cur->next;
 4021|      0|                    break;
 4022|      0|                }
 4023|       |
 4024|     52|                cur = cur->parent;
 4025|     52|                insert = insert->parent;
 4026|     52|                if (cur == node) {
  ------------------
  |  Branch (4026:21): [True: 52, False: 0]
  ------------------
 4027|     52|                    cur = NULL;
 4028|     52|                    break;
 4029|     52|                }
 4030|     52|            }
 4031|     52|        }
 4032|     52|    }
 4033|       |
 4034|    104|out:
 4035|    104|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (4035:9): [True: 0, False: 104]
  |  Branch (4035:35): [True: 0, False: 0]
  ------------------
 4036|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 4037|    104|    return(ret);
 4038|       |
 4039|      0|error:
 4040|      0|    xmlFreeNode(ret);
 4041|       |    return(NULL);
 4042|    104|}
xmlStaticCopyNodeList:
 4055|     52|xmlStaticCopyNodeList(xmlNode *node, xmlDoc *doc, xmlNode *parent) {
 4056|     52|    xmlNodePtr ret = NULL;
 4057|     52|    xmlNodePtr p = NULL,q;
 4058|     52|    xmlDtdPtr newSubset = NULL;
 4059|     52|    int linkedSubset = 0;
 4060|       |
 4061|    104|    while (node != NULL) {
  ------------------
  |  Branch (4061:12): [True: 52, False: 52]
  ------------------
 4062|     52|        xmlNodePtr next = node->next;
 4063|       |
 4064|     52|	if (node->type == XML_DTD_NODE ) {
  ------------------
  |  Branch (4064:6): [True: 0, False: 52]
  ------------------
 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|     52|	    q = xmlStaticCopyNode(node, doc, parent, 1);
 4102|     52|	if (q == NULL) goto error;
  ------------------
  |  Branch (4102:6): [True: 0, False: 52]
  ------------------
 4103|     52|	if (ret == NULL) {
  ------------------
  |  Branch (4103:6): [True: 52, False: 0]
  ------------------
 4104|     52|	    q->prev = NULL;
 4105|     52|	    ret = p = q;
 4106|     52|	} else if (p != q) {
  ------------------
  |  Branch (4106:13): [True: 0, False: 0]
  ------------------
 4107|       |	/* the test is required if xmlStaticCopyNode coalesced 2 text nodes */
 4108|      0|	    p->next = q;
 4109|      0|	    q->prev = p;
 4110|      0|	    p = q;
 4111|      0|	}
 4112|     52|	node = next;
 4113|     52|    }
 4114|     52|    if ((doc != NULL) && (newSubset != NULL))
  ------------------
  |  Branch (4114:9): [True: 52, False: 0]
  |  Branch (4114:26): [True: 0, False: 52]
  ------------------
 4115|      0|        doc->intSubset = newSubset;
 4116|     52|    return(ret);
 4117|      0|error:
 4118|      0|    xmlFreeNodeList(ret);
 4119|      0|    if (newSubset != NULL)
  ------------------
  |  Branch (4119:9): [True: 0, False: 0]
  ------------------
 4120|      0|        xmlFreeDtd(newSubset);
 4121|      0|    if (linkedSubset != 0) {
  ------------------
  |  Branch (4121:9): [True: 0, False: 0]
  ------------------
 4122|      0|        doc->intSubset->next = NULL;
 4123|      0|        doc->intSubset->prev = NULL;
 4124|      0|    }
 4125|       |    return(NULL);
 4126|     52|}
xmlCopyDoc:
 4318|     52|xmlCopyDoc(xmlDoc *doc, int recursive) {
 4319|     52|    xmlDocPtr ret;
 4320|       |
 4321|     52|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4321:9): [True: 0, False: 52]
  ------------------
 4322|     52|    ret = xmlNewDoc(doc->version);
 4323|     52|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (4323:9): [True: 0, False: 52]
  ------------------
 4324|     52|    ret->type = doc->type;
 4325|     52|    if (doc->name != NULL) {
  ------------------
  |  Branch (4325:9): [True: 0, False: 52]
  ------------------
 4326|      0|        ret->name = xmlMemStrdup(doc->name);
 4327|      0|        if (ret->name == NULL)
  ------------------
  |  Branch (4327:13): [True: 0, False: 0]
  ------------------
 4328|      0|            goto error;
 4329|      0|    }
 4330|     52|    if (doc->encoding != NULL) {
  ------------------
  |  Branch (4330:9): [True: 0, False: 52]
  ------------------
 4331|      0|        ret->encoding = xmlStrdup(doc->encoding);
 4332|      0|        if (ret->encoding == NULL)
  ------------------
  |  Branch (4332:13): [True: 0, False: 0]
  ------------------
 4333|      0|            goto error;
 4334|      0|    }
 4335|     52|    if (doc->URL != NULL) {
  ------------------
  |  Branch (4335:9): [True: 0, False: 52]
  ------------------
 4336|      0|        ret->URL = xmlStrdup(doc->URL);
 4337|      0|        if (ret->URL == NULL)
  ------------------
  |  Branch (4337:13): [True: 0, False: 0]
  ------------------
 4338|      0|            goto error;
 4339|      0|    }
 4340|     52|    ret->charset = doc->charset;
 4341|     52|    ret->compression = doc->compression;
 4342|     52|    ret->standalone = doc->standalone;
 4343|     52|    if (!recursive) return(ret);
  ------------------
  |  Branch (4343:9): [True: 0, False: 52]
  ------------------
 4344|       |
 4345|     52|    ret->last = NULL;
 4346|     52|    ret->children = NULL;
 4347|     52|    if (doc->intSubset != NULL) {
  ------------------
  |  Branch (4347:9): [True: 0, False: 52]
  ------------------
 4348|      0|        ret->intSubset = xmlCopyDtd(doc->intSubset);
 4349|      0|	if (ret->intSubset == NULL)
  ------------------
  |  Branch (4349:6): [True: 0, False: 0]
  ------------------
 4350|      0|            goto error;
 4351|       |        /* Can't fail on DTD */
 4352|      0|	xmlSetTreeDoc((xmlNodePtr)ret->intSubset, ret);
 4353|      0|    }
 4354|     52|    if (doc->oldNs != NULL) {
  ------------------
  |  Branch (4354:9): [True: 0, False: 52]
  ------------------
 4355|      0|        ret->oldNs = xmlCopyNamespaceList(doc->oldNs);
 4356|      0|        if (ret->oldNs == NULL)
  ------------------
  |  Branch (4356:13): [True: 0, False: 0]
  ------------------
 4357|      0|            goto error;
 4358|      0|    }
 4359|     52|    if (doc->children != NULL) {
  ------------------
  |  Branch (4359:9): [True: 52, False: 0]
  ------------------
 4360|     52|	xmlNodePtr tmp;
 4361|       |
 4362|     52|	ret->children = xmlStaticCopyNodeList(doc->children, ret,
 4363|     52|		                               (xmlNodePtr)ret);
 4364|     52|        if (ret->children == NULL)
  ------------------
  |  Branch (4364:13): [True: 0, False: 52]
  ------------------
 4365|      0|            goto error;
 4366|     52|	ret->last = NULL;
 4367|     52|	tmp = ret->children;
 4368|    104|	while (tmp != NULL) {
  ------------------
  |  Branch (4368:9): [True: 52, False: 52]
  ------------------
 4369|     52|	    if (tmp->next == NULL)
  ------------------
  |  Branch (4369:10): [True: 52, False: 0]
  ------------------
 4370|     52|	        ret->last = tmp;
 4371|     52|	    tmp = tmp->next;
 4372|     52|	}
 4373|     52|    }
 4374|     52|    return(ret);
 4375|       |
 4376|      0|error:
 4377|      0|    xmlFreeDoc(ret);
 4378|       |    return(NULL);
 4379|     52|}
xmlGetNodePath:
 4459|      5|{
 4460|      5|    const xmlNode *cur, *tmp;
 4461|      5|    const xmlNode **nodes = NULL;
 4462|      5|    xmlChar *ret = NULL;
 4463|      5|    xmlBuf *buf;
 4464|      5|    size_t numNodes, i;
 4465|       |
 4466|      5|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4466:9): [True: 0, False: 5]
  |  Branch (4466:27): [True: 0, False: 5]
  ------------------
 4467|      0|        return(NULL);
 4468|       |
 4469|      5|    buf = xmlBufCreate(50);
 4470|      5|    if (buf == NULL)
  ------------------
  |  Branch (4470:9): [True: 0, False: 5]
  ------------------
 4471|      0|        return(NULL);
 4472|       |
 4473|       |    /*
 4474|       |     * Get list of ancestors
 4475|       |     */
 4476|      5|    numNodes = 0;
 4477|     15|    for (cur = node; cur != NULL; cur = cur->parent)
  ------------------
  |  Branch (4477:22): [True: 10, False: 5]
  ------------------
 4478|     10|        numNodes += 1;
 4479|      5|    if (numNodes > SIZE_MAX / sizeof(nodes[0]))
  ------------------
  |  Branch (4479:9): [True: 0, False: 5]
  ------------------
 4480|      0|        goto error;
 4481|      5|    nodes = xmlMalloc(numNodes * sizeof(nodes[0]));
 4482|      5|    if (nodes == NULL)
  ------------------
  |  Branch (4482:9): [True: 0, False: 5]
  ------------------
 4483|      0|        goto error;
 4484|      5|    i = 0;
 4485|     15|    for (cur = node; cur != NULL && i < numNodes; cur = cur->parent)
  ------------------
  |  Branch (4485:22): [True: 10, False: 5]
  |  Branch (4485:37): [True: 10, False: 0]
  ------------------
 4486|     10|        nodes[i++] = cur;
 4487|       |
 4488|       |    /*
 4489|       |     * Iterate in reverse to start at root
 4490|       |     */
 4491|     15|    while (i > 0) {
  ------------------
  |  Branch (4491:12): [True: 10, False: 5]
  ------------------
 4492|     10|        int occur = 0;
 4493|       |
 4494|     10|        i -= 1;
 4495|     10|        cur = nodes[i];
 4496|       |
 4497|     10|        if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (4497:13): [True: 5, False: 5]
  ------------------
 4498|      5|            (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (4498:13): [True: 0, False: 5]
  ------------------
 4499|      5|            if (i == 0)
  ------------------
  |  Branch (4499:17): [True: 0, False: 5]
  ------------------
 4500|      0|                xmlBufCat(buf, BAD_CAST "/");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4501|      5|        } else if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (4501:20): [True: 5, False: 0]
  ------------------
 4502|      5|            int generic = 0;
 4503|       |
 4504|      5|            xmlBufCat(buf, BAD_CAST "/");
  ------------------
  |  |   34|      5|#define BAD_CAST (xmlChar *)
  ------------------
 4505|       |
 4506|      5|            if (cur->ns) {
  ------------------
  |  Branch (4506:17): [True: 0, False: 5]
  ------------------
 4507|      0|		if (cur->ns->prefix != NULL) {
  ------------------
  |  Branch (4507:7): [True: 0, False: 0]
  ------------------
 4508|      0|                    xmlBufCat(buf, cur->ns->prefix);
 4509|      0|                    xmlBufCat(buf, BAD_CAST ":");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4510|      0|                    xmlBufCat(buf, cur->name);
 4511|      0|		} else {
 4512|       |		    /*
 4513|       |		    * We cannot express named elements in the default
 4514|       |		    * namespace, so use "*".
 4515|       |		    */
 4516|      0|		    generic = 1;
 4517|      0|                    xmlBufCat(buf, BAD_CAST "*");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4518|      0|		}
 4519|      5|            } else {
 4520|      5|                xmlBufCat(buf, cur->name);
 4521|      5|            }
 4522|       |
 4523|       |            /*
 4524|       |             * Thumbler index computation
 4525|       |	     * TODO: the occurrence test seems bogus for namespaced names
 4526|       |             */
 4527|      5|            tmp = cur->prev;
 4528|      5|            while (tmp != NULL) {
  ------------------
  |  Branch (4528:20): [True: 0, False: 5]
  ------------------
 4529|      0|                if ((tmp->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (4529:21): [True: 0, False: 0]
  ------------------
 4530|      0|		    (generic ||
  ------------------
  |  Branch (4530:8): [True: 0, False: 0]
  ------------------
 4531|      0|		     (xmlStrEqual(cur->name, tmp->name) &&
  ------------------
  |  Branch (4531:9): [True: 0, False: 0]
  ------------------
 4532|      0|		     ((tmp->ns == cur->ns) ||
  ------------------
  |  Branch (4532:9): [True: 0, False: 0]
  ------------------
 4533|      0|		      ((tmp->ns != NULL) && (cur->ns != NULL) &&
  ------------------
  |  Branch (4533:10): [True: 0, False: 0]
  |  Branch (4533:31): [True: 0, False: 0]
  ------------------
 4534|      0|		       (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix)))))))
  ------------------
  |  Branch (4534:10): [True: 0, False: 0]
  ------------------
 4535|      0|                    occur++;
 4536|      0|                tmp = tmp->prev;
 4537|      0|            }
 4538|      5|            if (occur == 0) {
  ------------------
  |  Branch (4538:17): [True: 5, False: 0]
  ------------------
 4539|      5|                tmp = cur->next;
 4540|      5|                while (tmp != NULL && occur == 0) {
  ------------------
  |  Branch (4540:24): [True: 0, False: 5]
  |  Branch (4540:39): [True: 0, False: 0]
  ------------------
 4541|      0|                    if ((tmp->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (4541:25): [True: 0, False: 0]
  ------------------
 4542|      0|			(generic ||
  ------------------
  |  Branch (4542:5): [True: 0, False: 0]
  ------------------
 4543|      0|			 (xmlStrEqual(cur->name, tmp->name) &&
  ------------------
  |  Branch (4543:6): [True: 0, False: 0]
  ------------------
 4544|      0|			 ((tmp->ns == cur->ns) ||
  ------------------
  |  Branch (4544:6): [True: 0, False: 0]
  ------------------
 4545|      0|			  ((tmp->ns != NULL) && (cur->ns != NULL) &&
  ------------------
  |  Branch (4545:7): [True: 0, False: 0]
  |  Branch (4545:28): [True: 0, False: 0]
  ------------------
 4546|      0|			   (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix)))))))
  ------------------
  |  Branch (4546:7): [True: 0, False: 0]
  ------------------
 4547|      0|                        occur++;
 4548|      0|                    tmp = tmp->next;
 4549|      0|                }
 4550|      5|                if (occur != 0)
  ------------------
  |  Branch (4550:21): [True: 0, False: 5]
  ------------------
 4551|      0|                    occur = 1;
 4552|      5|            } else
 4553|      0|                occur++;
 4554|      5|        } else if (cur->type == XML_COMMENT_NODE) {
  ------------------
  |  Branch (4554:20): [True: 0, False: 0]
  ------------------
 4555|      0|            xmlBufCat(buf, BAD_CAST "/comment()");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4556|       |
 4557|       |            /*
 4558|       |             * Thumbler index computation
 4559|       |             */
 4560|      0|            tmp = cur->prev;
 4561|      0|            while (tmp != NULL) {
  ------------------
  |  Branch (4561:20): [True: 0, False: 0]
  ------------------
 4562|      0|                if (tmp->type == XML_COMMENT_NODE)
  ------------------
  |  Branch (4562:21): [True: 0, False: 0]
  ------------------
 4563|      0|		    occur++;
 4564|      0|                tmp = tmp->prev;
 4565|      0|            }
 4566|      0|            if (occur == 0) {
  ------------------
  |  Branch (4566:17): [True: 0, False: 0]
  ------------------
 4567|      0|                tmp = cur->next;
 4568|      0|                while (tmp != NULL && occur == 0) {
  ------------------
  |  Branch (4568:24): [True: 0, False: 0]
  |  Branch (4568:39): [True: 0, False: 0]
  ------------------
 4569|      0|		    if (tmp->type == XML_COMMENT_NODE)
  ------------------
  |  Branch (4569:11): [True: 0, False: 0]
  ------------------
 4570|      0|		        occur++;
 4571|      0|                    tmp = tmp->next;
 4572|      0|                }
 4573|      0|                if (occur != 0)
  ------------------
  |  Branch (4573:21): [True: 0, False: 0]
  ------------------
 4574|      0|                    occur = 1;
 4575|      0|            } else
 4576|      0|                occur++;
 4577|      0|        } else if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4577:20): [True: 0, False: 0]
  ------------------
 4578|      0|                   (cur->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (4578:20): [True: 0, False: 0]
  ------------------
 4579|      0|            xmlBufCat(buf, BAD_CAST "/text()");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4580|       |
 4581|       |            /*
 4582|       |             * Thumbler index computation
 4583|       |             */
 4584|      0|            tmp = cur->prev;
 4585|      0|            while (tmp != NULL) {
  ------------------
  |  Branch (4585:20): [True: 0, False: 0]
  ------------------
 4586|      0|                if ((tmp->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4586:21): [True: 0, False: 0]
  ------------------
 4587|      0|		    (tmp->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (4587:7): [True: 0, False: 0]
  ------------------
 4588|      0|		    occur++;
 4589|      0|                tmp = tmp->prev;
 4590|      0|            }
 4591|       |	    /*
 4592|       |	    * Evaluate if this is the only text- or CDATA-section-node;
 4593|       |	    * if yes, then we'll get "text()", otherwise "text()[1]".
 4594|       |	    */
 4595|      0|            if (occur == 0) {
  ------------------
  |  Branch (4595:17): [True: 0, False: 0]
  ------------------
 4596|      0|                tmp = cur->next;
 4597|      0|                while (tmp != NULL) {
  ------------------
  |  Branch (4597:24): [True: 0, False: 0]
  ------------------
 4598|      0|		    if ((tmp->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4598:11): [True: 0, False: 0]
  ------------------
 4599|      0|			(tmp->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (4599:4): [True: 0, False: 0]
  ------------------
 4600|      0|		    {
 4601|      0|			occur = 1;
 4602|      0|			break;
 4603|      0|		    }
 4604|      0|		    tmp = tmp->next;
 4605|      0|		}
 4606|      0|            } else
 4607|      0|                occur++;
 4608|      0|        } else if (cur->type == XML_PI_NODE) {
  ------------------
  |  Branch (4608:20): [True: 0, False: 0]
  ------------------
 4609|      0|            xmlBufCat(buf, BAD_CAST "/processing-instruction('");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4610|      0|            xmlBufCat(buf, cur->name);
 4611|      0|            xmlBufCat(buf, BAD_CAST "')");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4612|       |
 4613|       |            /*
 4614|       |             * Thumbler index computation
 4615|       |             */
 4616|      0|            tmp = cur->prev;
 4617|      0|            while (tmp != NULL) {
  ------------------
  |  Branch (4617:20): [True: 0, False: 0]
  ------------------
 4618|      0|                if ((tmp->type == XML_PI_NODE) &&
  ------------------
  |  Branch (4618:21): [True: 0, False: 0]
  ------------------
 4619|      0|		    (xmlStrEqual(cur->name, tmp->name)))
  ------------------
  |  Branch (4619:7): [True: 0, False: 0]
  ------------------
 4620|      0|                    occur++;
 4621|      0|                tmp = tmp->prev;
 4622|      0|            }
 4623|      0|            if (occur == 0) {
  ------------------
  |  Branch (4623:17): [True: 0, False: 0]
  ------------------
 4624|      0|                tmp = cur->next;
 4625|      0|                while (tmp != NULL && occur == 0) {
  ------------------
  |  Branch (4625:24): [True: 0, False: 0]
  |  Branch (4625:39): [True: 0, False: 0]
  ------------------
 4626|      0|                    if ((tmp->type == XML_PI_NODE) &&
  ------------------
  |  Branch (4626:25): [True: 0, False: 0]
  ------------------
 4627|      0|			(xmlStrEqual(cur->name, tmp->name)))
  ------------------
  |  Branch (4627:4): [True: 0, False: 0]
  ------------------
 4628|      0|                        occur++;
 4629|      0|                    tmp = tmp->next;
 4630|      0|                }
 4631|      0|                if (occur != 0)
  ------------------
  |  Branch (4631:21): [True: 0, False: 0]
  ------------------
 4632|      0|                    occur = 1;
 4633|      0|            } else
 4634|      0|                occur++;
 4635|       |
 4636|      0|        } else if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (4636:20): [True: 0, False: 0]
  ------------------
 4637|      0|            xmlBufCat(buf, BAD_CAST "/@");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4638|      0|            if (cur->ns && cur->ns->prefix != NULL) {
  ------------------
  |  Branch (4638:17): [True: 0, False: 0]
  |  Branch (4638:28): [True: 0, False: 0]
  ------------------
 4639|      0|                xmlBufCat(buf, cur->ns->prefix);
 4640|      0|                xmlBufCat(buf, BAD_CAST ":");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4641|      0|            }
 4642|      0|            xmlBufCat(buf, cur->name);
 4643|      0|        } else {
 4644|      0|            goto error;
 4645|      0|        }
 4646|       |
 4647|     10|        if (occur > 0) {
  ------------------
  |  Branch (4647:13): [True: 0, False: 10]
  ------------------
 4648|      0|            char tmpbuf[30];
 4649|       |
 4650|      0|            snprintf(tmpbuf, sizeof(tmpbuf), "[%d]", occur);
 4651|      0|            xmlBufCat(buf, BAD_CAST tmpbuf);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4652|      0|        }
 4653|     10|    }
 4654|       |
 4655|      5|    ret = xmlBufDetach(buf);
 4656|       |
 4657|      5|error:
 4658|      5|    xmlBufFree(buf);
 4659|      5|    xmlFree(nodes);
 4660|      5|    return(ret);
 4661|      5|}
xmlDocGetRootElement:
 4674|   314k|xmlDocGetRootElement(const xmlDoc *doc) {
 4675|   314k|    xmlNodePtr ret;
 4676|       |
 4677|   314k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4677:9): [True: 0, False: 314k]
  ------------------
 4678|   314k|    ret = doc->children;
 4679|   314k|    while (ret != NULL) {
  ------------------
  |  Branch (4679:12): [True: 314k, False: 0]
  ------------------
 4680|   314k|	if (ret->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (4680:6): [True: 314k, False: 1]
  ------------------
 4681|   314k|	    return(ret);
 4682|      1|        ret = ret->next;
 4683|      1|    }
 4684|      0|    return(ret);
 4685|   314k|}
xmlDocSetRootElement:
 4702|    247|xmlDocSetRootElement(xmlDoc *doc, xmlNode *root) {
 4703|    247|    xmlNodePtr old = NULL;
 4704|       |
 4705|    247|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4705:9): [True: 0, False: 247]
  ------------------
 4706|    247|    if ((root == NULL) || (root->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4706:9): [True: 0, False: 247]
  |  Branch (4706:27): [True: 0, False: 247]
  ------------------
 4707|      0|	return(NULL);
 4708|    247|    old = doc->children;
 4709|    247|    while (old != NULL) {
  ------------------
  |  Branch (4709:12): [True: 0, False: 247]
  ------------------
 4710|      0|	if (old->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (4710:6): [True: 0, False: 0]
  ------------------
 4711|      0|	    break;
 4712|      0|        old = old->next;
 4713|      0|    }
 4714|    247|    if (old == root)
  ------------------
  |  Branch (4714:9): [True: 0, False: 247]
  ------------------
 4715|      0|        return(old);
 4716|    247|    xmlUnlinkNodeInternal(root);
 4717|    247|    if (xmlSetTreeDoc(root, doc) < 0)
  ------------------
  |  Branch (4717:9): [True: 0, False: 247]
  ------------------
 4718|      0|        return(NULL);
 4719|    247|    root->parent = (xmlNodePtr) doc;
 4720|    247|    if (old == NULL) {
  ------------------
  |  Branch (4720:9): [True: 247, False: 0]
  ------------------
 4721|    247|	if (doc->children == NULL) {
  ------------------
  |  Branch (4721:6): [True: 247, False: 0]
  ------------------
 4722|    247|	    doc->children = root;
 4723|    247|	    doc->last = root;
 4724|    247|	} else {
 4725|      0|	    xmlAddSibling(doc->children, root);
 4726|      0|	}
 4727|    247|    } else {
 4728|      0|	xmlReplaceNode(old, root);
 4729|      0|    }
 4730|    247|    return(old);
 4731|    247|}
xmlBufGetNodeContent:
 5202|    292|{
 5203|    292|    if ((cur == NULL) || (buf == NULL))
  ------------------
  |  Branch (5203:9): [True: 0, False: 292]
  |  Branch (5203:26): [True: 0, False: 292]
  ------------------
 5204|      0|        return(-1);
 5205|       |
 5206|    292|    switch (cur->type) {
 5207|    292|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5207:9): [True: 292, False: 0]
  ------------------
 5208|    292|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5208:9): [True: 0, False: 292]
  ------------------
 5209|    292|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5209:9): [True: 0, False: 292]
  ------------------
 5210|    292|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5210:9): [True: 0, False: 292]
  ------------------
 5211|    292|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5211:9): [True: 0, False: 292]
  ------------------
 5212|    292|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (5212:9): [True: 0, False: 292]
  ------------------
 5213|    292|            xmlBufGetChildContent(buf, cur);
 5214|    292|            break;
 5215|       |
 5216|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5216:9): [True: 0, False: 292]
  ------------------
 5217|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5217:9): [True: 0, False: 292]
  ------------------
 5218|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5218:9): [True: 0, False: 292]
  ------------------
 5219|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5219:9): [True: 0, False: 292]
  ------------------
 5220|      0|	    xmlBufCat(buf, cur->content);
 5221|      0|            break;
 5222|       |
 5223|      0|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5223:9): [True: 0, False: 292]
  ------------------
 5224|      0|            xmlBufGetEntityRefContent(buf, cur);
 5225|      0|            break;
 5226|       |
 5227|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5227:9): [True: 0, False: 292]
  ------------------
 5228|      0|	    xmlBufCat(buf, ((xmlNsPtr) cur)->href);
 5229|      0|	    break;
 5230|       |
 5231|      0|        default:
  ------------------
  |  Branch (5231:9): [True: 0, False: 292]
  ------------------
 5232|      0|            break;
 5233|    292|    }
 5234|       |
 5235|    292|    return(0);
 5236|    292|}
xmlNodeGetContent:
 5253|   308k|{
 5254|   308k|    xmlBufPtr buf;
 5255|   308k|    xmlChar *ret;
 5256|       |
 5257|   308k|    if (cur == NULL)
  ------------------
  |  Branch (5257:9): [True: 0, False: 308k]
  ------------------
 5258|      0|        return (NULL);
 5259|       |
 5260|   308k|    switch (cur->type) {
 5261|    292|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5261:9): [True: 292, False: 307k]
  ------------------
 5262|    292|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5262:9): [True: 0, False: 308k]
  ------------------
 5263|    292|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5263:9): [True: 0, False: 308k]
  ------------------
 5264|    292|            break;
 5265|       |
 5266|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5266:9): [True: 0, False: 308k]
  ------------------
 5267|   307k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5267:9): [True: 307k, False: 292]
  ------------------
 5268|   307k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5268:9): [True: 0, False: 308k]
  ------------------
 5269|   307k|        case XML_ENTITY_DECL: {
  ------------------
  |  Branch (5269:9): [True: 0, False: 308k]
  ------------------
 5270|   307k|            xmlNodePtr children = cur->children;
 5271|       |
 5272|   307k|            if (children == NULL)
  ------------------
  |  Branch (5272:17): [True: 0, False: 307k]
  ------------------
 5273|      0|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5274|       |
 5275|       |            /* Optimization for single text children */
 5276|   307k|            if (((children->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (5276:18): [True: 307k, False: 0]
  ------------------
 5277|      0|                 (children->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (5277:18): [True: 0, False: 0]
  ------------------
 5278|   307k|                (children->next == NULL)) {
  ------------------
  |  Branch (5278:17): [True: 307k, False: 0]
  ------------------
 5279|   307k|                if (children->content == NULL)
  ------------------
  |  Branch (5279:21): [True: 0, False: 307k]
  ------------------
 5280|      0|                    return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5281|   307k|                return(xmlStrdup(children->content));
 5282|   307k|            }
 5283|       |
 5284|      0|            break;
 5285|   307k|        }
 5286|       |
 5287|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5287:9): [True: 0, False: 308k]
  ------------------
 5288|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5288:9): [True: 0, False: 308k]
  ------------------
 5289|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5289:9): [True: 0, False: 308k]
  ------------------
 5290|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5290:9): [True: 0, False: 308k]
  ------------------
 5291|      0|            if (cur->content != NULL)
  ------------------
  |  Branch (5291:17): [True: 0, False: 0]
  ------------------
 5292|      0|                return(xmlStrdup(cur->content));
 5293|      0|            else
 5294|      0|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5295|       |
 5296|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5296:9): [True: 0, False: 308k]
  ------------------
 5297|      0|	    return(xmlStrdup(((xmlNsPtr) cur)->href));
 5298|       |
 5299|      0|        default:
  ------------------
  |  Branch (5299:9): [True: 0, False: 308k]
  ------------------
 5300|      0|            return(NULL);
 5301|   308k|    }
 5302|       |
 5303|    292|    buf = xmlBufCreate(50);
 5304|    292|    if (buf == NULL)
  ------------------
  |  Branch (5304:9): [True: 0, False: 292]
  ------------------
 5305|      0|        return (NULL);
 5306|    292|    xmlBufGetNodeContent(buf, cur);
 5307|    292|    ret = xmlBufDetach(buf);
 5308|    292|    xmlBufFree(buf);
 5309|       |
 5310|    292|    return(ret);
 5311|    292|}
xmlNodeSetContent:
 5382|    247|xmlNodeSetContent(xmlNode *cur, const xmlChar *content) {
 5383|    247|    return(xmlNodeSetContentInternal(cur, content, -1));
 5384|    247|}
xmlSearchNsSafe:
 5650|      6|                xmlNs **out) {
 5651|      6|    xmlNsPtr cur;
 5652|      6|    xmlDocPtr doc;
 5653|      6|    xmlNodePtr orig = node;
 5654|      6|    xmlNodePtr parent;
 5655|       |
 5656|      6|    if (out == NULL)
  ------------------
  |  Branch (5656:9): [True: 0, False: 6]
  ------------------
 5657|      0|        return(1);
 5658|      6|    *out = NULL;
 5659|      6|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5659:9): [True: 0, False: 6]
  |  Branch (5659:27): [True: 0, False: 6]
  ------------------
 5660|      0|        return(1);
 5661|       |
 5662|      6|    doc = node->doc;
 5663|       |
 5664|      6|    if ((doc != NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|      6|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 6]
  |  |  |  Branch (100:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  101|      6|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 0, False: 0]
  |  |  |  Branch (101:22): [True: 0, False: 0]
  |  |  |  Branch (101:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5664:9): [True: 6, False: 0]
  ------------------
 5665|      0|        cur = xmlTreeEnsureXMLDecl(doc);
 5666|      0|        if (cur == NULL)
  ------------------
  |  Branch (5666:13): [True: 0, False: 0]
  ------------------
 5667|      0|            return(-1);
 5668|      0|        *out = cur;
 5669|      0|        return(0);
 5670|      0|    }
 5671|       |
 5672|      6|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5672:12): [True: 0, False: 6]
  ------------------
 5673|      0|        node = node->parent;
 5674|      0|        if (node == NULL)
  ------------------
  |  Branch (5674:13): [True: 0, False: 0]
  ------------------
 5675|      0|            return(0);
 5676|      0|    }
 5677|       |
 5678|      6|    parent = node;
 5679|       |
 5680|     12|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5680:12): [True: 12, False: 0]
  |  Branch (5680:30): [True: 6, False: 6]
  ------------------
 5681|      6|        cur = node->nsDef;
 5682|      6|        while (cur != NULL) {
  ------------------
  |  Branch (5682:16): [True: 0, False: 6]
  ------------------
 5683|      0|            if ((xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5683:17): [True: 0, False: 0]
  ------------------
 5684|      0|                (cur->href != NULL)) {
  ------------------
  |  Branch (5684:17): [True: 0, False: 0]
  ------------------
 5685|      0|                *out = cur;
 5686|      0|                return(0);
 5687|      0|            }
 5688|      0|            cur = cur->next;
 5689|      0|        }
 5690|      6|        if (orig != node) {
  ------------------
  |  Branch (5690:13): [True: 0, False: 6]
  ------------------
 5691|      0|            cur = node->ns;
 5692|      0|            if ((cur != NULL) &&
  ------------------
  |  Branch (5692:17): [True: 0, False: 0]
  ------------------
 5693|      0|                (xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5693:17): [True: 0, False: 0]
  ------------------
 5694|      0|                (cur->href != NULL)) {
  ------------------
  |  Branch (5694:17): [True: 0, False: 0]
  ------------------
 5695|      0|                *out = cur;
 5696|      0|                return(0);
 5697|      0|            }
 5698|      0|        }
 5699|       |
 5700|      6|	node = node->parent;
 5701|      6|    }
 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|      6|    if ((doc == NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|      0|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 0]
  |  |  |  Branch (100:43): [True: 0, False: 0]
  |  |  ------------------
  |  |  101|      0|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 0, False: 0]
  |  |  |  Branch (101:22): [True: 0, False: 0]
  |  |  |  Branch (101:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5708:9): [True: 0, False: 6]
  ------------------
 5709|      0|        cur = xmlNewXmlNs();
 5710|      0|        if (cur == NULL)
  ------------------
  |  Branch (5710:13): [True: 0, False: 0]
  ------------------
 5711|      0|            return(-1);
 5712|      0|        cur->next = parent->nsDef;
 5713|      0|        parent->nsDef = cur;
 5714|      0|        *out = cur;
 5715|      0|    }
 5716|       |
 5717|      6|    return(0);
 5718|      6|}
xmlSearchNs:
 5739|      6|            const xmlChar *nameSpace) {
 5740|      6|    xmlNsPtr cur;
 5741|       |
 5742|      6|    xmlSearchNsSafe(node, nameSpace, &cur);
 5743|      6|    return(cur);
 5744|      6|}
xmlIsBlankNode:
 6630|     20|xmlIsBlankNode(const xmlNode *node) {
 6631|     20|    const xmlChar *cur;
 6632|     20|    if (node == NULL) return(0);
  ------------------
  |  Branch (6632:9): [True: 0, False: 20]
  ------------------
 6633|       |
 6634|     20|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (6634:9): [True: 0, False: 20]
  ------------------
 6635|      0|        (node->type != XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (6635:9): [True: 0, False: 0]
  ------------------
 6636|      0|	return(0);
 6637|     20|    if (node->content == NULL) return(1);
  ------------------
  |  Branch (6637:9): [True: 0, False: 20]
  ------------------
 6638|     20|    cur = node->content;
 6639|     20|    while (*cur != 0) {
  ------------------
  |  Branch (6639:12): [True: 20, False: 0]
  ------------------
 6640|     20|	if (!IS_BLANK_CH(*cur)) return(0);
  ------------------
  |  |  137|     20|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|     20|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  |  |   91|     20|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 20, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  |  |   92|     20|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6641|      0|	cur++;
 6642|      0|    }
 6643|       |
 6644|      0|    return(1);
 6645|     20|}
tree.c:xmlNewElem:
 1842|    249|           const xmlChar *content) {
 1843|    249|    xmlNodePtr cur;
 1844|       |
 1845|    249|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1846|    249|    if (cur == NULL)
  ------------------
  |  Branch (1846:9): [True: 0, False: 249]
  ------------------
 1847|      0|	return(NULL);
 1848|    249|    memset(cur, 0, sizeof(xmlNode));
 1849|       |
 1850|    249|    cur->type = XML_ELEMENT_NODE;
 1851|    249|    cur->doc = doc;
 1852|    249|    cur->name = name;
 1853|    249|    cur->ns = ns;
 1854|       |
 1855|    249|    if (content != NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 249]
  ------------------
 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|    249|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1868:9): [True: 0, False: 249]
  |  Branch (1868:35): [True: 0, False: 0]
  ------------------
 1869|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1870|       |
 1871|    249|    return(cur);
 1872|    249|}
tree.c:xmlUnlinkNodeInternal:
 3485|    248|xmlUnlinkNodeInternal(xmlNodePtr cur) {
 3486|    248|    if (cur->parent != NULL) {
  ------------------
  |  Branch (3486:9): [True: 1, False: 247]
  ------------------
 3487|      1|	xmlNodePtr parent;
 3488|      1|	parent = cur->parent;
 3489|      1|	if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3489:6): [True: 0, False: 1]
  ------------------
 3490|      0|	    if (parent->properties == (xmlAttrPtr) cur)
  ------------------
  |  Branch (3490:10): [True: 0, False: 0]
  ------------------
 3491|      0|		parent->properties = ((xmlAttrPtr) cur)->next;
 3492|      1|	} else {
 3493|      1|	    if (parent->children == cur)
  ------------------
  |  Branch (3493:10): [True: 1, False: 0]
  ------------------
 3494|      1|		parent->children = cur->next;
 3495|      1|	    if (parent->last == cur)
  ------------------
  |  Branch (3495:10): [True: 0, False: 1]
  ------------------
 3496|      0|		parent->last = cur->prev;
 3497|      1|	}
 3498|      1|	cur->parent = NULL;
 3499|      1|    }
 3500|       |
 3501|    248|    if (cur->next != NULL)
  ------------------
  |  Branch (3501:9): [True: 1, False: 247]
  ------------------
 3502|      1|        cur->next->prev = cur->prev;
 3503|    248|    if (cur->prev != NULL)
  ------------------
  |  Branch (3503:9): [True: 0, False: 248]
  ------------------
 3504|      0|        cur->prev->next = cur->next;
 3505|    248|    cur->next = NULL;
 3506|       |    cur->prev = NULL;
 3507|    248|}
tree.c:xmlBufGetChildContent:
 5157|    292|xmlBufGetChildContent(xmlBufPtr buf, const xmlNode *tree) {
 5158|    292|    const xmlNode *cur = tree->children;
 5159|       |
 5160|    584|    while (cur != NULL) {
  ------------------
  |  Branch (5160:12): [True: 584, False: 0]
  ------------------
 5161|    584|        switch (cur->type) {
 5162|    292|            case XML_TEXT_NODE:
  ------------------
  |  Branch (5162:13): [True: 292, False: 292]
  ------------------
 5163|    292|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5163:13): [True: 0, False: 584]
  ------------------
 5164|    292|                xmlBufCat(buf, cur->content);
 5165|    292|                break;
 5166|       |
 5167|      0|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5167:13): [True: 0, False: 584]
  ------------------
 5168|      0|                xmlBufGetEntityRefContent(buf, cur);
 5169|      0|                break;
 5170|       |
 5171|    292|            default:
  ------------------
  |  Branch (5171:13): [True: 292, False: 292]
  ------------------
 5172|    292|                if (cur->children != NULL) {
  ------------------
  |  Branch (5172:21): [True: 292, False: 0]
  ------------------
 5173|    292|                    cur = cur->children;
 5174|    292|                    continue;
 5175|    292|                }
 5176|      0|                break;
 5177|    584|        }
 5178|       |
 5179|    584|        while (cur->next == NULL) {
  ------------------
  |  Branch (5179:16): [True: 584, False: 0]
  ------------------
 5180|    584|            cur = cur->parent;
 5181|    584|            if (cur == tree)
  ------------------
  |  Branch (5181:17): [True: 292, False: 292]
  ------------------
 5182|    292|                return;
 5183|    584|        }
 5184|      0|        cur = cur->next;
 5185|      0|    }
 5186|    292|}
tree.c:xmlNodeSetContentInternal:
 5314|    247|xmlNodeSetContentInternal(xmlNodePtr cur, const xmlChar *content, int len) {
 5315|    247|    if (cur == NULL) {
  ------------------
  |  Branch (5315:9): [True: 0, False: 247]
  ------------------
 5316|      0|	return(1);
 5317|      0|    }
 5318|    247|    switch (cur->type) {
 5319|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5319:9): [True: 0, False: 247]
  ------------------
 5320|    247|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5320:9): [True: 247, False: 0]
  ------------------
 5321|    247|        case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (5321:9): [True: 0, False: 247]
  ------------------
 5322|    247|            size_t maxSize = len < 0 ? SIZE_MAX : (size_t) len;
  ------------------
  |  Branch (5322:30): [True: 247, False: 0]
  ------------------
 5323|       |
 5324|       |            /*
 5325|       |             * We shouldn't parse the content as attribute value here,
 5326|       |             * but the API can't be changed.
 5327|       |             */
 5328|    247|            if (xmlNodeParseAttValue(cur->doc, (xmlAttr *) cur,
  ------------------
  |  Branch (5328:17): [True: 0, False: 247]
  ------------------
 5329|    247|                                     content, maxSize, NULL) < 0)
 5330|      0|                return(-1);
 5331|    247|	    break;
 5332|    247|        }
 5333|       |
 5334|    247|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5334:9): [True: 0, False: 247]
  ------------------
 5335|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5335:9): [True: 0, False: 247]
  ------------------
 5336|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5336:9): [True: 0, False: 247]
  ------------------
 5337|      0|        case XML_COMMENT_NODE: {
  ------------------
  |  Branch (5337:9): [True: 0, False: 247]
  ------------------
 5338|      0|            xmlChar *copy = NULL;
 5339|       |
 5340|      0|	    if (content != NULL) {
  ------------------
  |  Branch (5340:10): [True: 0, False: 0]
  ------------------
 5341|      0|                if (len < 0)
  ------------------
  |  Branch (5341:21): [True: 0, False: 0]
  ------------------
 5342|      0|                    copy = xmlStrdup(content);
 5343|      0|                else
 5344|      0|		    copy = xmlStrndup(content, len);
 5345|      0|                if (copy == NULL)
  ------------------
  |  Branch (5345:21): [True: 0, False: 0]
  ------------------
 5346|      0|                    return(-1);
 5347|      0|	    }
 5348|       |
 5349|      0|            xmlTextSetContent(cur, copy);
 5350|      0|	    break;
 5351|      0|        }
 5352|       |
 5353|      0|        default:
  ------------------
  |  Branch (5353:9): [True: 0, False: 247]
  ------------------
 5354|      0|            break;
 5355|    247|    }
 5356|       |
 5357|    247|    return(0);
 5358|    247|}

xmlParseURISafe:
  962|      1|xmlParseURISafe(const char *str, xmlURI **uriOut) {
  963|      1|    xmlURIPtr uri;
  964|      1|    int ret;
  965|       |
  966|      1|    if (uriOut == NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 1]
  ------------------
  967|      0|        return(1);
  968|      1|    *uriOut = NULL;
  969|      1|    if (str == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 1]
  ------------------
  970|      0|	return(1);
  971|       |
  972|      1|    uri = xmlCreateURI();
  973|      1|    if (uri == NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 1]
  ------------------
  974|      0|        return(-1);
  975|       |
  976|      1|    ret = xmlParse3986URIReference(uri, str);
  977|      1|    if (ret) {
  ------------------
  |  Branch (977:9): [True: 0, False: 1]
  ------------------
  978|      0|        xmlFreeURI(uri);
  979|      0|        return(ret);
  980|      0|    }
  981|       |
  982|      1|    *uriOut = uri;
  983|      1|    return(0);
  984|      1|}
xmlCreateURI:
 1058|      1|xmlCreateURI(void) {
 1059|      1|    xmlURIPtr ret;
 1060|       |
 1061|      1|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1062|      1|    if (ret == NULL)
  ------------------
  |  Branch (1062:9): [True: 0, False: 1]
  ------------------
 1063|      0|	return(NULL);
 1064|      1|    memset(ret, 0, sizeof(xmlURI));
 1065|      1|    ret->port = PORT_EMPTY;
  ------------------
  |  |   36|      1|#define PORT_EMPTY           0
  ------------------
 1066|      1|    return(ret);
 1067|      1|}
xmlFreeURI:
 1412|      1|xmlFreeURI(xmlURI *uri) {
 1413|      1|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 0, False: 1]
  ------------------
 1414|       |
 1415|      1|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 1, False: 0]
  ------------------
 1416|      1|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1416:9): [True: 1, False: 0]
  ------------------
 1417|      1|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1417:9): [True: 0, False: 1]
  ------------------
 1418|      1|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1418:9): [True: 1, False: 0]
  ------------------
 1419|      1|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1419:9): [True: 0, False: 1]
  ------------------
 1420|      1|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1420:9): [True: 0, False: 1]
  ------------------
 1421|      1|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1421:9): [True: 0, False: 1]
  ------------------
 1422|      1|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1422:9): [True: 0, False: 1]
  ------------------
 1423|      1|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1423:9): [True: 0, False: 1]
  ------------------
 1424|      1|    xmlFree(uri);
 1425|      1|}
xmlURIUnescapeString:
 1580|      2|xmlURIUnescapeString(const char *str, int len, char *target) {
 1581|      2|    char *ret, *out;
 1582|      2|    const char *in;
 1583|       |
 1584|      2|    if (str == NULL)
  ------------------
  |  Branch (1584:9): [True: 0, False: 2]
  ------------------
 1585|      0|	return(NULL);
 1586|      2|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1586:9): [True: 0, False: 2]
  ------------------
 1587|      2|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1587:9): [True: 0, False: 2]
  ------------------
 1588|       |
 1589|      2|    if (target == NULL) {
  ------------------
  |  Branch (1589:9): [True: 2, False: 0]
  ------------------
 1590|      2|	ret = xmlMalloc(len + 1);
 1591|      2|	if (ret == NULL)
  ------------------
  |  Branch (1591:6): [True: 0, False: 2]
  ------------------
 1592|      0|	    return(NULL);
 1593|      2|    } else
 1594|      0|	ret = target;
 1595|      2|    in = str;
 1596|      2|    out = ret;
 1597|     36|    while(len > 0) {
  ------------------
  |  Branch (1597:11): [True: 34, False: 2]
  ------------------
 1598|     34|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1598:6): [True: 30, False: 4]
  |  Branch (1598:19): [True: 0, False: 30]
  |  Branch (1598:35): [True: 0, False: 0]
  |  Branch (1598:54): [True: 0, False: 0]
  ------------------
 1599|      0|            int c = 0;
 1600|      0|	    in++;
 1601|      0|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1601:10): [True: 0, False: 0]
  |  Branch (1601:26): [True: 0, False: 0]
  ------------------
 1602|      0|	        c = (*in - '0');
 1603|      0|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1603:15): [True: 0, False: 0]
  |  Branch (1603:31): [True: 0, False: 0]
  ------------------
 1604|      0|	        c = (*in - 'a') + 10;
 1605|      0|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1605:15): [True: 0, False: 0]
  |  Branch (1605:31): [True: 0, False: 0]
  ------------------
 1606|      0|	        c = (*in - 'A') + 10;
 1607|      0|	    in++;
 1608|      0|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1608:10): [True: 0, False: 0]
  |  Branch (1608:26): [True: 0, False: 0]
  ------------------
 1609|      0|	        c = c * 16 + (*in - '0');
 1610|      0|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1610:15): [True: 0, False: 0]
  |  Branch (1610:31): [True: 0, False: 0]
  ------------------
 1611|      0|	        c = c * 16 + (*in - 'a') + 10;
 1612|      0|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1612:15): [True: 0, False: 0]
  |  Branch (1612:31): [True: 0, False: 0]
  ------------------
 1613|      0|	        c = c * 16 + (*in - 'A') + 10;
 1614|      0|	    in++;
 1615|      0|	    len -= 3;
 1616|       |            /* Explicit sign change */
 1617|      0|	    *out++ = (char) c;
 1618|     34|	} else {
 1619|     34|	    *out++ = *in++;
 1620|     34|	    len--;
 1621|     34|	}
 1622|     34|    }
 1623|      2|    *out = 0;
 1624|      2|    return(ret);
 1625|      2|}
xmlURIEscapeStr:
 1637|      2|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1638|      2|    xmlChar *ret, ch;
 1639|      2|    const xmlChar *in;
 1640|      2|    int len, out;
 1641|       |
 1642|      2|    if (str == NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 2]
  ------------------
 1643|      0|	return(NULL);
 1644|      2|    if (str[0] == 0)
  ------------------
  |  Branch (1644:9): [True: 0, False: 2]
  ------------------
 1645|      0|	return(xmlStrdup(str));
 1646|      2|    len = xmlStrlen(str);
 1647|      2|    if (len == 0)
  ------------------
  |  Branch (1647:9): [True: 0, False: 2]
  ------------------
 1648|      0|        return(NULL);
 1649|       |
 1650|      2|    len += 20;
 1651|      2|    ret = xmlMalloc(len);
 1652|      2|    if (ret == NULL)
  ------------------
  |  Branch (1652:9): [True: 0, False: 2]
  ------------------
 1653|      0|	return(NULL);
 1654|      2|    in = (const xmlChar *) str;
 1655|      2|    out = 0;
 1656|     84|    while(*in != 0) {
  ------------------
  |  Branch (1656:11): [True: 82, False: 2]
  ------------------
 1657|     82|	if (len - out <= 3) {
  ------------------
  |  Branch (1657:6): [True: 0, False: 82]
  ------------------
 1658|      0|            xmlChar *temp;
 1659|      0|            int newSize;
 1660|       |
 1661|      0|            newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1662|      0|            if (newSize < 0) {
  ------------------
  |  Branch (1662:17): [True: 0, False: 0]
  ------------------
 1663|      0|		xmlFree(ret);
 1664|      0|                return(NULL);
 1665|      0|            }
 1666|      0|            temp = xmlRealloc(ret, newSize);
 1667|      0|	    if (temp == NULL) {
  ------------------
  |  Branch (1667:10): [True: 0, False: 0]
  ------------------
 1668|      0|		xmlFree(ret);
 1669|      0|		return(NULL);
 1670|      0|	    }
 1671|      0|	    ret = temp;
 1672|      0|            len = newSize;
 1673|      0|	}
 1674|       |
 1675|     82|	ch = *in;
 1676|       |
 1677|     82|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  103|     82|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|    164|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    164|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|    164|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 46, False: 36]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 46, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|     36|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 10, False: 26]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 10, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|     26|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 8, False: 18]
  |  |  |  |  |  |  |  Branch (68:38): [True: 6, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|     20|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 2, False: 18]
  |  |  |  |  |  Branch (79:37): [True: 0, False: 18]
  |  |  |  |  |  Branch (79:53): [True: 6, False: 12]
  |  |  |  |  ------------------
  |  |  |  |   80|     20|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 0, False: 12]
  |  |  |  |  |  Branch (80:21): [True: 0, False: 12]
  |  |  |  |  |  Branch (80:37): [True: 0, False: 12]
  |  |  |  |  |  Branch (80:53): [True: 0, False: 12]
  |  |  |  |  ------------------
  |  |  |  |   81|     20|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 0, False: 12]
  |  |  |  |  |  Branch (81:21): [True: 0, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1677:6): [True: 82, False: 0]
  |  Branch (1677:45): [True: 0, False: 12]
  ------------------
 1678|      0|	    unsigned char val;
 1679|      0|	    ret[out++] = '%';
 1680|      0|	    val = ch >> 4;
 1681|      0|	    if (val <= 9)
  ------------------
  |  Branch (1681:10): [True: 0, False: 0]
  ------------------
 1682|      0|		ret[out++] = '0' + val;
 1683|      0|	    else
 1684|      0|		ret[out++] = 'A' + val - 0xA;
 1685|      0|	    val = ch & 0xF;
 1686|      0|	    if (val <= 9)
  ------------------
  |  Branch (1686:10): [True: 0, False: 0]
  ------------------
 1687|      0|		ret[out++] = '0' + val;
 1688|      0|	    else
 1689|      0|		ret[out++] = 'A' + val - 0xA;
 1690|      0|	    in++;
 1691|     82|	} else {
 1692|     82|	    ret[out++] = *in++;
 1693|     82|	}
 1694|       |
 1695|     82|    }
 1696|      2|    ret[out] = 0;
 1697|      2|    return(ret);
 1698|      2|}
xmlBuildURISafe:
 1972|      2|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 1973|      2|    xmlChar *val = NULL;
 1974|      2|    int ret, len, indx, cur, out;
 1975|      2|    xmlURIPtr ref = NULL;
 1976|      2|    xmlURIPtr bas = NULL;
 1977|      2|    xmlURIPtr res = NULL;
 1978|       |
 1979|      2|    if (valPtr == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 2]
  ------------------
 1980|      0|        return(1);
 1981|      2|    *valPtr = NULL;
 1982|       |
 1983|      2|    if (URI == NULL)
  ------------------
  |  Branch (1983:9): [True: 0, False: 2]
  ------------------
 1984|      0|        return(1);
 1985|       |
 1986|      2|    if (base == NULL) {
  ------------------
  |  Branch (1986:9): [True: 1, False: 1]
  ------------------
 1987|      1|        val = xmlStrdup(URI);
 1988|      1|        if (val == NULL)
  ------------------
  |  Branch (1988:13): [True: 0, False: 1]
  ------------------
 1989|      0|            return(-1);
 1990|      1|        *valPtr = val;
 1991|      1|        return(0);
 1992|      1|    }
 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|      1|    if (URI[0] != 0)
  ------------------
  |  Branch (2002:9): [True: 1, False: 0]
  ------------------
 2003|      1|        ret = xmlParseURISafe((const char *) URI, &ref);
 2004|      0|    else
 2005|      0|        ret = 0;
 2006|      1|    if (ret != 0)
  ------------------
  |  Branch (2006:9): [True: 0, False: 1]
  ------------------
 2007|      0|	goto done;
 2008|      1|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2008:9): [True: 1, False: 0]
  |  Branch (2008:26): [True: 1, False: 0]
  ------------------
 2009|       |	/*
 2010|       |	 * The URI is absolute don't modify.
 2011|       |	 */
 2012|      1|	val = xmlStrdup(URI);
 2013|      1|        if (val == NULL)
  ------------------
  |  Branch (2013:13): [True: 0, False: 1]
  ------------------
 2014|      0|            ret = -1;
 2015|      1|	goto done;
 2016|      1|    }
 2017|       |
 2018|       |    /*
 2019|       |     * If base has no scheme or authority, it is assumed to be a
 2020|       |     * filesystem path.
 2021|       |     */
 2022|      0|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2022:9): [True: 0, False: 0]
  ------------------
 2023|      0|        xmlFreeURI(ref);
 2024|      0|        return(xmlResolvePath(URI, base, valPtr));
 2025|      0|    }
 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|      0|    ret = xmlParseURISafe((const char *) base, &bas);
 2045|      0|    if (ret < 0)
  ------------------
  |  Branch (2045:9): [True: 0, False: 0]
  ------------------
 2046|      0|        goto done;
 2047|      0|    if (ret != 0) {
  ------------------
  |  Branch (2047:9): [True: 0, False: 0]
  ------------------
 2048|      0|	if (ref) {
  ------------------
  |  Branch (2048:6): [True: 0, False: 0]
  ------------------
 2049|      0|            ret = 0;
 2050|      0|	    val = xmlSaveUri(ref);
 2051|      0|            if (val == NULL)
  ------------------
  |  Branch (2051:17): [True: 0, False: 0]
  ------------------
 2052|      0|                ret = -1;
 2053|      0|        }
 2054|      0|	goto done;
 2055|      0|    }
 2056|      0|    if (ref == NULL) {
  ------------------
  |  Branch (2056:9): [True: 0, False: 0]
  ------------------
 2057|       |	/*
 2058|       |	 * the base fragment must be ignored
 2059|       |	 */
 2060|      0|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2060:6): [True: 0, False: 0]
  ------------------
 2061|      0|	    xmlFree(bas->fragment);
 2062|      0|	    bas->fragment = NULL;
 2063|      0|	}
 2064|      0|	val = xmlSaveUri(bas);
 2065|      0|        if (val == NULL)
  ------------------
  |  Branch (2065:13): [True: 0, False: 0]
  ------------------
 2066|      0|            ret = -1;
 2067|      0|	goto done;
 2068|      0|    }
 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|      0|    ret = -1;
 2083|      0|    res = xmlCreateURI();
 2084|      0|    if (res == NULL)
  ------------------
  |  Branch (2084:9): [True: 0, False: 0]
  ------------------
 2085|      0|	goto done;
 2086|      0|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2086:9): [True: 0, False: 0]
  |  Branch (2086:34): [True: 0, False: 0]
  ------------------
 2087|      0|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2087:3): [True: 0, False: 0]
  |  Branch (2087:31): [True: 0, False: 0]
  ------------------
 2088|      0|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   36|      0|#define PORT_EMPTY           0
  ------------------
  |  Branch (2088:10): [True: 0, False: 0]
  ------------------
 2089|      0|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2089:6): [True: 0, False: 0]
  ------------------
 2090|      0|	    res->scheme = xmlMemStrdup(bas->scheme);
 2091|      0|            if (res->scheme == NULL)
  ------------------
  |  Branch (2091:17): [True: 0, False: 0]
  ------------------
 2092|      0|                goto done;
 2093|      0|        }
 2094|      0|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2094:6): [True: 0, False: 0]
  ------------------
 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|      0|        } else {
 2099|      0|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2099:10): [True: 0, False: 0]
  ------------------
 2100|      0|		res->server = xmlMemStrdup(bas->server);
 2101|      0|                if (res->server == NULL)
  ------------------
  |  Branch (2101:21): [True: 0, False: 0]
  ------------------
 2102|      0|                    goto done;
 2103|      0|            }
 2104|      0|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2104:10): [True: 0, False: 0]
  ------------------
 2105|      0|		res->user = xmlMemStrdup(bas->user);
 2106|      0|                if (res->user == NULL)
  ------------------
  |  Branch (2106:21): [True: 0, False: 0]
  ------------------
 2107|      0|                    goto done;
 2108|      0|            }
 2109|      0|	    res->port = bas->port;
 2110|      0|	}
 2111|      0|	if (bas->path != NULL) {
  ------------------
  |  Branch (2111:6): [True: 0, False: 0]
  ------------------
 2112|      0|	    res->path = xmlMemStrdup(bas->path);
 2113|      0|            if (res->path == NULL)
  ------------------
  |  Branch (2113:17): [True: 0, False: 0]
  ------------------
 2114|      0|                goto done;
 2115|      0|        }
 2116|      0|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2116:6): [True: 0, False: 0]
  ------------------
 2117|      0|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2118|      0|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2118:17): [True: 0, False: 0]
  ------------------
 2119|      0|                goto done;
 2120|      0|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2120:20): [True: 0, False: 0]
  ------------------
 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|      0|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2124:20): [True: 0, False: 0]
  ------------------
 2125|      0|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2126|      0|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2126:17): [True: 0, False: 0]
  ------------------
 2127|      0|                goto done;
 2128|      0|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2128:20): [True: 0, False: 0]
  ------------------
 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|      0|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2133:6): [True: 0, False: 0]
  ------------------
 2134|      0|	    res->fragment = xmlMemStrdup(ref->fragment);
 2135|      0|            if (res->fragment == NULL)
  ------------------
  |  Branch (2135:17): [True: 0, False: 0]
  ------------------
 2136|      0|                goto done;
 2137|      0|        }
 2138|      0|	goto step_7;
 2139|      0|    }
 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|      0|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 0]
  ------------------
 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|      0|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 0, False: 0]
  ------------------
 2154|      0|	res->scheme = xmlMemStrdup(bas->scheme);
 2155|      0|        if (res->scheme == NULL)
  ------------------
  |  Branch (2155:13): [True: 0, False: 0]
  ------------------
 2156|      0|            goto done;
 2157|      0|    }
 2158|       |
 2159|      0|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2159:9): [True: 0, False: 0]
  ------------------
 2160|      0|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2161|      0|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2161:13): [True: 0, False: 0]
  ------------------
 2162|      0|            goto done;
 2163|      0|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2163:16): [True: 0, False: 0]
  ------------------
 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|      0|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2168:9): [True: 0, False: 0]
  ------------------
 2169|      0|	res->fragment = xmlMemStrdup(ref->fragment);
 2170|      0|        if (res->fragment == NULL)
  ------------------
  |  Branch (2170:13): [True: 0, False: 0]
  ------------------
 2171|      0|            goto done;
 2172|      0|    }
 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|      0|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 0]
  |  Branch (2181:37): [True: 0, False: 0]
  ------------------
 2182|      0|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   36|      0|#define PORT_EMPTY           0
  ------------------
  |  Branch (2182:10): [True: 0, False: 0]
  ------------------
 2183|      0|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 0]
  ------------------
 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|      0|        } else {
 2188|      0|            if (ref->server != NULL) {
  ------------------
  |  Branch (2188:17): [True: 0, False: 0]
  ------------------
 2189|      0|                res->server = xmlMemStrdup(ref->server);
 2190|      0|                if (res->server == NULL)
  ------------------
  |  Branch (2190:21): [True: 0, False: 0]
  ------------------
 2191|      0|                    goto done;
 2192|      0|            }
 2193|      0|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2193:10): [True: 0, False: 0]
  ------------------
 2194|      0|		res->user = xmlMemStrdup(ref->user);
 2195|      0|                if (res->user == NULL)
  ------------------
  |  Branch (2195:21): [True: 0, False: 0]
  ------------------
 2196|      0|                    goto done;
 2197|      0|            }
 2198|      0|            res->port = ref->port;
 2199|      0|	}
 2200|      0|	if (ref->path != NULL) {
  ------------------
  |  Branch (2200:6): [True: 0, False: 0]
  ------------------
 2201|      0|	    res->path = xmlMemStrdup(ref->path);
 2202|      0|            if (res->path == NULL)
  ------------------
  |  Branch (2202:17): [True: 0, False: 0]
  ------------------
 2203|      0|                goto done;
 2204|      0|        }
 2205|      0|	goto step_7;
 2206|      0|    }
 2207|      0|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 0]
  ------------------
 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|      0|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   36|      0|#define PORT_EMPTY           0
  ------------------
  |  Branch (2211:16): [True: 0, False: 0]
  |  Branch (2211:41): [True: 0, False: 0]
  ------------------
 2212|      0|	if (bas->server != NULL) {
  ------------------
  |  Branch (2212:6): [True: 0, False: 0]
  ------------------
 2213|      0|	    res->server = xmlMemStrdup(bas->server);
 2214|      0|            if (res->server == NULL)
  ------------------
  |  Branch (2214:17): [True: 0, False: 0]
  ------------------
 2215|      0|                goto done;
 2216|      0|        }
 2217|      0|	if (bas->user != NULL) {
  ------------------
  |  Branch (2217:6): [True: 0, False: 0]
  ------------------
 2218|      0|	    res->user = xmlMemStrdup(bas->user);
 2219|      0|            if (res->user == NULL)
  ------------------
  |  Branch (2219:17): [True: 0, False: 0]
  ------------------
 2220|      0|                goto done;
 2221|      0|        }
 2222|      0|	res->port = bas->port;
 2223|      0|    }
 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|      0|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2229:9): [True: 0, False: 0]
  |  Branch (2229:32): [True: 0, False: 0]
  ------------------
 2230|      0|	res->path = xmlMemStrdup(ref->path);
 2231|      0|        if (res->path == NULL)
  ------------------
  |  Branch (2231:13): [True: 0, False: 0]
  ------------------
 2232|      0|            goto done;
 2233|      0|	goto step_7;
 2234|      0|    }
 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|      0|    len = 2; /* extra / and 0 */
 2246|      0|    if (ref->path != NULL)
  ------------------
  |  Branch (2246:9): [True: 0, False: 0]
  ------------------
 2247|      0|	len += strlen(ref->path);
 2248|      0|    if (bas->path != NULL)
  ------------------
  |  Branch (2248:9): [True: 0, False: 0]
  ------------------
 2249|      0|	len += strlen(bas->path);
 2250|      0|    res->path = xmlMalloc(len);
 2251|      0|    if (res->path == NULL)
  ------------------
  |  Branch (2251:9): [True: 0, False: 0]
  ------------------
 2252|      0|	goto done;
 2253|      0|    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|      0|    cur = 0;
 2261|      0|    out = 0;
 2262|      0|    if (bas->path != NULL) {
  ------------------
  |  Branch (2262:9): [True: 0, False: 0]
  ------------------
 2263|      0|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2263:9): [True: 0, False: 0]
  ------------------
 2264|      0|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2264:13): [True: 0, False: 0]
  |  Branch (2264:38): [True: 0, False: 0]
  ------------------
 2265|      0|		cur++;
 2266|      0|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2266:10): [True: 0, False: 0]
  ------------------
 2267|      0|		break;
 2268|       |
 2269|      0|	    cur++;
 2270|      0|	    while (out < cur) {
  ------------------
  |  Branch (2270:13): [True: 0, False: 0]
  ------------------
 2271|      0|		res->path[out] = bas->path[out];
 2272|      0|		out++;
 2273|      0|	    }
 2274|      0|	}
 2275|      0|    }
 2276|      0|    res->path[out] = 0;
 2277|       |
 2278|       |    /*
 2279|       |     * b) The reference's path component is appended to the buffer
 2280|       |     *    string.
 2281|       |     */
 2282|      0|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2282:9): [True: 0, False: 0]
  |  Branch (2282:30): [True: 0, False: 0]
  ------------------
 2283|      0|	indx = 0;
 2284|       |	/*
 2285|       |	 * Ensure the path includes a '/'
 2286|       |	 */
 2287|      0|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   36|      0|#define PORT_EMPTY           0
  ------------------
  |  Branch (2287:6): [True: 0, False: 0]
  |  Branch (2287:21): [True: 0, False: 0]
  |  Branch (2287:46): [True: 0, False: 0]
  ------------------
 2288|      0|	    res->path[out++] = '/';
 2289|      0|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2289:9): [True: 0, False: 0]
  ------------------
 2290|      0|	    res->path[out++] = ref->path[indx++];
 2291|      0|	}
 2292|      0|    }
 2293|      0|    res->path[out] = 0;
 2294|       |
 2295|       |    /*
 2296|       |     * Steps c) to h) are really path normalization steps
 2297|       |     */
 2298|      0|    xmlNormalizeURIPath(res->path);
 2299|       |
 2300|      0|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|      0|    val = xmlSaveUri(res);
 2308|      0|    if (val != NULL)
  ------------------
  |  Branch (2308:9): [True: 0, False: 0]
  ------------------
 2309|      0|        ret = 0;
 2310|       |
 2311|      1|done:
 2312|      1|    if (ref != NULL)
  ------------------
  |  Branch (2312:9): [True: 1, False: 0]
  ------------------
 2313|      1|	xmlFreeURI(ref);
 2314|      1|    if (bas != NULL)
  ------------------
  |  Branch (2314:9): [True: 0, False: 1]
  ------------------
 2315|      0|	xmlFreeURI(bas);
 2316|      1|    if (res != NULL)
  ------------------
  |  Branch (2316:9): [True: 0, False: 1]
  ------------------
 2317|      0|	xmlFreeURI(res);
 2318|      1|    *valPtr = val;
 2319|      1|    return(ret);
 2320|      0|}
xmlCanonicPath:
 2747|      3|{
 2748|      3|    xmlChar *ret;
 2749|       |
 2750|      3|    if (path == NULL)
  ------------------
  |  Branch (2750:9): [True: 0, False: 3]
  ------------------
 2751|      0|	return(NULL);
 2752|       |
 2753|       |    /* Check if this is an "absolute uri" */
 2754|      3|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   34|      3|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2754:9): [True: 2, False: 1]
  ------------------
 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|      2|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 2763|      2|    } else {
 2764|      1|        ret = xmlStrdup((const xmlChar *) path);
 2765|      1|    }
 2766|       |
 2767|      3|    return(ret);
 2768|      3|}
xmlPathToURI:
 2781|      1|{
 2782|      1|    return(xmlCanonicPath(path));
 2783|      1|}
uri.c:xmlParse3986URIReference:
  924|      1|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  925|      1|    int ret;
  926|       |
  927|      1|    if (str == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 1]
  ------------------
  928|      0|	return(-1);
  929|      1|    xmlCleanURI(uri);
  930|       |
  931|       |    /*
  932|       |     * Try first to parse absolute refs, then fallback to relative if
  933|       |     * it fails.
  934|       |     */
  935|      1|    ret = xmlParse3986URI(uri, str);
  936|      1|    if (ret < 0)
  ------------------
  |  Branch (936:9): [True: 0, False: 1]
  ------------------
  937|      0|        return(ret);
  938|      1|    if (ret != 0) {
  ------------------
  |  Branch (938:9): [True: 0, False: 1]
  ------------------
  939|      0|	xmlCleanURI(uri);
  940|      0|        ret = xmlParse3986RelativeRef(uri, str);
  941|      0|	if (ret != 0) {
  ------------------
  |  Branch (941:6): [True: 0, False: 0]
  ------------------
  942|      0|	    xmlCleanURI(uri);
  943|      0|	    return(ret);
  944|      0|	}
  945|      0|    }
  946|      1|    return(0);
  947|      1|}
uri.c:xmlCleanURI:
 1383|      1|xmlCleanURI(xmlURIPtr uri) {
 1384|      1|    if (uri == NULL) return;
  ------------------
  |  Branch (1384:9): [True: 0, False: 1]
  ------------------
 1385|       |
 1386|      1|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1386:9): [True: 0, False: 1]
  ------------------
 1387|      1|    uri->scheme = NULL;
 1388|      1|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1388:9): [True: 0, False: 1]
  ------------------
 1389|      1|    uri->server = NULL;
 1390|      1|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1390:9): [True: 0, False: 1]
  ------------------
 1391|      1|    uri->user = NULL;
 1392|      1|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1392:9): [True: 0, False: 1]
  ------------------
 1393|      1|    uri->path = NULL;
 1394|      1|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1394:9): [True: 0, False: 1]
  ------------------
 1395|      1|    uri->fragment = NULL;
 1396|      1|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1396:9): [True: 0, False: 1]
  ------------------
 1397|      1|    uri->opaque = NULL;
 1398|      1|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1398:9): [True: 0, False: 1]
  ------------------
 1399|      1|    uri->authority = NULL;
 1400|      1|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1400:9): [True: 0, False: 1]
  ------------------
 1401|      1|    uri->query = NULL;
 1402|      1|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1402:9): [True: 0, False: 1]
  ------------------
 1403|       |    uri->query_raw = NULL;
 1404|      1|}
uri.c:xmlParse3986URI:
  885|      1|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  886|      1|    int ret;
  887|       |
  888|      1|    ret = xmlParse3986Scheme(uri, &str);
  889|      1|    if (ret != 0) return(ret);
  ------------------
  |  Branch (889:9): [True: 0, False: 1]
  ------------------
  890|      1|    if (*str != ':') {
  ------------------
  |  Branch (890:9): [True: 0, False: 1]
  ------------------
  891|      0|	return(1);
  892|      0|    }
  893|      1|    str++;
  894|      1|    ret = xmlParse3986HierPart(uri, &str);
  895|      1|    if (ret != 0) return(ret);
  ------------------
  |  Branch (895:9): [True: 0, False: 1]
  ------------------
  896|      1|    if (*str == '?') {
  ------------------
  |  Branch (896:9): [True: 0, False: 1]
  ------------------
  897|      0|	str++;
  898|      0|	ret = xmlParse3986Query(uri, &str);
  899|      0|	if (ret != 0) return(ret);
  ------------------
  |  Branch (899:6): [True: 0, False: 0]
  ------------------
  900|      0|    }
  901|      1|    if (*str == '#') {
  ------------------
  |  Branch (901:9): [True: 0, False: 1]
  ------------------
  902|      0|	str++;
  903|      0|	ret = xmlParse3986Fragment(uri, &str);
  904|      0|	if (ret != 0) return(ret);
  ------------------
  |  Branch (904:6): [True: 0, False: 0]
  ------------------
  905|      0|    }
  906|      1|    if (*str != 0) {
  ------------------
  |  Branch (906:9): [True: 0, False: 1]
  ------------------
  907|      0|	xmlCleanURI(uri);
  908|      0|	return(1);
  909|      0|    }
  910|      1|    return(0);
  911|      1|}
uri.c:xmlParse3986Scheme:
  224|      1|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  225|      1|    const char *cur;
  226|       |
  227|      1|    cur = *str;
  228|      1|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  128|      1|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 1, False: 0]
  |  |  |  Branch (128:41): [True: 1, False: 0]
  |  |  ------------------
  |  |  129|      1|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 0, False: 0]
  |  |  |  Branch (129:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  229|      0|	return(1);
  230|      1|    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|      4|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  128|      8|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 3, False: 1]
  |  |  |  Branch (128:41): [True: 3, False: 0]
  |  |  ------------------
  |  |  129|      8|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 0, False: 1]
  |  |  |  Branch (129:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  127|      5|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 1, False: 0]
  |  |  |  Branch (127:40): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  241|      3|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (241:12): [True: 0, False: 1]
  |  Branch (241:29): [True: 0, False: 1]
  |  Branch (241:46): [True: 0, False: 1]
  ------------------
  242|      1|    if (uri != NULL) {
  ------------------
  |  Branch (242:9): [True: 1, False: 0]
  ------------------
  243|      1|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (243:6): [True: 0, False: 1]
  ------------------
  244|      1|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      1|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  245|      1|        if (uri->scheme == NULL)
  ------------------
  |  Branch (245:13): [True: 0, False: 1]
  ------------------
  246|      0|            return(-1);
  247|      1|    }
  248|      1|    *str = cur;
  249|      1|    return(0);
  250|      1|}
uri.c:xmlParse3986HierPart:
  782|      1|{
  783|      1|    const char *cur;
  784|      1|    int ret;
  785|       |
  786|      1|    cur = *str;
  787|       |
  788|      1|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (788:9): [True: 1, False: 0]
  |  Branch (788:26): [True: 1, False: 0]
  ------------------
  789|      1|        cur += 2;
  790|      1|	ret = xmlParse3986Authority(uri, &cur);
  791|      1|	if (ret != 0) return(ret);
  ------------------
  |  Branch (791:6): [True: 0, False: 1]
  ------------------
  792|       |        /*
  793|       |         * An empty server is marked with a special URI value.
  794|       |         */
  795|      1|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   36|      0|#define PORT_EMPTY           0
  ------------------
  |  Branch (795:6): [True: 0, False: 1]
  |  Branch (795:31): [True: 0, False: 0]
  ------------------
  796|      0|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   37|      0|#define PORT_EMPTY_SERVER   -1
  ------------------
  797|      1|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  798|      1|	if (ret != 0) return(ret);
  ------------------
  |  Branch (798:6): [True: 0, False: 1]
  ------------------
  799|      1|	*str = cur;
  800|      1|	return(0);
  801|      1|    } else if (*cur == '/') {
  ------------------
  |  Branch (801:16): [True: 0, False: 0]
  ------------------
  802|      0|        ret = xmlParse3986PathAbsolute(uri, &cur);
  803|      0|	if (ret != 0) return(ret);
  ------------------
  |  Branch (803:6): [True: 0, False: 0]
  ------------------
  804|      0|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  174|      0|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|      0|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|      0|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|      0|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 0, False: 0]
  |  |  |  |  |  Branch (139:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (139:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  140|      0|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 0, False: 0]
  |  |  |  |  |  Branch (140:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (140:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  141|      0|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 0, False: 0]
  |  |  |  |  |  Branch (141:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (141:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  142|      0|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|      0|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 0, False: 0]
  |  |  |  Branch (175:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  805|      0|        ret = xmlParse3986PathRootless(uri, &cur);
  806|      0|	if (ret != 0) return(ret);
  ------------------
  |  Branch (806:6): [True: 0, False: 0]
  ------------------
  807|      0|    } else {
  808|       |	/* path-empty is effectively empty */
  809|      0|	if (uri != NULL) {
  ------------------
  |  Branch (809:6): [True: 0, False: 0]
  ------------------
  810|      0|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (810:10): [True: 0, False: 0]
  ------------------
  811|      0|	    uri->path = NULL;
  812|      0|	}
  813|      0|    }
  814|      0|    *str = cur;
  815|      0|    return (0);
  816|      1|}
uri.c:xmlParse3986Authority:
  529|      1|{
  530|      1|    const char *cur;
  531|      1|    int ret;
  532|       |
  533|      1|    cur = *str;
  534|       |    /*
  535|       |     * try to parse an userinfo and check for the trailing @
  536|       |     */
  537|      1|    ret = xmlParse3986Userinfo(uri, &cur);
  538|      1|    if (ret < 0)
  ------------------
  |  Branch (538:9): [True: 0, False: 1]
  ------------------
  539|      0|        return(ret);
  540|      1|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (540:9): [True: 1, False: 0]
  |  Branch (540:23): [True: 0, False: 0]
  ------------------
  541|      1|        cur = *str;
  542|      0|    else
  543|      0|        cur++;
  544|      1|    ret = xmlParse3986Host(uri, &cur);
  545|      1|    if (ret != 0) return(ret);
  ------------------
  |  Branch (545:9): [True: 0, False: 1]
  ------------------
  546|      1|    if (*cur == ':') {
  ------------------
  |  Branch (546:9): [True: 0, False: 1]
  ------------------
  547|      0|        cur++;
  548|      0|        ret = xmlParse3986Port(uri, &cur);
  549|      0|	if (ret != 0) return(ret);
  ------------------
  |  Branch (549:6): [True: 0, False: 0]
  ------------------
  550|      0|    }
  551|      1|    *str = cur;
  552|      1|    return(0);
  553|      1|}
uri.c:xmlParse3986Userinfo:
  379|      1|{
  380|      1|    const char *cur;
  381|       |
  382|      1|    cur = *str;
  383|     11|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  189|     22|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 10, False: 1]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  168|     12|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  384|      1|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  139|     12|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 0, False: 1]
  |  |  |  Branch (139:27): [True: 0, False: 1]
  |  |  |  Branch (139:46): [True: 0, False: 1]
  |  |  ------------------
  |  |  140|      1|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 0, False: 1]
  |  |  |  Branch (140:27): [True: 0, False: 1]
  |  |  |  Branch (140:46): [True: 0, False: 1]
  |  |  ------------------
  |  |  141|      1|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 0, False: 1]
  |  |  |  Branch (141:27): [True: 0, False: 1]
  |  |  |  Branch (141:46): [True: 0, False: 1]
  |  |  ------------------
  |  |  142|      1|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 0, False: 1]
  |  |  |  Branch (142:27): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (384:34): [True: 0, False: 1]
  ------------------
  385|     10|	NEXT(cur);
  ------------------
  |  |  108|     10|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  386|      1|    if (*cur == '@') {
  ------------------
  |  Branch (386:9): [True: 0, False: 1]
  ------------------
  387|      0|	if (uri != NULL) {
  ------------------
  |  Branch (387:6): [True: 0, False: 0]
  ------------------
  388|      0|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (388:10): [True: 0, False: 0]
  ------------------
  389|      0|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|      0|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (389:10): [True: 0, False: 0]
  ------------------
  390|      0|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  391|      0|	    else
  392|      0|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  393|      0|            if (uri->user == NULL)
  ------------------
  |  Branch (393:17): [True: 0, False: 0]
  ------------------
  394|      0|                return(-1);
  395|      0|	}
  396|      0|	*str = cur;
  397|      0|	return(0);
  398|      0|    }
  399|      1|    return(1);
  400|      1|}
uri.c:xmlParse3986Host:
  452|      1|{
  453|      1|    const char *cur = *str;
  454|      1|    const char *host;
  455|       |
  456|      1|    host = cur;
  457|       |    /*
  458|       |     * IPv6 and future addressing scheme are enclosed between brackets
  459|       |     */
  460|      1|    if (*cur == '[') {
  ------------------
  |  Branch (460:9): [True: 0, False: 1]
  ------------------
  461|      0|        cur++;
  462|      0|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (462:9): [True: 0, False: 0]
  |  Branch (462:26): [True: 0, False: 0]
  ------------------
  463|      0|	    cur++;
  464|      0|	if (*cur != ']')
  ------------------
  |  Branch (464:6): [True: 0, False: 0]
  ------------------
  465|      0|	    return(1);
  466|      0|	cur++;
  467|      0|	goto found;
  468|      0|    }
  469|       |    /*
  470|       |     * try to parse an IPv4
  471|       |     */
  472|      1|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|      1|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 1, False: 0]
  |  |  |  Branch (127:40): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  473|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (473:13): [True: 0, False: 0]
  ------------------
  474|      0|	    goto not_ipv4;
  475|      0|	if (*cur != '.')
  ------------------
  |  Branch (475:6): [True: 0, False: 0]
  ------------------
  476|      0|	    goto not_ipv4;
  477|      0|	cur++;
  478|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (478:13): [True: 0, False: 0]
  ------------------
  479|      0|	    goto not_ipv4;
  480|      0|	if (*cur != '.')
  ------------------
  |  Branch (480:6): [True: 0, False: 0]
  ------------------
  481|      0|	    goto not_ipv4;
  482|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (482:13): [True: 0, False: 0]
  ------------------
  483|      0|	    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|      0|not_ipv4:
  490|      0|        cur = *str;
  491|      0|    }
  492|       |    /*
  493|       |     * then this should be a hostname which can be empty
  494|       |     */
  495|     11|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  189|     22|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 10, False: 1]
  |  |  ------------------
  ------------------
  496|      1|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  168|     12|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 0, False: 1]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  139|      1|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 0, False: 1]
  |  |  |  Branch (139:27): [True: 0, False: 1]
  |  |  |  Branch (139:46): [True: 0, False: 1]
  |  |  ------------------
  |  |  140|      1|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 0, False: 1]
  |  |  |  Branch (140:27): [True: 0, False: 1]
  |  |  |  Branch (140:46): [True: 0, False: 1]
  |  |  ------------------
  |  |  141|      1|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 0, False: 1]
  |  |  |  Branch (141:27): [True: 0, False: 1]
  |  |  |  Branch (141:46): [True: 0, False: 1]
  |  |  ------------------
  |  |  142|      1|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 0, False: 1]
  |  |  |  Branch (142:27): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  497|     10|        NEXT(cur);
  ------------------
  |  |  108|     11|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  498|      1|found:
  499|      1|    if (uri != NULL) {
  ------------------
  |  Branch (499:9): [True: 1, False: 0]
  ------------------
  500|      1|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (500:6): [True: 0, False: 1]
  ------------------
  501|      1|	uri->authority = NULL;
  502|      1|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (502:6): [True: 0, False: 1]
  ------------------
  503|      1|	if (cur != host) {
  ------------------
  |  Branch (503:6): [True: 1, False: 0]
  ------------------
  504|      1|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|      1|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (504:10): [True: 0, False: 1]
  ------------------
  505|      0|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  506|      1|	    else
  507|      1|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  508|      1|            if (uri->server == NULL)
  ------------------
  |  Branch (508:17): [True: 0, False: 1]
  ------------------
  509|      0|                return(-1);
  510|      1|	} else
  511|      0|	    uri->server = NULL;
  512|      1|    }
  513|      1|    *str = cur;
  514|      1|    return(0);
  515|      1|}
uri.c:xmlParse3986PathAbEmpty:
  609|      1|{
  610|      1|    const char *cur;
  611|      1|    int ret;
  612|       |
  613|      1|    cur = *str;
  614|       |
  615|      4|    while (*cur == '/') {
  ------------------
  |  Branch (615:12): [True: 3, False: 1]
  ------------------
  616|      3|        cur++;
  617|      3|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  618|      3|	if (ret != 0) return(ret);
  ------------------
  |  Branch (618:6): [True: 0, False: 3]
  ------------------
  619|      3|    }
  620|      1|    if (uri != NULL) {
  ------------------
  |  Branch (620:9): [True: 1, False: 0]
  ------------------
  621|      1|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (621:6): [True: 0, False: 1]
  ------------------
  622|      1|        if (*str != cur) {
  ------------------
  |  Branch (622:13): [True: 1, False: 0]
  ------------------
  623|      1|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|      1|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (623:17): [True: 0, False: 1]
  ------------------
  624|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  625|      1|            else
  626|      1|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  627|      1|            if (uri->path == NULL)
  ------------------
  |  Branch (627:17): [True: 0, False: 1]
  ------------------
  628|      0|                return (-1);
  629|      1|        } else {
  630|      0|            uri->path = NULL;
  631|      0|        }
  632|      1|    }
  633|      1|    *str = cur;
  634|      1|    return (0);
  635|      1|}
uri.c:xmlParse3986Segment:
  572|      3|{
  573|      3|    const char *cur;
  574|       |
  575|      3|    cur = *str;
  576|      3|    if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) {
  ------------------
  |  |  174|      6|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|      6|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|      3|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|      3|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 0, False: 0]
  |  |  |  |  |  Branch (139:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (139:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  140|      0|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 0, False: 0]
  |  |  |  |  |  Branch (140:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (140:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  141|      0|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 0, False: 0]
  |  |  |  |  |  Branch (141:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (141:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  142|      0|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|      3|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 0, False: 0]
  |  |  |  Branch (175:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (576:33): [True: 0, False: 3]
  ------------------
  577|      0|        if (empty)
  ------------------
  |  Branch (577:13): [True: 0, False: 0]
  ------------------
  578|      0|	    return(0);
  579|      0|	return(1);
  580|      0|    }
  581|      3|    NEXT(cur);
  ------------------
  |  |  108|      3|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  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|     21|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  174|     42|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|     42|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 18, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|     24|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|      0|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (131:43): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (132:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|     24|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 0, False: 3]
  |  |  |  |  |  Branch (139:27): [True: 0, False: 3]
  |  |  |  |  |  Branch (139:46): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  140|      3|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 0, False: 3]
  |  |  |  |  |  Branch (140:27): [True: 0, False: 3]
  |  |  |  |  |  Branch (140:46): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  141|      3|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 0, False: 3]
  |  |  |  |  |  Branch (141:27): [True: 0, False: 3]
  |  |  |  |  |  Branch (141:46): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  142|      3|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 0, False: 3]
  |  |  |  |  |  Branch (142:27): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|     21|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 0, False: 3]
  |  |  |  Branch (175:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  |  Branch (591:35): [True: 18, False: 0]
  ------------------
  592|     18|        NEXT(cur);
  ------------------
  |  |  108|     21|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 0, False: 18]
  |  |  ------------------
  ------------------
  593|      3|    *str = cur;
  594|      3|    return (0);
  595|      3|}
uri.c:xmlIsUnreserved:
  196|     46|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  197|     46|    if (uri == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 46]
  ------------------
  198|      0|        return(0);
  199|       |
  200|     46|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  161|     46|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|     46|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:24): [True: 26, False: 20]
  |  |  |  |  |  Branch (128:41): [True: 26, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  129|     46|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 5, False: 15]
  |  |  |  |  |  Branch (129:41): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  127|     15|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:23): [True: 4, False: 11]
  |  |  |  |  |  Branch (127:40): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (161:44): [True: 1, False: 10]
  |  |  ------------------
  |  |  162|     46|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (162:8): [True: 5, False: 5]
  |  |  |  Branch (162:27): [True: 0, False: 5]
  |  |  |  Branch (162:46): [True: 0, False: 5]
  |  |  ------------------
  ------------------
  201|     41|        return(1);
  202|       |
  203|      5|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  191|      5|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (203:9): [True: 0, False: 5]
  ------------------
  204|      0|        if (IS_UNWISE(cur))
  ------------------
  |  |   87|      0|      (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) ||         \
  |  |  ------------------
  |  |  |  Branch (87:8): [True: 0, False: 0]
  |  |  |  Branch (87:27): [True: 0, False: 0]
  |  |  |  Branch (87:46): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|       ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) ||        \
  |  |  ------------------
  |  |  |  Branch (88:8): [True: 0, False: 0]
  |  |  |  Branch (88:28): [True: 0, False: 0]
  |  |  |  Branch (88:47): [True: 0, False: 0]
  |  |  ------------------
  |  |   89|      0|       ((*(p) == ']')) || ((*(p) == '`')))
  |  |  ------------------
  |  |  |  Branch (89:8): [True: 0, False: 0]
  |  |  |  Branch (89:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  205|      0|            return(1);
  206|      5|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  193|      5|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (206:16): [True: 0, False: 5]
  ------------------
  207|      0|        if (ISA_UCSCHAR(cur))
  ------------------
  |  |  185|      0|    ((*(p) <= 0x20) || (*(p) >= 0x7F) || (*(p) == '<') || (*(p) == '>') || \
  |  |  ------------------
  |  |  |  Branch (185:6): [True: 0, False: 0]
  |  |  |  Branch (185:24): [True: 0, False: 0]
  |  |  |  Branch (185:42): [True: 0, False: 0]
  |  |  |  Branch (185:59): [True: 0, False: 0]
  |  |  ------------------
  |  |  186|      0|     (*(p) == '"')  || (*(p) == '{')  || (*(p) == '}') || (*(p) == '|') || \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 0, False: 0]
  |  |  |  Branch (186:24): [True: 0, False: 0]
  |  |  |  Branch (186:42): [True: 0, False: 0]
  |  |  |  Branch (186:59): [True: 0, False: 0]
  |  |  ------------------
  |  |  187|      0|     (*(p) == '\\') || (*(p) == '^')  || (*(p) == '`'))
  |  |  ------------------
  |  |  |  Branch (187:6): [True: 0, False: 0]
  |  |  |  Branch (187:24): [True: 0, False: 0]
  |  |  |  Branch (187:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  208|      0|            return(1);
  209|      0|    }
  210|       |
  211|      5|    return(0);
  212|      5|}

xmlNewValidCtxt:
  664|     38|xmlValidCtxt *xmlNewValidCtxt(void) {
  665|     38|    xmlValidCtxtPtr ret;
  666|       |
  667|     38|    ret = xmlMalloc(sizeof (xmlValidCtxt));
  668|     38|    if (ret == NULL)
  ------------------
  |  Branch (668:9): [True: 0, False: 38]
  ------------------
  669|      0|	return (NULL);
  670|       |
  671|     38|    (void) memset(ret, 0, sizeof (xmlValidCtxt));
  672|     38|    ret->flags |= XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|     38|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  673|       |
  674|     38|    return (ret);
  675|     38|}
xmlFreeValidCtxt:
  683|     38|xmlFreeValidCtxt(xmlValidCtxt *cur) {
  684|     38|    if (cur == NULL)
  ------------------
  |  Branch (684:9): [True: 0, False: 38]
  ------------------
  685|      0|        return;
  686|     38|    if (cur->vstateTab != NULL)
  ------------------
  |  Branch (686:9): [True: 0, False: 38]
  ------------------
  687|      0|        xmlFree(cur->vstateTab);
  688|     38|    if (cur->nodeTab != NULL)
  ------------------
  |  Branch (688:9): [True: 0, False: 38]
  ------------------
  689|      0|        xmlFree(cur->nodeTab);
  690|     38|    xmlFree(cur);
  691|     38|}
xmlGetDtdElementDesc:
 2794|    112|xmlGetDtdElementDesc(xmlDtd *dtd, const xmlChar *name) {
 2795|    112|    xmlElementTablePtr table;
 2796|    112|    xmlElementPtr cur;
 2797|    112|    const xmlChar *localname;
 2798|    112|    xmlChar *prefix;
 2799|       |
 2800|    112|    if ((dtd == NULL) || (dtd->elements == NULL) ||
  ------------------
  |  Branch (2800:9): [True: 112, False: 0]
  |  Branch (2800:26): [True: 0, False: 0]
  ------------------
 2801|      0|        (name == NULL))
  ------------------
  |  Branch (2801:9): [True: 0, False: 0]
  ------------------
 2802|    112|        return(NULL);
 2803|       |
 2804|      0|    table = (xmlElementTablePtr) dtd->elements;
 2805|      0|    if (table == NULL)
  ------------------
  |  Branch (2805:9): [True: 0, False: 0]
  ------------------
 2806|      0|	return(NULL);
 2807|       |
 2808|      0|    localname = xmlSplitQName4(name, &prefix);
 2809|      0|    if (localname == NULL)
  ------------------
  |  Branch (2809:9): [True: 0, False: 0]
  ------------------
 2810|      0|        return(NULL);
 2811|      0|    cur = xmlHashLookup2(table, localname, prefix);
 2812|      0|    if (prefix != NULL)
  ------------------
  |  Branch (2812:9): [True: 0, False: 0]
  ------------------
 2813|      0|        xmlFree(prefix);
 2814|      0|    return(cur);
 2815|      0|}
xmlValidateDocument:
 6361|     38|xmlValidateDocument(xmlValidCtxt *vctxt, xmlDoc *doc) {
 6362|       |    return(xmlValidateDocumentInternal(NULL, vctxt, doc));
 6363|     38|}
xmlValidGetValidElements:
 6473|    112|                         int max) {
 6474|    112|    xmlValidCtxt vctxt;
 6475|    112|    int nb_valid_elements = 0;
 6476|    112|    const xmlChar *elements[256]={0};
 6477|    112|    int nb_elements = 0, i;
 6478|    112|    const xmlChar *name;
 6479|       |
 6480|    112|    xmlNode *ref_node;
 6481|    112|    xmlNode *parent;
 6482|    112|    xmlNode *test_node;
 6483|       |
 6484|    112|    xmlNode *prev_next;
 6485|    112|    xmlNode *next_prev;
 6486|    112|    xmlNode *parent_childs;
 6487|    112|    xmlNode *parent_last;
 6488|       |
 6489|    112|    xmlElement *element_desc;
 6490|       |
 6491|    112|    if (prev == NULL && next == NULL)
  ------------------
  |  Branch (6491:9): [True: 0, False: 112]
  |  Branch (6491:25): [True: 0, False: 0]
  ------------------
 6492|      0|        return(-1);
 6493|       |
 6494|    112|    if (names == NULL) return(-1);
  ------------------
  |  Branch (6494:9): [True: 0, False: 112]
  ------------------
 6495|    112|    if (max <= 0) return(-1);
  ------------------
  |  Branch (6495:9): [True: 0, False: 112]
  ------------------
 6496|       |
 6497|    112|    memset(&vctxt, 0, sizeof (xmlValidCtxt));
 6498|    112|    vctxt.error = xmlNoValidityErr;	/* this suppresses err/warn output */
 6499|       |
 6500|    112|    nb_valid_elements = 0;
 6501|    112|    ref_node = prev ? prev : next;
  ------------------
  |  Branch (6501:16): [True: 112, False: 0]
  ------------------
 6502|    112|    parent = ref_node->parent;
 6503|       |
 6504|       |    /*
 6505|       |     * Retrieves the parent element declaration
 6506|       |     */
 6507|    112|    element_desc = xmlGetDtdElementDesc(parent->doc->intSubset,
 6508|    112|                                         parent->name);
 6509|    112|    if ((element_desc == NULL) && (parent->doc->extSubset != NULL))
  ------------------
  |  Branch (6509:9): [True: 112, False: 0]
  |  Branch (6509:35): [True: 0, False: 112]
  ------------------
 6510|      0|        element_desc = xmlGetDtdElementDesc(parent->doc->extSubset,
 6511|      0|                                             parent->name);
 6512|    112|    if (element_desc == NULL) return(-1);
  ------------------
  |  Branch (6512:9): [True: 112, False: 0]
  ------------------
 6513|       |
 6514|       |    /*
 6515|       |     * Do a backup of the current tree structure
 6516|       |     */
 6517|      0|    prev_next = prev ? prev->next : NULL;
  ------------------
  |  Branch (6517:17): [True: 0, False: 0]
  ------------------
 6518|      0|    next_prev = next ? next->prev : NULL;
  ------------------
  |  Branch (6518:17): [True: 0, False: 0]
  ------------------
 6519|      0|    parent_childs = parent->children;
 6520|      0|    parent_last = parent->last;
 6521|       |
 6522|       |    /*
 6523|       |     * Creates a dummy node and insert it into the tree
 6524|       |     */
 6525|      0|    test_node = xmlNewDocNode (ref_node->doc, NULL, BAD_CAST "<!dummy?>", NULL);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6526|      0|    if (test_node == NULL)
  ------------------
  |  Branch (6526:9): [True: 0, False: 0]
  ------------------
 6527|      0|        return(-1);
 6528|       |
 6529|      0|    test_node->parent = parent;
 6530|      0|    test_node->prev = prev;
 6531|      0|    test_node->next = next;
 6532|      0|    name = test_node->name;
 6533|       |
 6534|      0|    if (prev) prev->next = test_node;
  ------------------
  |  Branch (6534:9): [True: 0, False: 0]
  ------------------
 6535|      0|    else parent->children = test_node;
 6536|       |
 6537|      0|    if (next) next->prev = test_node;
  ------------------
  |  Branch (6537:9): [True: 0, False: 0]
  ------------------
 6538|      0|    else parent->last = test_node;
 6539|       |
 6540|       |    /*
 6541|       |     * Insert each potential child node and check if the parent is
 6542|       |     * still valid
 6543|       |     */
 6544|      0|    nb_elements = xmlValidGetPotentialChildren(element_desc->content,
 6545|      0|		       elements, &nb_elements, 256);
 6546|       |
 6547|      0|    for (i = 0;i < nb_elements;i++) {
  ------------------
  |  Branch (6547:16): [True: 0, False: 0]
  ------------------
 6548|      0|	test_node->name = elements[i];
 6549|      0|	if (xmlValidateOneElement(&vctxt, parent->doc, parent)) {
  ------------------
  |  Branch (6549:6): [True: 0, False: 0]
  ------------------
 6550|      0|	    int j;
 6551|       |
 6552|      0|	    for (j = 0; j < nb_valid_elements;j++)
  ------------------
  |  Branch (6552:18): [True: 0, False: 0]
  ------------------
 6553|      0|		if (xmlStrEqual(elements[i], names[j])) break;
  ------------------
  |  Branch (6553:7): [True: 0, False: 0]
  ------------------
 6554|      0|	    names[nb_valid_elements++] = elements[i];
 6555|      0|	    if (nb_valid_elements >= max) break;
  ------------------
  |  Branch (6555:10): [True: 0, False: 0]
  ------------------
 6556|      0|	}
 6557|      0|    }
 6558|       |
 6559|       |    /*
 6560|       |     * Restore the tree structure
 6561|       |     */
 6562|      0|    if (prev) prev->next = prev_next;
  ------------------
  |  Branch (6562:9): [True: 0, False: 0]
  ------------------
 6563|      0|    if (next) next->prev = next_prev;
  ------------------
  |  Branch (6563:9): [True: 0, False: 0]
  ------------------
 6564|      0|    parent->children = parent_childs;
 6565|      0|    parent->last = parent_last;
 6566|       |
 6567|       |    /*
 6568|       |     * Free up the dummy node
 6569|       |     */
 6570|      0|    test_node->name = name;
 6571|      0|    xmlFreeNode(test_node);
 6572|       |
 6573|      0|    return(nb_valid_elements);
 6574|      0|}
valid.c:xmlDoErrValid:
   75|     38|              const char *msg, ...) {
   76|     38|    xmlParserCtxtPtr pctxt = NULL;
   77|     38|    va_list ap;
   78|     38|    int ret = 0;
   79|       |
   80|     38|    if (ctxt == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 38]
  ------------------
   81|      0|        return -1;
   82|     38|    if (ctxt->flags & XML_VCTXT_USE_PCTXT)
  ------------------
  |  |   20|     38|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (82:9): [True: 0, False: 38]
  ------------------
   83|      0|        pctxt = ctxt->userData;
   84|       |
   85|     38|    va_start(ap, msg);
   86|     38|    if (pctxt != NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 38]
  ------------------
   87|      0|        xmlCtxtVErr(pctxt, node, XML_FROM_VALID, code, level,
   88|      0|                    str1, str2, str3, int1, msg, ap);
   89|      0|        if (pctxt->errNo == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (89:13): [True: 0, False: 0]
  ------------------
   90|      0|            ret = -1;
   91|     38|    } else {
   92|     38|        xmlGenericErrorFunc channel = NULL;
   93|     38|        void *data = NULL;
   94|     38|        int res;
   95|       |
   96|     38|        if (ctxt != NULL) {
  ------------------
  |  Branch (96:13): [True: 38, False: 0]
  ------------------
   97|     38|            channel = ctxt->error;
   98|     38|            data = ctxt->userData;
   99|     38|        }
  100|     38|        res = xmlVRaiseError(NULL, channel, data, NULL, node,
  101|     38|                             XML_FROM_VALID, code, level, NULL, 0,
  102|     38|                             (const char *) str1, (const char *) str2,
  103|     38|                             (const char *) str2, int1, 0,
  104|     38|                             msg, ap);
  105|     38|        if (res < 0) {
  ------------------
  |  Branch (105:13): [True: 0, False: 38]
  ------------------
  106|      0|            xmlVErrMemory(ctxt);
  107|      0|            ret = -1;
  108|      0|        }
  109|     38|    }
  110|     38|    va_end(ap);
  111|       |
  112|     38|    return ret;
  113|     38|}
valid.c:xmlErrValid:
  148|     38|{
  149|     38|    xmlDoErrValid(ctxt, NULL, error, XML_ERR_ERROR, (const xmlChar *) extra,
  150|     38|                  NULL, NULL, 0, msg, extra);
  151|     38|}
valid.c:xmlValidateDocumentInternal:
 6264|     38|                            xmlDocPtr doc) {
 6265|     38|    int ret;
 6266|     38|    xmlNodePtr root;
 6267|       |
 6268|     38|    if (doc == NULL)
  ------------------
  |  Branch (6268:9): [True: 0, False: 38]
  ------------------
 6269|      0|        return(0);
 6270|     38|    if ((doc->intSubset == NULL) && (doc->extSubset == NULL)) {
  ------------------
  |  Branch (6270:9): [True: 37, False: 1]
  |  Branch (6270:37): [True: 37, False: 0]
  ------------------
 6271|     37|        xmlErrValid(vctxt, XML_DTD_NO_DTD,
 6272|     37|	            "no DTD found!\n", NULL);
 6273|     37|	return(0);
 6274|     37|    }
 6275|       |
 6276|      1|    if ((doc->intSubset != NULL) && ((doc->intSubset->SystemID != NULL) ||
  ------------------
  |  Branch (6276:9): [True: 1, False: 0]
  |  Branch (6276:38): [True: 1, False: 0]
  ------------------
 6277|      1|	(doc->intSubset->ExternalID != NULL)) && (doc->extSubset == NULL)) {
  ------------------
  |  Branch (6277:2): [True: 0, False: 0]
  |  Branch (6277:43): [True: 1, False: 0]
  ------------------
 6278|      1|	xmlChar *sysID = NULL;
 6279|       |
 6280|      1|	if (doc->intSubset->SystemID != NULL) {
  ------------------
  |  Branch (6280:6): [True: 1, False: 0]
  ------------------
 6281|      1|            int res;
 6282|       |
 6283|      1|            res = xmlBuildURISafe(doc->intSubset->SystemID, doc->URL, &sysID);
 6284|      1|            if (res < 0) {
  ------------------
  |  Branch (6284:17): [True: 0, False: 1]
  ------------------
 6285|      0|                xmlVErrMemory(vctxt);
 6286|      0|                return 0;
 6287|      1|            } else if (res != 0) {
  ------------------
  |  Branch (6287:24): [True: 0, False: 1]
  ------------------
 6288|      0|                xmlErrValid(vctxt, XML_DTD_LOAD_ERROR,
 6289|      0|			"Could not build URI for external subset \"%s\"\n",
 6290|      0|			(const char *) doc->intSubset->SystemID);
 6291|      0|		return 0;
 6292|      0|	    }
 6293|      1|	}
 6294|       |
 6295|      1|        if (ctxt != NULL) {
  ------------------
  |  Branch (6295:13): [True: 0, False: 1]
  ------------------
 6296|      0|            xmlParserInputPtr input;
 6297|       |
 6298|      0|            input = xmlLoadResource(ctxt, (const char *) sysID,
 6299|      0|                    (const char *) doc->intSubset->ExternalID,
 6300|      0|                    XML_RESOURCE_DTD);
 6301|      0|            if (input == NULL) {
  ------------------
  |  Branch (6301:17): [True: 0, False: 0]
  ------------------
 6302|      0|                xmlFree(sysID);
 6303|      0|                return 0;
 6304|      0|            }
 6305|       |
 6306|      0|            doc->extSubset = xmlCtxtParseDtd(ctxt, input,
 6307|      0|                                             doc->intSubset->ExternalID,
 6308|      0|                                             sysID);
 6309|      1|        } else {
 6310|      1|            doc->extSubset = xmlParseDTD(doc->intSubset->ExternalID, sysID);
 6311|      1|        }
 6312|       |
 6313|      1|	if (sysID != NULL)
  ------------------
  |  Branch (6313:6): [True: 1, False: 0]
  ------------------
 6314|      1|	    xmlFree(sysID);
 6315|      1|        if (doc->extSubset == NULL) {
  ------------------
  |  Branch (6315:13): [True: 1, False: 0]
  ------------------
 6316|      1|	    if (doc->intSubset->SystemID != NULL) {
  ------------------
  |  Branch (6316:10): [True: 1, False: 0]
  ------------------
 6317|      1|		xmlErrValid(vctxt, XML_DTD_LOAD_ERROR,
 6318|      1|		       "Could not load the external subset \"%s\"\n",
 6319|      1|		       (const char *) doc->intSubset->SystemID);
 6320|      1|	    } else {
 6321|      0|		xmlErrValid(vctxt, XML_DTD_LOAD_ERROR,
 6322|      0|		       "Could not load the external subset \"%s\"\n",
 6323|      0|		       (const char *) doc->intSubset->ExternalID);
 6324|      0|	    }
 6325|      1|	    return(0);
 6326|      1|	}
 6327|      1|    }
 6328|       |
 6329|      0|    if (doc->ids != NULL) {
  ------------------
  |  Branch (6329:9): [True: 0, False: 0]
  ------------------
 6330|      0|          xmlFreeIDTable(doc->ids);
 6331|      0|          doc->ids = NULL;
 6332|      0|    }
 6333|      0|    if (doc->refs != NULL) {
  ------------------
  |  Branch (6333:9): [True: 0, False: 0]
  ------------------
 6334|      0|          xmlFreeRefTable(doc->refs);
 6335|      0|          doc->refs = NULL;
 6336|      0|    }
 6337|      0|    ret = xmlValidateDtdFinal(vctxt, doc);
 6338|      0|    if (!xmlValidateRoot(vctxt, doc)) return(0);
  ------------------
  |  Branch (6338:9): [True: 0, False: 0]
  ------------------
 6339|       |
 6340|      0|    root = xmlDocGetRootElement(doc);
 6341|      0|    ret &= xmlValidateElement(vctxt, doc, root);
 6342|      0|    ret &= xmlValidateDocumentFinal(vctxt, doc);
 6343|      0|    return(ret);
 6344|      0|}

xmlXIncludeNewContext:
  258|    204|xmlXIncludeNewContext(xmlDoc *doc) {
  259|    204|    xmlXIncludeCtxtPtr ret;
  260|       |
  261|    204|    if (doc == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 204]
  ------------------
  262|      0|	return(NULL);
  263|    204|    ret = (xmlXIncludeCtxtPtr) xmlMalloc(sizeof(xmlXIncludeCtxt));
  264|    204|    if (ret == NULL)
  ------------------
  |  Branch (264:9): [True: 0, False: 204]
  ------------------
  265|      0|	return(NULL);
  266|    204|    memset(ret, 0, sizeof(xmlXIncludeCtxt));
  267|    204|    ret->doc = doc;
  268|    204|    ret->incNr = 0;
  269|    204|    ret->incMax = 0;
  270|       |    ret->incTab = NULL;
  271|    204|    ret->nbErrors = 0;
  272|    204|    return(ret);
  273|    204|}
xmlXIncludeFreeContext:
  281|    204|xmlXIncludeFreeContext(xmlXIncludeCtxt *ctxt) {
  282|    204|    int i;
  283|       |
  284|    204|    if (ctxt == NULL)
  ------------------
  |  Branch (284:9): [True: 0, False: 204]
  ------------------
  285|      0|	return;
  286|    204|    if (ctxt->urlTab != NULL) {
  ------------------
  |  Branch (286:9): [True: 0, False: 204]
  ------------------
  287|      0|	for (i = 0; i < ctxt->urlNr; i++) {
  ------------------
  |  Branch (287:14): [True: 0, False: 0]
  ------------------
  288|      0|	    xmlFreeDoc(ctxt->urlTab[i].doc);
  289|      0|	    xmlFree(ctxt->urlTab[i].url);
  290|      0|	}
  291|      0|	xmlFree(ctxt->urlTab);
  292|      0|    }
  293|    204|    for (i = 0;i < ctxt->incNr;i++) {
  ------------------
  |  Branch (293:16): [True: 0, False: 204]
  ------------------
  294|      0|	if (ctxt->incTab[i] != NULL)
  ------------------
  |  Branch (294:6): [True: 0, False: 0]
  ------------------
  295|      0|	    xmlXIncludeFreeRef(ctxt->incTab[i]);
  296|      0|    }
  297|    204|    if (ctxt->incTab != NULL)
  ------------------
  |  Branch (297:9): [True: 0, False: 204]
  ------------------
  298|      0|	xmlFree(ctxt->incTab);
  299|    204|    if (ctxt->txtTab != NULL) {
  ------------------
  |  Branch (299:9): [True: 0, False: 204]
  ------------------
  300|      0|	for (i = 0;i < ctxt->txtNr;i++) {
  ------------------
  |  Branch (300:13): [True: 0, False: 0]
  ------------------
  301|      0|	    xmlFree(ctxt->txtTab[i].text);
  302|      0|	    xmlFree(ctxt->txtTab[i].url);
  303|      0|	}
  304|      0|	xmlFree(ctxt->txtTab);
  305|      0|    }
  306|    204|#ifdef LIBXML_XPTR_ENABLED
  307|    204|    if (ctxt->xpctxt != NULL)
  ------------------
  |  Branch (307:9): [True: 0, False: 204]
  ------------------
  308|      0|	xmlXPathFreeContext(ctxt->xpctxt);
  309|    204|#endif
  310|    204|    xmlFree(ctxt);
  311|    204|}
xmlXIncludeSetResourceLoader:
 2013|    204|                             xmlResourceLoader loader, void *data) {
 2014|    204|    if (ctxt == NULL)
  ------------------
  |  Branch (2014:9): [True: 0, False: 204]
  ------------------
 2015|      0|        return;
 2016|    204|    ctxt->resourceLoader = loader;
 2017|    204|    ctxt->resourceCtxt = data;
 2018|    204|}
xmlXIncludeSetFlags:
 2028|    204|xmlXIncludeSetFlags(xmlXIncludeCtxt *ctxt, int flags) {
 2029|    204|    if (ctxt == NULL)
  ------------------
  |  Branch (2029:9): [True: 0, False: 204]
  ------------------
 2030|      0|        return(-1);
 2031|    204|    ctxt->parseFlags = flags;
 2032|    204|    return(0);
 2033|    204|}
xmlXIncludeProcessNode:
 2180|    204|xmlXIncludeProcessNode(xmlXIncludeCtxt *ctxt, xmlNode *node) {
 2181|    204|    int ret = 0;
 2182|       |
 2183|    204|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2183:9): [True: 0, False: 204]
  |  Branch (2183:27): [True: 0, False: 204]
  ------------------
 2184|    204|        (node->doc == NULL) || (ctxt == NULL))
  ------------------
  |  Branch (2184:9): [True: 0, False: 204]
  |  Branch (2184:32): [True: 0, False: 204]
  ------------------
 2185|      0|	return(-1);
 2186|    204|    ret = xmlXIncludeDoProcessRoot(ctxt, node);
 2187|    204|    if ((ret >= 0) && (ctxt->nbErrors > 0))
  ------------------
  |  Branch (2187:9): [True: 204, False: 0]
  |  Branch (2187:23): [True: 0, False: 204]
  ------------------
 2188|      0|	ret = -1;
 2189|    204|    return(ret);
 2190|    204|}
xinclude.c:xmlXIncludeDoProcessRoot:
 1962|    204|xmlXIncludeDoProcessRoot(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
 1963|    204|    if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1963:9): [True: 0, False: 204]
  |  Branch (1963:27): [True: 0, False: 204]
  ------------------
 1964|      0|	return(-1);
 1965|    204|    if (ctxt == NULL)
  ------------------
  |  Branch (1965:9): [True: 0, False: 204]
  ------------------
 1966|      0|	return(-1);
 1967|       |
 1968|    204|    return(xmlXIncludeDoProcess(ctxt, tree));
 1969|    204|}
xinclude.c:xmlXIncludeDoProcess:
 1881|    204|xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
 1882|    204|    xmlXIncludeRefPtr ref;
 1883|    204|    xmlNodePtr cur;
 1884|    204|    int ret = 0;
 1885|    204|    int i, start;
 1886|       |
 1887|       |    /*
 1888|       |     * First phase: lookup the elements in the document
 1889|       |     */
 1890|    204|    start = ctxt->incNr;
 1891|    204|    cur = tree;
 1892|    610|    do {
 1893|       |	/* TODO: need to work on entities -> stack */
 1894|    610|        if (xmlXIncludeTestNode(ctxt, cur) == 1) {
  ------------------
  |  Branch (1894:13): [True: 0, False: 610]
  ------------------
 1895|      0|            ref = xmlXIncludeExpandNode(ctxt, cur);
 1896|       |            /*
 1897|       |             * Mark direct includes.
 1898|       |             */
 1899|      0|            if (ref != NULL)
  ------------------
  |  Branch (1899:17): [True: 0, False: 0]
  ------------------
 1900|      0|                ref->replace = 1;
 1901|    610|        } else if ((cur->children != NULL) &&
  ------------------
  |  Branch (1901:20): [True: 407, False: 203]
  ------------------
 1902|    407|                   ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1902:21): [True: 203, False: 204]
  ------------------
 1903|    406|                    (cur->type == XML_ELEMENT_NODE))) {
  ------------------
  |  Branch (1903:21): [True: 203, False: 1]
  ------------------
 1904|    406|            cur = cur->children;
 1905|    406|            continue;
 1906|    406|        }
 1907|    610|        do {
 1908|    610|            if (cur == tree)
  ------------------
  |  Branch (1908:17): [True: 204, False: 406]
  ------------------
 1909|    204|                break;
 1910|    406|            if (cur->next != NULL) {
  ------------------
  |  Branch (1910:17): [True: 0, False: 406]
  ------------------
 1911|      0|                cur = cur->next;
 1912|      0|                break;
 1913|      0|            }
 1914|    406|            cur = cur->parent;
 1915|    406|        } while (cur != NULL);
  ------------------
  |  Branch (1915:18): [True: 406, False: 0]
  ------------------
 1916|    610|    } while ((cur != NULL) && (cur != tree));
  ------------------
  |  Branch (1916:14): [True: 610, False: 0]
  |  Branch (1916:31): [True: 406, False: 204]
  ------------------
 1917|       |
 1918|       |    /*
 1919|       |     * Second phase: extend the original document infoset.
 1920|       |     */
 1921|    204|    for (i = start; i < ctxt->incNr; i++) {
  ------------------
  |  Branch (1921:21): [True: 0, False: 204]
  ------------------
 1922|      0|	if (ctxt->incTab[i]->replace != 0) {
  ------------------
  |  Branch (1922:6): [True: 0, False: 0]
  ------------------
 1923|      0|            xmlXIncludeIncludeNode(ctxt, ctxt->incTab[i]);
 1924|      0|            ctxt->incTab[i]->replace = 0;
 1925|      0|        } else {
 1926|       |            /*
 1927|       |             * Ignore includes which were added indirectly, for example
 1928|       |             * inside xi:fallback elements.
 1929|       |             */
 1930|      0|            if (ctxt->incTab[i]->inc != NULL) {
  ------------------
  |  Branch (1930:17): [True: 0, False: 0]
  ------------------
 1931|      0|                xmlFreeNodeList(ctxt->incTab[i]->inc);
 1932|      0|                ctxt->incTab[i]->inc = NULL;
 1933|      0|            }
 1934|      0|        }
 1935|      0|	ret++;
 1936|      0|    }
 1937|       |
 1938|    204|    if (ctxt->isStream) {
  ------------------
  |  Branch (1938:9): [True: 0, False: 204]
  ------------------
 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|      0|        for (i = 0;i < ctxt->incNr;i++) {
  ------------------
  |  Branch (1944:20): [True: 0, False: 0]
  ------------------
 1945|      0|            xmlXIncludeFreeRef(ctxt->incTab[i]);
 1946|      0|        }
 1947|      0|        ctxt->incNr = 0;
 1948|      0|    }
 1949|       |
 1950|    204|    return(ret);
 1951|    204|}
xinclude.c:xmlXIncludeTestNode:
 1811|    610|xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
 1812|    610|    if (node == NULL)
  ------------------
  |  Branch (1812:9): [True: 0, False: 610]
  ------------------
 1813|      0|	return(0);
 1814|    610|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1814:9): [True: 407, False: 203]
  ------------------
 1815|    407|	return(0);
 1816|    203|    if (node->ns == NULL)
  ------------------
  |  Branch (1816:9): [True: 203, False: 0]
  ------------------
 1817|    203|	return(0);
 1818|      0|    if ((xmlStrEqual(node->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|      0|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1818:9): [True: 0, False: 0]
  ------------------
 1819|      0|        (xmlStrEqual(node->ns->href, XINCLUDE_OLD_NS))) {
  ------------------
  |  |   34|      0|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1819:9): [True: 0, False: 0]
  ------------------
 1820|      0|	if (xmlStrEqual(node->ns->href, XINCLUDE_OLD_NS)) {
  ------------------
  |  |   34|      0|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1820:6): [True: 0, False: 0]
  ------------------
 1821|      0|	    if (ctxt->legacy == 0) {
  ------------------
  |  Branch (1821:10): [True: 0, False: 0]
  ------------------
 1822|      0|	        ctxt->legacy = 1;
 1823|      0|	    }
 1824|      0|	}
 1825|      0|	if (xmlStrEqual(node->name, XINCLUDE_NODE)) {
  ------------------
  |  |   38|      0|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1825:6): [True: 0, False: 0]
  ------------------
 1826|      0|	    xmlNodePtr child = node->children;
 1827|      0|	    int nb_fallback = 0;
 1828|       |
 1829|      0|	    while (child != NULL) {
  ------------------
  |  Branch (1829:13): [True: 0, False: 0]
  ------------------
 1830|      0|		if ((child->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1830:7): [True: 0, False: 0]
  ------------------
 1831|      0|		    (child->ns != NULL) &&
  ------------------
  |  Branch (1831:7): [True: 0, False: 0]
  ------------------
 1832|      0|		    ((xmlStrEqual(child->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|      0|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1832:8): [True: 0, False: 0]
  ------------------
 1833|      0|		     (xmlStrEqual(child->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|      0|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1833:8): [True: 0, False: 0]
  ------------------
 1834|      0|		    if (xmlStrEqual(child->name, XINCLUDE_NODE)) {
  ------------------
  |  |   38|      0|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1834:11): [True: 0, False: 0]
  ------------------
 1835|      0|			xmlXIncludeErr(ctxt, node,
 1836|      0|			               XML_XINCLUDE_INCLUDE_IN_INCLUDE,
 1837|      0|				       "%s has an 'include' child\n",
 1838|      0|				       XINCLUDE_NODE);
  ------------------
  |  |   38|      0|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
 1839|      0|			return(0);
 1840|      0|		    }
 1841|      0|		    if (xmlStrEqual(child->name, XINCLUDE_FALLBACK)) {
  ------------------
  |  |   42|      0|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1841:11): [True: 0, False: 0]
  ------------------
 1842|      0|			nb_fallback++;
 1843|      0|		    }
 1844|      0|		}
 1845|      0|		child = child->next;
 1846|      0|	    }
 1847|      0|	    if (nb_fallback > 1) {
  ------------------
  |  Branch (1847:10): [True: 0, False: 0]
  ------------------
 1848|      0|		xmlXIncludeErr(ctxt, node, XML_XINCLUDE_FALLBACKS_IN_INCLUDE,
 1849|      0|			       "%s has multiple fallback children\n",
 1850|      0|		               XINCLUDE_NODE);
  ------------------
  |  |   38|      0|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
 1851|      0|		return(0);
 1852|      0|	    }
 1853|      0|	    return(1);
 1854|      0|	}
 1855|      0|	if (xmlStrEqual(node->name, XINCLUDE_FALLBACK)) {
  ------------------
  |  |   42|      0|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1855:6): [True: 0, False: 0]
  ------------------
 1856|      0|	    if ((node->parent == NULL) ||
  ------------------
  |  Branch (1856:10): [True: 0, False: 0]
  ------------------
 1857|      0|		(node->parent->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (1857:3): [True: 0, False: 0]
  ------------------
 1858|      0|		(node->parent->ns == NULL) ||
  ------------------
  |  Branch (1858:3): [True: 0, False: 0]
  ------------------
 1859|      0|		((!xmlStrEqual(node->parent->ns->href, XINCLUDE_NS)) &&
  ------------------
  |  |   30|      0|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1859:4): [True: 0, False: 0]
  ------------------
 1860|      0|		 (!xmlStrEqual(node->parent->ns->href, XINCLUDE_OLD_NS))) ||
  ------------------
  |  |   34|      0|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1860:4): [True: 0, False: 0]
  ------------------
 1861|      0|		(!xmlStrEqual(node->parent->name, XINCLUDE_NODE))) {
  ------------------
  |  |   38|      0|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1861:3): [True: 0, False: 0]
  ------------------
 1862|      0|		xmlXIncludeErr(ctxt, node,
 1863|      0|		               XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE,
 1864|      0|			       "%s is not the child of an 'include'\n",
 1865|      0|			       XINCLUDE_FALLBACK);
  ------------------
  |  |   42|      0|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
 1866|      0|	    }
 1867|      0|	}
 1868|      0|    }
 1869|      0|    return(0);
 1870|      0|}

xmlSerializeText:
  306|      1|                 unsigned flags) {
  307|      1|    const xmlChar *cur;
  308|      1|    const signed char *tab;
  309|       |
  310|      1|    if (string == NULL)
  ------------------
  |  Branch (310:9): [True: 0, False: 1]
  ------------------
  311|      0|        return;
  312|       |
  313|      1|#ifdef LIBXML_HTML_ENABLED
  314|      1|    if (flags & XML_ESCAPE_HTML) {
  ------------------
  |  |   24|      1|#define XML_ESCAPE_HTML             (1u << 2)
  ------------------
  |  Branch (314:9): [True: 0, False: 1]
  ------------------
  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|    else
  321|      1|#endif
  322|      1|    {
  323|      1|        if (flags & XML_ESCAPE_QUOT)
  ------------------
  |  |   25|      1|#define XML_ESCAPE_QUOT             (1u << 3)
  ------------------
  |  Branch (323:13): [True: 0, False: 1]
  ------------------
  324|      0|            tab = xmlEscapeTabQuot;
  325|      1|        else if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|      1|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (325:18): [True: 0, False: 1]
  ------------------
  326|      0|            tab = xmlEscapeTabAttr;
  327|      1|        else
  328|      1|            tab = xmlEscapeTab;
  329|      1|    }
  330|       |
  331|      1|    cur = string;
  332|       |
  333|      1|    while (1) {
  ------------------
  |  Branch (333:12): [True: 1, Folded]
  ------------------
  334|      1|        const xmlChar *base;
  335|      1|        int c;
  336|      1|        int offset;
  337|       |
  338|      1|        base = cur;
  339|      1|        offset = -1;
  340|       |
  341|      4|        while (1) {
  ------------------
  |  Branch (341:16): [True: 4, Folded]
  ------------------
  342|      4|            if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (342:17): [True: 0, False: 4]
  ------------------
  343|      0|                break;
  344|       |
  345|      4|            c = (unsigned char) *cur;
  346|       |
  347|      4|            if (c < 0x80) {
  ------------------
  |  Branch (347:17): [True: 4, False: 0]
  ------------------
  348|      4|                offset = tab[c];
  349|      4|                if (offset >= 0)
  ------------------
  |  Branch (349:21): [True: 1, False: 3]
  ------------------
  350|      1|                    break;
  351|      4|            } else if (flags & XML_ESCAPE_NON_ASCII) {
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  |  Branch (351:24): [True: 0, False: 0]
  ------------------
  352|      0|                break;
  353|      0|            }
  354|       |
  355|      3|            cur += 1;
  356|      3|        }
  357|       |
  358|      1|        if (cur > base)
  ------------------
  |  Branch (358:13): [True: 1, False: 0]
  ------------------
  359|      1|            xmlOutputBufferWrite(buf, cur - base, (char *) base);
  360|       |
  361|      1|        if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (361:13): [True: 0, False: 1]
  ------------------
  362|      0|            break;
  363|       |
  364|      1|        if (offset >= 0) {
  ------------------
  |  Branch (364:13): [True: 1, False: 0]
  ------------------
  365|      1|            if (c == 0)
  ------------------
  |  Branch (365:17): [True: 1, False: 0]
  ------------------
  366|      1|                break;
  367|       |
  368|      0|            xmlOutputBufferWrite(buf, xmlEscapeContent[offset],
  369|      0|                                 &xmlEscapeContent[offset+1]);
  370|      0|            cur += 1;
  371|      0|        } 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|    }
  390|      1|}
xmlAllocParserInputBuffer:
 1332|      5|xmlAllocParserInputBuffer(xmlCharEncoding enc) {
 1333|      5|    xmlParserInputBufferPtr ret;
 1334|       |
 1335|      5|    ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer));
 1336|      5|    if (ret == NULL) {
  ------------------
  |  Branch (1336:9): [True: 0, False: 5]
  ------------------
 1337|      0|	return(NULL);
 1338|      0|    }
 1339|      5|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 1340|      5|    ret->buffer = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|      5|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1341|      5|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1341:9): [True: 0, False: 5]
  ------------------
 1342|      0|        xmlFree(ret);
 1343|      0|	return(NULL);
 1344|      0|    }
 1345|      5|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1345:9): [True: 0, False: 5]
  ------------------
 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|      5|    if (ret->encoder != NULL)
  ------------------
  |  Branch (1352:9): [True: 0, False: 5]
  ------------------
 1353|      0|        ret->raw = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|      0|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1354|      5|    else
 1355|      5|        ret->raw = NULL;
 1356|      5|    ret->readcallback = NULL;
 1357|      5|    ret->closecallback = NULL;
 1358|      5|    ret->context = NULL;
 1359|      5|    ret->compressed = -1;
 1360|      5|    ret->rawconsumed = 0;
 1361|       |
 1362|      5|    return(ret);
 1363|      5|}
xmlAllocOutputBuffer:
 1375|      9|xmlAllocOutputBuffer(xmlCharEncodingHandler *encoder) {
 1376|      9|    xmlOutputBufferPtr ret;
 1377|       |
 1378|      9|    ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
 1379|      9|    if (ret == NULL) {
  ------------------
  |  Branch (1379:9): [True: 0, False: 9]
  ------------------
 1380|      0|	return(NULL);
 1381|      0|    }
 1382|      9|    memset(ret, 0, sizeof(xmlOutputBuffer));
 1383|      9|    ret->buffer = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|      9|#define MINLEN 4000
  ------------------
 1384|      9|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1384:9): [True: 0, False: 9]
  ------------------
 1385|      0|        xmlFree(ret);
 1386|      0|	return(NULL);
 1387|      0|    }
 1388|       |
 1389|      9|    ret->encoder = encoder;
 1390|      9|    if (encoder != NULL) {
  ------------------
  |  Branch (1390:9): [True: 0, False: 9]
  ------------------
 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|      9|        ret->conv = NULL;
 1404|      9|    ret->writecallback = NULL;
 1405|      9|    ret->closecallback = NULL;
 1406|      9|    ret->context = NULL;
 1407|      9|    ret->written = 0;
 1408|       |
 1409|      9|    return(ret);
 1410|      9|}
xmlFreeParserInputBuffer:
 1419|     39|xmlFreeParserInputBuffer(xmlParserInputBuffer *in) {
 1420|     39|    if (in == NULL) return;
  ------------------
  |  Branch (1420:9): [True: 0, False: 39]
  ------------------
 1421|       |
 1422|     39|    if (in->raw) {
  ------------------
  |  Branch (1422:9): [True: 0, False: 39]
  ------------------
 1423|      0|        xmlBufFree(in->raw);
 1424|      0|	in->raw = NULL;
 1425|      0|    }
 1426|     39|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1426:9): [True: 0, False: 39]
  ------------------
 1427|      0|        xmlCharEncCloseFunc(in->encoder);
 1428|      0|    }
 1429|     39|    if (in->closecallback != NULL) {
  ------------------
  |  Branch (1429:9): [True: 1, False: 38]
  ------------------
 1430|      1|	in->closecallback(in->context);
 1431|      1|    }
 1432|     39|    if (in->buffer != NULL) {
  ------------------
  |  Branch (1432:9): [True: 39, False: 0]
  ------------------
 1433|     39|        xmlBufFree(in->buffer);
 1434|     39|	in->buffer = NULL;
 1435|     39|    }
 1436|       |
 1437|     39|    xmlFree(in);
 1438|     39|}
xmlOutputBufferClose:
 1451|      9|{
 1452|      9|    int ret;
 1453|       |
 1454|      9|    if (out == NULL)
  ------------------
  |  Branch (1454:9): [True: 0, False: 9]
  ------------------
 1455|      0|        return (-1);
 1456|       |
 1457|      9|    if (out->writecallback != NULL)
  ------------------
  |  Branch (1457:9): [True: 1, False: 8]
  ------------------
 1458|      1|        xmlOutputBufferFlush(out);
 1459|       |
 1460|      9|    if (out->closecallback != NULL) {
  ------------------
  |  Branch (1460:9): [True: 1, False: 8]
  ------------------
 1461|      1|        int code = out->closecallback(out->context);
 1462|       |
 1463|      1|        if ((code != XML_ERR_OK) &&
  ------------------
  |  Branch (1463:13): [True: 0, False: 1]
  ------------------
 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|      1|    }
 1471|       |
 1472|      9|    if (out->error != XML_ERR_OK)
  ------------------
  |  Branch (1472:9): [True: 0, False: 9]
  ------------------
 1473|      0|        ret = -out->error;
 1474|      9|    else
 1475|      9|        ret = out->written;
 1476|       |
 1477|      9|    if (out->conv) {
  ------------------
  |  Branch (1477:9): [True: 0, False: 9]
  ------------------
 1478|      0|        xmlBufFree(out->conv);
 1479|      0|        out->conv = NULL;
 1480|      0|    }
 1481|      9|    if (out->encoder != NULL) {
  ------------------
  |  Branch (1481:9): [True: 0, False: 9]
  ------------------
 1482|      0|        xmlCharEncCloseFunc(out->encoder);
 1483|      0|    }
 1484|      9|    if (out->buffer != NULL) {
  ------------------
  |  Branch (1484:9): [True: 9, False: 0]
  ------------------
 1485|      9|        xmlBufFree(out->buffer);
 1486|      9|        out->buffer = NULL;
 1487|      9|    }
 1488|       |
 1489|      9|    xmlFree(out);
 1490|       |
 1491|      9|    return(ret);
 1492|      9|}
xmlParserInputBufferCreateUrl:
 1505|      1|                              xmlParserInputBuffer **out) {
 1506|      1|    xmlParserInputBufferPtr buf;
 1507|      1|    xmlParserErrors ret;
 1508|      1|    int i;
 1509|       |
 1510|      1|    xmlInitParser();
 1511|       |
 1512|      1|    *out = NULL;
 1513|      1|    if (URI == NULL)
  ------------------
  |  Branch (1513:9): [True: 0, False: 1]
  ------------------
 1514|      0|        return(XML_ERR_ARGUMENT);
 1515|       |
 1516|       |    /*
 1517|       |     * Allocate the Input buffer front-end.
 1518|       |     */
 1519|      1|    buf = xmlAllocParserInputBuffer(enc);
 1520|      1|    if (buf == NULL)
  ------------------
  |  Branch (1520:9): [True: 0, False: 1]
  ------------------
 1521|      0|        return(XML_ERR_NO_MEMORY);
 1522|       |
 1523|       |    /*
 1524|       |     * Try to find one of the input accept method accepting that scheme
 1525|       |     * Go in reverse to give precedence to user defined handlers.
 1526|       |     */
 1527|      1|    ret = XML_IO_ENOENT;
 1528|      2|    for (i = xmlInputCallbackNr - 1; i >= 0; i--) {
  ------------------
  |  Branch (1528:38): [True: 1, False: 1]
  ------------------
 1529|      1|        xmlInputCallback *cb = &xmlInputCallbackTable[i];
 1530|       |
 1531|      1|        if (cb->matchcallback == xmlIODefaultMatch) {
  ------------------
  |  Branch (1531:13): [True: 1, False: 0]
  ------------------
 1532|      1|            int fd;
 1533|       |
 1534|      1|            ret = xmlFdOpen(URI, 0, &fd);
 1535|       |
 1536|      1|            if (ret == XML_ERR_OK) {
  ------------------
  |  Branch (1536:17): [True: 0, False: 1]
  ------------------
 1537|      0|                ret = xmlInputFromFd(buf, fd, flags);
 1538|      0|                close(fd);
 1539|      0|                break;
 1540|      1|            } else if (ret != XML_IO_ENOENT) {
  ------------------
  |  Branch (1540:24): [True: 0, False: 1]
  ------------------
 1541|      0|                break;
 1542|      0|            }
 1543|      1|        } else if ((cb->matchcallback != NULL) &&
  ------------------
  |  Branch (1543:20): [True: 0, False: 0]
  ------------------
 1544|      0|                   (cb->matchcallback(URI) != 0)) {
  ------------------
  |  Branch (1544:20): [True: 0, False: 0]
  ------------------
 1545|      0|            buf->context = cb->opencallback(URI);
 1546|      0|            if (buf->context != NULL) {
  ------------------
  |  Branch (1546:17): [True: 0, False: 0]
  ------------------
 1547|      0|                buf->readcallback = cb->readcallback;
 1548|      0|                buf->closecallback = cb->closecallback;
 1549|      0|                ret = XML_ERR_OK;
 1550|      0|                break;
 1551|      0|            }
 1552|      0|        }
 1553|      1|    }
 1554|      1|    if (ret != XML_ERR_OK) {
  ------------------
  |  Branch (1554:9): [True: 1, False: 0]
  ------------------
 1555|      1|        xmlFreeParserInputBuffer(buf);
 1556|      1|        *out = NULL;
 1557|      1|	return(ret);
 1558|      1|    }
 1559|       |
 1560|      0|    *out = buf;
 1561|      0|    return(ret);
 1562|      1|}
xmlNewInputBufferMemory:
 1940|     34|                        xmlParserInputFlags flags, xmlCharEncoding enc) {
 1941|     34|    xmlParserInputBufferPtr ret;
 1942|       |
 1943|     34|    if ((flags & XML_INPUT_BUF_STATIC) &&
  ------------------
  |  Branch (1943:9): [True: 34, False: 0]
  ------------------
 1944|     34|        ((flags & XML_INPUT_BUF_ZERO_TERMINATED) == 0)) {
  ------------------
  |  Branch (1944:9): [True: 0, False: 34]
  ------------------
 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|     34|    } else {
 1968|     34|        ret = xmlMalloc(sizeof(*ret));
 1969|     34|        if (ret == NULL)
  ------------------
  |  Branch (1969:13): [True: 0, False: 34]
  ------------------
 1970|      0|            return(NULL);
 1971|     34|        memset(ret, 0, sizeof(xmlParserInputBuffer));
 1972|     34|        ret->compressed = -1;
 1973|       |
 1974|     34|        ret->buffer = xmlBufCreateMem((const xmlChar *) mem, size,
 1975|     34|                                      (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (1975:40): [True: 34, False: 0]
  ------------------
 1976|     34|        if (ret->buffer == NULL) {
  ------------------
  |  Branch (1976:13): [True: 0, False: 34]
  ------------------
 1977|      0|            xmlFree(ret);
 1978|      0|            return(NULL);
 1979|      0|        }
 1980|     34|    }
 1981|       |
 1982|     34|    return(ret);
 1983|     34|}
xmlOutputBufferCreateFd:
 2080|      1|xmlOutputBufferCreateFd(int fd, xmlCharEncodingHandler *encoder) {
 2081|      1|    xmlOutputBufferPtr ret;
 2082|       |
 2083|      1|    if (fd < 0) {
  ------------------
  |  Branch (2083:9): [True: 0, False: 1]
  ------------------
 2084|      0|        return(NULL);
 2085|      0|    }
 2086|       |
 2087|      1|    ret = xmlAllocOutputBuffer(encoder);
 2088|      1|    if (ret != NULL) {
  ------------------
  |  Branch (2088:9): [True: 1, False: 0]
  ------------------
 2089|      1|        xmlFdIOCtxt *fdctxt;
 2090|       |
 2091|      1|        fdctxt = xmlMalloc(sizeof(*fdctxt));
 2092|      1|        if (fdctxt == NULL) {
  ------------------
  |  Branch (2092:13): [True: 0, False: 1]
  ------------------
 2093|      0|            return(NULL);
 2094|      0|        }
 2095|      1|        fdctxt->fd = fd;
 2096|       |
 2097|      1|        ret->context = fdctxt;
 2098|      1|	ret->writecallback = xmlFdWrite;
 2099|      1|        ret->closecallback = xmlFdFree;
 2100|      1|    }
 2101|       |
 2102|      1|    return(ret);
 2103|      1|}
xmlParserInputBufferCreateIO:
 2124|      1|	 xmlInputCloseCallback  ioclose, void *ioctx, xmlCharEncoding enc) {
 2125|      1|    xmlParserInputBufferPtr ret;
 2126|       |
 2127|      1|    if (ioread == NULL) return(NULL);
  ------------------
  |  Branch (2127:9): [True: 0, False: 1]
  ------------------
 2128|       |
 2129|      1|    ret = xmlAllocParserInputBuffer(enc);
 2130|      1|    if (ret != NULL) {
  ------------------
  |  Branch (2130:9): [True: 1, False: 0]
  ------------------
 2131|      1|        ret->context = (void *) ioctx;
 2132|      1|	ret->readcallback = ioread;
 2133|      1|	ret->closecallback = ioclose;
 2134|      1|    }
 2135|       |
 2136|      1|    return(ret);
 2137|      1|}
xmlParserInputBufferGrow:
 2298|      1|xmlParserInputBufferGrow(xmlParserInputBuffer *in, int len) {
 2299|      1|    int res = 0;
 2300|       |
 2301|      1|    if ((in == NULL) || (in->error))
  ------------------
  |  Branch (2301:9): [True: 0, False: 1]
  |  Branch (2301:25): [True: 0, False: 1]
  ------------------
 2302|      0|        return(-1);
 2303|       |
 2304|      1|    if (len < MINLEN)
  ------------------
  |  |   52|      1|#define MINLEN 4000
  ------------------
  |  Branch (2304:9): [True: 1, False: 0]
  ------------------
 2305|      1|        len = MINLEN;
  ------------------
  |  |   52|      1|#define MINLEN 4000
  ------------------
 2306|       |
 2307|       |    /*
 2308|       |     * Call the read method for this I/O type.
 2309|       |     */
 2310|      1|    if (in->readcallback != NULL) {
  ------------------
  |  Branch (2310:9): [True: 1, False: 0]
  ------------------
 2311|      1|        xmlBufPtr buf;
 2312|       |
 2313|      1|        if (in->encoder == NULL) {
  ------------------
  |  Branch (2313:13): [True: 1, False: 0]
  ------------------
 2314|      1|            buf = in->buffer;
 2315|      1|        } 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|      1|        if (xmlBufGrow(buf, len) < 0) {
  ------------------
  |  Branch (2330:13): [True: 0, False: 1]
  ------------------
 2331|      0|            in->error = XML_ERR_NO_MEMORY;
 2332|      0|            return(-1);
 2333|      0|        }
 2334|       |
 2335|      1|	res = in->readcallback(in->context, (char *)xmlBufEnd(buf), len);
 2336|      1|	if (res <= 0)
  ------------------
  |  Branch (2336:6): [True: 1, False: 0]
  ------------------
 2337|      1|	    in->readcallback = endOfInput;
 2338|      1|        if (res < 0) {
  ------------------
  |  Branch (2338:13): [True: 1, False: 0]
  ------------------
 2339|      1|            if (res == -1)
  ------------------
  |  Branch (2339:17): [True: 1, False: 0]
  ------------------
 2340|      1|                in->error = XML_IO_UNKNOWN;
 2341|      0|            else
 2342|      0|                in->error = -res;
 2343|      1|            return(-1);
 2344|      1|        }
 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|      0|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2355:9): [True: 0, False: 0]
  ------------------
 2356|      0|        size_t sizeOut;
 2357|       |
 2358|       |        /*
 2359|       |         * Don't convert whole buffer when reading from memory.
 2360|       |         */
 2361|      0|        if (in->readcallback == NULL)
  ------------------
  |  Branch (2361:13): [True: 0, False: 0]
  ------------------
 2362|      0|            sizeOut = len;
 2363|      0|        else
 2364|      0|            sizeOut = SIZE_MAX;
 2365|       |
 2366|      0|	if (xmlCharEncInput(in, &sizeOut, /* flush */ 0) !=
  ------------------
  |  Branch (2366:6): [True: 0, False: 0]
  ------------------
 2367|      0|            XML_ENC_ERR_SUCCESS)
 2368|      0|	    return(-1);
 2369|      0|        res = sizeOut;
 2370|      0|    }
 2371|      0|    return(res);
 2372|      0|}
xmlParserInputBufferRead:
 2385|      1|xmlParserInputBufferRead(xmlParserInputBuffer *in, int len) {
 2386|      1|    return(xmlParserInputBufferGrow(in, len));
 2387|      1|}
xmlOutputBufferWrite:
 2403|     68|xmlOutputBufferWrite(xmlOutputBuffer *out, int len, const char *data) {
 2404|     68|    xmlBufPtr buf = NULL;
 2405|     68|    size_t written = 0;
 2406|     68|    int ret;
 2407|       |
 2408|     68|    if ((out == NULL) || (out->error))
  ------------------
  |  Branch (2408:9): [True: 0, False: 68]
  |  Branch (2408:26): [True: 0, False: 68]
  ------------------
 2409|      0|        return(-1);
 2410|     68|    if (len < 0)
  ------------------
  |  Branch (2410:9): [True: 0, False: 68]
  ------------------
 2411|      0|        return(0);
 2412|       |
 2413|     68|    ret = xmlBufAdd(out->buffer, (const xmlChar *) data, len);
 2414|     68|    if (ret != 0) {
  ------------------
  |  Branch (2414:9): [True: 0, False: 68]
  ------------------
 2415|      0|        out->error = XML_ERR_NO_MEMORY;
 2416|      0|        return(-1);
 2417|      0|    }
 2418|       |
 2419|       |    /*
 2420|       |     * first handle encoding stuff.
 2421|       |     */
 2422|     68|    if (out->encoder != NULL) {
  ------------------
  |  Branch (2422:9): [True: 0, False: 68]
  ------------------
 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|     68|    } else {
 2450|     68|        if (out->writecallback)
  ------------------
  |  Branch (2450:13): [True: 12, False: 56]
  ------------------
 2451|     12|            buf = out->buffer;
 2452|     56|        else
 2453|     56|            written = len;
 2454|     68|    }
 2455|       |
 2456|     68|    if ((buf != NULL) && (out->writecallback)) {
  ------------------
  |  Branch (2456:9): [True: 12, False: 56]
  |  Branch (2456:26): [True: 12, False: 0]
  ------------------
 2457|       |        /*
 2458|       |         * second write the stuff to the I/O channel
 2459|       |         */
 2460|     12|        while (1) {
  ------------------
  |  Branch (2460:16): [True: 12, Folded]
  ------------------
 2461|     12|            size_t nbchars = xmlBufUse(buf);
 2462|       |
 2463|     12|            if (nbchars < MINLEN)
  ------------------
  |  |   52|     12|#define MINLEN 4000
  ------------------
  |  Branch (2463:17): [True: 12, False: 0]
  ------------------
 2464|     12|                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|     12|    }
 2490|       |
 2491|     68|    return(written <= INT_MAX ? written : INT_MAX);
  ------------------
  |  Branch (2491:12): [True: 68, False: 0]
  ------------------
 2492|     68|}
xmlOutputBufferWriteString:
 2580|     59|xmlOutputBufferWriteString(xmlOutputBuffer *out, const char *str) {
 2581|     59|    int len;
 2582|       |
 2583|     59|    if ((out == NULL) || (out->error)) return(-1);
  ------------------
  |  Branch (2583:9): [True: 0, False: 59]
  |  Branch (2583:26): [True: 0, False: 59]
  ------------------
 2584|     59|    if (str == NULL)
  ------------------
  |  Branch (2584:9): [True: 0, False: 59]
  ------------------
 2585|      0|        return(-1);
 2586|     59|    len = strlen(str);
 2587|       |
 2588|     59|    if (len > 0)
  ------------------
  |  Branch (2588:9): [True: 59, False: 0]
  ------------------
 2589|     59|	return(xmlOutputBufferWrite(out, len, str));
 2590|      0|    return(len);
 2591|     59|}
xmlOutputBufferFlush:
 2655|     10|xmlOutputBufferFlush(xmlOutputBuffer *out) {
 2656|     10|    int nbchars = 0, ret = 0;
 2657|       |
 2658|     10|    if ((out == NULL) || (out->error)) return(-1);
  ------------------
  |  Branch (2658:9): [True: 0, False: 10]
  |  Branch (2658:26): [True: 0, False: 10]
  ------------------
 2659|       |    /*
 2660|       |     * first handle encoding stuff.
 2661|       |     */
 2662|     10|    if ((out->conv != NULL) && (out->encoder != NULL)) {
  ------------------
  |  Branch (2662:9): [True: 0, False: 10]
  |  Branch (2662:32): [True: 0, False: 0]
  ------------------
 2663|       |	/*
 2664|       |	 * convert as much as possible to the parser output buffer.
 2665|       |	 */
 2666|      0|	do {
 2667|      0|	    nbchars = xmlCharEncOutput(out, 0);
 2668|      0|	    if (nbchars < 0)
  ------------------
  |  Branch (2668:10): [True: 0, False: 0]
  ------------------
 2669|      0|		return(-1);
 2670|      0|	} while (nbchars);
  ------------------
  |  Branch (2670:11): [True: 0, False: 0]
  ------------------
 2671|      0|    }
 2672|       |
 2673|       |    /*
 2674|       |     * second flush the stuff to the I/O channel
 2675|       |     */
 2676|     10|    if ((out->conv != NULL) && (out->encoder != NULL) &&
  ------------------
  |  Branch (2676:9): [True: 0, False: 10]
  |  Branch (2676:32): [True: 0, False: 0]
  ------------------
 2677|      0|	(out->writecallback != NULL)) {
  ------------------
  |  Branch (2677:2): [True: 0, False: 0]
  ------------------
 2678|      0|        size_t bufsize = xmlBufUse(out->conv);
 2679|      0|        if (bufsize >= INT_MAX) {
  ------------------
  |  Branch (2679:13): [True: 0, False: 0]
  ------------------
 2680|      0|            out->error = XML_ERR_INTERNAL_ERROR;
 2681|      0|            return(-1);
 2682|      0|        }
 2683|      0|	ret = out->writecallback(out->context,
 2684|      0|                                 (const char *)xmlBufContent(out->conv),
 2685|      0|                                 bufsize);
 2686|      0|	if (ret >= 0)
  ------------------
  |  Branch (2686:6): [True: 0, False: 0]
  ------------------
 2687|      0|	    xmlBufShrink(out->conv, ret);
 2688|     10|    } else if (out->writecallback != NULL) {
  ------------------
  |  Branch (2688:16): [True: 2, False: 8]
  ------------------
 2689|      2|        size_t bufsize = xmlBufUse(out->buffer);
 2690|      2|        if (bufsize >= INT_MAX) {
  ------------------
  |  Branch (2690:13): [True: 0, False: 2]
  ------------------
 2691|      0|            out->error = XML_ERR_INTERNAL_ERROR;
 2692|      0|            return(-1);
 2693|      0|        }
 2694|      2|	ret = out->writecallback(out->context,
 2695|      2|                                 (const char *)xmlBufContent(out->buffer),
 2696|      2|                                 bufsize);
 2697|      2|	if (ret >= 0)
  ------------------
  |  Branch (2697:6): [True: 2, False: 0]
  ------------------
 2698|      2|	    xmlBufShrink(out->buffer, ret);
 2699|      2|    }
 2700|     10|    if (ret < 0) {
  ------------------
  |  Branch (2700:9): [True: 0, False: 10]
  ------------------
 2701|      0|        out->error = (ret == -1) ? XML_IO_WRITE : -ret;
  ------------------
  |  Branch (2701:22): [True: 0, False: 0]
  ------------------
 2702|      0|	return(ret);
 2703|      0|    }
 2704|     10|    if (out->written > INT_MAX - ret)
  ------------------
  |  Branch (2704:9): [True: 0, False: 10]
  ------------------
 2705|      0|        out->written = INT_MAX;
 2706|     10|    else
 2707|     10|        out->written += ret;
 2708|       |
 2709|     10|    return(ret);
 2710|     10|}
xmlParserGetDirectory:
 2720|      1|xmlParserGetDirectory(const char *filename) {
 2721|      1|    char *ret = NULL;
 2722|      1|    char dir[1024];
 2723|      1|    char *cur;
 2724|       |
 2725|      1|    if (filename == NULL) return(NULL);
  ------------------
  |  Branch (2725:9): [True: 0, False: 1]
  ------------------
 2726|       |
 2727|       |#if defined(LIBXML_WINPATH_ENABLED)
 2728|       |#   define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\'))
 2729|       |#else
 2730|      1|#   define IS_XMLPGD_SEP(ch) (ch=='/')
 2731|      1|#endif
 2732|       |
 2733|      1|    strncpy(dir, filename, 1023);
 2734|      1|    dir[1023] = 0;
 2735|      1|    cur = &dir[strlen(dir)];
 2736|      1|    while (cur > dir) {
  ------------------
  |  Branch (2736:12): [True: 0, False: 1]
  ------------------
 2737|      0|         if (IS_XMLPGD_SEP(*cur)) break;
  ------------------
  |  | 2730|      0|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2738|      0|	 cur --;
 2739|      0|    }
 2740|      1|    if (IS_XMLPGD_SEP(*cur)) {
  ------------------
  |  | 2730|      1|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 2741|      0|        if (cur == dir) dir[1] = 0;
  ------------------
  |  Branch (2741:13): [True: 0, False: 0]
  ------------------
 2742|      0|	else *cur = 0;
 2743|      0|	ret = xmlMemStrdup(dir);
 2744|      1|    } else {
 2745|      1|        ret = xmlMemStrdup(".");
 2746|      1|    }
 2747|      1|    return(ret);
 2748|      1|#undef IS_XMLPGD_SEP
 2749|      1|}
xmlInitIOCallbacks:
 2790|    324|{
 2791|    324|    xmlInputCallbackNr = 1;
 2792|    324|    xmlInputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2793|       |
 2794|    324|#ifdef LIBXML_OUTPUT_ENABLED
 2795|    324|    xmlOutputCallbackNr = 1;
 2796|    324|    xmlOutputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2797|    324|#endif
 2798|    324|}
xmlIO.c:xmlFdOpen:
  730|      1|xmlFdOpen(const char *filename, int write, int *out) {
  731|      1|    char *fromUri = NULL;
  732|      1|    int flags;
  733|      1|    int fd;
  734|      1|    xmlParserErrors ret;
  735|       |
  736|      1|    *out = -1;
  737|      1|    if (filename == NULL)
  ------------------
  |  Branch (737:9): [True: 0, False: 1]
  ------------------
  738|      0|        return(XML_ERR_ARGUMENT);
  739|       |
  740|      1|    if (xmlConvertUriToPath(filename, &fromUri) < 0)
  ------------------
  |  Branch (740:9): [True: 0, False: 1]
  ------------------
  741|      0|        return(XML_ERR_NO_MEMORY);
  742|       |
  743|      1|    if (fromUri != NULL)
  ------------------
  |  Branch (743:9): [True: 0, False: 1]
  ------------------
  744|      0|        filename = fromUri;
  745|       |
  746|       |#if defined(_WIN32)
  747|       |    {
  748|       |        wchar_t *wpath;
  749|       |
  750|       |        wpath = __xmlIOWin32UTF8ToWChar(filename);
  751|       |        if (wpath == NULL) {
  752|       |            xmlFree(fromUri);
  753|       |            return(XML_ERR_NO_MEMORY);
  754|       |        }
  755|       |        if (write)
  756|       |            flags = _O_WRONLY | _O_CREAT | _O_TRUNC;
  757|       |        else
  758|       |            flags = _O_RDONLY;
  759|       |	fd = _wopen(wpath, flags | _O_BINARY, 0666);
  760|       |        xmlFree(wpath);
  761|       |    }
  762|       |#else
  763|      1|    if (write)
  ------------------
  |  Branch (763:9): [True: 0, False: 1]
  ------------------
  764|      0|        flags = O_WRONLY | O_CREAT | O_TRUNC;
  765|      1|    else
  766|      1|        flags = O_RDONLY;
  767|      1|    fd = open(filename, flags, 0666);
  768|      1|#endif /* WIN32 */
  769|       |
  770|      1|    if (fd < 0) {
  ------------------
  |  Branch (770:9): [True: 1, False: 0]
  ------------------
  771|       |        /*
  772|       |         * Windows and possibly other platforms return EINVAL
  773|       |         * for invalid filenames.
  774|       |         */
  775|      1|        if ((errno == ENOENT) || (errno == EINVAL)) {
  ------------------
  |  Branch (775:13): [True: 1, False: 0]
  |  Branch (775:34): [True: 0, False: 0]
  ------------------
  776|      1|            ret = XML_IO_ENOENT;
  777|      1|        } else {
  778|      0|            ret = xmlIOErr(errno);
  779|      0|        }
  780|      1|    } else {
  781|      0|        *out = fd;
  782|      0|        ret = XML_ERR_OK;
  783|      0|    }
  784|       |
  785|      1|    xmlFree(fromUri);
  786|      1|    return(ret);
  787|      1|}
xmlIO.c:xmlFdFree:
  855|      1|xmlFdFree(void *context) {
  856|      1|    xmlFree(context);
  857|      1|    return(XML_ERR_OK);
  858|      1|}
xmlIO.c:xmlFdWrite:
  835|      2|xmlFdWrite(void *context, const char *buffer, int len) {
  836|      2|    xmlFdIOCtxt *fdctxt = context;
  837|      2|    int fd = fdctxt->fd;
  838|      2|    int ret = 0;
  839|      2|    int bytes;
  840|       |
  841|      3|    while (len > 0) {
  ------------------
  |  Branch (841:12): [True: 1, False: 2]
  ------------------
  842|      1|	bytes = write(fd, buffer, len);
  843|      1|	if (bytes < 0)
  ------------------
  |  Branch (843:6): [True: 0, False: 1]
  ------------------
  844|      0|            return(-xmlIOErr(errno));
  845|      1|        ret += bytes;
  846|      1|        buffer += bytes;
  847|      1|        len -= bytes;
  848|      1|    }
  849|       |
  850|      2|    return(ret);
  851|      2|}
xmlIO.c:xmlConvertUriToPath:
  681|      1|xmlConvertUriToPath(const char *uri, char **out) {
  682|      1|    const char *escaped;
  683|      1|    char *unescaped;
  684|       |#ifdef LIBXML_WINPATH_ENABLED
  685|       |    xmlChar ch;
  686|       |#endif
  687|       |
  688|      1|    *out = NULL;
  689|       |
  690|      1|    if (!xmlStrncasecmp(BAD_CAST uri, BAD_CAST "file://localhost/", 17)) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
                  if (!xmlStrncasecmp(BAD_CAST uri, BAD_CAST "file://localhost/", 17)) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (690:9): [True: 0, False: 1]
  ------------------
  691|      0|        escaped = &uri[16];
  692|      1|    } else if (!xmlStrncasecmp(BAD_CAST uri, BAD_CAST "file:///", 8)) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
                  } else if (!xmlStrncasecmp(BAD_CAST uri, BAD_CAST "file:///", 8)) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (692:16): [True: 0, False: 1]
  ------------------
  693|      0|        escaped = &uri[7];
  694|      1|    } else if (!xmlStrncasecmp(BAD_CAST uri, BAD_CAST "file:/", 6)) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
                  } else if (!xmlStrncasecmp(BAD_CAST uri, BAD_CAST "file:/", 6)) {
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (694:16): [True: 0, False: 1]
  ------------------
  695|       |        /* lots of generators seems to lazy to read RFC 1738 */
  696|      0|        escaped = &uri[5];
  697|      1|    } else {
  698|      1|        return(1);
  699|      1|    }
  700|       |
  701|       |#ifdef LIBXML_WINPATH_ENABLED
  702|       |    /* Ignore slash like in file:///C:/file.txt */
  703|       |    if (escaped[0] == '/') {
  704|       |        ch = escaped[1];
  705|       |        if (((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))
  706|       |            && escaped[2] == ':')
  707|       |            escaped += 1;
  708|       |    }
  709|       |#endif
  710|       |
  711|      0|    unescaped = xmlURIUnescapeString(escaped, 0, NULL);
  712|      0|    if (unescaped == NULL)
  ------------------
  |  Branch (712:9): [True: 0, False: 0]
  ------------------
  713|      0|        return(-1);
  714|       |
  715|      0|    *out = unescaped;
  716|      0|    return(0);
  717|      0|}

xmllintMain:
 3062|    330|            xmlResourceLoader loader) {
 3063|    330|    xmllintState state, *lint;
 3064|    330|    int i, j, res;
 3065|    330|    int files = 0;
 3066|       |
 3067|       |#ifdef _WIN32
 3068|       |    _setmode(_fileno(stdin), _O_BINARY);
 3069|       |    _setmode(_fileno(stdout), _O_BINARY);
 3070|       |    _setmode(_fileno(stderr), _O_BINARY);
 3071|       |#endif
 3072|       |
 3073|    330|    lint = &state;
 3074|    330|    xmllintInit(lint);
 3075|    330|    lint->errStream = errStream;
 3076|    330|    lint->defaultResourceLoader = loader;
 3077|       |
 3078|    330|    res = xmllintParseOptions(lint, argc, argv);
 3079|    330|    if (res != XMLLINT_RETURN_OK) {
  ------------------
  |  Branch (3079:9): [True: 7, False: 323]
  ------------------
 3080|      7|        return(res);
 3081|      7|    }
 3082|       |
 3083|       |    /*
 3084|       |     * Note that we must not make any memory allocations through xmlMalloc
 3085|       |     * before calling xmlMemSetup.
 3086|       |     */
 3087|    323|    xmllintMaxmem = 0;
 3088|    323|    if (lint->maxmem != 0) {
  ------------------
  |  Branch (3088:9): [True: 25, False: 298]
  ------------------
 3089|     25|        xmllintMaxmem = lint->maxmem;
 3090|     25|        xmllintMaxmemReached = 0;
 3091|     25|        xmllintOom = 0;
 3092|     25|        xmlMemSetup(myFreeFunc, myMallocFunc, myReallocFunc, myStrdupFunc);
 3093|     25|    }
 3094|       |
 3095|    323|    LIBXML_TEST_VERSION
  ------------------
  |  |   40|    323|#define LIBXML_TEST_VERSION xmlCheckVersion(21600);
  ------------------
 3096|       |
 3097|    323|#ifdef LIBXML_CATALOG_ENABLED
 3098|    323|    if ((lint->appOptions & XML_LINT_USE_NO_CATALOGS) != XML_LINT_USE_NO_CATALOGS) {
  ------------------
  |  Branch (3098:9): [True: 0, False: 323]
  ------------------
 3099|      0|	if (lint->appOptions & XML_LINT_USE_CATALOGS) {
  ------------------
  |  Branch (3099:6): [True: 0, False: 0]
  ------------------
 3100|      0|	    const char *catal;
 3101|       |
 3102|      0|	    catal = getenv("SGML_CATALOG_FILES");
 3103|      0|	    if (catal != NULL) {
  ------------------
  |  Branch (3103:10): [True: 0, False: 0]
  ------------------
 3104|      0|		xmlLoadCatalogs(catal);
 3105|      0|	    } else {
 3106|      0|		fprintf(errStream, "Variable $SGML_CATALOG_FILES not set\n");
 3107|      0|	    }
 3108|      0|	}
 3109|      0|    }
 3110|    323|#endif
 3111|       |
 3112|    323|#ifdef LIBXML_OUTPUT_ENABLED
 3113|    323|    {
 3114|    323|        const char *indent = getenv("XMLLINT_INDENT");
 3115|    323|        if (indent != NULL) {
  ------------------
  |  Branch (3115:13): [True: 0, False: 323]
  ------------------
 3116|      0|            lint->indentString = indent;
 3117|      0|        }
 3118|    323|    }
 3119|    323|#endif
 3120|       |
 3121|       |#ifdef LIBXML_SCHEMATRON_ENABLED
 3122|       |    if ((lint->schematron != NULL) && ((lint->appOptions & XML_LINT_SAX_ENABLED) != XML_LINT_SAX_ENABLED)
 3123|       |#ifdef LIBXML_READER_ENABLED
 3124|       |        && ((lint->appOptions & XML_LINT_USE_STREAMING) != XML_LINT_USE_STREAMING)
 3125|       |#endif /* LIBXML_READER_ENABLED */
 3126|       |	) {
 3127|       |	xmlSchematronParserCtxtPtr ctxt;
 3128|       |
 3129|       |        /* forces loading the DTDs */
 3130|       |	lint->parseOptions |= XML_PARSE_DTDLOAD;
 3131|       |	if (lint->appOptions & XML_LINT_TIMINGS) {
 3132|       |	    startTimer(lint);
 3133|       |	}
 3134|       |	ctxt = xmlSchematronNewParserCtxt(lint->schematron);
 3135|       |        if (ctxt == NULL) {
 3136|       |            lint->progresult = XMLLINT_ERR_MEM;
 3137|       |            goto error;
 3138|       |        }
 3139|       |	lint->wxschematron = xmlSchematronParse(ctxt);
 3140|       |	xmlSchematronFreeParserCtxt(ctxt);
 3141|       |	if (lint->wxschematron == NULL) {
 3142|       |	    fprintf(errStream, "Schematron schema %s failed to compile\n",
 3143|       |                    lint->schematron);
 3144|       |            lint->progresult = XMLLINT_ERR_SCHEMACOMP;
 3145|       |            goto error;
 3146|       |	}
 3147|       |	if (lint->appOptions & XML_LINT_TIMINGS) {
 3148|       |	    endTimer(lint, "Compiling the schemas");
 3149|       |	}
 3150|       |    }
 3151|       |#endif
 3152|       |
 3153|    323|#ifdef LIBXML_RELAXNG_ENABLED
 3154|    323|    if ((lint->relaxng != NULL) && ((lint->appOptions & XML_LINT_SAX_ENABLED) != XML_LINT_SAX_ENABLED)
  ------------------
  |  Branch (3154:9): [True: 0, False: 323]
  |  Branch (3154:36): [True: 0, False: 0]
  ------------------
 3155|      0|#ifdef LIBXML_READER_ENABLED
 3156|      0|        && ((lint->appOptions & XML_LINT_USE_STREAMING) != XML_LINT_USE_STREAMING)
  ------------------
  |  Branch (3156:12): [True: 0, False: 0]
  ------------------
 3157|    323|#endif /* LIBXML_READER_ENABLED */
 3158|    323|	) {
 3159|      0|	xmlRelaxNGParserCtxtPtr ctxt;
 3160|       |
 3161|       |        /* forces loading the DTDs */
 3162|      0|	lint->parseOptions |= XML_PARSE_DTDLOAD;
 3163|      0|	if (lint->appOptions & XML_LINT_TIMINGS) {
  ------------------
  |  Branch (3163:6): [True: 0, False: 0]
  ------------------
 3164|      0|	    startTimer(lint);
 3165|      0|	}
 3166|      0|	ctxt = xmlRelaxNGNewParserCtxt(lint->relaxng);
 3167|      0|        if (ctxt == NULL) {
  ------------------
  |  Branch (3167:13): [True: 0, False: 0]
  ------------------
 3168|      0|            lint->progresult = XMLLINT_ERR_MEM;
 3169|      0|            goto error;
 3170|      0|        }
 3171|      0|        xmlRelaxNGSetResourceLoader(ctxt, xmllintResourceLoader, lint);
 3172|      0|	lint->relaxngschemas = xmlRelaxNGParse(ctxt);
 3173|      0|	xmlRelaxNGFreeParserCtxt(ctxt);
 3174|      0|	if (lint->relaxngschemas == NULL) {
  ------------------
  |  Branch (3174:6): [True: 0, False: 0]
  ------------------
 3175|      0|	    fprintf(errStream, "Relax-NG schema %s failed to compile\n",
 3176|      0|                    lint->relaxng);
 3177|      0|            lint->progresult = XMLLINT_ERR_SCHEMACOMP;
 3178|      0|            goto error;
 3179|      0|	}
 3180|      0|	if (lint->appOptions & XML_LINT_TIMINGS) {
  ------------------
  |  Branch (3180:6): [True: 0, False: 0]
  ------------------
 3181|      0|	    endTimer(lint, "Compiling the schemas");
 3182|      0|	}
 3183|      0|    }
 3184|    323|#endif /* LIBXML_RELAXNG_ENABLED */
 3185|       |
 3186|    323|#ifdef LIBXML_SCHEMAS_ENABLED
 3187|    323|    if ((lint->schema != NULL)
  ------------------
  |  Branch (3187:9): [True: 0, False: 323]
  ------------------
 3188|      0|#ifdef LIBXML_READER_ENABLED
 3189|      0|        && ((lint->appOptions& XML_LINT_USE_STREAMING) != XML_LINT_USE_STREAMING)
  ------------------
  |  Branch (3189:12): [True: 0, False: 0]
  ------------------
 3190|    323|#endif
 3191|    323|	) {
 3192|      0|	xmlSchemaParserCtxtPtr ctxt;
 3193|       |
 3194|      0|	if (lint->appOptions & XML_LINT_TIMINGS) {
  ------------------
  |  Branch (3194:6): [True: 0, False: 0]
  ------------------
 3195|      0|	    startTimer(lint);
 3196|      0|	}
 3197|      0|	ctxt = xmlSchemaNewParserCtxt(lint->schema);
 3198|      0|        if (ctxt == NULL) {
  ------------------
  |  Branch (3198:13): [True: 0, False: 0]
  ------------------
 3199|      0|            lint->progresult = XMLLINT_ERR_MEM;
 3200|      0|            goto error;
 3201|      0|        }
 3202|      0|        xmlSchemaSetResourceLoader(ctxt, xmllintResourceLoader, lint);
 3203|      0|	lint->wxschemas = xmlSchemaParse(ctxt);
 3204|      0|	xmlSchemaFreeParserCtxt(ctxt);
 3205|      0|	if (lint->wxschemas == NULL) {
  ------------------
  |  Branch (3205:6): [True: 0, False: 0]
  ------------------
 3206|      0|	    fprintf(errStream, "WXS schema %s failed to compile\n",
 3207|      0|                    lint->schema);
 3208|      0|            lint->progresult = XMLLINT_ERR_SCHEMACOMP;
 3209|      0|            goto error;
 3210|      0|	}
 3211|      0|	if (lint->appOptions & XML_LINT_TIMINGS) {
  ------------------
  |  Branch (3211:6): [True: 0, False: 0]
  ------------------
 3212|      0|	    endTimer(lint, "Compiling the schemas");
 3213|      0|	}
 3214|      0|    }
 3215|    323|#endif /* LIBXML_SCHEMAS_ENABLED */
 3216|       |
 3217|    323|#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
 3218|    323|    if ((lint->pattern != NULL) && ((lint->appOptions & XML_LINT_USE_WALKER) != XML_LINT_USE_WALKER)) {
  ------------------
  |  Branch (3218:9): [True: 110, False: 213]
  |  Branch (3218:36): [True: 85, False: 25]
  ------------------
 3219|     85|        res = xmlPatternCompileSafe(BAD_CAST lint->pattern, NULL, 0, NULL,
  ------------------
  |  |   34|     85|#define BAD_CAST (xmlChar *)
  ------------------
 3220|     85|                                    &lint->patternc);
 3221|     85|	if (lint->patternc == NULL) {
  ------------------
  |  Branch (3221:6): [True: 39, False: 46]
  ------------------
 3222|     39|            if (res < 0) {
  ------------------
  |  Branch (3222:17): [True: 4, False: 35]
  ------------------
 3223|      4|                lint->progresult = XMLLINT_ERR_MEM;
 3224|     35|            } else {
 3225|     35|                fprintf(errStream, "Pattern %s failed to compile\n",
 3226|     35|                        lint->pattern);
 3227|     35|                lint->progresult = XMLLINT_ERR_SCHEMAPAT;
 3228|     35|            }
 3229|     39|            goto error;
 3230|     39|	}
 3231|     85|    }
 3232|    284|#endif /* LIBXML_READER_ENABLED && LIBXML_PATTERN_ENABLED */
 3233|       |
 3234|       |    /*
 3235|       |     * The main loop over input documents
 3236|       |     */
 3237|  4.86k|    for (i = 1; i < argc ; i++) {
  ------------------
  |  Branch (3237:17): [True: 4.58k, False: 282]
  ------------------
 3238|  4.58k|        const char *filename = argv[i];
 3239|  4.58k|#if HAVE_DECL_MMAP
 3240|  4.58k|        int memoryFd = -1;
 3241|  4.58k|#endif
 3242|       |
 3243|  4.58k|	if ((filename[0] == '-') && (strcmp(filename, "-") != 0)) {
  ------------------
  |  Branch (3243:6): [True: 4.29k, False: 284]
  |  Branch (3243:30): [True: 4.29k, False: 0]
  ------------------
 3244|  4.29k|            i += skipArgs(filename);
 3245|  4.29k|            continue;
 3246|  4.29k|        }
 3247|       |
 3248|    284|#if HAVE_DECL_MMAP
 3249|    284|        if (lint->appOptions & XML_LINT_MEMORY) {
  ------------------
  |  Branch (3249:13): [True: 0, False: 284]
  ------------------
 3250|      0|            struct stat info;
 3251|      0|            if (stat(filename, &info) < 0) {
  ------------------
  |  Branch (3251:17): [True: 0, False: 0]
  ------------------
 3252|      0|                lint->progresult = XMLLINT_ERR_RDFILE;
 3253|      0|                break;
 3254|      0|            }
 3255|      0|            memoryFd = open(filename, O_RDONLY);
 3256|      0|            if (memoryFd < 0) {
  ------------------
  |  Branch (3256:17): [True: 0, False: 0]
  ------------------
 3257|      0|                lint->progresult = XMLLINT_ERR_RDFILE;
 3258|      0|                break;
 3259|      0|            }
 3260|      0|            lint->memoryData = mmap(NULL, info.st_size, PROT_READ,
 3261|      0|                                    MAP_SHARED, memoryFd, 0);
 3262|      0|            if (lint->memoryData == (void *) MAP_FAILED) {
  ------------------
  |  Branch (3262:17): [True: 0, False: 0]
  ------------------
 3263|      0|                close(memoryFd);
 3264|      0|                fprintf(errStream, "mmap failure for file %s\n", filename);
 3265|      0|                lint->progresult = XMLLINT_ERR_RDFILE;
 3266|      0|                break;
 3267|      0|            }
 3268|      0|            lint->memorySize = info.st_size;
 3269|      0|        }
 3270|    284|#endif /* HAVE_DECL_MMAP */
 3271|       |
 3272|    284|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat > 1))
  ------------------
  |  Branch (3272:6): [True: 70, False: 214]
  |  Branch (3272:47): [True: 10, False: 60]
  ------------------
 3273|     10|	    startTimer(lint);
 3274|       |
 3275|    284|#ifdef LIBXML_READER_ENABLED
 3276|    284|        if (lint->appOptions & XML_LINT_USE_STREAMING) {
  ------------------
  |  Branch (3276:13): [True: 64, False: 220]
  ------------------
 3277|    136|            for (j = 0; j < lint->repeat; j++)
  ------------------
  |  Branch (3277:25): [True: 72, False: 64]
  ------------------
 3278|     72|                streamFile(lint, filename);
 3279|     64|        } else
 3280|    220|#endif /* LIBXML_READER_ENABLED */
 3281|    220|        {
 3282|    220|            xmlParserCtxtPtr ctxt;
 3283|       |
 3284|    220|#ifdef LIBXML_HTML_ENABLED
 3285|    220|            if (lint->appOptions & XML_LINT_HTML_ENABLED) {
  ------------------
  |  Branch (3285:17): [True: 33, False: 187]
  ------------------
 3286|     33|#ifdef LIBXML_PUSH_ENABLED
 3287|     33|                if (lint->appOptions & XML_LINT_PUSH_ENABLED) {
  ------------------
  |  Branch (3287:21): [True: 0, False: 33]
  ------------------
 3288|      0|                    ctxt = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0,
 3289|      0|                                                    filename,
 3290|      0|                                                    XML_CHAR_ENCODING_NONE);
 3291|      0|                } else
 3292|     33|#endif /* LIBXML_PUSH_ENABLED */
 3293|     33|                {
 3294|     33|                    ctxt = htmlNewParserCtxt();
 3295|     33|                }
 3296|     33|                htmlCtxtUseOptions(ctxt, lint->htmlOptions);
 3297|     33|            } else
 3298|    187|#endif /* LIBXML_HTML_ENABLED */
 3299|    187|            {
 3300|    187|#ifdef LIBXML_PUSH_ENABLED
 3301|    187|                if (lint->appOptions & XML_LINT_PUSH_ENABLED) {
  ------------------
  |  Branch (3301:21): [True: 2, False: 185]
  ------------------
 3302|      2|                    ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0,
 3303|      2|                                                   filename);
 3304|      2|                } else
 3305|    185|#endif /* LIBXML_PUSH_ENABLED */
 3306|    185|                {
 3307|    185|                    ctxt = xmlNewParserCtxt();
 3308|    185|                }
 3309|    187|                xmlCtxtUseOptions(ctxt, lint->parseOptions);
 3310|    187|            }
 3311|    220|            if (ctxt == NULL) {
  ------------------
  |  Branch (3311:17): [True: 2, False: 218]
  ------------------
 3312|      2|                lint->progresult = XMLLINT_ERR_MEM;
 3313|      2|                goto error;
 3314|      2|            }
 3315|       |
 3316|    218|            if (lint->appOptions & XML_LINT_SAX_ENABLED) {
  ------------------
  |  Branch (3316:17): [True: 30, False: 188]
  ------------------
 3317|     30|                const xmlSAXHandler *handler;
 3318|       |
 3319|     30|                if (lint->noout) {
  ------------------
  |  Branch (3319:21): [True: 6, False: 24]
  ------------------
 3320|      6|                    handler = &emptySAXHandler;
 3321|      6|#ifdef LIBXML_SAX1_ENABLED
 3322|     24|                } else if (lint->parseOptions & XML_PARSE_SAX1) {
  ------------------
  |  Branch (3322:28): [True: 0, False: 24]
  ------------------
 3323|      0|                    handler = &debugSAXHandler;
 3324|      0|#endif
 3325|     24|                } else {
 3326|     24|                    handler = &debugSAX2Handler;
 3327|     24|                }
 3328|       |
 3329|     30|                *ctxt->sax = *handler;
 3330|     30|                ctxt->userData = lint;
 3331|     30|            }
 3332|       |
 3333|    218|            xmlCtxtSetResourceLoader(ctxt, xmllintResourceLoader, lint);
 3334|    218|            if (lint->maxAmpl > 0)
  ------------------
  |  Branch (3334:17): [True: 15, False: 203]
  ------------------
 3335|     15|                xmlCtxtSetMaxAmplification(ctxt, lint->maxAmpl);
 3336|       |
 3337|    218|            lint->ctxt = ctxt;
 3338|       |
 3339|    478|            for (j = 0; j < lint->repeat; j++) {
  ------------------
  |  Branch (3339:25): [True: 260, False: 218]
  ------------------
 3340|    260|                if (j > 0) {
  ------------------
  |  Branch (3340:21): [True: 42, False: 218]
  ------------------
 3341|     42|#ifdef LIBXML_PUSH_ENABLED
 3342|     42|                    if (lint->appOptions & XML_LINT_PUSH_ENABLED) {
  ------------------
  |  Branch (3342:25): [True: 0, False: 42]
  ------------------
 3343|      0|                        xmlCtxtResetPush(ctxt, NULL, 0, NULL, NULL);
 3344|      0|                    } else
 3345|     42|#endif
 3346|     42|                    {
 3347|     42|                        xmlCtxtReset(ctxt);
 3348|     42|                    }
 3349|     42|                }
 3350|       |
 3351|    260|                if (lint->appOptions & XML_LINT_SAX_ENABLED) {
  ------------------
  |  Branch (3351:21): [True: 50, False: 210]
  ------------------
 3352|     50|                    testSAX(lint, filename);
 3353|    210|                } else {
 3354|    210|                    parseAndPrintFile(lint, filename);
 3355|    210|                }
 3356|    260|            }
 3357|       |
 3358|    218|            xmlFreeParserCtxt(ctxt);
 3359|    218|        }
 3360|       |
 3361|    282|        if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat > 1)) {
  ------------------
  |  Branch (3361:13): [True: 70, False: 212]
  |  Branch (3361:54): [True: 10, False: 60]
  ------------------
 3362|     10|            endTimer(lint, "%d iterations", lint->repeat);
 3363|     10|        }
 3364|       |
 3365|    282|        files += 1;
 3366|       |
 3367|    282|#if HAVE_DECL_MMAP
 3368|    282|        if (lint->appOptions & XML_LINT_MEMORY) {
  ------------------
  |  Branch (3368:13): [True: 0, False: 282]
  ------------------
 3369|      0|            munmap(lint->memoryData, lint->memorySize);
 3370|      0|            close(memoryFd);
 3371|      0|        }
 3372|    282|#endif
 3373|    282|    }
 3374|       |
 3375|    282|    if (lint->appOptions & XML_LINT_GENERATE)
  ------------------
  |  Branch (3375:9): [True: 247, False: 35]
  ------------------
 3376|    247|	parseAndPrintFile(lint, NULL);
 3377|       |
 3378|    282|    if ((files == 0) && ((lint->appOptions & XML_LINT_GENERATE) != XML_LINT_GENERATE) && (lint->version == 0)) {
  ------------------
  |  Branch (3378:9): [True: 0, False: 282]
  |  Branch (3378:25): [True: 0, False: 0]
  |  Branch (3378:90): [True: 0, False: 0]
  ------------------
 3379|      0|	usage(errStream, argv[0]);
 3380|      0|        lint->progresult = XMLLINT_ERR_UNCLASS;
 3381|      0|    }
 3382|       |
 3383|    323|error:
 3384|       |
 3385|       |#ifdef LIBXML_SCHEMATRON_ENABLED
 3386|       |    if (lint->wxschematron != NULL)
 3387|       |	xmlSchematronFree(lint->wxschematron);
 3388|       |#endif
 3389|    323|#ifdef LIBXML_RELAXNG_ENABLED
 3390|    323|    if (lint->relaxngschemas != NULL)
  ------------------
  |  Branch (3390:9): [True: 0, False: 323]
  ------------------
 3391|      0|	xmlRelaxNGFree(lint->relaxngschemas);
 3392|    323|#endif
 3393|    323|#ifdef LIBXML_SCHEMAS_ENABLED
 3394|    323|    if (lint->wxschemas != NULL)
  ------------------
  |  Branch (3394:9): [True: 0, False: 323]
  ------------------
 3395|      0|	xmlSchemaFree(lint->wxschemas);
 3396|    323|#endif
 3397|    323|#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
 3398|    323|    if (lint->patternc != NULL)
  ------------------
  |  Branch (3398:9): [True: 46, False: 277]
  ------------------
 3399|     46|        xmlFreePattern(lint->patternc);
 3400|    323|#endif
 3401|       |
 3402|    323|    xmlCleanupParser();
 3403|       |
 3404|    323|    if ((lint->maxmem) && (xmllintMaxmemReached)) {
  ------------------
  |  Branch (3404:9): [True: 25, False: 298]
  |  Branch (3404:27): [True: 4, False: 21]
  ------------------
 3405|      4|        fprintf(errStream, "Maximum memory exceeded (%d bytes)\n",
 3406|      4|                xmllintMaxmem);
 3407|    319|    } else if (lint->progresult == XMLLINT_ERR_MEM) {
  ------------------
  |  Branch (3407:16): [True: 2, False: 317]
  ------------------
 3408|      2|        fprintf(errStream, "Out-of-memory error reported\n");
 3409|      2|    }
 3410|       |
 3411|    323|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 3412|    323|    if ((lint->maxmem) &&
  ------------------
  |  Branch (3412:9): [True: 25, False: 298]
  ------------------
 3413|     25|        (xmllintOom != (lint->progresult == XMLLINT_ERR_MEM))) {
  ------------------
  |  Branch (3413:9): [True: 0, False: 25]
  ------------------
 3414|      0|        fprintf(stderr, "xmllint: malloc failure %s reported\n",
 3415|      0|                xmllintOom ? "not" : "erroneously");
  ------------------
  |  Branch (3415:17): [True: 0, False: 0]
  ------------------
 3416|      0|        abort();
 3417|      0|    }
 3418|    323|#endif
 3419|       |
 3420|    323|    return(lint->progresult);
 3421|    323|}
xmllint.c:xmllintInit:
 2574|    330|xmllintInit(xmllintState *lint) {
 2575|    330|    memset(lint, 0, sizeof(*lint));
 2576|       |
 2577|    330|    lint->repeat = 1;
 2578|    330|    lint->progresult = XMLLINT_RETURN_OK;
 2579|    330|    lint->parseOptions = XML_PARSE_COMPACT | XML_PARSE_BIG_LINES;
 2580|    330|#ifdef LIBXML_HTML_ENABLED
 2581|    330|    lint->htmlOptions = HTML_PARSE_COMPACT | HTML_PARSE_BIG_LINES;
 2582|    330|#endif
 2583|    330|}
xmllint.c:xmllintParseOptions:
 2591|    330|xmllintParseOptions(xmllintState *lint, int argc, const char **argv) {
 2592|    330|    FILE *errStream = lint->errStream;
 2593|    330|    const char *specialMode = NULL;
 2594|    330|    int i;
 2595|       |
 2596|    330|    if (argc <= 1) {
  ------------------
  |  Branch (2596:9): [True: 0, False: 330]
  ------------------
 2597|      0|        usage(errStream, argv[0]);
 2598|      0|        return(XMLLINT_ERR_UNCLASS);
 2599|      0|    }
 2600|       |
 2601|  5.51k|    for (i = 1; i < argc ; i++) {
  ------------------
  |  Branch (2601:17): [True: 5.19k, False: 323]
  ------------------
 2602|  5.19k|        unsigned long val;
 2603|       |
 2604|  5.19k|        if (argv[i][0] != '-' || argv[i][1] == 0)
  ------------------
  |  Branch (2604:13): [True: 323, False: 4.87k]
  |  Branch (2604:34): [True: 0, False: 4.87k]
  ------------------
 2605|    323|            continue;
 2606|       |
 2607|  4.87k|        if ((!strcmp(argv[i], "-maxmem")) ||
  ------------------
  |  Branch (2607:13): [True: 0, False: 4.87k]
  ------------------
 2608|  4.87k|            (!strcmp(argv[i], "--maxmem"))) {
  ------------------
  |  Branch (2608:13): [True: 27, False: 4.84k]
  ------------------
 2609|     27|            i++;
 2610|     27|            if (i >= argc) {
  ------------------
  |  Branch (2610:17): [True: 0, False: 27]
  ------------------
 2611|      0|                fprintf(errStream, "maxmem: missing integer value\n");
 2612|      0|                return(XMLLINT_ERR_UNCLASS);
 2613|      0|            }
 2614|     27|            if (parseInteger(&val, errStream, "maxmem", argv[i],
  ------------------
  |  Branch (2614:17): [True: 0, False: 27]
  ------------------
 2615|     27|                             0, INT_MAX) < 0)
 2616|      0|                return(XMLLINT_ERR_UNCLASS);
 2617|     27|            lint->maxmem = val;
 2618|  4.84k|        } else if ((!strcmp(argv[i], "-debug")) ||
  ------------------
  |  Branch (2618:20): [True: 0, False: 4.84k]
  ------------------
 2619|  4.84k|                   (!strcmp(argv[i], "--debug"))) {
  ------------------
  |  Branch (2619:20): [True: 121, False: 4.72k]
  ------------------
 2620|    121|            lint->appOptions |= XML_LINT_DEBUG_ENABLED;
 2621|  4.72k|        } else if ((!strcmp(argv[i], "-shell")) ||
  ------------------
  |  Branch (2621:20): [True: 0, False: 4.72k]
  ------------------
 2622|  4.72k|                   (!strcmp(argv[i], "--shell"))) {
  ------------------
  |  Branch (2622:20): [True: 0, False: 4.72k]
  ------------------
 2623|      0|            lint->appOptions |= XML_LINT_NAVIGATING_SHELL;
 2624|  4.72k|        } else if ((!strcmp(argv[i], "-copy")) ||
  ------------------
  |  Branch (2624:20): [True: 0, False: 4.72k]
  ------------------
 2625|  4.72k|                   (!strcmp(argv[i], "--copy"))) {
  ------------------
  |  Branch (2625:20): [True: 62, False: 4.66k]
  ------------------
 2626|     62|            lint->appOptions |= XML_LINT_COPY_ENABLED;
 2627|  4.66k|        } else if ((!strcmp(argv[i], "-recover")) ||
  ------------------
  |  Branch (2627:20): [True: 0, False: 4.66k]
  ------------------
 2628|  4.66k|                   (!strcmp(argv[i], "--recover"))) {
  ------------------
  |  Branch (2628:20): [True: 34, False: 4.62k]
  ------------------
 2629|     34|            lint->parseOptions |= XML_PARSE_RECOVER;
 2630|  4.62k|        } else if ((!strcmp(argv[i], "-huge")) ||
  ------------------
  |  Branch (2630:20): [True: 0, False: 4.62k]
  ------------------
 2631|  4.62k|                   (!strcmp(argv[i], "--huge"))) {
  ------------------
  |  Branch (2631:20): [True: 95, False: 4.53k]
  ------------------
 2632|     95|            lint->parseOptions |= XML_PARSE_HUGE;
 2633|     95|#ifdef LIBXML_HTML_ENABLED
 2634|     95|            lint->htmlOptions |= HTML_PARSE_HUGE;
 2635|     95|#endif
 2636|  4.53k|        } else if ((!strcmp(argv[i], "-noent")) ||
  ------------------
  |  Branch (2636:20): [True: 0, False: 4.53k]
  ------------------
 2637|  4.53k|                   (!strcmp(argv[i], "--noent"))) {
  ------------------
  |  Branch (2637:20): [True: 51, False: 4.48k]
  ------------------
 2638|     51|            lint->parseOptions |= XML_PARSE_NOENT;
 2639|  4.48k|        } else if ((!strcmp(argv[i], "-noenc")) ||
  ------------------
  |  Branch (2639:20): [True: 0, False: 4.48k]
  ------------------
 2640|  4.48k|                   (!strcmp(argv[i], "--noenc"))) {
  ------------------
  |  Branch (2640:20): [True: 74, False: 4.40k]
  ------------------
 2641|     74|            lint->parseOptions |= XML_PARSE_IGNORE_ENC;
 2642|     74|#ifdef LIBXML_HTML_ENABLED
 2643|     74|            lint->htmlOptions |= HTML_PARSE_IGNORE_ENC;
 2644|     74|#endif
 2645|  4.40k|        } else if ((!strcmp(argv[i], "-nsclean")) ||
  ------------------
  |  Branch (2645:20): [True: 0, False: 4.40k]
  ------------------
 2646|  4.40k|                   (!strcmp(argv[i], "--nsclean"))) {
  ------------------
  |  Branch (2646:20): [True: 154, False: 4.25k]
  ------------------
 2647|    154|            lint->parseOptions |= XML_PARSE_NSCLEAN;
 2648|  4.25k|        } else if ((!strcmp(argv[i], "-nocdata")) ||
  ------------------
  |  Branch (2648:20): [True: 0, False: 4.25k]
  ------------------
 2649|  4.25k|                   (!strcmp(argv[i], "--nocdata"))) {
  ------------------
  |  Branch (2649:20): [True: 131, False: 4.12k]
  ------------------
 2650|    131|            lint->parseOptions |= XML_PARSE_NOCDATA;
 2651|  4.12k|        } else if ((!strcmp(argv[i], "-nodict")) ||
  ------------------
  |  Branch (2651:20): [True: 0, False: 4.12k]
  ------------------
 2652|  4.12k|                   (!strcmp(argv[i], "--nodict"))) {
  ------------------
  |  Branch (2652:20): [True: 92, False: 4.03k]
  ------------------
 2653|     92|            lint->parseOptions |= XML_PARSE_NODICT;
 2654|  4.03k|        } else if ((!strcmp(argv[i], "-version")) ||
  ------------------
  |  Branch (2654:20): [True: 0, False: 4.03k]
  ------------------
 2655|  4.03k|                   (!strcmp(argv[i], "--version"))) {
  ------------------
  |  Branch (2655:20): [True: 84, False: 3.94k]
  ------------------
 2656|     84|            showVersion(errStream, argv[0]);
 2657|     84|            lint->version = 1;
 2658|  3.94k|        } else if ((!strcmp(argv[i], "-noout")) ||
  ------------------
  |  Branch (2658:20): [True: 0, False: 3.94k]
  ------------------
 2659|  3.94k|                   (!strcmp(argv[i], "--noout"))) {
  ------------------
  |  Branch (2659:20): [True: 101, False: 3.84k]
  ------------------
 2660|    101|            lint->noout = 1;
 2661|    101|#ifdef LIBXML_HTML_ENABLED
 2662|  3.84k|        } else if ((!strcmp(argv[i], "-html")) ||
  ------------------
  |  Branch (2662:20): [True: 0, False: 3.84k]
  ------------------
 2663|  3.84k|                   (!strcmp(argv[i], "--html"))) {
  ------------------
  |  Branch (2663:20): [True: 35, False: 3.81k]
  ------------------
 2664|     35|            lint->appOptions |= XML_LINT_HTML_ENABLED;
 2665|  3.81k|        } else if ((!strcmp(argv[i], "-nodefdtd")) ||
  ------------------
  |  Branch (2665:20): [True: 0, False: 3.81k]
  ------------------
 2666|  3.81k|                   (!strcmp(argv[i], "--nodefdtd"))) {
  ------------------
  |  Branch (2666:20): [True: 113, False: 3.69k]
  ------------------
 2667|    113|            lint->htmlOptions |= HTML_PARSE_NODEFDTD;
 2668|    113|#ifdef LIBXML_OUTPUT_ENABLED
 2669|  3.69k|        } else if ((!strcmp(argv[i], "-xmlout")) ||
  ------------------
  |  Branch (2669:20): [True: 0, False: 3.69k]
  ------------------
 2670|  3.69k|                   (!strcmp(argv[i], "--xmlout"))) {
  ------------------
  |  Branch (2670:20): [True: 58, False: 3.64k]
  ------------------
 2671|     58|            lint->appOptions |= XML_LINT_XML_OUT;
 2672|     58|#endif
 2673|     58|#endif /* LIBXML_HTML_ENABLED */
 2674|  3.64k|        } else if ((!strcmp(argv[i], "-loaddtd")) ||
  ------------------
  |  Branch (2674:20): [True: 0, False: 3.64k]
  ------------------
 2675|  3.64k|                   (!strcmp(argv[i], "--loaddtd"))) {
  ------------------
  |  Branch (2675:20): [True: 83, False: 3.55k]
  ------------------
 2676|     83|            lint->parseOptions |= XML_PARSE_DTDLOAD;
 2677|  3.55k|        } else if ((!strcmp(argv[i], "-dtdattr")) ||
  ------------------
  |  Branch (2677:20): [True: 0, False: 3.55k]
  ------------------
 2678|  3.55k|                   (!strcmp(argv[i], "--dtdattr"))) {
  ------------------
  |  Branch (2678:20): [True: 140, False: 3.41k]
  ------------------
 2679|    140|            lint->parseOptions |= XML_PARSE_DTDATTR;
 2680|    140|#ifdef LIBXML_VALID_ENABLED
 2681|  3.41k|        } else if ((!strcmp(argv[i], "-valid")) ||
  ------------------
  |  Branch (2681:20): [True: 0, False: 3.41k]
  ------------------
 2682|  3.41k|                   (!strcmp(argv[i], "--valid"))) {
  ------------------
  |  Branch (2682:20): [True: 90, False: 3.32k]
  ------------------
 2683|     90|            lint->parseOptions |= XML_PARSE_DTDVALID;
 2684|  3.32k|        } else if ((!strcmp(argv[i], "-postvalid")) ||
  ------------------
  |  Branch (2684:20): [True: 0, False: 3.32k]
  ------------------
 2685|  3.32k|                   (!strcmp(argv[i], "--postvalid"))) {
  ------------------
  |  Branch (2685:20): [True: 45, False: 3.28k]
  ------------------
 2686|     45|            lint->appOptions |= XML_LINT_POST_VALIDATION;
 2687|     45|            lint->parseOptions |= XML_PARSE_DTDLOAD;
 2688|  3.28k|        } else if ((!strcmp(argv[i], "-dtdvalid")) ||
  ------------------
  |  Branch (2688:20): [True: 0, False: 3.28k]
  ------------------
 2689|  3.28k|                   (!strcmp(argv[i], "--dtdvalid"))) {
  ------------------
  |  Branch (2689:20): [True: 0, False: 3.28k]
  ------------------
 2690|      0|            i++;
 2691|      0|            lint->dtdvalid = argv[i];
 2692|      0|            lint->parseOptions |= XML_PARSE_DTDLOAD;
 2693|  3.28k|        } else if ((!strcmp(argv[i], "-dtdvalidfpi")) ||
  ------------------
  |  Branch (2693:20): [True: 0, False: 3.28k]
  ------------------
 2694|  3.28k|                   (!strcmp(argv[i], "--dtdvalidfpi"))) {
  ------------------
  |  Branch (2694:20): [True: 0, False: 3.28k]
  ------------------
 2695|      0|            i++;
 2696|      0|            lint->dtdvalidfpi = argv[i];
 2697|      0|            lint->parseOptions |= XML_PARSE_DTDLOAD;
 2698|  3.28k|        } else if ((!strcmp(argv[i], "-insert")) ||
  ------------------
  |  Branch (2698:20): [True: 0, False: 3.28k]
  ------------------
 2699|  3.28k|                   (!strcmp(argv[i], "--insert"))) {
  ------------------
  |  Branch (2699:20): [True: 159, False: 3.12k]
  ------------------
 2700|    159|            lint->appOptions |= XML_LINT_VALID_INSERTIONS;
 2701|    159|#endif /* LIBXML_VALID_ENABLED */
 2702|  3.12k|        } else if ((!strcmp(argv[i], "-strict-namespace")) ||
  ------------------
  |  Branch (2702:20): [True: 0, False: 3.12k]
  ------------------
 2703|  3.12k|            (!strcmp(argv[i], "--strict-namespace"))) {
  ------------------
  |  Branch (2703:13): [True: 0, False: 3.12k]
  ------------------
 2704|      0|            lint->appOptions |= XML_LINT_STRICT_NAMESPACE;
 2705|  3.12k|        } else if ((!strcmp(argv[i], "-dropdtd")) ||
  ------------------
  |  Branch (2705:20): [True: 0, False: 3.12k]
  ------------------
 2706|  3.12k|                   (!strcmp(argv[i], "--dropdtd"))) {
  ------------------
  |  Branch (2706:20): [True: 53, False: 3.07k]
  ------------------
 2707|     53|            lint->appOptions |= XML_LINT_DROP_DTD;
 2708|  3.07k|        } else if ((!strcmp(argv[i], "-quiet")) ||
  ------------------
  |  Branch (2708:20): [True: 0, False: 3.07k]
  ------------------
 2709|  3.07k|                   (!strcmp(argv[i], "--quiet"))) {
  ------------------
  |  Branch (2709:20): [True: 24, False: 3.04k]
  ------------------
 2710|     24|            lint->appOptions |= XML_LINT_QUIET;
 2711|  3.04k|        } else if ((!strcmp(argv[i], "-timing")) ||
  ------------------
  |  Branch (2711:20): [True: 0, False: 3.04k]
  ------------------
 2712|  3.04k|                   (!strcmp(argv[i], "--timing"))) {
  ------------------
  |  Branch (2712:20): [True: 72, False: 2.97k]
  ------------------
 2713|     72|            lint->appOptions |= XML_LINT_TIMINGS;
 2714|  2.97k|        } else if ((!strcmp(argv[i], "-auto")) ||
  ------------------
  |  Branch (2714:20): [True: 0, False: 2.97k]
  ------------------
 2715|  2.97k|                   (!strcmp(argv[i], "--auto"))) {
  ------------------
  |  Branch (2715:20): [True: 261, False: 2.71k]
  ------------------
 2716|    261|            lint->appOptions |= XML_LINT_GENERATE;
 2717|  2.71k|        } else if ((!strcmp(argv[i], "-repeat")) ||
  ------------------
  |  Branch (2717:20): [True: 0, False: 2.71k]
  ------------------
 2718|  2.71k|                   (!strcmp(argv[i], "--repeat"))) {
  ------------------
  |  Branch (2718:20): [True: 51, False: 2.66k]
  ------------------
 2719|     51|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2720|     51|            lint->repeat = 2;
 2721|       |#else
 2722|       |            if (lint->repeat > 1)
 2723|       |                lint->repeat *= 10;
 2724|       |            else
 2725|       |                lint->repeat = 100;
 2726|       |#endif
 2727|     51|#ifdef LIBXML_PUSH_ENABLED
 2728|  2.66k|        } else if ((!strcmp(argv[i], "-push")) ||
  ------------------
  |  Branch (2728:20): [True: 0, False: 2.66k]
  ------------------
 2729|  2.66k|                   (!strcmp(argv[i], "--push"))) {
  ------------------
  |  Branch (2729:20): [True: 9, False: 2.65k]
  ------------------
 2730|      9|            lint->appOptions |= XML_LINT_PUSH_ENABLED;
 2731|      9|#endif /* LIBXML_PUSH_ENABLED */
 2732|      9|#if HAVE_DECL_MMAP
 2733|  2.65k|        } else if ((!strcmp(argv[i], "-memory")) ||
  ------------------
  |  Branch (2733:20): [True: 0, False: 2.65k]
  ------------------
 2734|  2.65k|                   (!strcmp(argv[i], "--memory"))) {
  ------------------
  |  Branch (2734:20): [True: 0, False: 2.65k]
  ------------------
 2735|      0|            lint->appOptions |= XML_LINT_MEMORY;
 2736|      0|#endif
 2737|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 2738|  2.65k|        } else if ((!strcmp(argv[i], "-xinclude")) ||
  ------------------
  |  Branch (2738:20): [True: 0, False: 2.65k]
  ------------------
 2739|  2.65k|                   (!strcmp(argv[i], "--xinclude"))) {
  ------------------
  |  Branch (2739:20): [True: 92, False: 2.56k]
  ------------------
 2740|     92|            lint->appOptions |= XML_LINT_XINCLUDE;
 2741|     92|            lint->parseOptions |= XML_PARSE_XINCLUDE;
 2742|  2.56k|        } else if ((!strcmp(argv[i], "-noxincludenode")) ||
  ------------------
  |  Branch (2742:20): [True: 0, False: 2.56k]
  ------------------
 2743|  2.56k|                   (!strcmp(argv[i], "--noxincludenode"))) {
  ------------------
  |  Branch (2743:20): [True: 194, False: 2.36k]
  ------------------
 2744|    194|            lint->appOptions |= XML_LINT_XINCLUDE;
 2745|    194|            lint->parseOptions |= XML_PARSE_XINCLUDE;
 2746|    194|            lint->parseOptions |= XML_PARSE_NOXINCNODE;
 2747|  2.36k|        } else if ((!strcmp(argv[i], "-nofixup-base-uris")) ||
  ------------------
  |  Branch (2747:20): [True: 0, False: 2.36k]
  ------------------
 2748|  2.36k|                   (!strcmp(argv[i], "--nofixup-base-uris"))) {
  ------------------
  |  Branch (2748:20): [True: 72, False: 2.29k]
  ------------------
 2749|     72|            lint->appOptions |= XML_LINT_XINCLUDE;
 2750|     72|            lint->parseOptions |= XML_PARSE_XINCLUDE;
 2751|     72|            lint->parseOptions |= XML_PARSE_NOBASEFIX;
 2752|     72|#endif
 2753|  2.29k|        } else if ((!strcmp(argv[i], "-nowarning")) ||
  ------------------
  |  Branch (2753:20): [True: 0, False: 2.29k]
  ------------------
 2754|  2.29k|                   (!strcmp(argv[i], "--nowarning"))) {
  ------------------
  |  Branch (2754:20): [True: 124, False: 2.17k]
  ------------------
 2755|    124|            lint->parseOptions |= XML_PARSE_NOWARNING;
 2756|    124|            lint->parseOptions &= ~XML_PARSE_PEDANTIC;
 2757|    124|#ifdef LIBXML_HTML_ENABLED
 2758|    124|            lint->htmlOptions |= HTML_PARSE_NOWARNING;
 2759|    124|#endif
 2760|  2.17k|        } else if ((!strcmp(argv[i], "-pedantic")) ||
  ------------------
  |  Branch (2760:20): [True: 0, False: 2.17k]
  ------------------
 2761|  2.17k|                   (!strcmp(argv[i], "--pedantic"))) {
  ------------------
  |  Branch (2761:20): [True: 33, False: 2.13k]
  ------------------
 2762|     33|            lint->parseOptions |= XML_PARSE_PEDANTIC;
 2763|     33|            lint->parseOptions &= ~XML_PARSE_NOWARNING;
 2764|     33|#ifdef LIBXML_CATALOG_ENABLED
 2765|  2.13k|        } else if ((!strcmp(argv[i], "-catalogs")) ||
  ------------------
  |  Branch (2765:20): [True: 0, False: 2.13k]
  ------------------
 2766|  2.13k|                   (!strcmp(argv[i], "--catalogs"))) {
  ------------------
  |  Branch (2766:20): [True: 0, False: 2.13k]
  ------------------
 2767|      0|            lint->appOptions |= XML_LINT_USE_CATALOGS;
 2768|  2.13k|        } else if ((!strcmp(argv[i], "-nocatalogs")) ||
  ------------------
  |  Branch (2768:20): [True: 0, False: 2.13k]
  ------------------
 2769|  2.13k|                   (!strcmp(argv[i], "--nocatalogs"))) {
  ------------------
  |  Branch (2769:20): [True: 330, False: 1.80k]
  ------------------
 2770|    330|            lint->appOptions |= XML_LINT_USE_NO_CATALOGS;
 2771|    330|            lint->parseOptions |= XML_PARSE_NO_SYS_CATALOG;
 2772|    330|#endif
 2773|  1.80k|        } else if ((!strcmp(argv[i], "-noblanks")) ||
  ------------------
  |  Branch (2773:20): [True: 0, False: 1.80k]
  ------------------
 2774|  1.80k|                   (!strcmp(argv[i], "--noblanks"))) {
  ------------------
  |  Branch (2774:20): [True: 90, False: 1.71k]
  ------------------
 2775|     90|            lint->parseOptions |= XML_PARSE_NOBLANKS;
 2776|     90|#ifdef LIBXML_HTML_ENABLED
 2777|     90|            lint->htmlOptions |= HTML_PARSE_NOBLANKS;
 2778|     90|#endif
 2779|     90|#ifdef LIBXML_OUTPUT_ENABLED
 2780|  1.71k|        } else if ((!strcmp(argv[i], "-o")) ||
  ------------------
  |  Branch (2780:20): [True: 0, False: 1.71k]
  ------------------
 2781|  1.71k|                   (!strcmp(argv[i], "-output")) ||
  ------------------
  |  Branch (2781:20): [True: 0, False: 1.71k]
  ------------------
 2782|  1.71k|                   (!strcmp(argv[i], "--output"))) {
  ------------------
  |  Branch (2782:20): [True: 0, False: 1.71k]
  ------------------
 2783|      0|            i++;
 2784|      0|            lint->output = argv[i];
 2785|  1.71k|        } else if ((!strcmp(argv[i], "-format")) ||
  ------------------
  |  Branch (2785:20): [True: 0, False: 1.71k]
  ------------------
 2786|  1.71k|                   (!strcmp(argv[i], "--format"))) {
  ------------------
  |  Branch (2786:20): [True: 171, False: 1.54k]
  ------------------
 2787|    171|            lint->format = 1;
 2788|    171|            lint->parseOptions |= XML_PARSE_NOBLANKS;
 2789|    171|#ifdef LIBXML_HTML_ENABLED
 2790|    171|            lint->htmlOptions |= HTML_PARSE_NOBLANKS;
 2791|    171|#endif
 2792|  1.54k|        } else if ((!strcmp(argv[i], "-encode")) ||
  ------------------
  |  Branch (2792:20): [True: 0, False: 1.54k]
  ------------------
 2793|  1.54k|                   (!strcmp(argv[i], "--encode"))) {
  ------------------
  |  Branch (2793:20): [True: 142, False: 1.40k]
  ------------------
 2794|    142|            i++;
 2795|    142|            lint->encoding = argv[i];
 2796|  1.40k|        } else if ((!strcmp(argv[i], "-pretty")) ||
  ------------------
  |  Branch (2796:20): [True: 0, False: 1.40k]
  ------------------
 2797|  1.40k|                   (!strcmp(argv[i], "--pretty"))) {
  ------------------
  |  Branch (2797:20): [True: 166, False: 1.23k]
  ------------------
 2798|    166|            i++;
 2799|    166|            if (i >= argc) {
  ------------------
  |  Branch (2799:17): [True: 0, False: 166]
  ------------------
 2800|      0|                fprintf(errStream, "pretty: missing integer value\n");
 2801|      0|                return(XMLLINT_ERR_UNCLASS);
 2802|      0|            }
 2803|    166|            if (parseInteger(&val, errStream, "pretty", argv[i],
  ------------------
  |  Branch (2803:17): [True: 2, False: 164]
  ------------------
 2804|    166|                             0, 2) < 0)
 2805|      2|                return(XMLLINT_ERR_UNCLASS);
 2806|    164|            lint->format = val;
 2807|    164|#ifdef LIBXML_ZLIB_ENABLED
 2808|  1.23k|        } else if ((!strcmp(argv[i], "-compress")) ||
  ------------------
  |  Branch (2808:20): [True: 0, False: 1.23k]
  ------------------
 2809|  1.23k|                   (!strcmp(argv[i], "--compress"))) {
  ------------------
  |  Branch (2809:20): [True: 17, False: 1.22k]
  ------------------
 2810|     17|            lint->appOptions |= XML_LINT_ZLIB_COMPRESSION;
 2811|     17|#endif
 2812|     17|#ifdef LIBXML_C14N_ENABLED
 2813|  1.22k|        } else if ((!strcmp(argv[i], "-c14n")) ||
  ------------------
  |  Branch (2813:20): [True: 0, False: 1.22k]
  ------------------
 2814|  1.22k|                   (!strcmp(argv[i], "--c14n"))) {
  ------------------
  |  Branch (2814:20): [True: 59, False: 1.16k]
  ------------------
 2815|     59|            lint->appOptions |= XML_LINT_CANONICAL_V1_0;
 2816|     59|            lint->parseOptions |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
 2817|  1.16k|        } else if ((!strcmp(argv[i], "-c14n11")) ||
  ------------------
  |  Branch (2817:20): [True: 0, False: 1.16k]
  ------------------
 2818|  1.16k|                   (!strcmp(argv[i], "--c14n11"))) {
  ------------------
  |  Branch (2818:20): [True: 132, False: 1.03k]
  ------------------
 2819|    132|            lint->appOptions |= XML_LINT_CANONICAL_V1_1;
 2820|    132|            lint->parseOptions |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
 2821|  1.03k|        } else if ((!strcmp(argv[i], "-exc-c14n")) ||
  ------------------
  |  Branch (2821:20): [True: 0, False: 1.03k]
  ------------------
 2822|  1.03k|                   (!strcmp(argv[i], "--exc-c14n"))) {
  ------------------
  |  Branch (2822:20): [True: 64, False: 967]
  ------------------
 2823|     64|            lint->appOptions |= XML_LINT_CANONICAL_EXE;
 2824|     64|            lint->parseOptions |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
 2825|     64|#endif /* LIBXML_C14N_ENABLED */
 2826|     64|#endif /* LIBXML_OUTPUT_ENABLED */
 2827|     64|#ifdef LIBXML_READER_ENABLED
 2828|    967|        } else if ((!strcmp(argv[i], "-stream")) ||
  ------------------
  |  Branch (2828:20): [True: 0, False: 967]
  ------------------
 2829|    967|                   (!strcmp(argv[i], "--stream"))) {
  ------------------
  |  Branch (2829:20): [True: 70, False: 897]
  ------------------
 2830|     70|             lint->appOptions |= XML_LINT_USE_STREAMING;
 2831|    897|        } else if ((!strcmp(argv[i], "-walker")) ||
  ------------------
  |  Branch (2831:20): [True: 0, False: 897]
  ------------------
 2832|    897|                   (!strcmp(argv[i], "--walker"))) {
  ------------------
  |  Branch (2832:20): [True: 57, False: 840]
  ------------------
 2833|     57|             lint->appOptions |= XML_LINT_USE_WALKER;
 2834|     57|             lint->noout = 1;
 2835|     57|#ifdef LIBXML_PATTERN_ENABLED
 2836|    840|        } else if ((!strcmp(argv[i], "-pattern")) ||
  ------------------
  |  Branch (2836:20): [True: 0, False: 840]
  ------------------
 2837|    840|                   (!strcmp(argv[i], "--pattern"))) {
  ------------------
  |  Branch (2837:20): [True: 110, False: 730]
  ------------------
 2838|    110|            i++;
 2839|    110|            lint->pattern = argv[i];
 2840|    110|#endif
 2841|    110|#endif /* LIBXML_READER_ENABLED */
 2842|    110|#ifdef LIBXML_SAX1_ENABLED
 2843|    730|        } else if ((!strcmp(argv[i], "-sax1")) ||
  ------------------
  |  Branch (2843:20): [True: 0, False: 730]
  ------------------
 2844|    730|                   (!strcmp(argv[i], "--sax1"))) {
  ------------------
  |  Branch (2844:20): [True: 7, False: 723]
  ------------------
 2845|      7|            lint->parseOptions |= XML_PARSE_SAX1;
 2846|      7|#endif /* LIBXML_SAX1_ENABLED */
 2847|    723|        } else if ((!strcmp(argv[i], "-sax")) ||
  ------------------
  |  Branch (2847:20): [True: 0, False: 723]
  ------------------
 2848|    723|                   (!strcmp(argv[i], "--sax"))) {
  ------------------
  |  Branch (2848:20): [True: 31, False: 692]
  ------------------
 2849|     31|            lint->appOptions |= XML_LINT_SAX_ENABLED;
 2850|     31|#ifdef LIBXML_RELAXNG_ENABLED
 2851|    692|        } else if ((!strcmp(argv[i], "-relaxng")) ||
  ------------------
  |  Branch (2851:20): [True: 0, False: 692]
  ------------------
 2852|    692|                   (!strcmp(argv[i], "--relaxng"))) {
  ------------------
  |  Branch (2852:20): [True: 0, False: 692]
  ------------------
 2853|      0|            i++;
 2854|      0|            lint->relaxng = argv[i];
 2855|      0|            lint->parseOptions |= XML_PARSE_NOENT;
 2856|      0|#endif
 2857|      0|#ifdef LIBXML_SCHEMAS_ENABLED
 2858|    692|        } else if ((!strcmp(argv[i], "-schema")) ||
  ------------------
  |  Branch (2858:20): [True: 0, False: 692]
  ------------------
 2859|    692|                 (!strcmp(argv[i], "--schema"))) {
  ------------------
  |  Branch (2859:18): [True: 0, False: 692]
  ------------------
 2860|      0|            i++;
 2861|      0|            lint->schema = argv[i];
 2862|      0|            lint->parseOptions |= XML_PARSE_NOENT;
 2863|      0|#endif
 2864|       |#ifdef LIBXML_SCHEMATRON_ENABLED
 2865|       |        } else if ((!strcmp(argv[i], "-schematron")) ||
 2866|       |                   (!strcmp(argv[i], "--schematron"))) {
 2867|       |            i++;
 2868|       |            lint->schematron = argv[i];
 2869|       |            lint->parseOptions |= XML_PARSE_NOENT;
 2870|       |#endif
 2871|    692|        } else if ((!strcmp(argv[i], "-nonet")) ||
  ------------------
  |  Branch (2871:20): [True: 0, False: 692]
  ------------------
 2872|    692|                   (!strcmp(argv[i], "--nonet"))) {
  ------------------
  |  Branch (2872:20): [True: 112, False: 580]
  ------------------
 2873|    112|            lint->parseOptions |= XML_PARSE_NONET;
 2874|    580|        } else if ((!strcmp(argv[i], "-nocompact")) ||
  ------------------
  |  Branch (2874:20): [True: 0, False: 580]
  ------------------
 2875|    580|                   (!strcmp(argv[i], "--nocompact"))) {
  ------------------
  |  Branch (2875:20): [True: 94, False: 486]
  ------------------
 2876|     94|            lint->parseOptions &= ~XML_PARSE_COMPACT;
 2877|     94|#ifdef LIBXML_HTML_ENABLED
 2878|     94|            lint->htmlOptions &= ~HTML_PARSE_COMPACT;
 2879|     94|#endif
 2880|    486|        } else if ((!strcmp(argv[i], "-load-trace")) ||
  ------------------
  |  Branch (2880:20): [True: 0, False: 486]
  ------------------
 2881|    486|                   (!strcmp(argv[i], "--load-trace"))) {
  ------------------
  |  Branch (2881:20): [True: 88, False: 398]
  ------------------
 2882|     88|            lint->appOptions |= XML_LINT_USE_LOAD_TRACE;
 2883|    398|        } else if ((!strcmp(argv[i], "-path")) ||
  ------------------
  |  Branch (2883:20): [True: 0, False: 398]
  ------------------
 2884|    398|                   (!strcmp(argv[i], "--path"))) {
  ------------------
  |  Branch (2884:20): [True: 0, False: 398]
  ------------------
 2885|      0|            i++;
 2886|      0|            parsePath(lint, BAD_CAST argv[i]);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 2887|      0|#ifdef LIBXML_XPATH_ENABLED
 2888|    398|        } else if ((!strcmp(argv[i], "-xpath")) ||
  ------------------
  |  Branch (2888:20): [True: 0, False: 398]
  ------------------
 2889|    398|                   (!strcmp(argv[i], "--xpath"))) {
  ------------------
  |  Branch (2889:20): [True: 220, False: 178]
  ------------------
 2890|    220|            i++;
 2891|    220|            lint->noout++;
 2892|    220|            lint->xpathquery = argv[i];
 2893|    220|            lint->xpathsep = "\n";
 2894|    220|        } else if ((!strcmp(argv[i], "-xpath0")) ||
  ------------------
  |  Branch (2894:20): [True: 0, False: 178]
  ------------------
 2895|    178|                   (!strcmp(argv[i], "--xpath0"))) {
  ------------------
  |  Branch (2895:20): [True: 0, False: 178]
  ------------------
 2896|      0|            i++;
 2897|      0|            lint->noout++;
 2898|      0|            lint->xpathquery = argv[i];
 2899|      0|            lint->xpathsep = "\0";
 2900|      0|#endif
 2901|    178|        } else if ((!strcmp(argv[i], "-oldxml10")) ||
  ------------------
  |  Branch (2901:20): [True: 0, False: 178]
  ------------------
 2902|    178|                   (!strcmp(argv[i], "--oldxml10"))) {
  ------------------
  |  Branch (2902:20): [True: 144, False: 34]
  ------------------
 2903|    144|            lint->parseOptions |= XML_PARSE_OLD10;
 2904|    144|        } else if ((!strcmp(argv[i], "-max-ampl")) ||
  ------------------
  |  Branch (2904:20): [True: 0, False: 34]
  ------------------
 2905|     34|                   (!strcmp(argv[i], "--max-ampl"))) {
  ------------------
  |  Branch (2905:20): [True: 29, False: 5]
  ------------------
 2906|     29|            i++;
 2907|     29|            if (i >= argc) {
  ------------------
  |  Branch (2907:17): [True: 0, False: 29]
  ------------------
 2908|      0|                fprintf(errStream, "max-ampl: missing integer value\n");
 2909|      0|                return(XMLLINT_ERR_UNCLASS);
 2910|      0|            }
 2911|     29|            if (parseInteger(&val, errStream, "max-ampl", argv[i],
  ------------------
  |  Branch (2911:17): [True: 0, False: 29]
  ------------------
 2912|     29|                             1, UINT_MAX) < 0)
 2913|      0|                return(XMLLINT_ERR_UNCLASS);
 2914|     29|            lint->maxAmpl = val;
 2915|     29|        } else {
 2916|      5|            fprintf(errStream, "Unknown option %s\n", argv[i]);
 2917|      5|            usage(errStream, argv[0]);
 2918|      5|            return(XMLLINT_ERR_UNCLASS);
 2919|      5|        }
 2920|  4.87k|    }
 2921|       |
 2922|    323|    if (lint->appOptions & XML_LINT_NAVIGATING_SHELL)
  ------------------
  |  Branch (2922:9): [True: 0, False: 323]
  ------------------
 2923|      0|        lint->repeat = 1;
 2924|       |
 2925|    323|#ifdef LIBXML_READER_ENABLED
 2926|    323|    if (lint->appOptions & XML_LINT_USE_STREAMING) {
  ------------------
  |  Branch (2926:9): [True: 70, False: 253]
  ------------------
 2927|     70|        specialMode = "--stream";
 2928|       |
 2929|     70|        if (lint->appOptions & XML_LINT_SAX_ENABLED)
  ------------------
  |  Branch (2929:13): [True: 0, False: 70]
  ------------------
 2930|      0|            xmllintOptWarnNoSupport(errStream, "--stream", "--sax");
 2931|     70|#ifdef LIBXML_PUSH_ENABLED
 2932|     70|        if (lint->appOptions & XML_LINT_PUSH_ENABLED)
  ------------------
  |  Branch (2932:13): [True: 3, False: 67]
  ------------------
 2933|      3|            xmllintOptWarnNoSupport(errStream, "--stream", "--push");
 2934|     70|#endif
 2935|     70|#ifdef LIBXML_HTML_ENABLED
 2936|     70|        if (lint->appOptions & XML_LINT_HTML_ENABLED)
  ------------------
  |  Branch (2936:13): [True: 0, False: 70]
  ------------------
 2937|      0|            xmllintOptWarnNoSupport(errStream, "--stream", "--html");
 2938|     70|#endif
 2939|     70|    }
 2940|    323|#endif /* LIBXML_READER_ENABLED */
 2941|       |
 2942|    323|    if (lint->appOptions & XML_LINT_SAX_ENABLED) {
  ------------------
  |  Branch (2942:9): [True: 31, False: 292]
  ------------------
 2943|     31|        specialMode = "--sax";
 2944|       |
 2945|     31|#ifdef LIBXML_XINCLUDE_ENABLED
 2946|     31|        if (lint->appOptions & XML_LINT_XINCLUDE)
  ------------------
  |  Branch (2946:13): [True: 31, False: 0]
  ------------------
 2947|     31|            xmllintOptWarnNoSupport(errStream, "--sax", "--xinclude");
 2948|     31|#endif
 2949|     31|#ifdef LIBXML_RELAXNG_ENABLED
 2950|     31|        if (lint->relaxng != NULL)
  ------------------
  |  Branch (2950:13): [True: 0, False: 31]
  ------------------
 2951|      0|            xmllintOptWarnNoSupport(errStream, "--sax", "--relaxng");
 2952|     31|#endif
 2953|     31|    }
 2954|       |
 2955|    323|    if (specialMode != NULL) {
  ------------------
  |  Branch (2955:9): [True: 101, False: 222]
  ------------------
 2956|    101|        if (lint->appOptions & XML_LINT_GENERATE)
  ------------------
  |  Branch (2956:13): [True: 97, False: 4]
  ------------------
 2957|     97|            xmllintOptWarnNoSupport(errStream, specialMode, "--auto");
 2958|    101|        if (lint->appOptions & XML_LINT_DROP_DTD)
  ------------------
  |  Branch (2958:13): [True: 11, False: 90]
  ------------------
 2959|     11|            xmllintOptWarnNoSupport(errStream, specialMode, "--dropdtd");
 2960|    101|        if (lint->appOptions & XML_LINT_NAVIGATING_SHELL)
  ------------------
  |  Branch (2960:13): [True: 0, False: 101]
  ------------------
 2961|      0|            xmllintOptWarnNoSupport(errStream, specialMode, "--shell");
 2962|    101|        if (lint->appOptions & XML_LINT_COPY_ENABLED)
  ------------------
  |  Branch (2962:13): [True: 8, False: 93]
  ------------------
 2963|      8|            xmllintOptWarnNoSupport(errStream, specialMode, "--copy");
 2964|    101|#ifdef LIBXML_XPATH_ENABLED
 2965|    101|        if (lint->xpathquery != NULL)
  ------------------
  |  Branch (2965:13): [True: 67, False: 34]
  ------------------
 2966|     67|            xmllintOptWarnNoSupport(errStream, specialMode, "--xpath");
 2967|    101|#endif
 2968|    101|#ifdef LIBXML_READER_ENABLED
 2969|    101|        if (lint->appOptions & XML_LINT_USE_WALKER)
  ------------------
  |  Branch (2969:13): [True: 19, False: 82]
  ------------------
 2970|     19|            xmllintOptWarnNoSupport(errStream, specialMode, "--walker");
 2971|    101|#endif
 2972|    101|#ifdef LIBXML_VALID_ENABLED
 2973|    101|        if (lint->appOptions & XML_LINT_VALID_INSERTIONS)
  ------------------
  |  Branch (2973:13): [True: 63, False: 38]
  ------------------
 2974|     63|            xmllintOptWarnNoSupport(errStream, specialMode, "--insert");
 2975|    101|        if (lint->dtdvalid != NULL)
  ------------------
  |  Branch (2975:13): [True: 0, False: 101]
  ------------------
 2976|      0|            xmllintOptWarnNoSupport(errStream, specialMode, "--dtdvalid");
 2977|    101|        if (lint->dtdvalidfpi != NULL)
  ------------------
  |  Branch (2977:13): [True: 0, False: 101]
  ------------------
 2978|      0|            xmllintOptWarnNoSupport(errStream, specialMode, "--dtdvalidfpi");
 2979|    101|        if (lint->appOptions & XML_LINT_POST_VALIDATION)
  ------------------
  |  Branch (2979:13): [True: 9, False: 92]
  ------------------
 2980|      9|            xmllintOptWarnNoSupport(errStream, specialMode, "--postvalid");
 2981|    101|#endif
 2982|       |#ifdef LIBXML_SCHEMATRON_ENABLED
 2983|       |        if (lint->schematron != NULL)
 2984|       |            xmllintOptWarnNoSupport(errStream, specialMode, "--schematron");
 2985|       |#endif
 2986|    101|#ifdef LIBXML_OUTPUT_ENABLED
 2987|    101|        if (lint->output != NULL)
  ------------------
  |  Branch (2987:13): [True: 0, False: 101]
  ------------------
 2988|      0|            xmllintOptWarnNoSupport(errStream, specialMode, "--output");
 2989|    101|        if (lint->encoding != NULL)
  ------------------
  |  Branch (2989:13): [True: 61, False: 40]
  ------------------
 2990|     61|            xmllintOptWarnNoSupport(errStream, specialMode, "--encode");
 2991|    101|        if (lint->format > 0)
  ------------------
  |  Branch (2991:13): [True: 71, False: 30]
  ------------------
 2992|     71|            xmllintOptWarnNoSupport(errStream, specialMode,
 2993|     71|                                    "--format or -pretty");
 2994|    101|#ifdef LIBXML_ZLIB_ENABLED
 2995|    101|        if (lint->appOptions & XML_LINT_ZLIB_COMPRESSION)
  ------------------
  |  Branch (2995:13): [True: 5, False: 96]
  ------------------
 2996|      5|            xmllintOptWarnNoSupport(errStream, specialMode, "--compress");
 2997|    101|#endif
 2998|    101|#ifdef LIBXML_HTML_ENABLED
 2999|    101|        if (lint->appOptions & XML_LINT_XML_OUT)
  ------------------
  |  Branch (2999:13): [True: 15, False: 86]
  ------------------
 3000|     15|            xmllintOptWarnNoSupport(errStream, specialMode, "--xmlout");
 3001|    101|#endif
 3002|    101|#ifdef LIBXML_C14N_ENABLED
 3003|    101|        if (lint->appOptions & XML_LINT_CANONICAL_V1_0)
  ------------------
  |  Branch (3003:13): [True: 10, False: 91]
  ------------------
 3004|     10|            xmllintOptWarnNoSupport(errStream, specialMode, "--c14n");
 3005|    101|        if (lint->appOptions & XML_LINT_CANONICAL_V1_1)
  ------------------
  |  Branch (3005:13): [True: 45, False: 56]
  ------------------
 3006|     45|            xmllintOptWarnNoSupport(errStream, specialMode, "--c14n11");
 3007|    101|        if (lint->appOptions & XML_LINT_CANONICAL_EXE)
  ------------------
  |  Branch (3007:13): [True: 14, False: 87]
  ------------------
 3008|     14|            xmllintOptWarnNoSupport(errStream, specialMode, "--exc-c14n");
 3009|    101|#endif
 3010|    101|#endif /* LIBXML_OUTPUT_ENABLED */
 3011|    101|    }
 3012|       |
 3013|    323|#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
 3014|    323|    if (lint->pattern && !((lint->appOptions & XML_LINT_USE_STREAMING) || (lint->appOptions & XML_LINT_USE_WALKER)))
  ------------------
  |  Branch (3014:9): [True: 110, False: 213]
  |  Branch (3014:28): [True: 15, False: 95]
  |  Branch (3014:75): [True: 21, False: 74]
  ------------------
 3015|     74|        fprintf(errStream, "Warning: Option %s requires %s\n",
 3016|     74|                "--pattern", "--stream or --walker");
 3017|    323|#endif
 3018|       |
 3019|    323|#ifdef LIBXML_HTML_ENABLED
 3020|    323|    if (lint->appOptions & XML_LINT_HTML_ENABLED) {
  ------------------
  |  Branch (3020:9): [True: 35, False: 288]
  ------------------
 3021|     35|        if (lint->parseOptions & XML_PARSE_DTDATTR)
  ------------------
  |  Branch (3021:13): [True: 30, False: 5]
  ------------------
 3022|     30|            xmllintOptWarnNoSupport(errStream, "--html", "--dtdattr");
 3023|     35|        if (lint->parseOptions & XML_PARSE_DTDLOAD)
  ------------------
  |  Branch (3023:13): [True: 34, False: 1]
  ------------------
 3024|     34|            xmllintOptWarnNoSupport(errStream, "--html", "--loaddtd");
 3025|     35|        if (lint->maxAmpl)
  ------------------
  |  Branch (3025:13): [True: 7, False: 28]
  ------------------
 3026|      7|            xmllintOptWarnNoSupport(errStream, "--html", "--max-ampl");
 3027|     35|        if (lint->parseOptions & XML_PARSE_NOCDATA)
  ------------------
  |  Branch (3027:13): [True: 16, False: 19]
  ------------------
 3028|     16|            xmllintOptWarnNoSupport(errStream, "--html", "--nocdata");
 3029|     35|        if (lint->parseOptions & XML_PARSE_NODICT)
  ------------------
  |  Branch (3029:13): [True: 12, False: 23]
  ------------------
 3030|     12|            xmllintOptWarnNoSupport(errStream, "--html", "--nodict");
 3031|     35|        if (lint->parseOptions & XML_PARSE_NOENT)
  ------------------
  |  Branch (3031:13): [True: 27, False: 8]
  ------------------
 3032|     27|            xmllintOptWarnNoSupport(errStream, "--html", "--noent");
 3033|     35|        if (lint->parseOptions & XML_PARSE_NONET)
  ------------------
  |  Branch (3033:13): [True: 13, False: 22]
  ------------------
 3034|     13|            xmllintOptWarnNoSupport(errStream, "--html", "--nonet");
 3035|     35|        if (lint->parseOptions & XML_PARSE_NSCLEAN)
  ------------------
  |  Branch (3035:13): [True: 14, False: 21]
  ------------------
 3036|     14|            xmllintOptWarnNoSupport(errStream, "--html", "--nsclean");
 3037|     35|        if (lint->parseOptions & XML_PARSE_OLD10)
  ------------------
  |  Branch (3037:13): [True: 9, False: 26]
  ------------------
 3038|      9|            xmllintOptWarnNoSupport(errStream, "--html", "--oldxml10");
 3039|     35|        if (lint->parseOptions & XML_PARSE_PEDANTIC)
  ------------------
  |  Branch (3039:13): [True: 2, False: 33]
  ------------------
 3040|      2|            xmllintOptWarnNoSupport(errStream, "--html", "--pedantic");
 3041|     35|        if (lint->parseOptions & XML_PARSE_DTDVALID)
  ------------------
  |  Branch (3041:13): [True: 20, False: 15]
  ------------------
 3042|     20|            xmllintOptWarnNoSupport(errStream, "--html", "--valid");
 3043|     35|        if (lint->parseOptions & XML_PARSE_SAX1)
  ------------------
  |  Branch (3043:13): [True: 0, False: 35]
  ------------------
 3044|      0|            xmllintOptWarnNoSupport(errStream, "--html", "--sax1");
 3045|    288|    } else {
 3046|    288|        if (lint->htmlOptions & HTML_PARSE_NODEFDTD)
  ------------------
  |  Branch (3046:13): [True: 101, False: 187]
  ------------------
 3047|    101|            fprintf(errStream, "Warning: Option %s requires %s\n",
 3048|    101|                    "--nodefdtd", "--html");
 3049|    288|#ifdef LIBXML_OUTPUT_ENABLED
 3050|    288|        if (lint->appOptions & XML_LINT_XML_OUT)
  ------------------
  |  Branch (3050:13): [True: 24, False: 264]
  ------------------
 3051|     24|            fprintf(errStream, "Warning: Option %s requires %s\n",
 3052|     24|                    "--xmlout", "--html");
 3053|    288|#endif
 3054|    288|    }
 3055|    323|#endif
 3056|       |
 3057|    323|    return(XMLLINT_RETURN_OK);
 3058|    330|}
xmllint.c:parseInteger:
 2497|    222|             const char *str, unsigned long min, unsigned long max) {
 2498|    222|    char *strEnd;
 2499|    222|    unsigned long val;
 2500|       |
 2501|    222|    if (str != NULL && *str == '-') {
  ------------------
  |  Branch (2501:9): [True: 222, False: 0]
  |  Branch (2501:24): [True: 0, False: 222]
  ------------------
 2502|      0|        fprintf(errStream, "%s: value not allowed: %s\n", ctxt, str);
 2503|      0|        return(-1);
 2504|      0|    }
 2505|       |
 2506|    222|    errno = 0;
 2507|    222|    val = strtoul(str, &strEnd, 10);
 2508|    222|    if (errno == EINVAL || *strEnd != 0) {
  ------------------
  |  Branch (2508:9): [True: 0, False: 222]
  |  Branch (2508:28): [True: 0, False: 222]
  ------------------
 2509|      0|        fprintf(errStream, "%s: invalid integer: %s\n", ctxt, str);
 2510|      0|        return(-1);
 2511|      0|    }
 2512|    222|    if (errno != 0 || val < min || val > max) {
  ------------------
  |  Branch (2512:9): [True: 0, False: 222]
  |  Branch (2512:23): [True: 0, False: 222]
  |  Branch (2512:36): [True: 2, False: 220]
  ------------------
 2513|      2|        fprintf(errStream, "%s: integer out of range: %s\n", ctxt, str);
 2514|      2|        return(-1);
 2515|      2|    }
 2516|       |
 2517|    220|    *result = val;
 2518|    220|    return(0);
 2519|    222|}
xmllint.c:showVersion:
 2349|     84|static void showVersion(FILE *errStream, const char *name) {
 2350|     84|    fprintf(errStream, "%s: using libxml version %s\n", name, xmlParserVersion);
 2351|     84|    fprintf(errStream, "   compiled with: ");
 2352|     84|    if (xmlHasFeature(XML_WITH_THREAD)) fprintf(errStream, "Threads ");
  ------------------
  |  Branch (2352:9): [True: 84, False: 0]
  ------------------
 2353|     84|    fprintf(errStream, "Tree ");
 2354|     84|    if (xmlHasFeature(XML_WITH_OUTPUT)) fprintf(errStream, "Output ");
  ------------------
  |  Branch (2354:9): [True: 84, False: 0]
  ------------------
 2355|     84|    if (xmlHasFeature(XML_WITH_PUSH)) fprintf(errStream, "Push ");
  ------------------
  |  Branch (2355:9): [True: 84, False: 0]
  ------------------
 2356|     84|    if (xmlHasFeature(XML_WITH_READER)) fprintf(errStream, "Reader ");
  ------------------
  |  Branch (2356:9): [True: 84, False: 0]
  ------------------
 2357|     84|    if (xmlHasFeature(XML_WITH_PATTERN)) fprintf(errStream, "Patterns ");
  ------------------
  |  Branch (2357:9): [True: 84, False: 0]
  ------------------
 2358|     84|    if (xmlHasFeature(XML_WITH_WRITER)) fprintf(errStream, "Writer ");
  ------------------
  |  Branch (2358:9): [True: 84, False: 0]
  ------------------
 2359|     84|    if (xmlHasFeature(XML_WITH_SAX1)) fprintf(errStream, "SAXv1 ");
  ------------------
  |  Branch (2359:9): [True: 84, False: 0]
  ------------------
 2360|     84|    if (xmlHasFeature(XML_WITH_VALID)) fprintf(errStream, "DTDValid ");
  ------------------
  |  Branch (2360:9): [True: 84, False: 0]
  ------------------
 2361|     84|    if (xmlHasFeature(XML_WITH_HTML)) fprintf(errStream, "HTML ");
  ------------------
  |  Branch (2361:9): [True: 84, False: 0]
  ------------------
 2362|     84|    if (xmlHasFeature(XML_WITH_C14N)) fprintf(errStream, "C14N ");
  ------------------
  |  Branch (2362:9): [True: 84, False: 0]
  ------------------
 2363|     84|    if (xmlHasFeature(XML_WITH_CATALOG)) fprintf(errStream, "Catalog ");
  ------------------
  |  Branch (2363:9): [True: 84, False: 0]
  ------------------
 2364|     84|    if (xmlHasFeature(XML_WITH_XPATH)) fprintf(errStream, "XPath ");
  ------------------
  |  Branch (2364:9): [True: 84, False: 0]
  ------------------
 2365|     84|    if (xmlHasFeature(XML_WITH_XPTR)) fprintf(errStream, "XPointer ");
  ------------------
  |  Branch (2365:9): [True: 84, False: 0]
  ------------------
 2366|     84|    if (xmlHasFeature(XML_WITH_XINCLUDE)) fprintf(errStream, "XInclude ");
  ------------------
  |  Branch (2366:9): [True: 84, False: 0]
  ------------------
 2367|     84|    if (xmlHasFeature(XML_WITH_ICONV)) fprintf(errStream, "Iconv ");
  ------------------
  |  Branch (2367:9): [True: 84, False: 0]
  ------------------
 2368|     84|    if (xmlHasFeature(XML_WITH_ICU)) fprintf(errStream, "ICU ");
  ------------------
  |  Branch (2368:9): [True: 0, False: 84]
  ------------------
 2369|     84|    if (xmlHasFeature(XML_WITH_ISO8859X)) fprintf(errStream, "ISO8859X ");
  ------------------
  |  Branch (2369:9): [True: 84, False: 0]
  ------------------
 2370|     84|    if (xmlHasFeature(XML_WITH_REGEXP))
  ------------------
  |  Branch (2370:9): [True: 84, False: 0]
  ------------------
 2371|     84|        fprintf(errStream, "Regexps Automata ");
 2372|     84|    if (xmlHasFeature(XML_WITH_RELAXNG)) fprintf(errStream, "RelaxNG ");
  ------------------
  |  Branch (2372:9): [True: 84, False: 0]
  ------------------
 2373|     84|    if (xmlHasFeature(XML_WITH_SCHEMAS)) fprintf(errStream, "Schemas ");
  ------------------
  |  Branch (2373:9): [True: 84, False: 0]
  ------------------
 2374|     84|    if (xmlHasFeature(XML_WITH_SCHEMATRON)) fprintf(errStream, "Schematron ");
  ------------------
  |  Branch (2374:9): [True: 0, False: 84]
  ------------------
 2375|     84|    if (xmlHasFeature(XML_WITH_MODULES)) fprintf(errStream, "Modules ");
  ------------------
  |  Branch (2375:9): [True: 84, False: 0]
  ------------------
 2376|     84|    if (xmlHasFeature(XML_WITH_DEBUG)) fprintf(errStream, "Debug ");
  ------------------
  |  Branch (2376:9): [True: 0, False: 84]
  ------------------
 2377|     84|    if (xmlHasFeature(XML_WITH_ZLIB)) fprintf(errStream, "Zlib ");
  ------------------
  |  Branch (2377:9): [True: 84, False: 0]
  ------------------
 2378|     84|    fprintf(errStream, "\n");
 2379|     84|}
xmllint.c:xmllintOptWarnNoSupport:
 2586|    713|xmllintOptWarnNoSupport(FILE *errStream, const char *opt, const char *nosupp) {
 2587|    713|    fprintf(errStream, "Warning: Option %s doesn't support %s\n", opt, nosupp);
 2588|    713|}
xmllint.c:myFreeFunc:
  512|  11.8k|myFreeFunc(void *mem) {
  513|  11.8k|    xmlMemFree(mem);
  514|  11.8k|}
xmllint.c:myMallocFunc:
  517|  11.8k|myMallocFunc(size_t size) {
  518|  11.8k|    void *ret;
  519|       |
  520|  11.8k|    if (xmlMemUsed() + size > (size_t) xmllintMaxmem) {
  ------------------
  |  Branch (520:9): [True: 4, False: 11.8k]
  ------------------
  521|       |#if XMLLINT_ABORT_ON_FAILURE
  522|       |        abort();
  523|       |#endif
  524|      4|        xmllintMaxmemReached = 1;
  525|      4|        xmllintOom = 1;
  526|      4|        return(NULL);
  527|      4|    }
  528|       |
  529|  11.8k|    ret = xmlMemMalloc(size);
  530|  11.8k|    if (ret == NULL)
  ------------------
  |  Branch (530:9): [True: 0, False: 11.8k]
  ------------------
  531|      0|        xmllintOom = 1;
  532|       |
  533|  11.8k|    return(ret);
  534|  11.8k|}
xmllint.c:myReallocFunc:
  537|    105|myReallocFunc(void *mem, size_t size) {
  538|    105|    void *ret;
  539|    105|    size_t oldsize = xmlMemSize(mem);
  540|       |
  541|    105|    if (xmlMemUsed() + size - oldsize > (size_t) xmllintMaxmem) {
  ------------------
  |  Branch (541:9): [True: 0, False: 105]
  ------------------
  542|       |#if XMLLINT_ABORT_ON_FAILURE
  543|       |        abort();
  544|       |#endif
  545|      0|        xmllintMaxmemReached = 1;
  546|      0|        xmllintOom = 1;
  547|      0|        return(NULL);
  548|      0|    }
  549|       |
  550|    105|    ret = xmlMemRealloc(mem, size);
  551|    105|    if (ret == NULL)
  ------------------
  |  Branch (551:9): [True: 0, False: 105]
  ------------------
  552|      0|        xmllintOom = 1;
  553|       |
  554|    105|    return(ret);
  555|    105|}
xmllint.c:myStrdupFunc:
  558|     46|myStrdupFunc(const char *str) {
  559|     46|    size_t size;
  560|     46|    char *ret;
  561|       |
  562|     46|    if (str == NULL)
  ------------------
  |  Branch (562:9): [True: 0, False: 46]
  ------------------
  563|      0|        return(NULL);
  564|       |
  565|     46|    size = strlen(str) + 1;
  566|     46|    if (xmlMemUsed() + size > (size_t) xmllintMaxmem) {
  ------------------
  |  Branch (566:9): [True: 44, False: 2]
  ------------------
  567|       |#if XMLLINT_ABORT_ON_FAILURE
  568|       |        abort();
  569|       |#endif
  570|     44|        xmllintMaxmemReached = 1;
  571|     44|        xmllintOom = 1;
  572|     44|        return(NULL);
  573|     44|    }
  574|       |
  575|      2|    ret = xmlMemMalloc(size);
  576|      2|    if (ret == NULL) {
  ------------------
  |  Branch (576:9): [True: 0, False: 2]
  ------------------
  577|      0|        xmllintOom = 1;
  578|      0|        return(NULL);
  579|      0|    }
  580|       |
  581|      2|    memcpy(ret, str, size);
  582|       |
  583|      2|    return(ret);
  584|      2|}
xmllint.c:startTimer:
  615|    324|{
  616|    324|    getTime(&lint->begin);
  617|    324|}
xmllint.c:getTime:
  594|    610|getTime(xmlTime *time) {
  595|       |#ifdef _WIN32
  596|       |    struct __timeb64 timebuffer;
  597|       |
  598|       |    _ftime64(&timebuffer);
  599|       |    time->sec = timebuffer.time;
  600|       |    time->usec = timebuffer.millitm * 1000;
  601|       |#else /* _WIN32 */
  602|    610|    struct timeval tv;
  603|       |
  604|       |    gettimeofday(&tv, NULL);
  605|    610|    time->sec = tv.tv_sec;
  606|    610|    time->usec = tv.tv_usec;
  607|    610|#endif /* _WIN32 */
  608|    610|}
xmllint.c:xmllintResourceLoader:
  277|     34|                      xmlParserInputFlags flags, xmlParserInputPtr *out) {
  278|     34|    xmllintState *lint = ctxt;
  279|     34|    xmlParserErrors code;
  280|     34|    int i;
  281|     34|    const char *lastsegment = URL;
  282|     34|    const char *iter = URL;
  283|       |
  284|     34|    if ((lint->nbpaths > 0) && (iter != NULL)) {
  ------------------
  |  Branch (284:9): [True: 0, False: 34]
  |  Branch (284:32): [True: 0, False: 0]
  ------------------
  285|      0|	while (*iter != 0) {
  ------------------
  |  Branch (285:9): [True: 0, False: 0]
  ------------------
  286|      0|	    if (*iter == '/')
  ------------------
  |  Branch (286:10): [True: 0, False: 0]
  ------------------
  287|      0|		lastsegment = iter + 1;
  288|      0|	    iter++;
  289|      0|	}
  290|      0|    }
  291|       |
  292|     34|    if (lint->defaultResourceLoader != NULL)
  ------------------
  |  Branch (292:9): [True: 34, False: 0]
  ------------------
  293|     34|        code = lint->defaultResourceLoader(NULL, URL, ID, type, flags, out);
  294|      0|    else
  295|      0|        code = xmlNewInputFromUrl(URL, flags, out);
  296|     34|    if (code != XML_IO_ENOENT) {
  ------------------
  |  Branch (296:9): [True: 34, False: 0]
  ------------------
  297|     34|        if ((lint->appOptions & XML_LINT_USE_LOAD_TRACE) && (code == XML_ERR_OK)) {
  ------------------
  |  Branch (297:13): [True: 12, False: 22]
  |  Branch (297:61): [True: 0, False: 12]
  ------------------
  298|      0|            fprintf(lint->errStream, "Loaded URL=\"%s\" ID=\"%s\"\n",
  299|      0|                    URL, ID ? ID : "(null)");
  ------------------
  |  Branch (299:26): [True: 0, False: 0]
  ------------------
  300|      0|        }
  301|     34|        return(code);
  302|     34|    }
  303|       |
  304|      0|    for (i = 0; i < lint->nbpaths; i++) {
  ------------------
  |  Branch (304:17): [True: 0, False: 0]
  ------------------
  305|      0|	xmlChar *newURL;
  306|       |
  307|      0|	newURL = xmlStrdup((const xmlChar *) lint->paths[i]);
  308|      0|	if (newURL == NULL)
  ------------------
  |  Branch (308:6): [True: 0, False: 0]
  ------------------
  309|      0|	    return(XML_ERR_NO_MEMORY);
  310|      0|	newURL = xmlStrcat(newURL, (const xmlChar *) "/");
  311|      0|	if (newURL == NULL)
  ------------------
  |  Branch (311:6): [True: 0, False: 0]
  ------------------
  312|      0|	    return(XML_ERR_NO_MEMORY);
  313|      0|	newURL = xmlStrcat(newURL, (const xmlChar *) lastsegment);
  314|      0|	if (newURL != NULL) {
  ------------------
  |  Branch (314:6): [True: 0, False: 0]
  ------------------
  315|      0|            if (lint->defaultResourceLoader != NULL)
  ------------------
  |  Branch (315:17): [True: 0, False: 0]
  ------------------
  316|      0|                code = lint->defaultResourceLoader(NULL, (const char *) newURL,
  317|      0|                                                   ID, type, flags, out);
  318|      0|            else
  319|      0|                code = xmlNewInputFromUrl((const char *) newURL, flags, out);
  320|      0|            if (code != XML_IO_ENOENT) {
  ------------------
  |  Branch (320:17): [True: 0, False: 0]
  ------------------
  321|      0|                if ((lint->appOptions & XML_LINT_USE_LOAD_TRACE) && (code == XML_ERR_OK)) {
  ------------------
  |  Branch (321:21): [True: 0, False: 0]
  |  Branch (321:69): [True: 0, False: 0]
  ------------------
  322|      0|                    fprintf(lint->errStream, "Loaded URL=\"%s\" ID=\"%s\"\n",
  323|      0|                            newURL, ID ? ID : "(null)");
  ------------------
  |  Branch (323:37): [True: 0, False: 0]
  ------------------
  324|      0|                }
  325|      0|	        xmlFree(newURL);
  326|      0|                return(code);
  327|      0|            }
  328|      0|	    xmlFree(newURL);
  329|      0|	}
  330|      0|    }
  331|       |
  332|      0|    return(XML_IO_ENOENT);
  333|      0|}
xmllint.c:endTimer:
  626|    286|{
  627|    286|    xmlSeconds msec;
  628|    286|    va_list ap;
  629|       |
  630|    286|    getTime(&lint->end);
  631|    286|    msec = lint->end.sec - lint->begin.sec;
  632|    286|    msec *= 1000;
  633|    286|    msec += (lint->end.usec - lint->begin.usec) / 1000;
  634|       |
  635|    286|    va_start(ap, fmt);
  636|    286|    vfprintf(lint->errStream, fmt, ap);
  637|    286|    va_end(ap);
  638|       |
  639|    286|    fprintf(lint->errStream, " took %ld ms\n", (long) msec);
  640|    286|}
xmllint.c:skipArgs:
 2522|  4.29k|skipArgs(const char *arg) {
 2523|  4.29k|    if ((!strcmp(arg, "-path")) ||
  ------------------
  |  Branch (2523:9): [True: 0, False: 4.29k]
  ------------------
 2524|  4.29k|        (!strcmp(arg, "--path")) ||
  ------------------
  |  Branch (2524:9): [True: 0, False: 4.29k]
  ------------------
 2525|  4.29k|        (!strcmp(arg, "-maxmem")) ||
  ------------------
  |  Branch (2525:9): [True: 0, False: 4.29k]
  ------------------
 2526|  4.29k|        (!strcmp(arg, "--maxmem")) ||
  ------------------
  |  Branch (2526:9): [True: 16, False: 4.28k]
  ------------------
 2527|  4.28k|#ifdef LIBXML_OUTPUT_ENABLED
 2528|  4.28k|        (!strcmp(arg, "-o")) ||
  ------------------
  |  Branch (2528:9): [True: 0, False: 4.28k]
  ------------------
 2529|  4.28k|        (!strcmp(arg, "-output")) ||
  ------------------
  |  Branch (2529:9): [True: 0, False: 4.28k]
  ------------------
 2530|  4.28k|        (!strcmp(arg, "--output")) ||
  ------------------
  |  Branch (2530:9): [True: 0, False: 4.28k]
  ------------------
 2531|  4.28k|        (!strcmp(arg, "-encode")) ||
  ------------------
  |  Branch (2531:9): [True: 0, False: 4.28k]
  ------------------
 2532|  4.28k|        (!strcmp(arg, "--encode")) ||
  ------------------
  |  Branch (2532:9): [True: 129, False: 4.15k]
  ------------------
 2533|  4.15k|        (!strcmp(arg, "-pretty")) ||
  ------------------
  |  Branch (2533:9): [True: 0, False: 4.15k]
  ------------------
 2534|  4.15k|        (!strcmp(arg, "--pretty")) ||
  ------------------
  |  Branch (2534:9): [True: 136, False: 4.01k]
  ------------------
 2535|  4.01k|#endif
 2536|  4.01k|#ifdef LIBXML_VALID_ENABLED
 2537|  4.01k|        (!strcmp(arg, "-dtdvalid")) ||
  ------------------
  |  Branch (2537:9): [True: 0, False: 4.01k]
  ------------------
 2538|  4.01k|        (!strcmp(arg, "--dtdvalid")) ||
  ------------------
  |  Branch (2538:9): [True: 0, False: 4.01k]
  ------------------
 2539|  4.01k|        (!strcmp(arg, "-dtdvalidfpi")) ||
  ------------------
  |  Branch (2539:9): [True: 0, False: 4.01k]
  ------------------
 2540|  4.01k|        (!strcmp(arg, "--dtdvalidfpi")) ||
  ------------------
  |  Branch (2540:9): [True: 0, False: 4.01k]
  ------------------
 2541|  4.01k|#endif
 2542|  4.01k|#ifdef LIBXML_RELAXNG_ENABLED
 2543|  4.01k|        (!strcmp(arg, "-relaxng")) ||
  ------------------
  |  Branch (2543:9): [True: 0, False: 4.01k]
  ------------------
 2544|  4.01k|        (!strcmp(arg, "--relaxng")) ||
  ------------------
  |  Branch (2544:9): [True: 0, False: 4.01k]
  ------------------
 2545|  4.01k|#endif
 2546|  4.01k|#ifdef LIBXML_SCHEMAS_ENABLED
 2547|  4.01k|        (!strcmp(arg, "-schema")) ||
  ------------------
  |  Branch (2547:9): [True: 0, False: 4.01k]
  ------------------
 2548|  4.01k|        (!strcmp(arg, "--schema")) ||
  ------------------
  |  Branch (2548:9): [True: 0, False: 4.01k]
  ------------------
 2549|  4.01k|#endif
 2550|       |#ifdef LIBXML_SCHEMATRON_ENABLED
 2551|       |        (!strcmp(arg, "-schematron")) ||
 2552|       |        (!strcmp(arg, "--schematron")) ||
 2553|       |#endif
 2554|  4.01k|#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
 2555|  4.01k|        (!strcmp(arg, "-pattern")) ||
  ------------------
  |  Branch (2555:9): [True: 0, False: 4.01k]
  ------------------
 2556|  4.01k|        (!strcmp(arg, "--pattern")) ||
  ------------------
  |  Branch (2556:9): [True: 71, False: 3.94k]
  ------------------
 2557|  3.94k|#endif
 2558|  3.94k|#ifdef LIBXML_XPATH_ENABLED
 2559|  3.94k|        (!strcmp(arg, "-xpath")) ||
  ------------------
  |  Branch (2559:9): [True: 0, False: 3.94k]
  ------------------
 2560|  3.94k|        (!strcmp(arg, "--xpath")) ||
  ------------------
  |  Branch (2560:9): [True: 204, False: 3.74k]
  ------------------
 2561|  3.74k|        (!strcmp(arg, "-xpath0")) ||
  ------------------
  |  Branch (2561:9): [True: 0, False: 3.74k]
  ------------------
 2562|  3.74k|        (!strcmp(arg, "--xpath0")) ||
  ------------------
  |  Branch (2562:9): [True: 0, False: 3.74k]
  ------------------
 2563|  3.74k|#endif
 2564|  3.74k|        (!strcmp(arg, "-max-ampl")) ||
  ------------------
  |  Branch (2564:9): [True: 0, False: 3.74k]
  ------------------
 2565|  3.74k|        (!strcmp(arg, "--max-ampl"))
  ------------------
  |  Branch (2565:9): [True: 17, False: 3.72k]
  ------------------
 2566|  4.29k|    ) {
 2567|    573|        return(1);
 2568|    573|    }
 2569|       |
 2570|  3.72k|    return(0);
 2571|  4.29k|}
xmllint.c:streamFile:
 1385|     72|static void streamFile(xmllintState *lint, const char *filename) {
 1386|     72|    xmlParserInputBufferPtr input = NULL;
 1387|     72|    FILE *errStream = lint->errStream;
 1388|     72|    xmlTextReaderPtr reader;
 1389|     72|    int ret;
 1390|       |
 1391|     72|#if HAVE_DECL_MMAP
 1392|     72|    if (lint->appOptions & XML_LINT_MEMORY) {
  ------------------
  |  Branch (1392:9): [True: 0, False: 72]
  ------------------
 1393|      0|	reader = xmlReaderForMemory(lint->memoryData, lint->memorySize,
 1394|      0|                                    filename, NULL, lint->parseOptions);
 1395|      0|        if (reader == NULL) {
  ------------------
  |  Branch (1395:13): [True: 0, False: 0]
  ------------------
 1396|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1397|      0|            return;
 1398|      0|        }
 1399|      0|    } else
 1400|     72|#endif
 1401|     72|    {
 1402|     72|#ifdef LIBXML_ZLIB_ENABLED
 1403|     72|        gzFile gz;
 1404|     72|#endif
 1405|       |
 1406|     72|        xmlResetLastError();
 1407|       |
 1408|     72|#ifdef LIBXML_ZLIB_ENABLED
 1409|     72|        if (strcmp(filename, "-") == 0)
  ------------------
  |  Branch (1409:13): [True: 0, False: 72]
  ------------------
 1410|      0|            gz = gzdopen(STDIN_FILENO, "rb");
 1411|     72|        else
 1412|     72|            gz = gzopen(filename, "rb");
 1413|       |
 1414|     72|        if (gz == NULL) {
  ------------------
  |  Branch (1414:13): [True: 71, False: 1]
  ------------------
 1415|     71|            fprintf(lint->errStream, "Can't open %s\n", filename);
 1416|     71|            lint->progresult = XMLLINT_ERR_RDFILE;
 1417|     71|            return;
 1418|     71|        }
 1419|       |
 1420|      1|        reader = xmlReaderForIO(xmllintGzRead, xmllintGzClose, gz,
 1421|      1|                                filename, NULL, lint->parseOptions);
 1422|       |#else
 1423|       |        if (strcmp(filename, "-") == 0) {
 1424|       |            reader = xmlReaderForFd(STDIN_FILENO, "-", NULL,
 1425|       |                                    lint->parseOptions);
 1426|       |        }
 1427|       |        else {
 1428|       |            reader = xmlReaderForFile(filename, NULL, lint->parseOptions);
 1429|       |        }
 1430|       |#endif
 1431|      1|        if (reader == NULL) {
  ------------------
  |  Branch (1431:13): [True: 1, False: 0]
  ------------------
 1432|      1|            const xmlError *error = xmlGetLastError();
 1433|       |
 1434|      1|            if ((error != NULL) && (error->code == XML_ERR_NO_MEMORY)) {
  ------------------
  |  Branch (1434:17): [True: 0, False: 1]
  |  Branch (1434:36): [True: 0, False: 0]
  ------------------
 1435|      0|                lint->progresult = XMLLINT_ERR_MEM;
 1436|      1|            } else {
 1437|      1|                fprintf(errStream, "Unable to open %s\n", filename);
 1438|      1|                lint->progresult = XMLLINT_ERR_RDFILE;
 1439|      1|            }
 1440|      1|            return;
 1441|      1|        }
 1442|      1|    }
 1443|       |
 1444|      0|#ifdef LIBXML_PATTERN_ENABLED
 1445|      0|    if (lint->patternc != NULL) {
  ------------------
  |  Branch (1445:9): [True: 0, False: 0]
  ------------------
 1446|      0|        lint->patstream = xmlPatternGetStreamCtxt(lint->patternc);
 1447|      0|	if (lint->patstream != NULL) {
  ------------------
  |  Branch (1447:6): [True: 0, False: 0]
  ------------------
 1448|      0|	    ret = xmlStreamPush(lint->patstream, NULL, NULL);
 1449|      0|	    if (ret < 0) {
  ------------------
  |  Branch (1449:10): [True: 0, False: 0]
  ------------------
 1450|      0|		fprintf(errStream, "xmlStreamPush() failure\n");
 1451|      0|		xmlFreeStreamCtxt(lint->patstream);
 1452|      0|		lint->patstream = NULL;
 1453|      0|            }
 1454|      0|	}
 1455|      0|    }
 1456|      0|#endif
 1457|       |
 1458|       |
 1459|      0|    xmlTextReaderSetResourceLoader(reader, xmllintResourceLoader, lint);
 1460|      0|    if (lint->maxAmpl > 0)
  ------------------
  |  Branch (1460:9): [True: 0, False: 0]
  ------------------
 1461|      0|        xmlTextReaderSetMaxAmplification(reader, lint->maxAmpl);
 1462|       |
 1463|      0|#ifdef LIBXML_RELAXNG_ENABLED
 1464|      0|    if (lint->relaxng != NULL) {
  ------------------
  |  Branch (1464:9): [True: 0, False: 0]
  ------------------
 1465|      0|        if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1465:13): [True: 0, False: 0]
  |  Branch (1465:54): [True: 0, False: 0]
  ------------------
 1466|      0|            startTimer(lint);
 1467|      0|        }
 1468|      0|        ret = xmlTextReaderRelaxNGValidate(reader, lint->relaxng);
 1469|      0|        if (ret < 0) {
  ------------------
  |  Branch (1469:13): [True: 0, False: 0]
  ------------------
 1470|      0|            fprintf(errStream, "Relax-NG schema %s failed to compile\n",
 1471|      0|                    lint->relaxng);
 1472|      0|            lint->progresult = XMLLINT_ERR_SCHEMACOMP;
 1473|      0|            lint->relaxng = NULL;
 1474|      0|        }
 1475|      0|        if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1475:13): [True: 0, False: 0]
  |  Branch (1475:54): [True: 0, False: 0]
  ------------------
 1476|      0|            endTimer(lint, "Compiling the schemas");
 1477|      0|        }
 1478|      0|    }
 1479|      0|#endif
 1480|      0|#ifdef LIBXML_SCHEMAS_ENABLED
 1481|      0|    if (lint->schema != NULL) {
  ------------------
  |  Branch (1481:9): [True: 0, False: 0]
  ------------------
 1482|      0|        if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1482:13): [True: 0, False: 0]
  |  Branch (1482:54): [True: 0, False: 0]
  ------------------
 1483|      0|            startTimer(lint);
 1484|      0|        }
 1485|      0|        ret = xmlTextReaderSchemaValidate(reader, lint->schema);
 1486|      0|        if (ret < 0) {
  ------------------
  |  Branch (1486:13): [True: 0, False: 0]
  ------------------
 1487|      0|            fprintf(errStream, "XSD schema %s failed to compile\n",
 1488|      0|                    lint->schema);
 1489|      0|            lint->progresult = XMLLINT_ERR_SCHEMACOMP;
 1490|      0|            lint->schema = NULL;
 1491|      0|        }
 1492|      0|        if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1492:13): [True: 0, False: 0]
  |  Branch (1492:54): [True: 0, False: 0]
  ------------------
 1493|      0|            endTimer(lint, "Compiling the schemas");
 1494|      0|        }
 1495|      0|    }
 1496|      0|#endif
 1497|       |
 1498|       |    /*
 1499|       |     * Process all nodes in sequence
 1500|       |     */
 1501|      0|    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1501:9): [True: 0, False: 0]
  |  Branch (1501:50): [True: 0, False: 0]
  ------------------
 1502|      0|        startTimer(lint);
 1503|      0|    }
 1504|      0|    ret = xmlTextReaderRead(reader);
 1505|      0|    while (ret == 1) {
  ------------------
  |  Branch (1505:12): [True: 0, False: 0]
  ------------------
 1506|      0|        if ((lint->appOptions & XML_LINT_DEBUG_ENABLED)
  ------------------
  |  Branch (1506:13): [True: 0, False: 0]
  ------------------
 1507|      0|#ifdef LIBXML_PATTERN_ENABLED
 1508|      0|            || (lint->patternc)
  ------------------
  |  Branch (1508:16): [True: 0, False: 0]
  ------------------
 1509|      0|#endif
 1510|      0|           )
 1511|      0|            processNode(lint, reader);
 1512|      0|        ret = xmlTextReaderRead(reader);
 1513|      0|    }
 1514|      0|    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1514:9): [True: 0, False: 0]
  |  Branch (1514:50): [True: 0, False: 0]
  ------------------
 1515|      0|#ifdef LIBXML_RELAXNG_ENABLED
 1516|      0|        if (lint->relaxng != NULL)
  ------------------
  |  Branch (1516:13): [True: 0, False: 0]
  ------------------
 1517|      0|            endTimer(lint, "Parsing and validating");
 1518|      0|        else
 1519|      0|#endif
 1520|      0|#ifdef LIBXML_VALID_ENABLED
 1521|      0|        if (lint->parseOptions & XML_PARSE_DTDVALID)
  ------------------
  |  Branch (1521:13): [True: 0, False: 0]
  ------------------
 1522|      0|            endTimer(lint, "Parsing and validating");
 1523|      0|        else
 1524|      0|#endif
 1525|      0|        endTimer(lint, "Parsing");
 1526|      0|    }
 1527|       |
 1528|      0|#ifdef LIBXML_VALID_ENABLED
 1529|      0|    if (lint->parseOptions & XML_PARSE_DTDVALID) {
  ------------------
  |  Branch (1529:9): [True: 0, False: 0]
  ------------------
 1530|      0|        if (xmlTextReaderIsValid(reader) != 1) {
  ------------------
  |  Branch (1530:13): [True: 0, False: 0]
  ------------------
 1531|      0|            fprintf(errStream,
 1532|      0|                    "Document %s does not validate\n", filename);
 1533|      0|            lint->progresult = XMLLINT_ERR_VALID;
 1534|      0|        }
 1535|      0|    }
 1536|      0|#endif /* LIBXML_VALID_ENABLED */
 1537|      0|#if defined(LIBXML_RELAXNG_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
 1538|      0|    {
 1539|      0|        int hasSchema = 0;
 1540|       |
 1541|      0|#ifdef LIBXML_RELAXNG_ENABLED
 1542|      0|        if (lint->relaxng != NULL)
  ------------------
  |  Branch (1542:13): [True: 0, False: 0]
  ------------------
 1543|      0|            hasSchema = 1;
 1544|      0|#endif
 1545|      0|#ifdef LIBXML_SCHEMAS_ENABLED
 1546|      0|        if (lint->schema != NULL)
  ------------------
  |  Branch (1546:13): [True: 0, False: 0]
  ------------------
 1547|      0|            hasSchema = 1;
 1548|      0|#endif
 1549|      0|        if (hasSchema) {
  ------------------
  |  Branch (1549:13): [True: 0, False: 0]
  ------------------
 1550|      0|            if (xmlTextReaderIsValid(reader) != 1) {
  ------------------
  |  Branch (1550:17): [True: 0, False: 0]
  ------------------
 1551|      0|                fprintf(errStream, "%s fails to validate\n", filename);
 1552|      0|                lint->progresult = XMLLINT_ERR_VALID;
 1553|      0|            } else {
 1554|      0|                if ((lint->appOptions & XML_LINT_QUIET) != XML_LINT_QUIET) {
  ------------------
  |  Branch (1554:21): [True: 0, False: 0]
  ------------------
 1555|      0|                    fprintf(errStream, "%s validates\n", filename);
 1556|      0|                }
 1557|      0|            }
 1558|      0|        }
 1559|      0|    }
 1560|      0|#endif
 1561|       |    /*
 1562|       |     * Done, cleanup and status
 1563|       |     */
 1564|      0|    xmlFreeTextReader(reader);
 1565|      0|    xmlFreeParserInputBuffer(input);
 1566|      0|    if (ret != 0) {
  ------------------
  |  Branch (1566:9): [True: 0, False: 0]
  ------------------
 1567|      0|        fprintf(errStream, "%s : failed to parse\n", filename);
 1568|      0|        lint->progresult = XMLLINT_ERR_UNCLASS;
 1569|      0|    }
 1570|      0|#ifdef LIBXML_PATTERN_ENABLED
 1571|      0|    if (lint->patstream != NULL) {
  ------------------
  |  Branch (1571:9): [True: 0, False: 0]
  ------------------
 1572|      0|	xmlFreeStreamCtxt(lint->patstream);
 1573|       |	lint->patstream = NULL;
 1574|      0|    }
 1575|      0|#endif
 1576|      0|}
xmllint.c:xmllintGzRead:
  343|      1|xmllintGzRead(void *ctxt, char *buf, int len) {
  344|      1|    return gzread(ctxt, buf, len);
  345|      1|}
xmllint.c:xmllintGzClose:
  355|      1|xmllintGzClose(void *ctxt) {
  356|      1|    if (gzclose(ctxt) != Z_OK)
  ------------------
  |  Branch (356:9): [True: 0, False: 1]
  ------------------
  357|      0|        return -1;
  358|       |
  359|      1|    return 0;
  360|      1|}
xmllint.c:processNode:
 1300|     60|static void processNode(xmllintState *lint, xmlTextReaderPtr reader) {
 1301|     60|    const xmlChar *name, *value;
 1302|     60|    int type, empty;
 1303|       |
 1304|     60|    type = xmlTextReaderNodeType(reader);
 1305|     60|    empty = xmlTextReaderIsEmptyElement(reader);
 1306|       |
 1307|     60|    if (lint->appOptions & XML_LINT_DEBUG_ENABLED) {
  ------------------
  |  Branch (1307:9): [True: 36, False: 24]
  ------------------
 1308|     36|	name = xmlTextReaderConstName(reader);
 1309|     36|	if (name == NULL)
  ------------------
  |  Branch (1309:6): [True: 0, False: 36]
  ------------------
 1310|      0|	    name = BAD_CAST "--";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1311|       |
 1312|     36|	value = xmlTextReaderConstValue(reader);
 1313|       |
 1314|       |
 1315|     36|	printf("%d %d %s %d %d",
 1316|     36|		xmlTextReaderDepth(reader),
 1317|     36|		type,
 1318|     36|		name,
 1319|     36|		empty,
 1320|     36|		xmlTextReaderHasValue(reader));
 1321|     36|	if (value == NULL)
  ------------------
  |  Branch (1321:6): [True: 24, False: 12]
  ------------------
 1322|     24|	    printf("\n");
 1323|     12|	else {
 1324|     12|	    printf(" %s\n", value);
 1325|     12|	}
 1326|     36|    }
 1327|     60|#ifdef LIBXML_PATTERN_ENABLED
 1328|     60|    if (lint->patternc) {
  ------------------
  |  Branch (1328:9): [True: 39, False: 21]
  ------------------
 1329|     39|        xmlChar *path = NULL;
 1330|     39|        int match = -1;
 1331|       |
 1332|     39|	if (type == XML_READER_TYPE_ELEMENT) {
  ------------------
  |  Branch (1332:6): [True: 13, False: 26]
  ------------------
 1333|       |	    /* do the check only on element start */
 1334|     13|	    match = xmlPatternMatch(lint->patternc,
 1335|     13|                                    xmlTextReaderCurrentNode(reader));
 1336|       |
 1337|     13|	    if (match) {
  ------------------
  |  Branch (1337:10): [True: 5, False: 8]
  ------------------
 1338|      5|		path = xmlGetNodePath(xmlTextReaderCurrentNode(reader));
 1339|      5|		printf("Node %s matches pattern %s\n", path, lint->pattern);
 1340|      5|	    }
 1341|     13|	}
 1342|     39|	if (lint->patstream != NULL) {
  ------------------
  |  Branch (1342:6): [True: 39, False: 0]
  ------------------
 1343|     39|	    int ret;
 1344|       |
 1345|     39|	    if (type == XML_READER_TYPE_ELEMENT) {
  ------------------
  |  Branch (1345:10): [True: 13, False: 26]
  ------------------
 1346|     13|		ret = xmlStreamPush(lint->patstream,
 1347|     13|		                    xmlTextReaderConstLocalName(reader),
 1348|     13|				    xmlTextReaderConstNamespaceUri(reader));
 1349|     13|		if (ret < 0) {
  ------------------
  |  Branch (1349:7): [True: 0, False: 13]
  ------------------
 1350|      0|		    fprintf(lint->errStream, "xmlStreamPush() failure\n");
 1351|      0|                    xmlFreeStreamCtxt(lint->patstream);
 1352|      0|		    lint->patstream = NULL;
 1353|     13|		} else if (ret != match) {
  ------------------
  |  Branch (1353:14): [True: 0, False: 13]
  ------------------
 1354|      0|		    if (path == NULL) {
  ------------------
  |  Branch (1354:11): [True: 0, False: 0]
  ------------------
 1355|      0|		        path = xmlGetNodePath(
 1356|      0|		                       xmlTextReaderCurrentNode(reader));
 1357|      0|		    }
 1358|      0|		    fprintf(lint->errStream,
 1359|      0|		            "xmlPatternMatch and xmlStreamPush disagree\n");
 1360|      0|                    if (path != NULL)
  ------------------
  |  Branch (1360:25): [True: 0, False: 0]
  ------------------
 1361|      0|                        fprintf(lint->errStream, "  pattern %s node %s\n",
 1362|      0|                                lint->pattern, path);
 1363|      0|                    else
 1364|      0|		        fprintf(lint->errStream, "  pattern %s node %s\n",
 1365|      0|			    lint->pattern, xmlTextReaderConstName(reader));
 1366|      0|		}
 1367|       |
 1368|     13|	    }
 1369|     39|	    if ((type == XML_READER_TYPE_END_ELEMENT) ||
  ------------------
  |  Branch (1369:10): [True: 13, False: 26]
  ------------------
 1370|     26|	        ((type == XML_READER_TYPE_ELEMENT) && (empty))) {
  ------------------
  |  Branch (1370:11): [True: 13, False: 13]
  |  Branch (1370:48): [True: 0, False: 13]
  ------------------
 1371|     13|	        ret = xmlStreamPop(lint->patstream);
 1372|     13|		if (ret < 0) {
  ------------------
  |  Branch (1372:7): [True: 0, False: 13]
  ------------------
 1373|      0|		    fprintf(lint->errStream, "xmlStreamPop() failure\n");
 1374|      0|                    xmlFreeStreamCtxt(lint->patstream);
 1375|      0|		    lint->patstream = NULL;
 1376|      0|		}
 1377|     13|	    }
 1378|     39|	}
 1379|     39|	if (path != NULL)
  ------------------
  |  Branch (1379:6): [True: 5, False: 34]
  ------------------
 1380|      5|	    xmlFree(path);
 1381|     39|    }
 1382|     60|#endif
 1383|     60|}
xmllint.c:testSAX:
 1240|     50|testSAX(xmllintState *lint, const char *filename) {
 1241|     50|    lint->callbacks = 0;
 1242|       |
 1243|     50|#ifdef LIBXML_SCHEMAS_ENABLED
 1244|     50|    if (lint->wxschemas != NULL) {
  ------------------
  |  Branch (1244:9): [True: 0, False: 50]
  ------------------
 1245|      0|        int ret;
 1246|      0|	xmlSchemaValidCtxtPtr vctxt;
 1247|      0|        xmlParserInputBufferPtr buf;
 1248|       |
 1249|      0|        if (strcmp(filename, "-") == 0)
  ------------------
  |  Branch (1249:13): [True: 0, False: 0]
  ------------------
 1250|      0|            buf = xmlParserInputBufferCreateFd(STDIN_FILENO,
 1251|      0|                    XML_CHAR_ENCODING_NONE);
 1252|      0|        else
 1253|      0|            buf = xmlParserInputBufferCreateFilename(filename,
 1254|      0|                    XML_CHAR_ENCODING_NONE);
 1255|      0|        if (buf == NULL)
  ------------------
  |  Branch (1255:13): [True: 0, False: 0]
  ------------------
 1256|      0|            return;
 1257|       |
 1258|      0|	vctxt = xmlSchemaNewValidCtxt(lint->wxschemas);
 1259|      0|        if (vctxt == NULL) {
  ------------------
  |  Branch (1259:13): [True: 0, False: 0]
  ------------------
 1260|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1261|      0|            xmlFreeParserInputBuffer(buf);
 1262|      0|            return;
 1263|      0|        }
 1264|      0|	xmlSchemaValidateSetFilename(vctxt, filename);
 1265|       |
 1266|      0|	ret = xmlSchemaValidateStream(vctxt, buf, 0, lint->ctxt->sax, lint);
 1267|      0|	if (lint->repeat == 1) {
  ------------------
  |  Branch (1267:6): [True: 0, False: 0]
  ------------------
 1268|      0|	    if (ret == 0) {
  ------------------
  |  Branch (1268:10): [True: 0, False: 0]
  ------------------
 1269|      0|	        if ((lint->appOptions & XML_LINT_QUIET) != XML_LINT_QUIET) {
  ------------------
  |  Branch (1269:14): [True: 0, False: 0]
  ------------------
 1270|      0|	            fprintf(lint->errStream, "%s validates\n", filename);
 1271|      0|	        }
 1272|      0|	    } else if (ret > 0) {
  ------------------
  |  Branch (1272:17): [True: 0, False: 0]
  ------------------
 1273|      0|		fprintf(lint->errStream, "%s fails to validate\n", filename);
 1274|      0|		lint->progresult = XMLLINT_ERR_VALID;
 1275|      0|	    } else {
 1276|      0|		fprintf(lint->errStream, "%s validation generated an internal error\n",
 1277|      0|		       filename);
 1278|      0|		lint->progresult = XMLLINT_ERR_VALID;
 1279|      0|	    }
 1280|      0|	}
 1281|      0|	xmlSchemaFreeValidCtxt(vctxt);
 1282|      0|    } else
 1283|     50|#endif
 1284|     50|#ifdef LIBXML_HTML_ENABLED
 1285|     50|    if (lint->appOptions & XML_LINT_HTML_ENABLED) {
  ------------------
  |  Branch (1285:9): [True: 0, False: 50]
  ------------------
 1286|      0|        parseHtml(lint, filename);
 1287|      0|    } else
 1288|     50|#endif
 1289|     50|    {
 1290|     50|        parseXml(lint, filename);
 1291|     50|    }
 1292|     50|}
xmllint.c:parseHtml:
  443|     34|parseHtml(xmllintState *lint, const char *filename) {
  444|     34|    xmlParserCtxtPtr ctxt = lint->ctxt;
  445|     34|    xmlDocPtr doc;
  446|       |
  447|     34|#ifdef LIBXML_PUSH_ENABLED
  448|     34|    if (lint->appOptions & XML_LINT_PUSH_ENABLED) {
  ------------------
  |  Branch (448:9): [True: 0, False: 34]
  ------------------
  449|      0|        FILE *f;
  450|      0|        int res;
  451|      0|        char chars[4096];
  452|       |
  453|      0|        if ((filename[0] == '-') && (filename[1] == 0)) {
  ------------------
  |  Branch (453:13): [True: 0, False: 0]
  |  Branch (453:37): [True: 0, False: 0]
  ------------------
  454|      0|            f = stdin;
  455|      0|        } else {
  456|      0|	    f = fopen(filename, "rb");
  457|      0|            if (f == NULL) {
  ------------------
  |  Branch (457:17): [True: 0, False: 0]
  ------------------
  458|      0|                fprintf(lint->errStream, "Can't open %s\n", filename);
  459|      0|                lint->progresult = XMLLINT_ERR_RDFILE;
  460|      0|                return(NULL);
  461|      0|            }
  462|      0|        }
  463|       |
  464|      0|        while ((res = fread(chars, 1, 4096, f)) > 0) {
  ------------------
  |  Branch (464:16): [True: 0, False: 0]
  ------------------
  465|      0|            htmlParseChunk(ctxt, chars, res, 0);
  466|      0|        }
  467|      0|        htmlParseChunk(ctxt, chars, 0, 1);
  468|      0|        doc = xmlCtxtGetDocument(ctxt);
  469|       |
  470|      0|        if (f != stdin)
  ------------------
  |  Branch (470:13): [True: 0, False: 0]
  ------------------
  471|      0|            fclose(f);
  472|       |
  473|      0|        return(doc);
  474|      0|    }
  475|     34|#endif /* LIBXML_PUSH_ENABLED */
  476|       |
  477|     34|#if HAVE_DECL_MMAP
  478|     34|    if (lint->appOptions & XML_LINT_MEMORY) {
  ------------------
  |  Branch (478:9): [True: 0, False: 34]
  ------------------
  479|      0|        xmlParserInputPtr input;
  480|       |
  481|      0|        input = xmlNewInputFromMemory(filename,
  482|      0|                                      lint->memoryData, lint->memorySize,
  483|      0|                                      XML_INPUT_BUF_STATIC);
  484|      0|        if (input == NULL) {
  ------------------
  |  Branch (484:13): [True: 0, False: 0]
  ------------------
  485|      0|            lint->progresult = XMLLINT_ERR_MEM;
  486|      0|            return(NULL);
  487|      0|        }
  488|      0|        doc = htmlCtxtParseDocument(ctxt, input);
  489|      0|        return(doc);
  490|      0|    }
  491|     34|#endif
  492|       |
  493|     34|    if (strcmp(filename, "-") == 0)
  ------------------
  |  Branch (493:9): [True: 0, False: 34]
  ------------------
  494|      0|        doc = htmlCtxtReadFd(ctxt, STDIN_FILENO, "-", NULL,
  495|      0|                             lint->htmlOptions);
  496|     34|    else
  497|     34|        doc = htmlCtxtReadFile(ctxt, filename, NULL, lint->htmlOptions);
  498|       |
  499|     34|    return(doc);
  500|     34|}
xmllint.c:parseXml:
  364|    226|parseXml(xmllintState *lint, const char *filename) {
  365|    226|    xmlParserCtxtPtr ctxt = lint->ctxt;
  366|    226|    xmlDocPtr doc;
  367|    226|#ifdef LIBXML_ZLIB_ENABLED
  368|    226|    gzFile gz;
  369|    226|#endif
  370|       |
  371|    226|#ifdef LIBXML_PUSH_ENABLED
  372|    226|    if (lint->appOptions & XML_LINT_PUSH_ENABLED) {
  ------------------
  |  Branch (372:9): [True: 0, False: 226]
  ------------------
  373|      0|        FILE *f;
  374|      0|        int res;
  375|      0|        char chars[4096];
  376|       |
  377|      0|        if ((filename[0] == '-') && (filename[1] == 0)) {
  ------------------
  |  Branch (377:13): [True: 0, False: 0]
  |  Branch (377:37): [True: 0, False: 0]
  ------------------
  378|      0|            f = stdin;
  379|      0|        } else {
  380|      0|            f = fopen(filename, "rb");
  381|      0|            if (f == NULL) {
  ------------------
  |  Branch (381:17): [True: 0, False: 0]
  ------------------
  382|      0|                fprintf(lint->errStream, "Can't open %s\n", filename);
  383|      0|                lint->progresult = XMLLINT_ERR_RDFILE;
  384|      0|                return(NULL);
  385|      0|            }
  386|      0|        }
  387|       |
  388|      0|        while ((res = fread(chars, 1, 4096, f)) > 0) {
  ------------------
  |  Branch (388:16): [True: 0, False: 0]
  ------------------
  389|      0|            xmlParseChunk(ctxt, chars, res, 0);
  390|      0|        }
  391|      0|        xmlParseChunk(ctxt, chars, 0, 1);
  392|      0|        doc = xmlCtxtGetDocument(ctxt);
  393|       |
  394|      0|        if (f != stdin)
  ------------------
  |  Branch (394:13): [True: 0, False: 0]
  ------------------
  395|      0|            fclose(f);
  396|       |
  397|      0|        return(doc);
  398|      0|    }
  399|    226|#endif /* LIBXML_PUSH_ENABLED */
  400|       |
  401|    226|#if HAVE_DECL_MMAP
  402|    226|    if (lint->appOptions & XML_LINT_MEMORY) {
  ------------------
  |  Branch (402:9): [True: 0, False: 226]
  ------------------
  403|      0|        xmlParserInputPtr input;
  404|       |
  405|      0|        input = xmlNewInputFromMemory(filename,
  406|      0|                                      lint->memoryData, lint->memorySize,
  407|      0|                                      XML_INPUT_BUF_STATIC);
  408|      0|        if (input == NULL) {
  ------------------
  |  Branch (408:13): [True: 0, False: 0]
  ------------------
  409|      0|            lint->progresult = XMLLINT_ERR_MEM;
  410|      0|            return(NULL);
  411|      0|        }
  412|      0|        doc = xmlCtxtParseDocument(ctxt, input);
  413|      0|        return(doc);
  414|      0|    }
  415|    226|#endif
  416|       |
  417|    226|#ifdef LIBXML_ZLIB_ENABLED
  418|    226|    if (strcmp(filename, "-") == 0)
  ------------------
  |  Branch (418:9): [True: 0, False: 226]
  ------------------
  419|      0|        gz = gzdopen(STDIN_FILENO, "rb");
  420|    226|    else
  421|    226|        gz = gzopen(filename, "rb");
  422|       |
  423|    226|    if (gz == NULL) {
  ------------------
  |  Branch (423:9): [True: 226, False: 0]
  ------------------
  424|    226|        fprintf(lint->errStream, "Can't open %s\n", filename);
  425|    226|        lint->progresult = XMLLINT_ERR_RDFILE;
  426|    226|        return(NULL);
  427|    226|    }
  428|       |
  429|      0|    doc = xmlCtxtReadIO(ctxt, xmllintGzRead, xmllintGzClose, gz,
  430|      0|                        filename, NULL, lint->parseOptions);
  431|       |#else
  432|       |    if (strcmp(filename, "-") == 0)
  433|       |        doc = xmlCtxtReadFd(ctxt, STDIN_FILENO, "-", NULL, lint->parseOptions);
  434|       |    else
  435|       |        doc = xmlCtxtReadFile(ctxt, filename, NULL, lint->parseOptions);
  436|       |#endif
  437|       |
  438|      0|    return(doc);
  439|    226|}
xmllint.c:parseAndPrintFile:
 1855|    457|parseAndPrintFile(xmllintState *lint, const char *filename) {
 1856|    457|    FILE *errStream = lint->errStream;
 1857|    457|    xmlDocPtr doc;
 1858|       |
 1859|       |    /* Avoid unused variable warning */
 1860|    457|    (void) errStream;
 1861|       |
 1862|    457|    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1))
  ------------------
  |  Branch (1862:9): [True: 117, False: 340]
  |  Branch (1862:50): [True: 99, False: 18]
  ------------------
 1863|     99|	startTimer(lint);
 1864|       |
 1865|    457|    doc = parseFile(lint, filename);
 1866|    457|    if (doc == NULL) {
  ------------------
  |  Branch (1866:9): [True: 209, False: 248]
  ------------------
 1867|    209|        if (lint->progresult == XMLLINT_RETURN_OK)
  ------------------
  |  Branch (1867:13): [True: 32, False: 177]
  ------------------
 1868|     32|            lint->progresult = XMLLINT_ERR_UNCLASS;
 1869|    209|	return;
 1870|    209|    }
 1871|       |
 1872|    248|    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1872:9): [True: 67, False: 181]
  |  Branch (1872:50): [True: 61, False: 6]
  ------------------
 1873|     61|	endTimer(lint, "Parsing");
 1874|     61|    }
 1875|       |
 1876|    248|    if (lint->appOptions & XML_LINT_DROP_DTD) {
  ------------------
  |  Branch (1876:9): [True: 44, False: 204]
  ------------------
 1877|     44|	xmlDtdPtr dtd;
 1878|       |
 1879|     44|	dtd = xmlGetIntSubset(doc);
 1880|     44|	if (dtd != NULL) {
  ------------------
  |  Branch (1880:6): [True: 0, False: 44]
  ------------------
 1881|      0|	    xmlUnlinkNode((xmlNodePtr)dtd);
 1882|      0|            doc->intSubset = dtd;
 1883|      0|	}
 1884|     44|    }
 1885|       |
 1886|    248|#ifdef LIBXML_XINCLUDE_ENABLED
 1887|    248|    if (lint->appOptions & XML_LINT_XINCLUDE) {
  ------------------
  |  Branch (1887:9): [True: 204, False: 44]
  ------------------
 1888|    204|        xmlXIncludeCtxt *xinc;
 1889|    204|        int res;
 1890|       |
 1891|    204|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1891:6): [True: 64, False: 140]
  |  Branch (1891:47): [True: 58, False: 6]
  ------------------
 1892|     58|	    startTimer(lint);
 1893|     58|	}
 1894|       |
 1895|    204|        xinc = xmlXIncludeNewContext(doc);
 1896|    204|        if (xinc == NULL) {
  ------------------
  |  Branch (1896:13): [True: 0, False: 204]
  ------------------
 1897|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1898|      0|            goto done;
 1899|      0|        }
 1900|    204|        xmlXIncludeSetResourceLoader(xinc, xmllintResourceLoader, lint);
 1901|    204|        xmlXIncludeSetFlags(xinc, lint->parseOptions);
 1902|    204|        res = xmlXIncludeProcessNode(xinc, (xmlNode *) doc);
 1903|    204|        xmlXIncludeFreeContext(xinc);
 1904|    204|        if (res < 0) {
  ------------------
  |  Branch (1904:13): [True: 0, False: 204]
  ------------------
 1905|       |            /*
 1906|       |             * Return an error but continue to print the document
 1907|       |             * to match long-standing behavior.
 1908|       |             */
 1909|      0|	    lint->progresult = XMLLINT_ERR_UNCLASS;
 1910|      0|        }
 1911|       |
 1912|    204|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1912:6): [True: 64, False: 140]
  |  Branch (1912:47): [True: 58, False: 6]
  ------------------
 1913|     58|	    endTimer(lint, "Xinclude processing");
 1914|     58|	}
 1915|    204|    }
 1916|    248|#endif
 1917|       |
 1918|       |    /*
 1919|       |     * shell interaction
 1920|       |     */
 1921|    248|    if (lint->appOptions & XML_LINT_NAVIGATING_SHELL) {
  ------------------
  |  Branch (1921:9): [True: 0, False: 248]
  ------------------
 1922|      0|#ifdef LIBXML_XPATH_ENABLED
 1923|      0|        xmlXPathOrderDocElems(doc);
 1924|      0|#endif
 1925|      0|        xmllintShell(doc, filename, stdout);
 1926|      0|        goto done;
 1927|      0|    }
 1928|       |
 1929|    248|#ifdef LIBXML_XPATH_ENABLED
 1930|    248|    if (lint->xpathquery != NULL) {
  ------------------
  |  Branch (1930:9): [True: 192, False: 56]
  ------------------
 1931|    192|	xmlXPathOrderDocElems(doc);
 1932|    192|        doXPathQuery(lint, doc, lint->xpathquery);
 1933|    192|    }
 1934|    248|#endif
 1935|       |
 1936|       |    /*
 1937|       |     * test intermediate copy if needed.
 1938|       |     */
 1939|    248|    if (lint->appOptions & XML_LINT_COPY_ENABLED) {
  ------------------
  |  Branch (1939:9): [True: 52, False: 196]
  ------------------
 1940|     52|        xmlDocPtr tmp;
 1941|       |
 1942|     52|        tmp = doc;
 1943|     52|	if (lint->appOptions & XML_LINT_TIMINGS) {
  ------------------
  |  Branch (1943:6): [True: 21, False: 31]
  ------------------
 1944|     21|	    startTimer(lint);
 1945|     21|	}
 1946|     52|	doc = xmlCopyDoc(doc, 1);
 1947|     52|        if (doc == NULL) {
  ------------------
  |  Branch (1947:13): [True: 0, False: 52]
  ------------------
 1948|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1949|      0|            xmlFreeDoc(tmp);
 1950|      0|            return;
 1951|      0|        }
 1952|     52|	if (lint->appOptions & XML_LINT_TIMINGS) {
  ------------------
  |  Branch (1952:6): [True: 21, False: 31]
  ------------------
 1953|     21|	    endTimer(lint, "Copying");
 1954|     21|	}
 1955|     52|	if (lint->appOptions & XML_LINT_TIMINGS) {
  ------------------
  |  Branch (1955:6): [True: 21, False: 31]
  ------------------
 1956|     21|	    startTimer(lint);
 1957|     21|	}
 1958|     52|	xmlFreeDoc(tmp);
 1959|     52|	if (lint->appOptions & XML_LINT_TIMINGS) {
  ------------------
  |  Branch (1959:6): [True: 21, False: 31]
  ------------------
 1960|     21|	    endTimer(lint, "Freeing original");
 1961|     21|	}
 1962|     52|    }
 1963|       |
 1964|    248|#ifdef LIBXML_VALID_ENABLED
 1965|    248|    if ((lint->appOptions & XML_LINT_VALID_INSERTIONS)
  ------------------
  |  Branch (1965:9): [True: 134, False: 114]
  ------------------
 1966|    134|#ifdef LIBXML_HTML_ENABLED
 1967|    134|        && ((lint->appOptions & XML_LINT_HTML_ENABLED) != XML_LINT_HTML_ENABLED)
  ------------------
  |  Branch (1967:12): [True: 112, False: 22]
  ------------------
 1968|    248|#endif
 1969|    248|    ) {
 1970|    112|        const xmlChar* list[256];
 1971|    112|	int nb, i;
 1972|    112|	xmlNodePtr node;
 1973|       |
 1974|    112|	if (doc->children != NULL) {
  ------------------
  |  Branch (1974:6): [True: 112, False: 0]
  ------------------
 1975|    112|	    node = doc->children;
 1976|    112|	    while ((node != NULL) &&
  ------------------
  |  Branch (1976:13): [True: 112, False: 0]
  ------------------
 1977|    112|                   ((node->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (1977:21): [True: 0, False: 112]
  ------------------
 1978|    112|                    (node->last == NULL)))
  ------------------
  |  Branch (1978:21): [True: 0, False: 112]
  ------------------
 1979|      0|                node = node->next;
 1980|    112|	    if (node != NULL) {
  ------------------
  |  Branch (1980:10): [True: 112, False: 0]
  ------------------
 1981|    112|		nb = xmlValidGetValidElements(node->last, NULL, list, 256);
 1982|    112|		if (nb < 0) {
  ------------------
  |  Branch (1982:7): [True: 112, False: 0]
  ------------------
 1983|    112|		    fprintf(errStream, "could not get valid list of elements\n");
 1984|    112|		} else if (nb == 0) {
  ------------------
  |  Branch (1984:14): [True: 0, False: 0]
  ------------------
 1985|      0|		    fprintf(errStream, "No element can be inserted under root\n");
 1986|      0|		} else {
 1987|      0|		    fprintf(errStream, "%d element types can be inserted under root:\n",
 1988|      0|		           nb);
 1989|      0|		    for (i = 0;i < nb;i++) {
  ------------------
  |  Branch (1989:18): [True: 0, False: 0]
  ------------------
 1990|      0|			 fprintf(errStream, "%s\n", (char *) list[i]);
 1991|      0|		    }
 1992|      0|		}
 1993|    112|	    }
 1994|    112|	}
 1995|    112|    } else
 1996|    136|#endif /* LIBXML_VALID_ENABLED */
 1997|    136|#ifdef LIBXML_READER_ENABLED
 1998|    136|    if (lint->appOptions & XML_LINT_USE_WALKER) {
  ------------------
  |  Branch (1998:9): [True: 45, False: 91]
  ------------------
 1999|     45|        walkDoc(lint, doc);
 2000|     45|    }
 2001|    248|#endif /* LIBXML_READER_ENABLED */
 2002|    248|#ifdef LIBXML_OUTPUT_ENABLED
 2003|    248|    if (lint->noout == 0) {
  ------------------
  |  Branch (2003:9): [True: 42, False: 206]
  ------------------
 2004|       |	/*
 2005|       |	 * print it.
 2006|       |	 */
 2007|       |#ifdef LIBXML_DEBUG_ENABLED
 2008|       |	if ((lint->appOptions & XML_LINT_DEBUG_ENABLED) != XML_LINT_DEBUG_ENABLED) {
 2009|       |#endif
 2010|     42|	    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2010:10): [True: 8, False: 34]
  |  Branch (2010:51): [True: 4, False: 4]
  ------------------
 2011|      4|		startTimer(lint);
 2012|      4|	    }
 2013|     42|#ifdef LIBXML_C14N_ENABLED
 2014|     42|            if (lint->appOptions & XML_LINT_CANONICAL_V1_0) {
  ------------------
  |  Branch (2014:17): [True: 0, False: 42]
  ------------------
 2015|      0|	        xmlChar *result = NULL;
 2016|      0|		int size;
 2017|       |
 2018|      0|		size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_0, NULL, 1, &result);
 2019|      0|		if (size >= 0) {
  ------------------
  |  Branch (2019:7): [True: 0, False: 0]
  ------------------
 2020|      0|		    if (write(1, result, size) == -1) {
  ------------------
  |  Branch (2020:11): [True: 0, False: 0]
  ------------------
 2021|      0|		        fprintf(errStream, "Can't write data\n");
 2022|      0|		    }
 2023|      0|		    xmlFree(result);
 2024|      0|		} else {
 2025|      0|		    fprintf(errStream, "Failed to canonicalize\n");
 2026|      0|		    lint->progresult = XMLLINT_ERR_OUT;
 2027|      0|		}
 2028|     42|	    } else if (lint->appOptions & XML_LINT_CANONICAL_V1_1) {
  ------------------
  |  Branch (2028:17): [True: 2, False: 40]
  ------------------
 2029|      2|	        xmlChar *result = NULL;
 2030|      2|		int size;
 2031|       |
 2032|      2|		size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_1, NULL, 1, &result);
 2033|      2|		if (size >= 0) {
  ------------------
  |  Branch (2033:7): [True: 2, False: 0]
  ------------------
 2034|      2|		    if (write(1, result, size) == -1) {
  ------------------
  |  Branch (2034:11): [True: 0, False: 2]
  ------------------
 2035|      0|		        fprintf(errStream, "Can't write data\n");
 2036|      0|		    }
 2037|      2|		    xmlFree(result);
 2038|      2|		} else {
 2039|      0|		    fprintf(errStream, "Failed to canonicalize\n");
 2040|      0|		    lint->progresult = XMLLINT_ERR_OUT;
 2041|      0|		}
 2042|     40|	    } else if (lint->appOptions & XML_LINT_CANONICAL_EXE) {
  ------------------
  |  Branch (2042:17): [True: 6, False: 34]
  ------------------
 2043|      6|	        xmlChar *result = NULL;
 2044|      6|		int size;
 2045|       |
 2046|      6|		size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_EXCLUSIVE_1_0, NULL, 1, &result);
 2047|      6|		if (size >= 0) {
  ------------------
  |  Branch (2047:7): [True: 6, False: 0]
  ------------------
 2048|      6|		    if (write(1, result, size) == -1) {
  ------------------
  |  Branch (2048:11): [True: 0, False: 6]
  ------------------
 2049|      0|		        fprintf(errStream, "Can't write data\n");
 2050|      0|		    }
 2051|      6|		    xmlFree(result);
 2052|      6|		} else {
 2053|      0|		    fprintf(errStream, "Failed to canonicalize\n");
 2054|      0|		    lint->progresult = XMLLINT_ERR_OUT;
 2055|      0|		}
 2056|      6|	    } else
 2057|     34|#endif
 2058|     34|            {
 2059|     34|	        xmlSaveCtxtPtr ctxt = NULL;
 2060|     34|		int saveOpts = 0;
 2061|       |
 2062|     34|                if (lint->format == 1)
  ------------------
  |  Branch (2062:21): [True: 23, False: 11]
  ------------------
 2063|     23|		    saveOpts |= XML_SAVE_FORMAT;
 2064|     11|                else if (lint->format == 2)
  ------------------
  |  Branch (2064:26): [True: 1, False: 10]
  ------------------
 2065|      1|                    saveOpts |= XML_SAVE_WSNONSIG;
 2066|       |
 2067|     34|#if defined(LIBXML_HTML_ENABLED)
 2068|     34|                if (lint->appOptions & XML_LINT_XML_OUT)
  ------------------
  |  Branch (2068:21): [True: 4, False: 30]
  ------------------
 2069|      4|                    saveOpts |= XML_SAVE_AS_XML;
 2070|     34|#endif
 2071|       |
 2072|     34|#ifdef LIBXML_ZLIB_ENABLED
 2073|     34|	        if (lint->appOptions & XML_LINT_ZLIB_COMPRESSION) {
  ------------------
  |  Branch (2073:14): [True: 0, False: 34]
  ------------------
 2074|      0|                    gzFile gz;
 2075|       |
 2076|      0|                    if (lint->output == NULL)
  ------------------
  |  Branch (2076:25): [True: 0, False: 0]
  ------------------
 2077|      0|                        gz = gzdopen(STDOUT_FILENO, "wb9");
 2078|      0|                    else
 2079|      0|                        gz = gzopen(lint->output, "wb9");
 2080|       |
 2081|      0|                    if (gz != NULL)
  ------------------
  |  Branch (2081:25): [True: 0, False: 0]
  ------------------
 2082|      0|                        ctxt = xmlSaveToIO(xmllintGzWrite, xmllintGzClose, gz,
 2083|      0|                                           lint->encoding, saveOpts);
 2084|      0|                } else
 2085|     34|#endif
 2086|     34|                {
 2087|     34|                    if (lint->output == NULL)
  ------------------
  |  Branch (2087:25): [True: 34, False: 0]
  ------------------
 2088|     34|                        ctxt = xmlSaveToFd(STDOUT_FILENO, lint->encoding,
 2089|     34|                                           saveOpts);
 2090|      0|                    else
 2091|      0|                        ctxt = xmlSaveToFilename(lint->output, lint->encoding,
 2092|      0|                                                 saveOpts);
 2093|     34|                }
 2094|       |
 2095|     34|		if (ctxt != NULL) {
  ------------------
  |  Branch (2095:7): [True: 1, False: 33]
  ------------------
 2096|      1|                    if (lint->indentString != NULL)
  ------------------
  |  Branch (2096:25): [True: 0, False: 1]
  ------------------
 2097|      0|                        xmlSaveSetIndentString(ctxt, lint->indentString);
 2098|       |
 2099|      1|		    if (xmlSaveDoc(ctxt, doc) < 0) {
  ------------------
  |  Branch (2099:11): [True: 0, False: 1]
  ------------------
 2100|      0|			fprintf(errStream, "failed save to %s\n",
 2101|      0|				lint->output ? lint->output : "-");
  ------------------
  |  Branch (2101:5): [True: 0, False: 0]
  ------------------
 2102|      0|			lint->progresult = XMLLINT_ERR_OUT;
 2103|      0|		    }
 2104|      1|		    xmlSaveClose(ctxt);
 2105|     33|		} else {
 2106|     33|                    fprintf(errStream, "failed save to %s\n",
 2107|     33|                            lint->output ? lint->output : "-");
  ------------------
  |  Branch (2107:29): [True: 0, False: 33]
  ------------------
 2108|     33|		    lint->progresult = XMLLINT_ERR_OUT;
 2109|     33|		}
 2110|     34|	    }
 2111|     42|	    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2111:10): [True: 8, False: 34]
  |  Branch (2111:51): [True: 4, False: 4]
  ------------------
 2112|      4|		endTimer(lint, "Saving");
 2113|      4|	    }
 2114|       |#ifdef LIBXML_DEBUG_ENABLED
 2115|       |	} else {
 2116|       |	    FILE *out;
 2117|       |	    if (lint->output == NULL)
 2118|       |	        out = stdout;
 2119|       |	    else {
 2120|       |		out = fopen(lint->output, "wb");
 2121|       |	    }
 2122|       |	    if (out != NULL) {
 2123|       |		xmlDebugDumpDocument(out, doc);
 2124|       |
 2125|       |		if (lint->output != NULL)
 2126|       |		    fclose(out);
 2127|       |	    } else {
 2128|       |		fprintf(errStream, "failed to open %s\n", lint->output);
 2129|       |		lint->progresult = XMLLINT_ERR_OUT;
 2130|       |	    }
 2131|       |	}
 2132|       |#endif
 2133|     42|    }
 2134|    248|#endif /* LIBXML_OUTPUT_ENABLED */
 2135|       |
 2136|    248|#ifdef LIBXML_VALID_ENABLED
 2137|       |    /*
 2138|       |     * A posteriori validation test
 2139|       |     */
 2140|    248|    if ((lint->dtdvalid != NULL) || (lint->dtdvalidfpi != NULL)) {
  ------------------
  |  Branch (2140:9): [True: 0, False: 248]
  |  Branch (2140:37): [True: 0, False: 248]
  ------------------
 2141|      0|	xmlDtdPtr dtd;
 2142|       |
 2143|      0|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2143:6): [True: 0, False: 0]
  |  Branch (2143:47): [True: 0, False: 0]
  ------------------
 2144|      0|	    startTimer(lint);
 2145|      0|	}
 2146|      0|	if (lint->dtdvalid != NULL)
  ------------------
  |  Branch (2146:6): [True: 0, False: 0]
  ------------------
 2147|      0|	    dtd = xmlParseDTD(NULL, BAD_CAST lint->dtdvalid);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 2148|      0|	else
 2149|      0|	    dtd = xmlParseDTD(BAD_CAST lint->dtdvalidfpi, NULL);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 2150|      0|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2150:6): [True: 0, False: 0]
  |  Branch (2150:47): [True: 0, False: 0]
  ------------------
 2151|      0|	    endTimer(lint, "Parsing DTD");
 2152|      0|	}
 2153|      0|	if (dtd == NULL) {
  ------------------
  |  Branch (2153:6): [True: 0, False: 0]
  ------------------
 2154|      0|	    if (lint->dtdvalid != NULL)
  ------------------
  |  Branch (2154:10): [True: 0, False: 0]
  ------------------
 2155|      0|		fprintf(errStream, "Could not parse DTD %s\n",
 2156|      0|                        lint->dtdvalid);
 2157|      0|	    else
 2158|      0|		fprintf(errStream, "Could not parse DTD %s\n",
 2159|      0|                        lint->dtdvalidfpi);
 2160|      0|	    lint->progresult = XMLLINT_ERR_DTD;
 2161|      0|	} else {
 2162|      0|	    xmlValidCtxtPtr cvp;
 2163|       |
 2164|      0|	    cvp = xmlNewValidCtxt();
 2165|      0|	    if (cvp == NULL) {
  ------------------
  |  Branch (2165:10): [True: 0, False: 0]
  ------------------
 2166|      0|                lint->progresult = XMLLINT_ERR_MEM;
 2167|      0|                xmlFreeDtd(dtd);
 2168|      0|                return;
 2169|      0|	    }
 2170|       |
 2171|      0|	    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2171:10): [True: 0, False: 0]
  |  Branch (2171:51): [True: 0, False: 0]
  ------------------
 2172|      0|		startTimer(lint);
 2173|      0|	    }
 2174|      0|	    if (!xmlValidateDtd(cvp, doc, dtd)) {
  ------------------
  |  Branch (2174:10): [True: 0, False: 0]
  ------------------
 2175|      0|		if (lint->dtdvalid != NULL)
  ------------------
  |  Branch (2175:7): [True: 0, False: 0]
  ------------------
 2176|      0|		    fprintf(errStream,
 2177|      0|			    "Document %s does not validate against %s\n",
 2178|      0|			    filename, lint->dtdvalid);
 2179|      0|		else
 2180|      0|		    fprintf(errStream,
 2181|      0|			    "Document %s does not validate against %s\n",
 2182|      0|			    filename, lint->dtdvalidfpi);
 2183|      0|		lint->progresult = XMLLINT_ERR_VALID;
 2184|      0|	    }
 2185|      0|	    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2185:10): [True: 0, False: 0]
  |  Branch (2185:51): [True: 0, False: 0]
  ------------------
 2186|      0|		endTimer(lint, "Validating against DTD");
 2187|      0|	    }
 2188|      0|	    xmlFreeValidCtxt(cvp);
 2189|      0|	    xmlFreeDtd(dtd);
 2190|      0|	}
 2191|    248|    } else if (lint->appOptions & XML_LINT_POST_VALIDATION) {
  ------------------
  |  Branch (2191:16): [True: 38, False: 210]
  ------------------
 2192|     38|	xmlValidCtxtPtr cvp;
 2193|       |
 2194|     38|	cvp = xmlNewValidCtxt();
 2195|     38|	if (cvp == NULL) {
  ------------------
  |  Branch (2195:6): [True: 0, False: 38]
  ------------------
 2196|      0|            lint->progresult = XMLLINT_ERR_MEM;
 2197|      0|            xmlFreeDoc(doc);
 2198|      0|            return;
 2199|      0|	}
 2200|       |
 2201|     38|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2201:6): [True: 26, False: 12]
  |  Branch (2201:47): [True: 24, False: 2]
  ------------------
 2202|     24|	    startTimer(lint);
 2203|     24|	}
 2204|     38|	if (!xmlValidateDocument(cvp, doc)) {
  ------------------
  |  Branch (2204:6): [True: 38, False: 0]
  ------------------
 2205|     38|	    fprintf(errStream,
 2206|     38|		    "Document %s does not validate\n", filename);
 2207|     38|	    lint->progresult = XMLLINT_ERR_VALID;
 2208|     38|	}
 2209|     38|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2209:6): [True: 26, False: 12]
  |  Branch (2209:47): [True: 24, False: 2]
  ------------------
 2210|     24|	    endTimer(lint, "Validating");
 2211|     24|	}
 2212|     38|	xmlFreeValidCtxt(cvp);
 2213|     38|    }
 2214|    248|#endif /* LIBXML_VALID_ENABLED */
 2215|       |#ifdef LIBXML_SCHEMATRON_ENABLED
 2216|       |    if (lint->wxschematron != NULL) {
 2217|       |	xmlSchematronValidCtxtPtr ctxt;
 2218|       |	int ret;
 2219|       |	int flag;
 2220|       |
 2221|       |	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
 2222|       |	    startTimer(lint);
 2223|       |	}
 2224|       |
 2225|       |	if (lint->appOptions & XML_LINT_DEBUG_ENABLED)
 2226|       |	    flag = XML_SCHEMATRON_OUT_XML;
 2227|       |	else
 2228|       |	    flag = XML_SCHEMATRON_OUT_TEXT;
 2229|       |	if (lint->noout)
 2230|       |	    flag |= XML_SCHEMATRON_OUT_QUIET;
 2231|       |	ctxt = xmlSchematronNewValidCtxt(lint->wxschematron, flag);
 2232|       |        if (ctxt == NULL) {
 2233|       |            lint->progresult = XMLLINT_ERR_MEM;
 2234|       |            xmlFreeDoc(doc);
 2235|       |            return;
 2236|       |        }
 2237|       |	ret = xmlSchematronValidateDoc(ctxt, doc);
 2238|       |	if (ret == 0) {
 2239|       |	    if ((lint->appOptions & XML_LINT_QUIET) != XML_LINT_QUIET) {
 2240|       |	        fprintf(errStream, "%s validates\n", filename);
 2241|       |	    }
 2242|       |	} else if (ret > 0) {
 2243|       |	    fprintf(errStream, "%s fails to validate\n", filename);
 2244|       |	    lint->progresult = XMLLINT_ERR_VALID;
 2245|       |	} else {
 2246|       |	    fprintf(errStream, "%s validation generated an internal error\n",
 2247|       |		   filename);
 2248|       |	    lint->progresult = XMLLINT_ERR_VALID;
 2249|       |	}
 2250|       |	xmlSchematronFreeValidCtxt(ctxt);
 2251|       |	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
 2252|       |	    endTimer(lint, "Validating");
 2253|       |	}
 2254|       |    }
 2255|       |#endif
 2256|       |
 2257|    248|#ifdef LIBXML_RELAXNG_ENABLED
 2258|    248|    if (lint->relaxngschemas != NULL) {
  ------------------
  |  Branch (2258:9): [True: 0, False: 248]
  ------------------
 2259|      0|	xmlRelaxNGValidCtxtPtr ctxt;
 2260|      0|	int ret;
 2261|       |
 2262|      0|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2262:6): [True: 0, False: 0]
  |  Branch (2262:47): [True: 0, False: 0]
  ------------------
 2263|      0|	    startTimer(lint);
 2264|      0|	}
 2265|       |
 2266|      0|	ctxt = xmlRelaxNGNewValidCtxt(lint->relaxngschemas);
 2267|      0|        if (ctxt == NULL) {
  ------------------
  |  Branch (2267:13): [True: 0, False: 0]
  ------------------
 2268|      0|            lint->progresult = XMLLINT_ERR_MEM;
 2269|      0|            xmlFreeDoc(doc);
 2270|      0|            return;
 2271|      0|        }
 2272|      0|	ret = xmlRelaxNGValidateDoc(ctxt, doc);
 2273|      0|	if (ret == 0) {
  ------------------
  |  Branch (2273:6): [True: 0, False: 0]
  ------------------
 2274|      0|	    if ((lint->appOptions & XML_LINT_QUIET) != XML_LINT_QUIET) {
  ------------------
  |  Branch (2274:10): [True: 0, False: 0]
  ------------------
 2275|      0|	        fprintf(errStream, "%s validates\n", filename);
 2276|      0|	    }
 2277|      0|	} else if (ret > 0) {
  ------------------
  |  Branch (2277:13): [True: 0, False: 0]
  ------------------
 2278|      0|	    fprintf(errStream, "%s fails to validate\n", filename);
 2279|      0|	    lint->progresult = XMLLINT_ERR_VALID;
 2280|      0|	} else {
 2281|      0|	    fprintf(errStream, "%s validation generated an internal error\n",
 2282|      0|		   filename);
 2283|      0|	    lint->progresult = XMLLINT_ERR_VALID;
 2284|      0|	}
 2285|      0|	xmlRelaxNGFreeValidCtxt(ctxt);
 2286|      0|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2286:6): [True: 0, False: 0]
  |  Branch (2286:47): [True: 0, False: 0]
  ------------------
 2287|      0|	    endTimer(lint, "Validating");
 2288|      0|	}
 2289|      0|    }
 2290|    248|#endif /* LIBXML_RELAXNG_ENABLED */
 2291|       |
 2292|    248|#ifdef LIBXML_SCHEMAS_ENABLED
 2293|    248|    if (lint->wxschemas != NULL) {
  ------------------
  |  Branch (2293:9): [True: 0, False: 248]
  ------------------
 2294|      0|	xmlSchemaValidCtxtPtr ctxt;
 2295|      0|	int ret;
 2296|       |
 2297|      0|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2297:6): [True: 0, False: 0]
  |  Branch (2297:47): [True: 0, False: 0]
  ------------------
 2298|      0|	    startTimer(lint);
 2299|      0|	}
 2300|       |
 2301|      0|	ctxt = xmlSchemaNewValidCtxt(lint->wxschemas);
 2302|      0|        if (ctxt == NULL) {
  ------------------
  |  Branch (2302:13): [True: 0, False: 0]
  ------------------
 2303|      0|            lint->progresult = XMLLINT_ERR_MEM;
 2304|      0|            xmlFreeDoc(doc);
 2305|      0|            return;
 2306|      0|        }
 2307|      0|	ret = xmlSchemaValidateDoc(ctxt, doc);
 2308|      0|	if (ret == 0) {
  ------------------
  |  Branch (2308:6): [True: 0, False: 0]
  ------------------
 2309|      0|	    if ((lint->appOptions & XML_LINT_QUIET) != XML_LINT_QUIET) {
  ------------------
  |  Branch (2309:10): [True: 0, False: 0]
  ------------------
 2310|      0|	        fprintf(errStream, "%s validates\n", filename);
 2311|      0|	    }
 2312|      0|	} else if (ret > 0) {
  ------------------
  |  Branch (2312:13): [True: 0, False: 0]
  ------------------
 2313|      0|	    fprintf(errStream, "%s fails to validate\n", filename);
 2314|      0|	    lint->progresult = XMLLINT_ERR_VALID;
 2315|      0|	} else {
 2316|      0|	    fprintf(errStream, "%s validation generated an internal error\n",
 2317|      0|		   filename);
 2318|      0|	    lint->progresult = XMLLINT_ERR_VALID;
 2319|      0|	}
 2320|      0|	xmlSchemaFreeValidCtxt(ctxt);
 2321|      0|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2321:6): [True: 0, False: 0]
  |  Branch (2321:47): [True: 0, False: 0]
  ------------------
 2322|      0|	    endTimer(lint, "Validating");
 2323|      0|	}
 2324|      0|    }
 2325|    248|#endif /* LIBXML_SCHEMAS_ENABLED */
 2326|       |
 2327|       |    /* Avoid unused label warning */
 2328|    248|    goto done;
 2329|       |
 2330|    248|done:
 2331|       |    /*
 2332|       |     * free it.
 2333|       |     */
 2334|    248|    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2334:9): [True: 67, False: 181]
  |  Branch (2334:50): [True: 61, False: 6]
  ------------------
 2335|     61|	startTimer(lint);
 2336|     61|    }
 2337|    248|    xmlFreeDoc(doc);
 2338|    248|    if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (2338:9): [True: 67, False: 181]
  |  Branch (2338:50): [True: 61, False: 6]
  ------------------
 2339|     61|	endTimer(lint, "Freeing");
 2340|     61|    }
 2341|    248|}
xmllint.c:parseFile:
 1796|    457|parseFile(xmllintState *lint, const char *filename) {
 1797|    457|    xmlDocPtr doc = NULL;
 1798|       |
 1799|    457|    if ((lint->appOptions & XML_LINT_GENERATE) && (filename == NULL)) {
  ------------------
  |  Branch (1799:9): [True: 421, False: 36]
  |  Branch (1799:51): [True: 247, False: 174]
  ------------------
 1800|    247|        xmlNodePtr n;
 1801|       |
 1802|    247|        doc = xmlNewDoc(BAD_CAST "1.0");
  ------------------
  |  |   34|    247|#define BAD_CAST (xmlChar *)
  ------------------
 1803|    247|        if (doc == NULL) {
  ------------------
  |  Branch (1803:13): [True: 0, False: 247]
  ------------------
 1804|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1805|      0|            return(NULL);
 1806|      0|        }
 1807|    247|        n = xmlNewDocNode(doc, NULL, BAD_CAST "info", NULL);
  ------------------
  |  |   34|    247|#define BAD_CAST (xmlChar *)
  ------------------
 1808|    247|        if (n == NULL) {
  ------------------
  |  Branch (1808:13): [True: 0, False: 247]
  ------------------
 1809|      0|            xmlFreeDoc(doc);
 1810|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1811|      0|            return(NULL);
 1812|      0|        }
 1813|    247|        if (xmlNodeSetContent(n, BAD_CAST "abc") < 0) {
  ------------------
  |  |   34|    247|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1813:13): [True: 0, False: 247]
  ------------------
 1814|      0|            xmlFreeNode(n);
 1815|      0|            xmlFreeDoc(doc);
 1816|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1817|      0|            return(NULL);
 1818|      0|        }
 1819|    247|        xmlDocSetRootElement(doc, n);
 1820|       |
 1821|    247|        return(doc);
 1822|    247|    }
 1823|       |
 1824|    210|#ifdef LIBXML_HTML_ENABLED
 1825|    210|    if (lint->appOptions & XML_LINT_HTML_ENABLED) {
  ------------------
  |  Branch (1825:9): [True: 34, False: 176]
  ------------------
 1826|     34|        doc = parseHtml(lint, filename);
 1827|     34|        return(doc);
 1828|     34|    }
 1829|    176|#endif /* LIBXML_HTML_ENABLED */
 1830|    176|    {
 1831|    176|        doc = parseXml(lint, filename);
 1832|    176|    }
 1833|       |
 1834|    176|    if (doc == NULL) {
  ------------------
  |  Branch (1834:9): [True: 176, False: 0]
  ------------------
 1835|    176|        if (lint->ctxt->errNo == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1835:13): [True: 0, False: 176]
  ------------------
 1836|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1837|    176|        else
 1838|    176|	    lint->progresult = XMLLINT_ERR_RDFILE;
 1839|    176|    } else {
 1840|      0|        xmlParserStatus status = xmlCtxtGetStatus(lint->ctxt);
 1841|      0|        if ((lint->parseOptions & XML_PARSE_DTDVALID) &&
  ------------------
  |  Branch (1841:13): [True: 0, False: 0]
  ------------------
 1842|      0|            (status & XML_STATUS_DTD_VALIDATION_FAILED))
  ------------------
  |  Branch (1842:13): [True: 0, False: 0]
  ------------------
 1843|      0|            lint->progresult = XMLLINT_ERR_VALID;
 1844|       |
 1845|      0|        if ((lint->appOptions & XML_LINT_STRICT_NAMESPACE) &&
  ------------------
  |  Branch (1845:13): [True: 0, False: 0]
  ------------------
 1846|      0|            (status & XML_STATUS_NOT_NS_WELL_FORMED)) {
  ------------------
  |  Branch (1846:13): [True: 0, False: 0]
  ------------------
 1847|      0|            lint->progresult = XMLLINT_ERR_RDFILE;
 1848|      0|        }
 1849|      0|    }
 1850|       |
 1851|    176|    return(doc);
 1852|    210|}
xmllint.c:doXPathQuery:
 1747|    192|doXPathQuery(xmllintState *lint, xmlDocPtr doc, const char *query) {
 1748|    192|    xmlXPathContextPtr ctxt = NULL;
 1749|    192|    xmlXPathCompExprPtr comp = NULL;
 1750|    192|    xmlXPathObjectPtr res = NULL;
 1751|       |
 1752|    192|    ctxt = xmlXPathNewContext(doc);
 1753|    192|    if (ctxt == NULL) {
  ------------------
  |  Branch (1753:9): [True: 0, False: 192]
  ------------------
 1754|      0|        lint->progresult = XMLLINT_ERR_MEM;
 1755|      0|        goto error;
 1756|      0|    }
 1757|       |
 1758|    192|    comp = xmlXPathCtxtCompile(ctxt, BAD_CAST query);
  ------------------
  |  |   34|    192|#define BAD_CAST (xmlChar *)
  ------------------
 1759|    192|    if (comp == NULL) {
  ------------------
  |  Branch (1759:9): [True: 77, False: 115]
  ------------------
 1760|     77|        fprintf(lint->errStream, "XPath compilation failure\n");
 1761|     77|        lint->progresult = XMLLINT_ERR_XPATH;
 1762|     77|        goto error;
 1763|     77|    }
 1764|       |
 1765|       |#ifdef LIBXML_DEBUG_ENABLED
 1766|       |    if (lint->appOptions & XML_LINT_DEBUG_ENABLED) {
 1767|       |        xmlXPathDebugDumpCompExpr(stdout, comp, 0);
 1768|       |        printf("\n");
 1769|       |    }
 1770|       |#endif
 1771|       |
 1772|    115|    ctxt->node = (xmlNodePtr) doc;
 1773|    115|    res = xmlXPathCompiledEval(comp, ctxt);
 1774|    115|    if (res == NULL) {
  ------------------
  |  Branch (1774:9): [True: 53, False: 62]
  ------------------
 1775|     53|        fprintf(lint->errStream, "XPath evaluation failure\n");
 1776|     53|        lint->progresult = XMLLINT_ERR_XPATH;
 1777|     53|        goto error;
 1778|     53|    }
 1779|       |
 1780|     62|    doXPathDump(lint, res);
 1781|       |
 1782|    192|error:
 1783|    192|    xmlXPathFreeObject(res);
 1784|    192|    xmlXPathFreeCompExpr(comp);
 1785|    192|    xmlXPathFreeContext(ctxt);
 1786|    192|}
xmllint.c:doXPathDump:
 1681|     62|doXPathDump(xmllintState *lint, xmlXPathObjectPtr cur) {
 1682|     62|    switch(cur->type) {
 1683|     21|        case XPATH_NODESET: {
  ------------------
  |  Branch (1683:9): [True: 21, False: 41]
  ------------------
 1684|     21|#ifdef LIBXML_OUTPUT_ENABLED
 1685|     21|            xmlOutputBufferPtr buf;
 1686|     21|            xmlNodePtr node;
 1687|     21|            int i;
 1688|       |
 1689|     21|            if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr <= 0)) {
  ------------------
  |  Branch (1689:17): [True: 0, False: 21]
  |  Branch (1689:46): [True: 21, False: 0]
  ------------------
 1690|     21|                lint->progresult = XMLLINT_ERR_XPATH_EMPTY;
 1691|     21|                if ((lint->appOptions & XML_LINT_QUIET) != XML_LINT_QUIET) {
  ------------------
  |  Branch (1691:21): [True: 21, False: 0]
  ------------------
 1692|     21|                    fprintf(lint->errStream, "XPath set is empty\n");
 1693|     21|                }
 1694|     21|                break;
 1695|     21|            }
 1696|      0|            buf = xmlOutputBufferCreateFile(stdout, NULL);
 1697|      0|            if (buf == NULL) {
  ------------------
  |  Branch (1697:17): [True: 0, False: 0]
  ------------------
 1698|      0|                lint->progresult = XMLLINT_ERR_MEM;
 1699|      0|                return;
 1700|      0|            }
 1701|      0|            for (i = 0;i < cur->nodesetval->nodeNr;i++) {
  ------------------
  |  Branch (1701:24): [True: 0, False: 0]
  ------------------
 1702|      0|                node = cur->nodesetval->nodeTab[i];
 1703|      0|                xmlNodeDumpOutput(buf, NULL, node, 0, 0, NULL);
 1704|      0|                xmlOutputBufferWrite(buf, 1, lint->xpathsep);
 1705|      0|            }
 1706|      0|            xmlOutputBufferClose(buf);
 1707|       |#else
 1708|       |            printf("xpath returned %d nodes\n", cur->nodesetval->nodeNr);
 1709|       |#endif
 1710|      0|	    break;
 1711|      0|        }
 1712|      9|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (1712:9): [True: 9, False: 53]
  ------------------
 1713|      9|	    if (cur->boolval) printf("true%s", lint->xpathsep);
  ------------------
  |  Branch (1713:10): [True: 8, False: 1]
  ------------------
 1714|      1|	    else printf("false%s", lint->xpathsep);
 1715|      9|	    break;
 1716|      0|        case XPATH_NUMBER:
  ------------------
  |  Branch (1716:9): [True: 0, False: 62]
  ------------------
 1717|      0|	    switch (xmlXPathIsInf(cur->floatval)) {
 1718|      0|	    case 1:
  ------------------
  |  Branch (1718:6): [True: 0, False: 0]
  ------------------
 1719|      0|		printf("Infinity%s", lint->xpathsep);
 1720|      0|		break;
 1721|      0|	    case -1:
  ------------------
  |  Branch (1721:6): [True: 0, False: 0]
  ------------------
 1722|      0|		printf("-Infinity%s", lint->xpathsep);
 1723|      0|		break;
 1724|      0|	    default:
  ------------------
  |  Branch (1724:6): [True: 0, False: 0]
  ------------------
 1725|      0|		if (xmlXPathIsNaN(cur->floatval)) {
  ------------------
  |  Branch (1725:7): [True: 0, False: 0]
  ------------------
 1726|      0|		    printf("NaN%s", lint->xpathsep);
 1727|      0|		} else {
 1728|      0|		    printf("%0g%s", cur->floatval, lint->xpathsep);
 1729|      0|		}
 1730|      0|	    }
 1731|      0|	    break;
 1732|     32|        case XPATH_STRING:
  ------------------
  |  Branch (1732:9): [True: 32, False: 30]
  ------------------
 1733|     32|	    printf("%s%s", (const char *) cur->stringval, lint->xpathsep);
 1734|     32|	    break;
 1735|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (1735:9): [True: 0, False: 62]
  ------------------
 1736|      0|	    fprintf(lint->errStream, "XPath Object is uninitialized\n");
 1737|      0|            lint->progresult = XMLLINT_ERR_XPATH;
 1738|      0|	    break;
 1739|      0|	default:
  ------------------
  |  Branch (1739:2): [True: 0, False: 62]
  ------------------
 1740|      0|	    fprintf(lint->errStream, "XPath object of unexpected type\n");
 1741|      0|            lint->progresult = XMLLINT_ERR_XPATH;
 1742|      0|	    break;
 1743|     62|    }
 1744|     62|}
xmllint.c:walkDoc:
 1578|     45|static void walkDoc(xmllintState *lint, xmlDocPtr doc) {
 1579|     45|    FILE *errStream = lint->errStream;
 1580|     45|    xmlTextReaderPtr reader;
 1581|     45|    int ret;
 1582|       |
 1583|     45|#ifdef LIBXML_PATTERN_ENABLED
 1584|     45|    if (lint->pattern != NULL) {
  ------------------
  |  Branch (1584:9): [True: 22, False: 23]
  ------------------
 1585|     22|        xmlNodePtr root;
 1586|     22|        const xmlChar *namespaces[22];
 1587|     22|        int i;
 1588|     22|        xmlNsPtr ns;
 1589|       |
 1590|     22|        root = xmlDocGetRootElement(doc);
 1591|     22|        if (root == NULL ) {
  ------------------
  |  Branch (1591:13): [True: 0, False: 22]
  ------------------
 1592|      0|            fprintf(errStream,
 1593|      0|                    "Document does not have a root element");
 1594|      0|            lint->progresult = XMLLINT_ERR_UNCLASS;
 1595|      0|            return;
 1596|      0|        }
 1597|     22|        for (ns = root->nsDef, i = 0;ns != NULL && i < 20;ns=ns->next) {
  ------------------
  |  Branch (1597:38): [True: 0, False: 22]
  |  Branch (1597:52): [True: 0, False: 0]
  ------------------
 1598|      0|            namespaces[i++] = ns->href;
 1599|      0|            namespaces[i++] = ns->prefix;
 1600|      0|        }
 1601|     22|        namespaces[i++] = NULL;
 1602|     22|        namespaces[i] = NULL;
 1603|       |
 1604|     22|        ret = xmlPatternCompileSafe((const xmlChar *) lint->pattern, doc->dict,
 1605|     22|                                    0, &namespaces[0], &lint->patternc);
 1606|     22|	if (lint->patternc == NULL) {
  ------------------
  |  Branch (1606:6): [True: 9, False: 13]
  ------------------
 1607|      9|            if (ret < 0) {
  ------------------
  |  Branch (1607:17): [True: 0, False: 9]
  ------------------
 1608|      0|                lint->progresult = XMLLINT_ERR_MEM;
 1609|      9|            } else {
 1610|      9|                fprintf(errStream, "Pattern %s failed to compile\n",
 1611|      9|                        lint->pattern);
 1612|      9|                lint->progresult = XMLLINT_ERR_SCHEMAPAT;
 1613|      9|            }
 1614|      9|            goto error;
 1615|      9|	}
 1616|       |
 1617|     13|        lint->patstream = xmlPatternGetStreamCtxt(lint->patternc);
 1618|     13|        if (lint->patstream == NULL) {
  ------------------
  |  Branch (1618:13): [True: 0, False: 13]
  ------------------
 1619|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1620|      0|            goto error;
 1621|      0|        }
 1622|       |
 1623|     13|        ret = xmlStreamPush(lint->patstream, NULL, NULL);
 1624|     13|        if (ret < 0) {
  ------------------
  |  Branch (1624:13): [True: 0, False: 13]
  ------------------
 1625|      0|            fprintf(errStream, "xmlStreamPush() failure\n");
 1626|      0|            lint->progresult = XMLLINT_ERR_MEM;
 1627|      0|            goto error;
 1628|      0|        }
 1629|     13|    }
 1630|     36|#endif /* LIBXML_PATTERN_ENABLED */
 1631|     36|    reader = xmlReaderWalker(doc);
 1632|     36|    if (reader != NULL) {
  ------------------
  |  Branch (1632:9): [True: 36, False: 0]
  ------------------
 1633|     36|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1633:6): [True: 27, False: 9]
  |  Branch (1633:47): [True: 26, False: 1]
  ------------------
 1634|     26|	    startTimer(lint);
 1635|     26|	}
 1636|     36|	ret = xmlTextReaderRead(reader);
 1637|    144|	while (ret == 1) {
  ------------------
  |  Branch (1637:9): [True: 108, False: 36]
  ------------------
 1638|    108|	    if ((lint->appOptions & XML_LINT_DEBUG_ENABLED)
  ------------------
  |  Branch (1638:10): [True: 36, False: 72]
  ------------------
 1639|     72|#ifdef LIBXML_PATTERN_ENABLED
 1640|     72|	        || (lint->patternc)
  ------------------
  |  Branch (1640:13): [True: 24, False: 48]
  ------------------
 1641|    108|#endif
 1642|    108|	       )
 1643|     60|		processNode(lint, reader);
 1644|    108|	    ret = xmlTextReaderRead(reader);
 1645|    108|	}
 1646|     36|	if ((lint->appOptions & XML_LINT_TIMINGS) && (lint->repeat == 1)) {
  ------------------
  |  Branch (1646:6): [True: 27, False: 9]
  |  Branch (1646:47): [True: 26, False: 1]
  ------------------
 1647|     26|	    endTimer(lint, "walking through the doc");
 1648|     26|	}
 1649|     36|	xmlFreeTextReader(reader);
 1650|     36|	if (ret != 0) {
  ------------------
  |  Branch (1650:6): [True: 0, False: 36]
  ------------------
 1651|      0|	    fprintf(errStream, "failed to walk through the doc\n");
 1652|      0|	    lint->progresult = XMLLINT_ERR_UNCLASS;
 1653|      0|	}
 1654|     36|    } else {
 1655|      0|	fprintf(errStream, "Failed to create a reader from the document\n");
 1656|      0|	lint->progresult = XMLLINT_ERR_UNCLASS;
 1657|      0|    }
 1658|       |
 1659|     36|#ifdef LIBXML_PATTERN_ENABLED
 1660|     45|error:
 1661|     45|    if (lint->patternc != NULL) {
  ------------------
  |  Branch (1661:9): [True: 13, False: 32]
  ------------------
 1662|     13|        xmlFreePattern(lint->patternc);
 1663|     13|        lint->patternc = NULL;
 1664|     13|    }
 1665|     45|    if (lint->patstream != NULL) {
  ------------------
  |  Branch (1665:9): [True: 13, False: 32]
  ------------------
 1666|     13|	xmlFreeStreamCtxt(lint->patstream);
 1667|       |	lint->patstream = NULL;
 1668|     13|    }
 1669|     45|#endif
 1670|     45|}
xmllint.c:usage:
 2381|      5|static void usage(FILE *f, const char *name) {
 2382|      5|    fprintf(f, "Usage : %s [options] XMLfiles ...\n", name);
 2383|      5|#ifdef LIBXML_OUTPUT_ENABLED
 2384|      5|    fprintf(f, "\tParse the XML files and output the result of the parsing\n");
 2385|       |#else
 2386|       |    fprintf(f, "\tParse the XML files\n");
 2387|       |#endif /* LIBXML_OUTPUT_ENABLED */
 2388|      5|    fprintf(f, "\t--version : display the version of the XML library used\n");
 2389|      5|    fprintf(f, "\t--shell : run a navigating shell\n");
 2390|      5|    fprintf(f, "\t--debug : show additional debug information\n");
 2391|      5|    fprintf(f, "\t--copy : used to test the internal copy implementation\n");
 2392|      5|    fprintf(f, "\t--recover : output what was parsable on broken XML documents\n");
 2393|      5|    fprintf(f, "\t--huge : remove any internal arbitrary parser limits\n");
 2394|      5|    fprintf(f, "\t--noent : substitute entity references by their value\n");
 2395|      5|    fprintf(f, "\t--noenc : ignore any encoding specified inside the document\n");
 2396|      5|    fprintf(f, "\t--noout : don't output the result tree\n");
 2397|      5|    fprintf(f, "\t--path 'paths': provide a set of paths for resources\n");
 2398|      5|    fprintf(f, "\t--load-trace : print trace of all external entities loaded\n");
 2399|      5|    fprintf(f, "\t--nonet : refuse to fetch DTDs or entities over network\n");
 2400|      5|    fprintf(f, "\t--nocompact : do not generate compact text nodes\n");
 2401|      5|#ifdef LIBXML_VALID_ENABLED
 2402|      5|    fprintf(f, "\t--valid : validate the document in addition to std well-formed check\n");
 2403|      5|    fprintf(f, "\t--postvalid : do a posteriori validation, i.e after parsing\n");
 2404|      5|    fprintf(f, "\t--dtdvalid URL : do a posteriori validation against a given DTD\n");
 2405|      5|    fprintf(f, "\t--dtdvalidfpi FPI : same but name the DTD with a Public Identifier\n");
 2406|      5|    fprintf(f, "\t--insert : ad-hoc test for valid insertions\n");
 2407|      5|#endif /* LIBXML_VALID_ENABLED */
 2408|      5|    fprintf(f, "\t--strict-namespace : Return application failure if document has any namespace errors\n");
 2409|      5|    fprintf(f, "\t--quiet : be quiet when succeeded\n");
 2410|      5|    fprintf(f, "\t--timing : print some timings\n");
 2411|      5|    fprintf(f, "\t--repeat : repeat 100 times, for timing or profiling\n");
 2412|      5|    fprintf(f, "\t--dropdtd : remove the DOCTYPE of the input docs\n");
 2413|      5|#ifdef LIBXML_HTML_ENABLED
 2414|      5|    fprintf(f, "\t--html : use the HTML parser\n");
 2415|      5|    fprintf(f, "\t--nodefdtd : do not default HTML doctype\n");
 2416|      5|#ifdef LIBXML_OUTPUT_ENABLED
 2417|      5|    fprintf(f, "\t--xmlout : force to use the XML serializer when using --html\n");
 2418|      5|#endif
 2419|      5|#endif
 2420|      5|#ifdef LIBXML_PUSH_ENABLED
 2421|      5|    fprintf(f, "\t--push : use the push mode of the parser\n");
 2422|      5|#endif /* LIBXML_PUSH_ENABLED */
 2423|      5|#if HAVE_DECL_MMAP
 2424|      5|    fprintf(f, "\t--memory : parse from memory\n");
 2425|      5|#endif
 2426|      5|    fprintf(f, "\t--maxmem nbbytes : limits memory allocation to nbbytes bytes\n");
 2427|      5|    fprintf(f, "\t--nowarning : do not emit warnings from parser/validator\n");
 2428|      5|    fprintf(f, "\t--noblanks : drop (ignorable?) blanks spaces\n");
 2429|      5|    fprintf(f, "\t--nocdata : replace cdata section with text nodes\n");
 2430|      5|    fprintf(f, "\t--nodict : create document without dictionary\n");
 2431|      5|    fprintf(f, "\t--pedantic : enable additional warnings\n");
 2432|      5|#ifdef LIBXML_OUTPUT_ENABLED
 2433|      5|    fprintf(f, "\t--output file or -o file: save to a given file\n");
 2434|      5|    fprintf(f, "\t--format : reformat/reindent the output\n");
 2435|      5|    fprintf(f, "\t--encode encoding : output in the given encoding\n");
 2436|      5|    fprintf(f, "\t--pretty STYLE : pretty-print in a particular style\n");
 2437|      5|    fprintf(f, "\t                 0 Do not pretty print\n");
 2438|      5|    fprintf(f, "\t                 1 Format the XML content, as --format\n");
 2439|      5|    fprintf(f, "\t                 2 Add whitespace inside tags, preserving content\n");
 2440|      5|#ifdef LIBXML_ZLIB_ENABLED
 2441|      5|    fprintf(f, "\t--compress : turn on gzip compression of output\n");
 2442|      5|#endif
 2443|      5|#ifdef LIBXML_C14N_ENABLED
 2444|      5|    fprintf(f, "\t--c14n : save in W3C canonical format v1.0 (with comments)\n");
 2445|      5|    fprintf(f, "\t--c14n11 : save in W3C canonical format v1.1 (with comments)\n");
 2446|      5|    fprintf(f, "\t--exc-c14n : save in W3C exclusive canonical format (with comments)\n");
 2447|      5|#endif /* LIBXML_C14N_ENABLED */
 2448|      5|#endif /* LIBXML_OUTPUT_ENABLED */
 2449|      5|    fprintf(f, "\t--nsclean : remove redundant namespace declarations\n");
 2450|      5|#ifdef LIBXML_CATALOG_ENABLED
 2451|      5|    fprintf(f, "\t--catalogs : use SGML catalogs from $SGML_CATALOG_FILES\n");
 2452|      5|    fprintf(f, "\t             otherwise XML Catalogs starting from \n");
 2453|      5|    fprintf(f, "\t         file://" XML_SYSCONFDIR "/xml/catalog "
 2454|      5|            "are activated by default\n");
 2455|      5|    fprintf(f, "\t--nocatalogs: deactivate all catalogs\n");
 2456|      5|#endif
 2457|      5|    fprintf(f, "\t--auto : generate a small doc on the fly\n");
 2458|      5|#ifdef LIBXML_XINCLUDE_ENABLED
 2459|      5|    fprintf(f, "\t--xinclude : do XInclude processing\n");
 2460|      5|    fprintf(f, "\t--noxincludenode : same but do not generate XInclude nodes\n");
 2461|      5|    fprintf(f, "\t--nofixup-base-uris : do not fixup xml:base uris\n");
 2462|      5|#endif
 2463|      5|    fprintf(f, "\t--loaddtd : fetch external DTD\n");
 2464|      5|    fprintf(f, "\t--dtdattr : loaddtd + populate the tree with inherited attributes \n");
 2465|      5|#ifdef LIBXML_READER_ENABLED
 2466|      5|    fprintf(f, "\t--stream : use the streaming interface to process very large files\n");
 2467|      5|    fprintf(f, "\t--walker : create a reader and walk though the resulting doc\n");
 2468|      5|#ifdef LIBXML_PATTERN_ENABLED
 2469|      5|    fprintf(f, "\t--pattern pattern_value : test the pattern support\n");
 2470|      5|#endif
 2471|      5|#endif /* LIBXML_READER_ENABLED */
 2472|      5|#ifdef LIBXML_RELAXNG_ENABLED
 2473|      5|    fprintf(f, "\t--relaxng schema : do RelaxNG validation against the schema\n");
 2474|      5|#endif
 2475|      5|#ifdef LIBXML_SCHEMAS_ENABLED
 2476|      5|    fprintf(f, "\t--schema schema : do validation against the WXS schema\n");
 2477|      5|#endif
 2478|       |#ifdef LIBXML_SCHEMATRON_ENABLED
 2479|       |    fprintf(f, "\t--schematron schema : do validation against a schematron\n");
 2480|       |#endif
 2481|      5|#ifdef LIBXML_SAX1_ENABLED
 2482|      5|    fprintf(f, "\t--sax1: use the old SAX1 interfaces for processing\n");
 2483|      5|#endif
 2484|      5|    fprintf(f, "\t--sax: do not build a tree but work just at the SAX level\n");
 2485|      5|    fprintf(f, "\t--oldxml10: use XML-1.0 parsing rules before the 5th edition\n");
 2486|      5|#ifdef LIBXML_XPATH_ENABLED
 2487|      5|    fprintf(f, "\t--xpath expr: evaluate the XPath expression, results are separated by \\n, imply --noout\n");
 2488|      5|    fprintf(f, "\t--xpath0 expr: evaluate the XPath expression, results are separated by \\0, imply --noout\n");
 2489|      5|#endif
 2490|      5|    fprintf(f, "\t--max-ampl value: set maximum amplification factor\n");
 2491|       |
 2492|      5|    fprintf(f, "\nLibxml project home page: https://gitlab.gnome.org/GNOME/libxml2\n");
 2493|      5|}

xmlMemMalloc:
   96|  11.8k|{
   97|  11.8k|    MEMHDR *p;
   98|       |
   99|  11.8k|    xmlInitParser();
  100|       |
  101|  11.8k|    if (size > (MAX_SIZE_T - RESERVE_SIZE))
  ------------------
  |  |   53|  11.8k|#define MAX_SIZE_T ((size_t)-1)
  ------------------
                  if (size > (MAX_SIZE_T - RESERVE_SIZE))
  ------------------
  |  |   50|  11.8k|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  ------------------
  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  |  |   51|  11.8k|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  ------------------
  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  ------------------
  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  ------------------
  |  Branch (101:9): [True: 0, False: 11.8k]
  ------------------
  102|      0|        return(NULL);
  103|       |
  104|  11.8k|    p = (MEMHDR *) malloc(RESERVE_SIZE + size);
  ------------------
  |  |   50|  11.8k|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  ------------------
  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  |  |   51|  11.8k|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  ------------------
  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  ------------------
  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  ------------------
  105|  11.8k|    if (!p)
  ------------------
  |  Branch (105:9): [True: 0, False: 11.8k]
  ------------------
  106|      0|        return(NULL);
  107|  11.8k|    p->mh_tag = MEMTAG;
  ------------------
  |  |   38|  11.8k|#define MEMTAG 0x5aa5U
  ------------------
  108|  11.8k|    p->mh_size = size;
  109|       |
  110|  11.8k|    xmlMutexLock(&xmlMemMutex);
  111|  11.8k|    debugMemSize += size;
  112|  11.8k|    debugMemBlocks++;
  113|  11.8k|    xmlMutexUnlock(&xmlMemMutex);
  114|       |
  115|  11.8k|    return(HDR_2_CLIENT(p));
  ------------------
  |  |   56|  11.8k|#define HDR_2_CLIENT(a)    ((void *) (((char *) (a)) + RESERVE_SIZE))
  |  |  ------------------
  |  |  |  |   50|  11.8k|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |   51|  11.8k|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|  11.8k|}
xmlMemRealloc:
  142|    105|xmlMemRealloc(void *ptr, size_t size) {
  143|    105|    MEMHDR *p, *tmp;
  144|    105|    size_t oldSize;
  145|       |
  146|    105|    if (ptr == NULL)
  ------------------
  |  Branch (146:9): [True: 6, False: 99]
  ------------------
  147|      6|        return(xmlMemMalloc(size));
  148|       |
  149|     99|    xmlInitParser();
  150|       |
  151|     99|    if (size > (MAX_SIZE_T - RESERVE_SIZE))
  ------------------
  |  |   53|     99|#define MAX_SIZE_T ((size_t)-1)
  ------------------
                  if (size > (MAX_SIZE_T - RESERVE_SIZE))
  ------------------
  |  |   50|     99|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  ------------------
  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  |  |   51|     99|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  ------------------
  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  ------------------
  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  ------------------
  |  Branch (151:9): [True: 0, False: 99]
  ------------------
  152|      0|        return(NULL);
  153|       |
  154|     99|    p = CLIENT_2_HDR(ptr);
  ------------------
  |  |   55|     99|#define CLIENT_2_HDR(a) ((void *) (((char *) (a)) - RESERVE_SIZE))
  |  |  ------------------
  |  |  |  |   50|     99|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |   51|     99|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|     99|    if (p->mh_tag != MEMTAG) {
  ------------------
  |  |   38|     99|#define MEMTAG 0x5aa5U
  ------------------
  |  Branch (155:9): [True: 0, False: 99]
  ------------------
  156|      0|        xmlPrintErrorMessage("xmlMemRealloc: Tag error\n");
  157|      0|        return(NULL);
  158|      0|    }
  159|     99|    oldSize = p->mh_size;
  160|     99|    p->mh_tag = ~MEMTAG;
  ------------------
  |  |   38|     99|#define MEMTAG 0x5aa5U
  ------------------
  161|       |
  162|     99|    tmp = (MEMHDR *) realloc(p, RESERVE_SIZE + size);
  ------------------
  |  |   50|     99|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  ------------------
  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  |  |   51|     99|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  ------------------
  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  ------------------
  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  ------------------
  ------------------
  163|     99|    if (!tmp) {
  ------------------
  |  Branch (163:9): [True: 0, False: 99]
  ------------------
  164|      0|        p->mh_tag = MEMTAG;
  ------------------
  |  |   38|      0|#define MEMTAG 0x5aa5U
  ------------------
  165|      0|        return(NULL);
  166|      0|    }
  167|     99|    p = tmp;
  168|     99|    p->mh_tag = MEMTAG;
  ------------------
  |  |   38|     99|#define MEMTAG 0x5aa5U
  ------------------
  169|     99|    p->mh_size = size;
  170|       |
  171|     99|    xmlMutexLock(&xmlMemMutex);
  172|     99|    debugMemSize -= oldSize;
  173|     99|    debugMemSize += size;
  174|     99|    xmlMutexUnlock(&xmlMemMutex);
  175|       |
  176|     99|    return(HDR_2_CLIENT(p));
  ------------------
  |  |   56|     99|#define HDR_2_CLIENT(a)    ((void *) (((char *) (a)) + RESERVE_SIZE))
  |  |  ------------------
  |  |  |  |   50|     99|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |   51|     99|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|     99|}
xmlMemFree:
  186|  11.8k|{
  187|  11.8k|    MEMHDR *p;
  188|       |
  189|  11.8k|    if (ptr == NULL)
  ------------------
  |  Branch (189:9): [True: 41, False: 11.8k]
  ------------------
  190|     41|        return;
  191|       |
  192|  11.8k|    if (ptr == (void *) -1) {
  ------------------
  |  Branch (192:9): [True: 0, False: 11.8k]
  ------------------
  193|      0|        xmlPrintErrorMessage("xmlMemFree: Pointer from freed area\n");
  194|      0|        return;
  195|      0|    }
  196|       |
  197|  11.8k|    p = CLIENT_2_HDR(ptr);
  ------------------
  |  |   55|  11.8k|#define CLIENT_2_HDR(a) ((void *) (((char *) (a)) - RESERVE_SIZE))
  |  |  ------------------
  |  |  |  |   50|  11.8k|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |   51|  11.8k|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  11.8k|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|  11.8k|    if (p->mh_tag != MEMTAG) {
  ------------------
  |  |   38|  11.8k|#define MEMTAG 0x5aa5U
  ------------------
  |  Branch (198:9): [True: 0, False: 11.8k]
  ------------------
  199|      0|        xmlPrintErrorMessage("xmlMemFree: Tag error\n");
  200|      0|        return;
  201|      0|    }
  202|  11.8k|    p->mh_tag = ~MEMTAG;
  ------------------
  |  |   38|  11.8k|#define MEMTAG 0x5aa5U
  ------------------
  203|  11.8k|    memset(ptr, -1, p->mh_size);
  204|       |
  205|  11.8k|    xmlMutexLock(&xmlMemMutex);
  206|  11.8k|    debugMemSize -= p->mh_size;
  207|  11.8k|    debugMemBlocks--;
  208|  11.8k|    xmlMutexUnlock(&xmlMemMutex);
  209|       |
  210|  11.8k|    free(p);
  211|  11.8k|}
xmlMemSize:
  269|    105|xmlMemSize(void *ptr) {
  270|    105|    MEMHDR *p;
  271|       |
  272|    105|    if (ptr == NULL)
  ------------------
  |  Branch (272:9): [True: 6, False: 99]
  ------------------
  273|      6|	return(0);
  274|       |
  275|     99|    p = CLIENT_2_HDR(ptr);
  ------------------
  |  |   55|     99|#define CLIENT_2_HDR(a) ((void *) (((char *) (a)) - RESERVE_SIZE))
  |  |  ------------------
  |  |  |  |   50|     99|#define RESERVE_SIZE (((sizeof(MEMHDR) + ALIGN_SIZE - 1) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |   51|     99|		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  |  |               		      / ALIGN_SIZE ) * ALIGN_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     99|#define ALIGN_SIZE  sizeof(double)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|     99|    if (p->mh_tag != MEMTAG)
  ------------------
  |  |   38|     99|#define MEMTAG 0x5aa5U
  ------------------
  |  Branch (276:9): [True: 0, False: 99]
  ------------------
  277|      0|        return(0);
  278|       |
  279|     99|    return(p->mh_size);
  280|     99|}
xmlMemUsed:
  289|  12.3k|xmlMemUsed(void) {
  290|  12.3k|    return(debugMemSize);
  291|  12.3k|}
xmlInitMemoryInternal:
  368|    324|xmlInitMemoryInternal(void) {
  369|    324|    xmlInitMutex(&xmlMemMutex);
  370|    324|}
xmlCleanupMemoryInternal:
  387|    323|xmlCleanupMemoryInternal(void) {
  388|       |    /*
  389|       |     * Don't clean up mutex on Windows. Global state destructors can call
  390|       |     * malloc functions after xmlCleanupParser was called. If memory
  391|       |     * debugging is enabled, xmlMemMutex can be used after cleanup.
  392|       |     *
  393|       |     * See python/tests/thread2.py
  394|       |     */
  395|    323|#if !defined(LIBXML_THREAD_ENABLED) || !defined(_WIN32)
  396|    323|    xmlCleanupMutex(&xmlMemMutex);
  397|    323|#endif
  398|    323|}
xmlMemSetup:
  415|    355|            xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc) {
  416|    355|    if (freeFunc == NULL)
  ------------------
  |  Branch (416:9): [True: 0, False: 355]
  ------------------
  417|      0|	return(-1);
  418|    355|    if (mallocFunc == NULL)
  ------------------
  |  Branch (418:9): [True: 0, False: 355]
  ------------------
  419|      0|	return(-1);
  420|    355|    if (reallocFunc == NULL)
  ------------------
  |  Branch (420:9): [True: 0, False: 355]
  ------------------
  421|      0|	return(-1);
  422|    355|    if (strdupFunc == NULL)
  ------------------
  |  Branch (422:9): [True: 0, False: 355]
  ------------------
  423|      0|	return(-1);
  424|    355|    xmlFree = freeFunc;
  425|    355|    xmlMalloc = mallocFunc;
  426|    355|    xmlMallocAtomic = mallocFunc;
  427|    355|    xmlRealloc = reallocFunc;
  428|    355|    xmlMemStrdup = strdupFunc;
  429|    355|    return(0);
  430|    355|}

xmlTextReaderRead:
 1200|    144|xmlTextReaderRead(xmlTextReader *reader) {
 1201|    144|    int val, olddepth = 0;
 1202|    144|    xmlTextReaderState oldstate = XML_TEXTREADER_START;
 1203|    144|    xmlNodePtr oldnode = NULL;
 1204|       |
 1205|    144|    if (reader == NULL)
  ------------------
  |  Branch (1205:9): [True: 0, False: 144]
  ------------------
 1206|      0|	return(-1);
 1207|    144|    if (reader->state == XML_TEXTREADER_ERROR)
  ------------------
  |  Branch (1207:9): [True: 0, False: 144]
  ------------------
 1208|      0|        return(-1);
 1209|       |
 1210|    144|    reader->curnode = NULL;
 1211|    144|    if (reader->doc != NULL)
  ------------------
  |  Branch (1211:9): [True: 144, False: 0]
  ------------------
 1212|    144|        return(xmlTextReaderReadTree(reader));
 1213|      0|    if (reader->ctxt == NULL)
  ------------------
  |  Branch (1213:9): [True: 0, False: 0]
  ------------------
 1214|      0|	return(-1);
 1215|       |
 1216|      0|    if (reader->mode == XML_TEXTREADER_MODE_INITIAL) {
  ------------------
  |  Branch (1216:9): [True: 0, False: 0]
  ------------------
 1217|      0|	reader->mode = XML_TEXTREADER_MODE_INTERACTIVE;
 1218|       |	/*
 1219|       |	 * Initial state
 1220|       |	 */
 1221|      0|	do {
 1222|      0|	    val = xmlTextReaderPushData(reader);
 1223|      0|            if (val < 0) {
  ------------------
  |  Branch (1223:17): [True: 0, False: 0]
  ------------------
 1224|      0|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1225|      0|                reader->state = XML_TEXTREADER_ERROR;
 1226|      0|                return(-1);
 1227|      0|            }
 1228|      0|	} while ((reader->ctxt->node == NULL) &&
  ------------------
  |  Branch (1228:11): [True: 0, False: 0]
  ------------------
 1229|      0|		 ((reader->mode != XML_TEXTREADER_MODE_EOF) &&
  ------------------
  |  Branch (1229:5): [True: 0, False: 0]
  ------------------
 1230|      0|		  (reader->state != XML_TEXTREADER_DONE)));
  ------------------
  |  Branch (1230:5): [True: 0, False: 0]
  ------------------
 1231|      0|	if (reader->ctxt->node == NULL) {
  ------------------
  |  Branch (1231:6): [True: 0, False: 0]
  ------------------
 1232|      0|	    if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (1232:10): [True: 0, False: 0]
  ------------------
 1233|      0|		reader->node = reader->ctxt->myDoc->children;
 1234|      0|	    }
 1235|      0|	    if (reader->node == NULL) {
  ------------------
  |  Branch (1235:10): [True: 0, False: 0]
  ------------------
 1236|      0|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1237|      0|                reader->state = XML_TEXTREADER_ERROR;
 1238|      0|		return(-1);
 1239|      0|	    }
 1240|      0|	    reader->state = XML_TEXTREADER_ELEMENT;
 1241|      0|	} else {
 1242|      0|	    if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (1242:10): [True: 0, False: 0]
  ------------------
 1243|      0|		reader->node = reader->ctxt->myDoc->children;
 1244|      0|	    }
 1245|      0|	    if (reader->node == NULL)
  ------------------
  |  Branch (1245:10): [True: 0, False: 0]
  ------------------
 1246|      0|		reader->node = reader->ctxt->nodeTab[0];
 1247|      0|	    reader->state = XML_TEXTREADER_ELEMENT;
 1248|      0|	}
 1249|      0|	reader->depth = 0;
 1250|      0|	reader->ctxt->parseMode = XML_PARSE_READER;
 1251|      0|	goto node_found;
 1252|      0|    }
 1253|      0|    oldstate = reader->state;
 1254|      0|    olddepth = reader->ctxt->nodeNr;
 1255|      0|    oldnode = reader->node;
 1256|       |
 1257|      0|get_next_node:
 1258|      0|    if (reader->node == NULL) {
  ------------------
  |  Branch (1258:9): [True: 0, False: 0]
  ------------------
 1259|      0|	if (reader->mode == XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (1259:6): [True: 0, False: 0]
  ------------------
 1260|      0|	    return(0);
 1261|      0|        } else {
 1262|      0|            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1263|      0|            reader->state = XML_TEXTREADER_ERROR;
 1264|      0|	    return(-1);
 1265|      0|        }
 1266|      0|    }
 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|      0|    while ((reader->node != NULL) && (reader->node->next == NULL) &&
  ------------------
  |  Branch (1273:12): [True: 0, False: 0]
  |  Branch (1273:38): [True: 0, False: 0]
  ------------------
 1274|      0|	   (reader->ctxt->nodeNr == olddepth) &&
  ------------------
  |  Branch (1274:5): [True: 0, False: 0]
  ------------------
 1275|      0|           ((oldstate == XML_TEXTREADER_BACKTRACK) ||
  ------------------
  |  Branch (1275:13): [True: 0, False: 0]
  ------------------
 1276|      0|            (reader->node->children == NULL) ||
  ------------------
  |  Branch (1276:13): [True: 0, False: 0]
  ------------------
 1277|      0|	    (reader->node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (1277:6): [True: 0, False: 0]
  ------------------
 1278|      0|	    ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1278:7): [True: 0, False: 0]
  ------------------
 1279|      0|	     (reader->node->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1279:7): [True: 0, False: 0]
  ------------------
 1280|      0|	     (reader->node->children->next == NULL)) ||
  ------------------
  |  Branch (1280:7): [True: 0, False: 0]
  ------------------
 1281|      0|	    (reader->node->type == XML_DTD_NODE) ||
  ------------------
  |  Branch (1281:6): [True: 0, False: 0]
  ------------------
 1282|      0|	    (reader->node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1282:6): [True: 0, False: 0]
  ------------------
 1283|      0|	    (reader->node->type == XML_HTML_DOCUMENT_NODE)) &&
  ------------------
  |  Branch (1283:6): [True: 0, False: 0]
  ------------------
 1284|      0|	   ((reader->ctxt->node == NULL) ||
  ------------------
  |  Branch (1284:6): [True: 0, False: 0]
  ------------------
 1285|      0|	    (reader->ctxt->node == reader->node) ||
  ------------------
  |  Branch (1285:6): [True: 0, False: 0]
  ------------------
 1286|      0|	    (reader->ctxt->node == reader->node->parent)) &&
  ------------------
  |  Branch (1286:6): [True: 0, False: 0]
  ------------------
 1287|      0|	   (reader->ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (1287:5): [True: 0, False: 0]
  ------------------
 1288|      0|	   (PARSER_STOPPED(reader->ctxt) == 0)) {
  ------------------
  |  |   44|      0|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (1288:5): [True: 0, False: 0]
  ------------------
 1289|      0|	val = xmlTextReaderPushData(reader);
 1290|      0|	if (val < 0) {
  ------------------
  |  Branch (1290:6): [True: 0, False: 0]
  ------------------
 1291|      0|            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1292|      0|            reader->state = XML_TEXTREADER_ERROR;
 1293|      0|	    return(-1);
 1294|      0|        }
 1295|      0|	if (reader->node == NULL)
  ------------------
  |  Branch (1295:6): [True: 0, False: 0]
  ------------------
 1296|      0|	    goto node_end;
 1297|      0|    }
 1298|      0|    if (oldstate != XML_TEXTREADER_BACKTRACK) {
  ------------------
  |  Branch (1298:9): [True: 0, False: 0]
  ------------------
 1299|      0|	if ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1299:6): [True: 0, False: 0]
  ------------------
 1300|      0|	    (reader->node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1300:6): [True: 0, False: 0]
  ------------------
 1301|      0|	    (reader->node->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1301:6): [True: 0, False: 0]
  ------------------
 1302|      0|	    (reader->node->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (1302:6): [True: 0, False: 0]
  ------------------
 1303|      0|	    reader->node = reader->node->children;
 1304|      0|	    reader->depth++;
 1305|      0|	    reader->state = XML_TEXTREADER_ELEMENT;
 1306|      0|	    goto node_found;
 1307|      0|	}
 1308|      0|    }
 1309|      0|    if (reader->node->next != NULL) {
  ------------------
  |  Branch (1309:9): [True: 0, False: 0]
  ------------------
 1310|      0|	if ((oldstate == XML_TEXTREADER_ELEMENT) &&
  ------------------
  |  Branch (1310:6): [True: 0, False: 0]
  ------------------
 1311|      0|            (reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1311:13): [True: 0, False: 0]
  ------------------
 1312|      0|	    (reader->node->children == NULL) &&
  ------------------
  |  Branch (1312:6): [True: 0, False: 0]
  ------------------
 1313|      0|	    ((reader->node->extra & NODE_IS_EMPTY) == 0)
  ------------------
  |  |  169|      0|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1313:6): [True: 0, False: 0]
  ------------------
 1314|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 1315|      0|	    && (reader->in_xinclude <= 0)
  ------------------
  |  Branch (1315:9): [True: 0, False: 0]
  ------------------
 1316|      0|#endif
 1317|      0|	    ) {
 1318|      0|	    reader->state = XML_TEXTREADER_END;
 1319|      0|	    goto node_found;
 1320|      0|	}
 1321|      0|#ifdef LIBXML_REGEXP_ENABLED
 1322|      0|	if ((reader->validate) &&
  ------------------
  |  Branch (1322:6): [True: 0, False: 0]
  ------------------
 1323|      0|	    (reader->node->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (1323:6): [True: 0, False: 0]
  ------------------
 1324|      0|	    if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1324:10): [True: 0, False: 0]
  ------------------
 1325|      0|                return(-1);
 1326|      0|#endif /* LIBXML_REGEXP_ENABLED */
 1327|      0|        if ((reader->preserves > 0) &&
  ------------------
  |  Branch (1327:13): [True: 0, False: 0]
  ------------------
 1328|      0|	    (reader->node->extra & NODE_IS_SPRESERVED))
  ------------------
  |  |  171|      0|#define NODE_IS_SPRESERVED	0x4
  ------------------
  |  Branch (1328:6): [True: 0, False: 0]
  ------------------
 1329|      0|	    reader->preserves--;
 1330|      0|	reader->node = reader->node->next;
 1331|      0|	reader->state = XML_TEXTREADER_ELEMENT;
 1332|       |
 1333|       |	/*
 1334|       |	 * Cleanup of the old node
 1335|       |	 */
 1336|      0|	if ((reader->preserves == 0) &&
  ------------------
  |  Branch (1336:6): [True: 0, False: 0]
  ------------------
 1337|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 1338|      0|	    (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1338:6): [True: 0, False: 0]
  ------------------
 1339|      0|#endif
 1340|      0|	    (reader->entNr == 0) &&
  ------------------
  |  Branch (1340:6): [True: 0, False: 0]
  ------------------
 1341|      0|	    (reader->node->prev != NULL) &&
  ------------------
  |  Branch (1341:6): [True: 0, False: 0]
  ------------------
 1342|      0|            (reader->node->prev->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (1342:13): [True: 0, False: 0]
  ------------------
 1343|      0|	    xmlNodePtr tmp = reader->node->prev;
 1344|      0|	    if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
  ------------------
  |  |  170|      0|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1344:10): [True: 0, False: 0]
  ------------------
 1345|      0|                if (oldnode == tmp)
  ------------------
  |  Branch (1345:21): [True: 0, False: 0]
  ------------------
 1346|      0|                    oldnode = NULL;
 1347|      0|		xmlUnlinkNode(tmp);
 1348|      0|		xmlTextReaderFreeNode(reader, tmp);
 1349|      0|	    }
 1350|      0|	}
 1351|       |
 1352|      0|	goto node_found;
 1353|      0|    }
 1354|      0|    if ((oldstate == XML_TEXTREADER_ELEMENT) &&
  ------------------
  |  Branch (1354:9): [True: 0, False: 0]
  ------------------
 1355|      0|	(reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1355:2): [True: 0, False: 0]
  ------------------
 1356|      0|	(reader->node->children == NULL) &&
  ------------------
  |  Branch (1356:2): [True: 0, False: 0]
  ------------------
 1357|      0|	((reader->node->extra & NODE_IS_EMPTY) == 0)) {;
  ------------------
  |  |  169|      0|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1357:2): [True: 0, False: 0]
  ------------------
 1358|      0|	reader->state = XML_TEXTREADER_END;
 1359|      0|	goto node_found;
 1360|      0|    }
 1361|      0|#ifdef LIBXML_REGEXP_ENABLED
 1362|      0|    if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) &&
  ------------------
  |  Branch (1362:9): [True: 0, False: 0]
  ------------------
 1363|      0|        (reader->node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1363:9): [True: 0, False: 0]
  ------------------
 1364|      0|        if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1364:13): [True: 0, False: 0]
  ------------------
 1365|      0|            return(-1);
 1366|      0|    }
 1367|      0|#endif /* LIBXML_REGEXP_ENABLED */
 1368|      0|    if ((reader->preserves > 0) &&
  ------------------
  |  Branch (1368:9): [True: 0, False: 0]
  ------------------
 1369|      0|	(reader->node->extra & NODE_IS_SPRESERVED))
  ------------------
  |  |  171|      0|#define NODE_IS_SPRESERVED	0x4
  ------------------
  |  Branch (1369:2): [True: 0, False: 0]
  ------------------
 1370|      0|	reader->preserves--;
 1371|      0|    reader->node = reader->node->parent;
 1372|      0|    if ((reader->node == NULL) ||
  ------------------
  |  Branch (1372:9): [True: 0, False: 0]
  ------------------
 1373|      0|	(reader->node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1373:2): [True: 0, False: 0]
  ------------------
 1374|      0|	(reader->node->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (1374:2): [True: 0, False: 0]
  ------------------
 1375|      0|	if (reader->mode != XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (1375:6): [True: 0, False: 0]
  ------------------
 1376|      0|	    val = xmlParseChunk(reader->ctxt, "", 0, 1);
 1377|      0|	    reader->state = XML_TEXTREADER_DONE;
 1378|      0|	    if (val != 0) {
  ------------------
  |  Branch (1378:10): [True: 0, False: 0]
  ------------------
 1379|      0|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1380|      0|                reader->state = XML_TEXTREADER_ERROR;
 1381|      0|	        return(-1);
 1382|      0|            }
 1383|      0|	}
 1384|      0|	reader->node = NULL;
 1385|      0|	reader->depth = -1;
 1386|       |
 1387|       |	/*
 1388|       |	 * Cleanup of the old node
 1389|       |	 */
 1390|      0|	if ((oldnode != NULL) && (reader->preserves == 0) &&
  ------------------
  |  Branch (1390:6): [True: 0, False: 0]
  |  Branch (1390:27): [True: 0, False: 0]
  ------------------
 1391|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 1392|      0|	    (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1392:6): [True: 0, False: 0]
  ------------------
 1393|      0|#endif
 1394|      0|	    (reader->entNr == 0) &&
  ------------------
  |  Branch (1394:6): [True: 0, False: 0]
  ------------------
 1395|      0|	    (oldnode->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (1395:6): [True: 0, False: 0]
  ------------------
 1396|      0|	    ((oldnode->extra & NODE_IS_PRESERVED) == 0)) {
  ------------------
  |  |  170|      0|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1396:6): [True: 0, False: 0]
  ------------------
 1397|      0|	    xmlUnlinkNode(oldnode);
 1398|      0|	    xmlTextReaderFreeNode(reader, oldnode);
 1399|      0|	}
 1400|       |
 1401|      0|	goto node_end;
 1402|      0|    }
 1403|      0|    if ((reader->preserves == 0) &&
  ------------------
  |  Branch (1403:9): [True: 0, False: 0]
  ------------------
 1404|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 1405|      0|        (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1405:9): [True: 0, False: 0]
  ------------------
 1406|      0|#endif
 1407|      0|	(reader->entNr == 0) &&
  ------------------
  |  Branch (1407:2): [True: 0, False: 0]
  ------------------
 1408|      0|        (reader->node->last != NULL) &&
  ------------------
  |  Branch (1408:9): [True: 0, False: 0]
  ------------------
 1409|      0|        ((reader->node->last->extra & NODE_IS_PRESERVED) == 0)) {
  ------------------
  |  |  170|      0|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1409:9): [True: 0, False: 0]
  ------------------
 1410|      0|	xmlNodePtr tmp = reader->node->last;
 1411|      0|	xmlUnlinkNode(tmp);
 1412|      0|	xmlTextReaderFreeNode(reader, tmp);
 1413|      0|    }
 1414|      0|    reader->depth--;
 1415|      0|    reader->state = XML_TEXTREADER_BACKTRACK;
 1416|       |
 1417|      0|node_found:
 1418|       |    /*
 1419|       |     * If we are in the middle of a piece of CDATA make sure it's finished
 1420|       |     */
 1421|      0|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1421:9): [True: 0, False: 0]
  ------------------
 1422|      0|        (reader->node->next == NULL) &&
  ------------------
  |  Branch (1422:9): [True: 0, False: 0]
  ------------------
 1423|      0|        ((reader->node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1423:10): [True: 0, False: 0]
  ------------------
 1424|      0|	 (reader->node->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (1424:3): [True: 0, False: 0]
  ------------------
 1425|      0|            if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1425:17): [True: 0, False: 0]
  ------------------
 1426|      0|	        return -1;
 1427|      0|    }
 1428|       |
 1429|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 1430|       |    /*
 1431|       |     * Handle XInclude if asked for
 1432|       |     */
 1433|      0|    if ((reader->xinclude) && (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1433:9): [True: 0, False: 0]
  |  Branch (1433:31): [True: 0, False: 0]
  ------------------
 1434|      0|        (reader->state != XML_TEXTREADER_BACKTRACK) &&
  ------------------
  |  Branch (1434:9): [True: 0, False: 0]
  ------------------
 1435|      0|        (reader->node != NULL) &&
  ------------------
  |  Branch (1435:9): [True: 0, False: 0]
  ------------------
 1436|      0|	(reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1436:2): [True: 0, False: 0]
  ------------------
 1437|      0|	(reader->node->ns != NULL) &&
  ------------------
  |  Branch (1437:2): [True: 0, False: 0]
  ------------------
 1438|      0|	((xmlStrEqual(reader->node->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|      0|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1438:3): [True: 0, False: 0]
  ------------------
 1439|      0|	 (xmlStrEqual(reader->node->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|      0|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1439:3): [True: 0, False: 0]
  ------------------
 1440|      0|	if (reader->xincctxt == NULL) {
  ------------------
  |  Branch (1440:6): [True: 0, False: 0]
  ------------------
 1441|      0|	    reader->xincctxt = xmlXIncludeNewContext(reader->ctxt->myDoc);
 1442|      0|            if (reader->xincctxt == NULL) {
  ------------------
  |  Branch (1442:17): [True: 0, False: 0]
  ------------------
 1443|      0|                xmlTextReaderErrMemory(reader);
 1444|      0|                return(-1);
 1445|      0|            }
 1446|      0|	    xmlXIncludeSetFlags(reader->xincctxt,
 1447|      0|	                        reader->parserFlags & (~XML_PARSE_NOXINCNODE));
 1448|      0|            xmlXIncludeSetStreamingMode(reader->xincctxt, 1);
 1449|      0|            if ((reader->errorFunc != NULL) || (reader->sErrorFunc != NULL))
  ------------------
  |  Branch (1449:17): [True: 0, False: 0]
  |  Branch (1449:48): [True: 0, False: 0]
  ------------------
 1450|      0|                xmlXIncludeSetErrorHandler(reader->xincctxt,
 1451|      0|                        xmlTextReaderStructuredRelay, reader);
 1452|      0|            if (reader->resourceLoader != NULL)
  ------------------
  |  Branch (1452:17): [True: 0, False: 0]
  ------------------
 1453|      0|                xmlXIncludeSetResourceLoader(reader->xincctxt,
 1454|      0|                        reader->resourceLoader, reader->resourceCtxt);
 1455|      0|	}
 1456|       |	/*
 1457|       |	 * expand that node and process it
 1458|       |	 */
 1459|      0|	if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1459:6): [True: 0, False: 0]
  ------------------
 1460|      0|	    return(-1);
 1461|      0|        if (xmlXIncludeProcessNode(reader->xincctxt, reader->node) < 0) {
  ------------------
  |  Branch (1461:13): [True: 0, False: 0]
  ------------------
 1462|      0|            int err = xmlXIncludeGetLastError(reader->xincctxt);
 1463|       |
 1464|      0|            if (xmlIsCatastrophicError(XML_ERR_FATAL, err)) {
  ------------------
  |  Branch (1464:17): [True: 0, False: 0]
  ------------------
 1465|      0|                xmlFatalErr(reader->ctxt, err, NULL);
 1466|      0|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1467|      0|                reader->state = XML_TEXTREADER_ERROR;
 1468|      0|            }
 1469|      0|            return(-1);
 1470|      0|        }
 1471|      0|    }
 1472|      0|    if ((reader->node != NULL) && (reader->node->type == XML_XINCLUDE_START)) {
  ------------------
  |  Branch (1472:9): [True: 0, False: 0]
  |  Branch (1472:35): [True: 0, False: 0]
  ------------------
 1473|      0|        reader->in_xinclude++;
 1474|      0|	goto get_next_node;
 1475|      0|    }
 1476|      0|    if ((reader->node != NULL) && (reader->node->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (1476:9): [True: 0, False: 0]
  |  Branch (1476:35): [True: 0, False: 0]
  ------------------
 1477|      0|        reader->in_xinclude--;
 1478|      0|	goto get_next_node;
 1479|      0|    }
 1480|      0|#endif
 1481|       |    /*
 1482|       |     * Handle entities enter and exit when in entity replacement mode
 1483|       |     */
 1484|      0|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1484:9): [True: 0, False: 0]
  ------------------
 1485|      0|	(reader->node->type == XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1485:2): [True: 0, False: 0]
  ------------------
 1486|      0|	(reader->ctxt != NULL) && (reader->ctxt->replaceEntities == 1)) {
  ------------------
  |  Branch (1486:2): [True: 0, False: 0]
  |  Branch (1486:28): [True: 0, False: 0]
  ------------------
 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|      0|    } else if ((reader->node != NULL) &&
  ------------------
  |  Branch (1495:16): [True: 0, False: 0]
  ------------------
 1496|      0|	       (reader->node->type == XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1496:9): [True: 0, False: 0]
  ------------------
 1497|      0|	       (reader->ctxt != NULL) && (reader->validate)) {
  ------------------
  |  Branch (1497:9): [True: 0, False: 0]
  |  Branch (1497:35): [True: 0, False: 0]
  ------------------
 1498|      0|	if (xmlTextReaderValidateEntity(reader) < 0)
  ------------------
  |  Branch (1498:6): [True: 0, False: 0]
  ------------------
 1499|      0|            return(-1);
 1500|      0|#endif /* LIBXML_REGEXP_ENABLED */
 1501|      0|    }
 1502|      0|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1502:9): [True: 0, False: 0]
  ------------------
 1503|      0|	(reader->node->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1503:2): [True: 0, False: 0]
  ------------------
 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|      0|#ifdef LIBXML_REGEXP_ENABLED
 1510|      0|    if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) && (reader->node != NULL)) {
  ------------------
  |  Branch (1510:9): [True: 0, False: 0]
  |  Branch (1510:62): [True: 0, False: 0]
  ------------------
 1511|      0|	xmlNodePtr node = reader->node;
 1512|       |
 1513|      0|	if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1513:6): [True: 0, False: 0]
  ------------------
 1514|      0|            ((reader->state != XML_TEXTREADER_END) &&
  ------------------
  |  Branch (1514:14): [True: 0, False: 0]
  ------------------
 1515|      0|	     (reader->state != XML_TEXTREADER_BACKTRACK))) {
  ------------------
  |  Branch (1515:7): [True: 0, False: 0]
  ------------------
 1516|      0|	    if (xmlTextReaderValidatePush(reader) < 0)
  ------------------
  |  Branch (1516:10): [True: 0, False: 0]
  ------------------
 1517|      0|                return(-1);
 1518|      0|	} else if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1518:13): [True: 0, False: 0]
  ------------------
 1519|      0|		   (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1519:6): [True: 0, False: 0]
  ------------------
 1520|      0|            xmlTextReaderValidateCData(reader, node->content,
 1521|      0|	                               xmlStrlen(node->content));
 1522|      0|	}
 1523|      0|    }
 1524|      0|#endif /* LIBXML_REGEXP_ENABLED */
 1525|      0|#ifdef LIBXML_PATTERN_ENABLED
 1526|      0|    if ((reader->patternNr > 0) && (reader->state != XML_TEXTREADER_END) &&
  ------------------
  |  Branch (1526:9): [True: 0, False: 0]
  |  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|      0|#endif /* LIBXML_PATTERN_ENABLED */
 1537|      0|#ifdef LIBXML_SCHEMAS_ENABLED
 1538|      0|    if ((reader->validate == XML_TEXTREADER_VALIDATE_XSD) &&
  ------------------
  |  Branch (1538:9): [True: 0, False: 0]
  ------------------
 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|      0|#endif /* LIBXML_PATTERN_ENABLED */
 1544|      0|    return(1);
 1545|      0|node_end:
 1546|      0|    reader->state = XML_TEXTREADER_DONE;
 1547|      0|    return(0);
 1548|      0|}
xmlNewTextReader:
 1986|      1|xmlNewTextReader(xmlParserInputBuffer *input, const char *URI) {
 1987|      1|    xmlTextReaderPtr ret;
 1988|       |
 1989|      1|    if (input == NULL)
  ------------------
  |  Branch (1989:9): [True: 0, False: 1]
  ------------------
 1990|      0|	return(NULL);
 1991|      1|    ret = xmlMalloc(sizeof(xmlTextReader));
 1992|      1|    if (ret == NULL)
  ------------------
  |  Branch (1992:9): [True: 0, False: 1]
  ------------------
 1993|      0|	return(NULL);
 1994|      1|    memset(ret, 0, sizeof(xmlTextReader));
 1995|      1|    ret->doc = NULL;
 1996|      1|    ret->entTab = NULL;
 1997|      1|    ret->entMax = 0;
 1998|      1|    ret->entNr = 0;
 1999|      1|    ret->input = input;
 2000|      1|    ret->buffer = xmlBufCreate(50);
 2001|      1|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2001:9): [True: 0, False: 1]
  ------------------
 2002|      0|        xmlFree(ret);
 2003|      0|	return(NULL);
 2004|      0|    }
 2005|      1|    ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2006|      1|    if (ret->sax == NULL) {
  ------------------
  |  Branch (2006:9): [True: 0, False: 1]
  ------------------
 2007|      0|	xmlBufFree(ret->buffer);
 2008|      0|	xmlFree(ret);
 2009|      0|	return(NULL);
 2010|      0|    }
 2011|      1|    xmlSAXVersion(ret->sax, 2);
 2012|      1|    ret->startElement = ret->sax->startElement;
 2013|      1|    ret->sax->startElement = xmlTextReaderStartElement;
 2014|      1|    ret->endElement = ret->sax->endElement;
 2015|      1|    ret->sax->endElement = xmlTextReaderEndElement;
 2016|      1|#ifdef LIBXML_SAX1_ENABLED
 2017|      1|    if (ret->sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|      1|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2017:9): [True: 1, False: 0]
  ------------------
 2018|      1|#endif /* LIBXML_SAX1_ENABLED */
 2019|      1|	ret->startElementNs = ret->sax->startElementNs;
 2020|      1|	ret->sax->startElementNs = xmlTextReaderStartElementNs;
 2021|      1|	ret->endElementNs = ret->sax->endElementNs;
 2022|      1|	ret->sax->endElementNs = xmlTextReaderEndElementNs;
 2023|      1|#ifdef LIBXML_SAX1_ENABLED
 2024|      1|    } else {
 2025|      0|	ret->startElementNs = NULL;
 2026|      0|	ret->endElementNs = NULL;
 2027|      0|    }
 2028|      1|#endif /* LIBXML_SAX1_ENABLED */
 2029|      1|    ret->characters = ret->sax->characters;
 2030|      1|    ret->sax->characters = xmlTextReaderCharacters;
 2031|      1|    ret->sax->ignorableWhitespace = xmlTextReaderCharacters;
 2032|      1|    ret->cdataBlock = ret->sax->cdataBlock;
 2033|      1|    ret->sax->cdataBlock = xmlTextReaderCDataBlock;
 2034|       |
 2035|      1|    ret->mode = XML_TEXTREADER_MODE_INITIAL;
 2036|      1|    ret->node = NULL;
 2037|      1|    ret->curnode = NULL;
 2038|      1|    if (xmlBufUse(ret->input->buffer) < 4) {
  ------------------
  |  Branch (2038:9): [True: 1, False: 0]
  ------------------
 2039|      1|	xmlParserInputBufferRead(input, 4);
 2040|      1|    }
 2041|      1|    if (xmlBufUse(ret->input->buffer) >= 4) {
  ------------------
  |  Branch (2041:9): [True: 0, False: 1]
  ------------------
 2042|      0|	ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL,
 2043|      0|			     (const char *) xmlBufContent(ret->input->buffer),
 2044|      0|                                            4, URI);
 2045|      0|	ret->base = 0;
 2046|      0|	ret->cur = 4;
 2047|      1|    } else {
 2048|      1|	ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL, NULL, 0, URI);
 2049|      1|	ret->base = 0;
 2050|      1|	ret->cur = 0;
 2051|      1|    }
 2052|       |
 2053|      1|    if (ret->ctxt == NULL) {
  ------------------
  |  Branch (2053:9): [True: 1, False: 0]
  ------------------
 2054|      1|	xmlBufFree(ret->buffer);
 2055|      1|	xmlFree(ret->sax);
 2056|      1|	xmlFree(ret);
 2057|      1|	return(NULL);
 2058|      1|    }
 2059|      0|    ret->ctxt->parseMode = XML_PARSE_READER;
 2060|      0|    ret->ctxt->_private = ret;
 2061|      0|    ret->ctxt->dictNames = 1;
 2062|      0|    ret->allocs = XML_TEXTREADER_CTXT;
  ------------------
  |  |   78|      0|#define XML_TEXTREADER_CTXT	2
  ------------------
 2063|       |    /*
 2064|       |     * use the parser dictionary to allocate all elements and attributes names
 2065|       |     */
 2066|      0|    ret->dict = ret->ctxt->dict;
 2067|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 2068|      0|    ret->xinclude = 0;
 2069|      0|#endif
 2070|      0|#ifdef LIBXML_PATTERN_ENABLED
 2071|      0|    ret->patternMax = 0;
 2072|       |    ret->patternTab = NULL;
 2073|      0|#endif
 2074|      0|    return(ret);
 2075|      1|}
xmlFreeTextReader:
 2125|     36|xmlFreeTextReader(xmlTextReader *reader) {
 2126|     36|    if (reader == NULL)
  ------------------
  |  Branch (2126:9): [True: 0, False: 36]
  ------------------
 2127|      0|	return;
 2128|     36|#ifdef LIBXML_RELAXNG_ENABLED
 2129|     36|    if (reader->rngSchemas != NULL) {
  ------------------
  |  Branch (2129:9): [True: 0, False: 36]
  ------------------
 2130|      0|	xmlRelaxNGFree(reader->rngSchemas);
 2131|      0|	reader->rngSchemas = NULL;
 2132|      0|    }
 2133|     36|    if (reader->rngValidCtxt != NULL) {
  ------------------
  |  Branch (2133:9): [True: 0, False: 36]
  ------------------
 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|     36|#endif
 2139|     36|#ifdef LIBXML_SCHEMAS_ENABLED
 2140|     36|    if (reader->xsdPlug != NULL) {
  ------------------
  |  Branch (2140:9): [True: 0, False: 36]
  ------------------
 2141|      0|	xmlSchemaSAXUnplug(reader->xsdPlug);
 2142|      0|	reader->xsdPlug = NULL;
 2143|      0|    }
 2144|     36|    if (reader->xsdValidCtxt != NULL) {
  ------------------
  |  Branch (2144:9): [True: 0, False: 36]
  ------------------
 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|     36|    if (reader->xsdSchemas != NULL) {
  ------------------
  |  Branch (2149:9): [True: 0, False: 36]
  ------------------
 2150|      0|	xmlSchemaFree(reader->xsdSchemas);
 2151|      0|	reader->xsdSchemas = NULL;
 2152|      0|    }
 2153|     36|#endif
 2154|     36|#ifdef LIBXML_XINCLUDE_ENABLED
 2155|     36|    if (reader->xincctxt != NULL)
  ------------------
  |  Branch (2155:9): [True: 0, False: 36]
  ------------------
 2156|      0|	xmlXIncludeFreeContext(reader->xincctxt);
 2157|     36|#endif
 2158|     36|#ifdef LIBXML_PATTERN_ENABLED
 2159|     36|    if (reader->patternTab != NULL) {
  ------------------
  |  Branch (2159:9): [True: 0, False: 36]
  ------------------
 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|     36|#endif
 2168|     36|    if (reader->mode != XML_TEXTREADER_MODE_CLOSED)
  ------------------
  |  Branch (2168:9): [True: 36, False: 0]
  ------------------
 2169|     36|        xmlTextReaderClose(reader);
 2170|     36|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2170:9): [True: 0, False: 36]
  ------------------
 2171|      0|        if (reader->dict == reader->ctxt->dict)
  ------------------
  |  Branch (2171:13): [True: 0, False: 0]
  ------------------
 2172|      0|	    reader->dict = NULL;
 2173|      0|	if (reader->allocs & XML_TEXTREADER_CTXT)
  ------------------
  |  |   78|      0|#define XML_TEXTREADER_CTXT	2
  ------------------
  |  Branch (2173:6): [True: 0, False: 0]
  ------------------
 2174|      0|	    xmlFreeParserCtxt(reader->ctxt);
 2175|      0|    }
 2176|     36|    if (reader->sax != NULL)
  ------------------
  |  Branch (2176:9): [True: 0, False: 36]
  ------------------
 2177|      0|	xmlFree(reader->sax);
 2178|     36|    if (reader->buffer != NULL)
  ------------------
  |  Branch (2178:9): [True: 0, False: 36]
  ------------------
 2179|      0|        xmlBufFree(reader->buffer);
 2180|     36|    if (reader->entTab != NULL)
  ------------------
  |  Branch (2180:9): [True: 0, False: 36]
  ------------------
 2181|      0|	xmlFree(reader->entTab);
 2182|     36|    if (reader->dict != NULL)
  ------------------
  |  Branch (2182:9): [True: 36, False: 0]
  ------------------
 2183|     36|        xmlDictFree(reader->dict);
 2184|     36|    xmlFree(reader);
 2185|     36|}
xmlTextReaderClose:
 2201|     36|xmlTextReaderClose(xmlTextReader *reader) {
 2202|     36|    if (reader == NULL)
  ------------------
  |  Branch (2202:9): [True: 0, False: 36]
  ------------------
 2203|      0|	return(-1);
 2204|     36|    reader->node = NULL;
 2205|     36|    reader->curnode = NULL;
 2206|     36|    reader->mode = XML_TEXTREADER_MODE_CLOSED;
 2207|     36|    if (reader->faketext != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 36]
  ------------------
 2208|      0|        xmlFreeNode(reader->faketext);
 2209|      0|        reader->faketext = NULL;
 2210|      0|    }
 2211|     36|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2211:9): [True: 0, False: 36]
  ------------------
 2212|      0|#ifdef LIBXML_VALID_ENABLED
 2213|      0|	if ((reader->ctxt->vctxt.vstateTab != NULL) &&
  ------------------
  |  Branch (2213:6): [True: 0, False: 0]
  ------------------
 2214|      0|	    (reader->ctxt->vctxt.vstateMax > 0)){
  ------------------
  |  Branch (2214:6): [True: 0, False: 0]
  ------------------
 2215|      0|#ifdef LIBXML_REGEXP_ENABLED
 2216|      0|            while (reader->ctxt->vctxt.vstateNr > 0)
  ------------------
  |  Branch (2216:20): [True: 0, False: 0]
  ------------------
 2217|      0|                xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL);
 2218|      0|#endif /* LIBXML_REGEXP_ENABLED */
 2219|      0|	    xmlFree(reader->ctxt->vctxt.vstateTab);
 2220|      0|	    reader->ctxt->vctxt.vstateTab = NULL;
 2221|      0|	    reader->ctxt->vctxt.vstateMax = 0;
 2222|      0|	}
 2223|      0|#endif /* LIBXML_VALID_ENABLED */
 2224|      0|	xmlStopParser(reader->ctxt);
 2225|      0|	if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2225:6): [True: 0, False: 0]
  ------------------
 2226|      0|	    if (reader->preserve == 0)
  ------------------
  |  Branch (2226:10): [True: 0, False: 0]
  ------------------
 2227|      0|		xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
 2228|      0|	    reader->ctxt->myDoc = NULL;
 2229|      0|	}
 2230|      0|    }
 2231|     36|    if ((reader->input != NULL)  && (reader->allocs & XML_TEXTREADER_INPUT)) {
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (2231:9): [True: 0, False: 36]
  |  Branch (2231:37): [True: 0, False: 0]
  ------------------
 2232|      0|	xmlFreeParserInputBuffer(reader->input);
 2233|      0|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
 2234|      0|    }
 2235|     36|    return(0);
 2236|     36|}
xmlTextReaderNodeType:
 2927|     60|xmlTextReaderNodeType(xmlTextReader *reader) {
 2928|     60|    xmlNodePtr node;
 2929|       |
 2930|     60|    if (reader == NULL)
  ------------------
  |  Branch (2930:9): [True: 0, False: 60]
  ------------------
 2931|      0|	return(-1);
 2932|     60|    if (reader->node == NULL)
  ------------------
  |  Branch (2932:9): [True: 0, False: 60]
  ------------------
 2933|      0|	return(XML_READER_TYPE_NONE);
 2934|     60|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2934:9): [True: 0, False: 60]
  ------------------
 2935|      0|	node = reader->curnode;
 2936|     60|    else
 2937|     60|	node = reader->node;
 2938|     60|    switch (node->type) {
  ------------------
  |  Branch (2938:13): [True: 60, False: 0]
  ------------------
 2939|     40|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (2939:9): [True: 40, False: 20]
  ------------------
 2940|     40|	    if ((reader->state == XML_TEXTREADER_END) ||
  ------------------
  |  Branch (2940:10): [True: 0, False: 40]
  ------------------
 2941|     40|		(reader->state == XML_TEXTREADER_BACKTRACK))
  ------------------
  |  Branch (2941:3): [True: 20, False: 20]
  ------------------
 2942|     20|		return(XML_READER_TYPE_END_ELEMENT);
 2943|     20|	    return(XML_READER_TYPE_ELEMENT);
 2944|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (2944:9): [True: 0, False: 60]
  ------------------
 2945|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (2945:9): [True: 0, False: 60]
  ------------------
 2946|      0|	    return(XML_READER_TYPE_ATTRIBUTE);
 2947|     20|        case XML_TEXT_NODE:
  ------------------
  |  Branch (2947:9): [True: 20, False: 40]
  ------------------
 2948|     20|	    if (xmlIsBlankNode(reader->node)) {
  ------------------
  |  Branch (2948:10): [True: 0, False: 20]
  ------------------
 2949|      0|		if (xmlNodeGetSpacePreserve(reader->node))
  ------------------
  |  Branch (2949:7): [True: 0, False: 0]
  ------------------
 2950|      0|		    return(XML_READER_TYPE_SIGNIFICANT_WHITESPACE);
 2951|      0|		else
 2952|      0|		    return(XML_READER_TYPE_WHITESPACE);
 2953|     20|	    } else {
 2954|     20|		return(XML_READER_TYPE_TEXT);
 2955|     20|	    }
 2956|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (2956:9): [True: 0, False: 60]
  ------------------
 2957|      0|	    return(XML_READER_TYPE_CDATA);
 2958|      0|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (2958:9): [True: 0, False: 60]
  ------------------
 2959|      0|	    return(XML_READER_TYPE_ENTITY_REFERENCE);
 2960|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (2960:9): [True: 0, False: 60]
  ------------------
 2961|      0|	    return(XML_READER_TYPE_ENTITY);
 2962|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (2962:9): [True: 0, False: 60]
  ------------------
 2963|      0|	    return(XML_READER_TYPE_PROCESSING_INSTRUCTION);
 2964|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (2964:9): [True: 0, False: 60]
  ------------------
 2965|      0|	    return(XML_READER_TYPE_COMMENT);
 2966|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (2966:9): [True: 0, False: 60]
  ------------------
 2967|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (2967:9): [True: 0, False: 60]
  ------------------
 2968|      0|	    return(XML_READER_TYPE_DOCUMENT);
 2969|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (2969:9): [True: 0, False: 60]
  ------------------
 2970|      0|	    return(XML_READER_TYPE_DOCUMENT_FRAGMENT);
 2971|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (2971:9): [True: 0, False: 60]
  ------------------
 2972|      0|	    return(XML_READER_TYPE_NOTATION);
 2973|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (2973:9): [True: 0, False: 60]
  ------------------
 2974|      0|        case XML_DTD_NODE:
  ------------------
  |  Branch (2974:9): [True: 0, False: 60]
  ------------------
 2975|      0|	    return(XML_READER_TYPE_DOCUMENT_TYPE);
 2976|       |
 2977|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (2977:9): [True: 0, False: 60]
  ------------------
 2978|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (2978:9): [True: 0, False: 60]
  ------------------
 2979|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (2979:9): [True: 0, False: 60]
  ------------------
 2980|      0|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (2980:9): [True: 0, False: 60]
  ------------------
 2981|      0|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (2981:9): [True: 0, False: 60]
  ------------------
 2982|      0|	    return(XML_READER_TYPE_NONE);
 2983|     60|    }
 2984|      0|    return(-1);
 2985|     60|}
xmlTextReaderIsEmptyElement:
 2994|     60|xmlTextReaderIsEmptyElement(xmlTextReader *reader) {
 2995|     60|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (2995:9): [True: 0, False: 60]
  |  Branch (2995:29): [True: 0, False: 60]
  ------------------
 2996|      0|	return(-1);
 2997|     60|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2997:9): [True: 20, False: 40]
  ------------------
 2998|     20|	return(0);
 2999|     40|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2999:9): [True: 0, False: 40]
  ------------------
 3000|      0|	return(0);
 3001|     40|    if (reader->node->children != NULL)
  ------------------
  |  Branch (3001:9): [True: 40, False: 0]
  ------------------
 3002|     40|	return(0);
 3003|      0|    if (reader->state == XML_TEXTREADER_END)
  ------------------
  |  Branch (3003:9): [True: 0, False: 0]
  ------------------
 3004|      0|	return(0);
 3005|      0|    if (reader->doc != NULL)
  ------------------
  |  Branch (3005:9): [True: 0, False: 0]
  ------------------
 3006|      0|        return(1);
 3007|      0|#ifdef LIBXML_XINCLUDE_ENABLED
 3008|      0|    if (reader->in_xinclude > 0)
  ------------------
  |  Branch (3008:9): [True: 0, False: 0]
  ------------------
 3009|      0|        return(1);
 3010|      0|#endif
 3011|      0|    return((reader->node->extra & NODE_IS_EMPTY) != 0);
  ------------------
  |  |  169|      0|#define NODE_IS_EMPTY		0x1
  ------------------
 3012|      0|}
xmlTextReaderConstLocalName:
 3051|     13|xmlTextReaderConstLocalName(xmlTextReader *reader) {
 3052|     13|    xmlNodePtr node;
 3053|     13|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3053:9): [True: 0, False: 13]
  |  Branch (3053:29): [True: 0, False: 13]
  ------------------
 3054|      0|	return(NULL);
 3055|     13|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3055:9): [True: 0, False: 13]
  ------------------
 3056|      0|	node = reader->curnode;
 3057|     13|    else
 3058|     13|	node = reader->node;
 3059|     13|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3059:9): [True: 0, False: 13]
  ------------------
 3060|      0|	xmlNsPtr ns = (xmlNsPtr) node;
 3061|      0|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3061:6): [True: 0, False: 0]
  ------------------
 3062|      0|	    return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3063|      0|	else
 3064|      0|	    return(ns->prefix);
 3065|      0|    }
 3066|     13|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3066:9): [True: 0, False: 13]
  ------------------
 3067|      0|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3067:2): [True: 0, False: 0]
  ------------------
 3068|      0|	return(xmlTextReaderConstName(reader));
 3069|     13|    return(node->name);
 3070|     13|}
xmlTextReaderConstName:
 3151|     36|xmlTextReaderConstName(xmlTextReader *reader) {
 3152|     36|    xmlNodePtr node;
 3153|       |
 3154|     36|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3154:9): [True: 0, False: 36]
  |  Branch (3154:29): [True: 0, False: 36]
  ------------------
 3155|      0|	return(NULL);
 3156|     36|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3156:9): [True: 0, False: 36]
  ------------------
 3157|      0|	node = reader->curnode;
 3158|     36|    else
 3159|     36|	node = reader->node;
 3160|     36|    switch (node->type) {
  ------------------
  |  Branch (3160:13): [True: 36, False: 0]
  ------------------
 3161|     24|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3161:9): [True: 24, False: 12]
  ------------------
 3162|     24|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3162:9): [True: 0, False: 36]
  ------------------
 3163|     24|	    if ((node->ns == NULL) ||
  ------------------
  |  Branch (3163:10): [True: 24, False: 0]
  ------------------
 3164|      0|		(node->ns->prefix == NULL))
  ------------------
  |  Branch (3164:3): [True: 0, False: 0]
  ------------------
 3165|     24|		return(node->name);
 3166|      0|	    return(constQString(reader, node->ns->prefix, node->name));
 3167|     12|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3167:9): [True: 12, False: 24]
  ------------------
 3168|     12|	    return(constString(reader, BAD_CAST "#text"));
  ------------------
  |  |   34|     12|#define BAD_CAST (xmlChar *)
  ------------------
 3169|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3169:9): [True: 0, False: 36]
  ------------------
 3170|      0|	    return(constString(reader, BAD_CAST "#cdata-section"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3171|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (3171:9): [True: 0, False: 36]
  ------------------
 3172|      0|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3172:9): [True: 0, False: 36]
  ------------------
 3173|      0|	    return(constString(reader, node->name));
 3174|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (3174:9): [True: 0, False: 36]
  ------------------
 3175|      0|	    return(constString(reader, node->name));
 3176|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3176:9): [True: 0, False: 36]
  ------------------
 3177|      0|	    return(constString(reader, BAD_CAST "#comment"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3178|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3178:9): [True: 0, False: 36]
  ------------------
 3179|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3179:9): [True: 0, False: 36]
  ------------------
 3180|      0|	    return(constString(reader, BAD_CAST "#document"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3181|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3181:9): [True: 0, False: 36]
  ------------------
 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: 36]
  ------------------
 3184|      0|	    return(constString(reader, node->name));
 3185|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (3185:9): [True: 0, False: 36]
  ------------------
 3186|      0|        case XML_DTD_NODE:
  ------------------
  |  Branch (3186:9): [True: 0, False: 36]
  ------------------
 3187|      0|	    return(constString(reader, node->name));
 3188|      0|        case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (3188:9): [True: 0, False: 36]
  ------------------
 3189|      0|	    xmlNsPtr ns = (xmlNsPtr) node;
 3190|       |
 3191|      0|	    if (ns->prefix == NULL)
  ------------------
  |  Branch (3191:10): [True: 0, False: 0]
  ------------------
 3192|      0|		return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3193|      0|	    return(constQString(reader, BAD_CAST "xmlns", ns->prefix));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3194|      0|	}
 3195|       |
 3196|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (3196:9): [True: 0, False: 36]
  ------------------
 3197|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (3197:9): [True: 0, False: 36]
  ------------------
 3198|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (3198:9): [True: 0, False: 36]
  ------------------
 3199|      0|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3199:9): [True: 0, False: 36]
  ------------------
 3200|      0|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3200:9): [True: 0, False: 36]
  ------------------
 3201|      0|	    return(NULL);
 3202|     36|    }
 3203|      0|    return(NULL);
 3204|     36|}
xmlTextReaderConstNamespaceUri:
 3300|     13|xmlTextReaderConstNamespaceUri(xmlTextReader *reader) {
 3301|     13|    xmlNodePtr node;
 3302|     13|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3302:9): [True: 0, False: 13]
  |  Branch (3302:29): [True: 0, False: 13]
  ------------------
 3303|      0|	return(NULL);
 3304|     13|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3304:9): [True: 0, False: 13]
  ------------------
 3305|      0|	node = reader->curnode;
 3306|     13|    else
 3307|     13|	node = reader->node;
 3308|     13|    if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3308:9): [True: 0, False: 13]
  ------------------
 3309|      0|	return(constString(reader, BAD_CAST "http://www.w3.org/2000/xmlns/"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3310|     13|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3310:9): [True: 0, False: 13]
  ------------------
 3311|      0|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3311:2): [True: 0, False: 0]
  ------------------
 3312|      0|	return(NULL);
 3313|     13|    if (node->ns != NULL)
  ------------------
  |  Branch (3313:9): [True: 0, False: 13]
  ------------------
 3314|      0|	return(constString(reader, node->ns->href));
 3315|     13|    return(NULL);
 3316|     13|}
xmlTextReaderDepth:
 3371|     36|xmlTextReaderDepth(xmlTextReader *reader) {
 3372|     36|    if (reader == NULL)
  ------------------
  |  Branch (3372:9): [True: 0, False: 36]
  ------------------
 3373|      0|	return(-1);
 3374|     36|    if (reader->node == NULL)
  ------------------
  |  Branch (3374:9): [True: 0, False: 36]
  ------------------
 3375|      0|	return(0);
 3376|       |
 3377|     36|    if (reader->curnode != NULL) {
  ------------------
  |  Branch (3377:9): [True: 0, False: 36]
  ------------------
 3378|      0|	if ((reader->curnode->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (3378:6): [True: 0, False: 0]
  ------------------
 3379|      0|	    (reader->curnode->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3379:6): [True: 0, False: 0]
  ------------------
 3380|      0|	    return(reader->depth + 1);
 3381|      0|	return(reader->depth + 2);
 3382|      0|    }
 3383|     36|    return(reader->depth);
 3384|     36|}
xmlTextReaderHasValue:
 3418|     36|xmlTextReaderHasValue(xmlTextReader *reader) {
 3419|     36|    xmlNodePtr node;
 3420|     36|    if (reader == NULL)
  ------------------
  |  Branch (3420:9): [True: 0, False: 36]
  ------------------
 3421|      0|	return(-1);
 3422|     36|    if (reader->node == NULL)
  ------------------
  |  Branch (3422:9): [True: 0, False: 36]
  ------------------
 3423|      0|	return(0);
 3424|     36|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3424:9): [True: 0, False: 36]
  ------------------
 3425|      0|	node = reader->curnode;
 3426|     36|    else
 3427|     36|	node = reader->node;
 3428|       |
 3429|     36|    switch (node->type) {
 3430|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3430:9): [True: 0, False: 36]
  ------------------
 3431|     12|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3431:9): [True: 12, False: 24]
  ------------------
 3432|     12|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3432:9): [True: 0, False: 36]
  ------------------
 3433|     12|        case XML_PI_NODE:
  ------------------
  |  Branch (3433:9): [True: 0, False: 36]
  ------------------
 3434|     12|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3434:9): [True: 0, False: 36]
  ------------------
 3435|     12|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3435:9): [True: 0, False: 36]
  ------------------
 3436|     12|	    return(1);
 3437|     24|	default:
  ------------------
  |  Branch (3437:2): [True: 24, False: 12]
  ------------------
 3438|     24|	    break;
 3439|     36|    }
 3440|     24|    return(0);
 3441|     36|}
xmlTextReaderConstValue:
 3498|     36|xmlTextReaderConstValue(xmlTextReader *reader) {
 3499|     36|    xmlNodePtr node;
 3500|     36|    if (reader == NULL)
  ------------------
  |  Branch (3500:9): [True: 0, False: 36]
  ------------------
 3501|      0|	return(NULL);
 3502|     36|    if (reader->node == NULL)
  ------------------
  |  Branch (3502:9): [True: 0, False: 36]
  ------------------
 3503|      0|	return(NULL);
 3504|     36|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3504:9): [True: 0, False: 36]
  ------------------
 3505|      0|	node = reader->curnode;
 3506|     36|    else
 3507|     36|	node = reader->node;
 3508|       |
 3509|     36|    switch (node->type) {
 3510|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3510:9): [True: 0, False: 36]
  ------------------
 3511|      0|	    return(((xmlNsPtr) node)->href);
 3512|      0|        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (3512:9): [True: 0, False: 36]
  ------------------
 3513|      0|	    xmlAttrPtr attr = (xmlAttrPtr) node;
 3514|      0|	    const xmlChar *ret;
 3515|       |
 3516|      0|	    if ((attr->children != NULL) &&
  ------------------
  |  Branch (3516:10): [True: 0, False: 0]
  ------------------
 3517|      0|	        (attr->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (3517:10): [True: 0, False: 0]
  ------------------
 3518|      0|		(attr->children->next == NULL))
  ------------------
  |  Branch (3518:3): [True: 0, False: 0]
  ------------------
 3519|      0|		return(attr->children->content);
 3520|      0|	    else {
 3521|      0|		if (reader->buffer == NULL) {
  ------------------
  |  Branch (3521:7): [True: 0, False: 0]
  ------------------
 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|      0|                    xmlBufEmpty(reader->buffer);
 3527|      0|	        xmlBufGetNodeContent(reader->buffer, node);
 3528|      0|		ret = xmlBufContent(reader->buffer);
 3529|      0|		if (ret == NULL) {
  ------------------
  |  Branch (3529:7): [True: 0, False: 0]
  ------------------
 3530|      0|                    xmlTextReaderErrMemory(reader);
 3531|       |		    /* error on the buffer best to reallocate */
 3532|      0|		    xmlBufFree(reader->buffer);
 3533|      0|		    reader->buffer = xmlBufCreate(50);
 3534|      0|		}
 3535|      0|		return(ret);
 3536|      0|	    }
 3537|      0|	    break;
 3538|      0|	}
 3539|     12|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3539:9): [True: 12, False: 24]
  ------------------
 3540|     12|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3540:9): [True: 0, False: 36]
  ------------------
 3541|     12|        case XML_PI_NODE:
  ------------------
  |  Branch (3541:9): [True: 0, False: 36]
  ------------------
 3542|     12|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3542:9): [True: 0, False: 36]
  ------------------
 3543|     12|	    return(node->content);
 3544|     24|	default:
  ------------------
  |  Branch (3544:2): [True: 24, False: 12]
  ------------------
 3545|     24|	    break;
 3546|     36|    }
 3547|     24|    return(NULL);
 3548|     36|}
xmlTextReaderCurrentNode:
 3796|     18|xmlTextReaderCurrentNode(xmlTextReader *reader) {
 3797|     18|    if (reader == NULL)
  ------------------
  |  Branch (3797:9): [True: 0, False: 18]
  ------------------
 3798|      0|	return(NULL);
 3799|       |
 3800|     18|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3800:9): [True: 0, False: 18]
  ------------------
 3801|      0|	return(reader->curnode);
 3802|     18|    return(reader->node);
 3803|     18|}
xmlReaderWalker:
 4959|     36|{
 4960|     36|    xmlTextReaderPtr ret;
 4961|       |
 4962|     36|    if (doc == NULL)
  ------------------
  |  Branch (4962:9): [True: 0, False: 36]
  ------------------
 4963|      0|        return(NULL);
 4964|       |
 4965|     36|    ret = xmlMalloc(sizeof(xmlTextReader));
 4966|     36|    if (ret == NULL) {
  ------------------
  |  Branch (4966:9): [True: 0, False: 36]
  ------------------
 4967|      0|	return(NULL);
 4968|      0|    }
 4969|     36|    memset(ret, 0, sizeof(xmlTextReader));
 4970|     36|    ret->entNr = 0;
 4971|     36|    ret->input = NULL;
 4972|     36|    ret->mode = XML_TEXTREADER_MODE_INITIAL;
 4973|     36|    ret->node = NULL;
 4974|     36|    ret->curnode = NULL;
 4975|     36|    ret->base = 0;
 4976|     36|    ret->cur = 0;
 4977|     36|    ret->allocs = XML_TEXTREADER_CTXT;
  ------------------
  |  |   78|     36|#define XML_TEXTREADER_CTXT	2
  ------------------
 4978|     36|    ret->doc = doc;
 4979|     36|    ret->state = XML_TEXTREADER_START;
 4980|     36|    ret->dict = xmlDictCreate();
 4981|     36|    return(ret);
 4982|     36|}
xmlReaderForIO:
 5135|      1|{
 5136|      1|    xmlTextReaderPtr reader;
 5137|      1|    xmlParserInputBufferPtr input;
 5138|       |
 5139|      1|    if (ioread == NULL)
  ------------------
  |  Branch (5139:9): [True: 0, False: 1]
  ------------------
 5140|      0|        return (NULL);
 5141|       |
 5142|      1|    input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx,
 5143|      1|                                         XML_CHAR_ENCODING_NONE);
 5144|      1|    if (input == NULL) {
  ------------------
  |  Branch (5144:9): [True: 0, False: 1]
  ------------------
 5145|      0|        if (ioclose != NULL)
  ------------------
  |  Branch (5145:13): [True: 0, False: 0]
  ------------------
 5146|      0|            ioclose(ioctx);
 5147|      0|        return (NULL);
 5148|      0|    }
 5149|      1|    reader = xmlNewTextReader(input, URL);
 5150|      1|    if (reader == NULL) {
  ------------------
  |  Branch (5150:9): [True: 1, False: 0]
  ------------------
 5151|      1|        xmlFreeParserInputBuffer(input);
 5152|      1|        return (NULL);
 5153|      1|    }
 5154|      0|    reader->allocs |= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
 5155|      0|    if (xmlTextReaderSetup(reader, NULL, URL, encoding, options) < 0) {
  ------------------
  |  Branch (5155:9): [True: 0, False: 0]
  ------------------
 5156|      0|        xmlFreeTextReader(reader);
 5157|      0|        return (NULL);
 5158|      0|    }
 5159|      0|    return (reader);
 5160|      0|}
xmlreader.c:xmlTextReaderReadTree:
 1878|    144|xmlTextReaderReadTree(xmlTextReaderPtr reader) {
 1879|    144|    if (reader->state == XML_TEXTREADER_END)
  ------------------
  |  Branch (1879:9): [True: 0, False: 144]
  ------------------
 1880|      0|        return(0);
 1881|       |
 1882|    144|next_node:
 1883|    144|    if (reader->node == NULL) {
  ------------------
  |  Branch (1883:9): [True: 36, False: 108]
  ------------------
 1884|     36|        if (reader->doc->children == NULL) {
  ------------------
  |  Branch (1884:13): [True: 0, False: 36]
  ------------------
 1885|      0|            reader->state = XML_TEXTREADER_END;
 1886|      0|            return(0);
 1887|      0|        }
 1888|       |
 1889|     36|        reader->node = reader->doc->children;
 1890|     36|        reader->state = XML_TEXTREADER_START;
 1891|     36|        goto found_node;
 1892|     36|    }
 1893|       |
 1894|    108|    if ((reader->state != XML_TEXTREADER_BACKTRACK) &&
  ------------------
  |  Branch (1894:9): [True: 72, False: 36]
  ------------------
 1895|     72|        (reader->node->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (1895:9): [True: 72, False: 0]
  ------------------
 1896|     72|        (reader->node->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1896:9): [True: 72, False: 0]
  ------------------
 1897|     72|	(reader->node->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (1897:2): [True: 72, False: 0]
  ------------------
 1898|     72|        if (reader->node->children != NULL) {
  ------------------
  |  Branch (1898:13): [True: 36, False: 36]
  ------------------
 1899|     36|            reader->node = reader->node->children;
 1900|     36|            reader->depth++;
 1901|     36|            reader->state = XML_TEXTREADER_START;
 1902|     36|            goto found_node;
 1903|     36|        }
 1904|       |
 1905|     36|        if (reader->node->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (1905:13): [True: 0, False: 36]
  ------------------
 1906|      0|            reader->state = XML_TEXTREADER_BACKTRACK;
 1907|      0|            goto found_node;
 1908|      0|        }
 1909|     36|    }
 1910|       |
 1911|     72|    if (reader->node->next != NULL) {
  ------------------
  |  Branch (1911:9): [True: 0, False: 72]
  ------------------
 1912|      0|        reader->node = reader->node->next;
 1913|      0|        reader->state = XML_TEXTREADER_START;
 1914|      0|        goto found_node;
 1915|      0|    }
 1916|       |
 1917|     72|    if (reader->node->parent != NULL) {
  ------------------
  |  Branch (1917:9): [True: 72, False: 0]
  ------------------
 1918|     72|        if ((reader->node->parent->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1918:13): [True: 36, False: 36]
  ------------------
 1919|     36|	    (reader->node->parent->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (1919:6): [True: 0, False: 36]
  ------------------
 1920|     36|            reader->state = XML_TEXTREADER_END;
 1921|     36|            return(0);
 1922|     36|        }
 1923|       |
 1924|     36|        reader->node = reader->node->parent;
 1925|     36|        reader->depth--;
 1926|     36|        reader->state = XML_TEXTREADER_BACKTRACK;
 1927|     36|        goto found_node;
 1928|     72|    }
 1929|       |
 1930|      0|    reader->state = XML_TEXTREADER_END;
 1931|       |
 1932|    108|found_node:
 1933|    108|    if ((reader->node->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (1933:9): [True: 0, False: 108]
  ------------------
 1934|    108|        (reader->node->type == XML_XINCLUDE_END))
  ------------------
  |  Branch (1934:9): [True: 0, False: 108]
  ------------------
 1935|      0|	goto next_node;
 1936|       |
 1937|    108|    return(1);
 1938|    108|}
xmlreader.c:constString:
  236|     12|constString(xmlTextReaderPtr reader, const xmlChar *string) {
  237|     12|    const xmlChar *dictString;
  238|       |
  239|     12|    if (string == NULL)
  ------------------
  |  Branch (239:9): [True: 0, False: 12]
  ------------------
  240|      0|        return(NULL);
  241|       |
  242|     12|    dictString = xmlDictLookup(reader->dict, string, -1);
  243|     12|    if (dictString == NULL)
  ------------------
  |  Branch (243:9): [True: 0, False: 12]
  ------------------
  244|      0|        xmlTextReaderErrMemory(reader);
  245|       |
  246|     12|    return(dictString);
  247|     12|}

xmlSaveSetIndentString:
  126|      1|xmlSaveSetIndentString(xmlSaveCtxt *ctxt, const char *indent) {
  127|      1|    size_t len;
  128|      1|    int i;
  129|       |
  130|      1|    if ((ctxt == NULL) || (indent == NULL))
  ------------------
  |  Branch (130:9): [True: 0, False: 1]
  |  Branch (130:27): [True: 0, False: 1]
  ------------------
  131|      0|        return(-1);
  132|       |
  133|      1|    len = strlen(indent);
  134|      1|    if ((len <= 0) || (len > MAX_INDENT))
  ------------------
  |  |   20|      1|#define MAX_INDENT 60
  ------------------
  |  Branch (134:9): [True: 0, False: 1]
  |  Branch (134:23): [True: 0, False: 1]
  ------------------
  135|      0|        return(-1);
  136|       |
  137|      1|    ctxt->indent_size = len;
  138|      1|    ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
  ------------------
  |  |   20|      1|#define MAX_INDENT 60
  ------------------
  139|     31|    for (i = 0; i < ctxt->indent_nr; i++)
  ------------------
  |  Branch (139:17): [True: 30, False: 1]
  ------------------
  140|     30|        memcpy(&ctxt->indent[i * ctxt->indent_size], indent, len);
  141|       |
  142|      1|    return(0);
  143|      1|}
xmlSaveToFd:
 1832|     34|{
 1833|     34|    xmlSaveCtxtPtr ret;
 1834|       |
 1835|     34|    ret = xmlNewSaveCtxt(encoding, options);
 1836|     34|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (1836:9): [True: 33, False: 1]
  ------------------
 1837|      1|    ret->buf = xmlOutputBufferCreateFd(fd, ret->handler);
 1838|      1|    if (ret->buf == NULL) {
  ------------------
  |  Branch (1838:9): [True: 0, False: 1]
  ------------------
 1839|      0|        xmlCharEncCloseFunc(ret->handler);
 1840|      0|	xmlFreeSaveCtxt(ret);
 1841|      0|	return(NULL);
 1842|      0|    }
 1843|      1|    return(ret);
 1844|      1|}
xmlSaveDoc:
 1959|      1|{
 1960|      1|    long ret = 0;
 1961|       |
 1962|      1|    if ((ctxt == NULL) || (doc == NULL)) return(-1);
  ------------------
  |  Branch (1962:9): [True: 0, False: 1]
  |  Branch (1962:27): [True: 0, False: 1]
  ------------------
 1963|      1|    if (xmlSaveDocInternal(ctxt, doc, ctxt->encoding) < 0)
  ------------------
  |  Branch (1963:9): [True: 0, False: 1]
  ------------------
 1964|      0|        return(-1);
 1965|      1|    return(ret);
 1966|      1|}
xmlSaveFlush:
 2039|      1|{
 2040|      1|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2040:9): [True: 0, False: 1]
  ------------------
 2041|      1|    if (ctxt->buf == NULL) return(-1);
  ------------------
  |  Branch (2041:9): [True: 0, False: 1]
  ------------------
 2042|      1|    return(xmlOutputBufferFlush(ctxt->buf));
 2043|      1|}
xmlSaveClose:
 2054|      1|{
 2055|      1|    int ret;
 2056|       |
 2057|      1|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2057:9): [True: 0, False: 1]
  ------------------
 2058|      1|    ret = xmlSaveFlush(ctxt);
 2059|      1|    xmlFreeSaveCtxt(ctxt);
 2060|      1|    return(ret);
 2061|      1|}
xmlsave.c:xmlNewSaveCtxt:
  191|     34|{
  192|     34|    xmlSaveCtxtPtr ret;
  193|       |
  194|     34|    ret = (xmlSaveCtxtPtr) xmlMalloc(sizeof(xmlSaveCtxt));
  195|     34|    if (ret == NULL) {
  ------------------
  |  Branch (195:9): [True: 0, False: 34]
  ------------------
  196|      0|	xmlSaveErrMemory(NULL);
  197|      0|	return ( NULL );
  198|      0|    }
  199|     34|    memset(ret, 0, sizeof(xmlSaveCtxt));
  200|       |
  201|     34|    if (encoding != NULL) {
  ------------------
  |  Branch (201:9): [True: 33, False: 1]
  ------------------
  202|     33|        xmlParserErrors res;
  203|       |
  204|     33|        res = xmlOpenCharEncodingHandler(encoding, /* output */ 1,
  205|     33|                                         &ret->handler);
  206|     33|	if (res != XML_ERR_OK) {
  ------------------
  |  Branch (206:6): [True: 33, False: 0]
  ------------------
  207|     33|	    xmlSaveErr(NULL, res, NULL, encoding);
  208|     33|            xmlFreeSaveCtxt(ret);
  209|     33|	    return(NULL);
  210|     33|	}
  211|      0|        ret->encoding = xmlStrdup((const xmlChar *)encoding);
  212|      0|    }
  213|       |
  214|      1|    xmlSaveCtxtInit(ret, options);
  215|       |
  216|      1|    return(ret);
  217|     34|}
xmlsave.c:xmlSaveErr:
   77|     33|{
   78|     33|    const char *msg = NULL;
   79|     33|    int res;
   80|       |
   81|       |    /* Don't overwrite catastrophic errors */
   82|     33|    if ((out != NULL) &&
  ------------------
  |  Branch (82:9): [True: 0, False: 33]
  ------------------
   83|      0|        (out->error != XML_ERR_OK) &&
  ------------------
  |  Branch (83:9): [True: 0, False: 0]
  ------------------
   84|      0|        (xmlIsCatastrophicError(XML_ERR_FATAL, out->error)))
  ------------------
  |  Branch (84:9): [True: 0, False: 0]
  ------------------
   85|      0|        return;
   86|       |
   87|     33|    if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (87:9): [True: 8, False: 25]
  ------------------
   88|      8|        xmlSaveErrMemory(out);
   89|      8|        return;
   90|      8|    }
   91|       |
   92|     25|    if (out != NULL)
  ------------------
  |  Branch (92:9): [True: 0, False: 25]
  ------------------
   93|      0|        out->error = code;
   94|       |
   95|     25|    if (code == XML_ERR_UNSUPPORTED_ENCODING) {
  ------------------
  |  Branch (95:9): [True: 25, False: 0]
  ------------------
   96|     25|        msg = "Unsupported encoding: %s";
   97|     25|    } else {
   98|      0|        msg = xmlErrString(code);
   99|      0|        extra = NULL;
  100|      0|    }
  101|       |
  102|     25|    res = xmlRaiseError(NULL, NULL, NULL, NULL, node,
  103|     25|                        XML_FROM_OUTPUT, code, XML_ERR_ERROR, NULL, 0,
  104|     25|                        extra, NULL, NULL, 0, 0,
  105|     25|                        msg, extra);
  106|     25|    if (res < 0)
  ------------------
  |  Branch (106:9): [True: 0, False: 25]
  ------------------
  107|      0|        xmlSaveErrMemory(out);
  108|     25|}
xmlsave.c:xmlFreeSaveCtxt:
  175|     34|{
  176|     34|    if (ctxt == NULL) return;
  ------------------
  |  Branch (176:9): [True: 0, False: 34]
  ------------------
  177|     34|    if (ctxt->encoding != NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 34]
  ------------------
  178|      0|        xmlFree((char *) ctxt->encoding);
  179|     34|    if (ctxt->buf != NULL)
  ------------------
  |  Branch (179:9): [True: 1, False: 33]
  ------------------
  180|      1|        xmlOutputBufferClose(ctxt->buf);
  181|     34|    xmlFree(ctxt);
  182|     34|}
xmlsave.c:xmlSaveDocInternal:
 1226|      1|                   const xmlChar *encoding) {
 1227|      1|#ifdef LIBXML_HTML_ENABLED
 1228|      1|    xmlDtdPtr dtd;
 1229|      1|    int is_xhtml = 0;
 1230|      1|#endif
 1231|      1|    xmlOutputBufferPtr buf = ctxt->buf;
 1232|      1|    int switched_encoding = 0;
 1233|       |
 1234|      1|    xmlInitParser();
 1235|       |
 1236|      1|    if ((cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1236:9): [True: 1, False: 0]
  ------------------
 1237|      1|        (cur->type != XML_DOCUMENT_NODE))
  ------------------
  |  Branch (1237:9): [True: 0, False: 1]
  ------------------
 1238|      0|	 return(-1);
 1239|       |
 1240|      1|    if (encoding == NULL)
  ------------------
  |  Branch (1240:9): [True: 1, False: 0]
  ------------------
 1241|      1|	encoding = cur->encoding;
 1242|       |
 1243|      1|    if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1243:10): [True: 0, False: 1]
  ------------------
 1244|      0|         ((ctxt->options & XML_SAVE_AS_XML) == 0) &&
  ------------------
  |  Branch (1244:10): [True: 0, False: 0]
  ------------------
 1245|      0|         ((ctxt->options & XML_SAVE_XHTML) == 0)) ||
  ------------------
  |  Branch (1245:10): [True: 0, False: 0]
  ------------------
 1246|      1|        (ctxt->options & XML_SAVE_AS_HTML)) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 1]
  ------------------
 1247|      0|#ifdef LIBXML_HTML_ENABLED
 1248|      0|        int format = 0;
 1249|       |
 1250|      0|	if (ctxt->encoding == NULL) {
  ------------------
  |  Branch (1250:6): [True: 0, False: 0]
  ------------------
 1251|      0|            if (encoding == NULL)
  ------------------
  |  Branch (1251:17): [True: 0, False: 0]
  ------------------
 1252|      0|                encoding = BAD_CAST "HTML";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1253|       |
 1254|      0|	    if (xmlSaveSwitchEncoding(ctxt, (const char*) encoding) < 0) {
  ------------------
  |  Branch (1254:10): [True: 0, False: 0]
  ------------------
 1255|      0|		return(-1);
 1256|      0|	    }
 1257|      0|            switched_encoding = 1;
 1258|      0|	}
 1259|       |
 1260|      0|        if (ctxt->options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (1260:13): [True: 0, False: 0]
  ------------------
 1261|      0|            format = 1;
 1262|      0|        htmlNodeDumpInternal(buf, (htmlNodePtr) cur, (char *) ctxt->encoding,
 1263|      0|                             format);
 1264|       |#else
 1265|       |        return(-1);
 1266|       |#endif
 1267|      1|    } else if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1267:16): [True: 1, False: 0]
  ------------------
 1268|      0|               (ctxt->options & XML_SAVE_AS_XML) ||
  ------------------
  |  Branch (1268:16): [True: 0, False: 0]
  ------------------
 1269|      1|               (ctxt->options & XML_SAVE_XHTML)) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|      1|	if ((encoding != NULL) && (ctxt->encoding == NULL)) {
  ------------------
  |  Branch (1270:6): [True: 0, False: 1]
  |  Branch (1270:28): [True: 0, False: 0]
  ------------------
 1271|      0|            if (xmlSaveSwitchEncoding(ctxt, (const char *) encoding) < 0)
  ------------------
  |  Branch (1271:17): [True: 0, False: 0]
  ------------------
 1272|      0|                return(-1);
 1273|      0|            switched_encoding = 1;
 1274|      0|	}
 1275|       |
 1276|       |	/*
 1277|       |	 * Save the XML declaration
 1278|       |	 */
 1279|      1|	if ((ctxt->options & XML_SAVE_NO_DECL) == 0) {
  ------------------
  |  Branch (1279:6): [True: 1, False: 0]
  ------------------
 1280|      1|	    xmlOutputBufferWrite(buf, 15, "<?xml version=\"");
 1281|      1|	    if (cur->version != NULL)
  ------------------
  |  Branch (1281:10): [True: 1, False: 0]
  ------------------
 1282|      1|		xmlOutputBufferWriteString(buf, (char *) cur->version);
 1283|      0|	    else
 1284|      0|		xmlOutputBufferWrite(buf, 3, "1.0");
 1285|      1|	    xmlOutputBufferWrite(buf, 1, "\"");
 1286|      1|	    if (encoding != NULL) {
  ------------------
  |  Branch (1286:10): [True: 0, False: 1]
  ------------------
 1287|      0|		xmlOutputBufferWrite(buf, 11, " encoding=\"");
 1288|      0|		xmlOutputBufferWriteString(buf, (char *) encoding);
 1289|      0|	        xmlOutputBufferWrite(buf, 1, "\"");
 1290|      0|	    }
 1291|      1|	    switch (cur->standalone) {
  ------------------
  |  Branch (1291:14): [True: 0, False: 1]
  ------------------
 1292|      0|		case 0:
  ------------------
  |  Branch (1292:3): [True: 0, False: 1]
  ------------------
 1293|      0|		    xmlOutputBufferWrite(buf, 16, " standalone=\"no\"");
 1294|      0|		    break;
 1295|      0|		case 1:
  ------------------
  |  Branch (1295:3): [True: 0, False: 1]
  ------------------
 1296|      0|		    xmlOutputBufferWrite(buf, 17, " standalone=\"yes\"");
 1297|      0|		    break;
 1298|      1|	    }
 1299|      1|	    xmlOutputBufferWrite(buf, 3, "?>\n");
 1300|      1|	}
 1301|       |
 1302|      1|#ifdef LIBXML_HTML_ENABLED
 1303|      1|        if (ctxt->options & XML_SAVE_XHTML)
  ------------------
  |  Branch (1303:13): [True: 0, False: 1]
  ------------------
 1304|      0|            is_xhtml = 1;
 1305|      1|	if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) {
  ------------------
  |  Branch (1305:6): [True: 1, False: 0]
  ------------------
 1306|      1|	    dtd = xmlGetIntSubset(cur);
 1307|      1|	    if (dtd != NULL) {
  ------------------
  |  Branch (1307:10): [True: 0, False: 1]
  ------------------
 1308|      0|		is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 1309|      0|		if (is_xhtml < 0) is_xhtml = 0;
  ------------------
  |  Branch (1309:7): [True: 0, False: 0]
  ------------------
 1310|      0|	    }
 1311|      1|	}
 1312|      1|#endif
 1313|      1|	if (cur->children != NULL) {
  ------------------
  |  Branch (1313:6): [True: 1, False: 0]
  ------------------
 1314|      1|	    xmlNodePtr child = cur->children;
 1315|       |
 1316|      2|	    while (child != NULL) {
  ------------------
  |  Branch (1316:13): [True: 1, False: 1]
  ------------------
 1317|      1|		ctxt->level = 0;
 1318|      1|#ifdef LIBXML_HTML_ENABLED
 1319|      1|		if (is_xhtml)
  ------------------
  |  Branch (1319:7): [True: 0, False: 1]
  ------------------
 1320|      0|		    xhtmlNodeDumpOutput(ctxt, child);
 1321|      1|		else
 1322|      1|#endif
 1323|      1|		    xmlNodeDumpOutputInternal(ctxt, child);
 1324|      1|                if ((child->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1324:21): [True: 1, False: 0]
  ------------------
 1325|      1|                    (child->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1325:21): [True: 1, False: 0]
  ------------------
 1326|      1|                    xmlOutputBufferWrite(buf, 1, "\n");
 1327|      1|		child = child->next;
 1328|      1|	    }
 1329|      1|	}
 1330|      1|    }
 1331|       |
 1332|       |    /*
 1333|       |     * Restore the state of the saving context at the end of the document
 1334|       |     */
 1335|      1|    if (switched_encoding) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 1]
  ------------------
 1336|      0|	xmlSaveClearEncoding(ctxt);
 1337|      0|    }
 1338|       |
 1339|      1|    return(0);
 1340|      1|}
xmlsave.c:xmlSaveWriteText:
  226|      1|xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
  227|      1|    if (ctxt->encoding == NULL)
  ------------------
  |  Branch (227:9): [True: 1, False: 0]
  ------------------
  228|      1|        flags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      1|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  229|       |
  230|       |    xmlSerializeText(ctxt->buf, text, SIZE_MAX, flags);
  231|      1|}
xmlsave.c:xmlNodeDumpOutputInternal:
  961|      1|xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  962|      1|    int format = ctxt->format;
  963|      1|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
  964|      1|    xmlAttrPtr attr;
  965|      1|    xmlChar *start, *end;
  966|      1|    xmlOutputBufferPtr buf;
  967|       |
  968|      1|    if (cur == NULL) return;
  ------------------
  |  Branch (968:9): [True: 0, False: 1]
  ------------------
  969|      1|    buf = ctxt->buf;
  970|       |
  971|      1|    root = cur;
  972|      1|    parent = cur->parent;
  973|      2|    while (1) {
  ------------------
  |  Branch (973:12): [True: 2, Folded]
  ------------------
  974|      2|        switch (cur->type) {
  975|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (975:9): [True: 0, False: 2]
  ------------------
  976|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (976:9): [True: 0, False: 2]
  ------------------
  977|      0|	    xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
  978|      0|	    break;
  979|       |
  980|      0|        case XML_DTD_NODE:
  ------------------
  |  Branch (980:9): [True: 0, False: 2]
  ------------------
  981|      0|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
  982|      0|            break;
  983|       |
  984|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (984:9): [True: 0, False: 2]
  ------------------
  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|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (993:9): [True: 0, False: 2]
  ------------------
  994|      0|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
  995|      0|            break;
  996|       |
  997|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (997:9): [True: 0, False: 2]
  ------------------
  998|      0|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
  999|      0|            break;
 1000|       |
 1001|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1001:9): [True: 0, False: 2]
  ------------------
 1002|      0|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1003|      0|            break;
 1004|       |
 1005|      1|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1005:9): [True: 1, False: 1]
  ------------------
 1006|      1|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1006:10): [True: 0, False: 1]
  |  Branch (1006:27): [True: 0, False: 0]
  ------------------
 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|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 1]
  |  Branch (1014:44): [True: 0, False: 0]
  ------------------
 1015|      0|                xmlNodeDumpOutputInternal(ctxt, cur);
 1016|      0|                break;
 1017|      0|            }
 1018|       |
 1019|      1|            xmlOutputBufferWrite(buf, 1, "<");
 1020|      1|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1020:17): [True: 0, False: 1]
  |  Branch (1020:38): [True: 0, False: 0]
  ------------------
 1021|      0|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1022|      0|                xmlOutputBufferWrite(buf, 1, ":");
 1023|      0|            }
 1024|      1|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1025|      1|            if (cur->nsDef)
  ------------------
  |  Branch (1025:17): [True: 0, False: 1]
  ------------------
 1026|      0|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1027|      1|            for (attr = cur->properties; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (1027:42): [True: 0, False: 1]
  ------------------
 1028|      0|                xmlAttrDumpOutput(ctxt, attr);
 1029|       |
 1030|      1|            if (cur->children == NULL) {
  ------------------
  |  Branch (1030:17): [True: 0, False: 1]
  ------------------
 1031|      0|                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
  ------------------
  |  Branch (1031:21): [True: 0, False: 0]
  ------------------
 1032|      0|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1032:25): [True: 0, False: 0]
  ------------------
 1033|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1034|      0|                    xmlOutputBufferWrite(buf, 2, "/>");
 1035|      0|                } 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|            } else {
 1050|      1|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1050:21): [True: 1, False: 0]
  ------------------
 1051|      1|                    tmp = cur->children;
 1052|      1|                    while (tmp != NULL) {
  ------------------
  |  Branch (1052:28): [True: 1, False: 0]
  ------------------
 1053|      1|                        if ((tmp->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1053:29): [True: 1, False: 0]
  ------------------
 1054|      0|                            (tmp->type == XML_CDATA_SECTION_NODE) ||
  ------------------
  |  Branch (1054:29): [True: 0, False: 0]
  ------------------
 1055|      1|                            (tmp->type == XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (1055:29): [True: 0, False: 0]
  ------------------
 1056|      1|                            ctxt->format = 0;
 1057|      1|                            unformattedNode = cur;
 1058|      1|                            break;
 1059|      1|                        }
 1060|      0|                        tmp = tmp->next;
 1061|      0|                    }
 1062|      1|                }
 1063|      1|                if (ctxt->format == 2)
  ------------------
  |  Branch (1063:21): [True: 0, False: 1]
  ------------------
 1064|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1065|      1|                xmlOutputBufferWrite(buf, 1, ">");
 1066|      1|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1066:21): [True: 0, False: 1]
  ------------------
 1067|      1|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1067:21): [True: 1, False: 0]
  ------------------
 1068|      1|                parent = cur;
 1069|      1|                cur = cur->children;
 1070|      1|                continue;
 1071|      1|            }
 1072|       |
 1073|      0|            break;
 1074|       |
 1075|      1|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1075:9): [True: 1, False: 1]
  ------------------
 1076|      1|	    if (cur->content == NULL)
  ------------------
  |  Branch (1076:10): [True: 0, False: 1]
  ------------------
 1077|      0|                break;
 1078|      1|	    if (cur->name != xmlStringTextNoenc) {
  ------------------
  |  Branch (1078:10): [True: 1, False: 0]
  ------------------
 1079|      1|                if (ctxt->escape)
  ------------------
  |  Branch (1079:21): [True: 0, False: 1]
  ------------------
 1080|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1081|      0|                                               ctxt->escape);
 1082|       |#ifdef TEST_OUTPUT_BUFFER_WRITE_ESCAPE
 1083|       |                else if (ctxt->encoding)
 1084|       |                    xmlOutputBufferWriteEscape(buf, cur->content, NULL);
 1085|       |#endif
 1086|      1|                else
 1087|      1|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1088|      1|	    } else {
 1089|       |		/*
 1090|       |		 * Disable escaping, needed for XSLT
 1091|       |		 */
 1092|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1093|      0|	    }
 1094|      1|	    break;
 1095|       |
 1096|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (1096:9): [True: 0, False: 2]
  ------------------
 1097|      0|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1097:10): [True: 0, False: 0]
  |  Branch (1097:27): [True: 0, False: 0]
  ------------------
 1098|      0|                xmlSaveWriteIndent(ctxt, 0);
 1099|       |
 1100|      0|            if (cur->content != NULL) {
  ------------------
  |  Branch (1100:17): [True: 0, False: 0]
  ------------------
 1101|      0|                xmlOutputBufferWrite(buf, 2, "<?");
 1102|      0|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1103|      0|                if (cur->content != NULL) {
  ------------------
  |  Branch (1103:21): [True: 0, False: 0]
  ------------------
 1104|      0|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1104:25): [True: 0, False: 0]
  ------------------
 1105|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1106|      0|                    else
 1107|      0|                        xmlOutputBufferWrite(buf, 1, " ");
 1108|      0|                    xmlOutputBufferWriteString(buf,
 1109|      0|                            (const char *)cur->content);
 1110|      0|                }
 1111|      0|                xmlOutputBufferWrite(buf, 2, "?>");
 1112|      0|            } else {
 1113|      0|                xmlOutputBufferWrite(buf, 2, "<?");
 1114|      0|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1115|      0|                if (ctxt->format == 2)
  ------------------
  |  Branch (1115:21): [True: 0, False: 0]
  ------------------
 1116|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1117|      0|                xmlOutputBufferWrite(buf, 2, "?>");
 1118|      0|            }
 1119|      0|            break;
 1120|       |
 1121|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1121:9): [True: 0, False: 2]
  ------------------
 1122|      0|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1122:10): [True: 0, False: 0]
  |  Branch (1122:27): [True: 0, False: 0]
  ------------------
 1123|      0|                xmlSaveWriteIndent(ctxt, 0);
 1124|       |
 1125|      0|            if (cur->content != NULL) {
  ------------------
  |  Branch (1125:17): [True: 0, False: 0]
  ------------------
 1126|      0|                xmlOutputBufferWrite(buf, 4, "<!--");
 1127|      0|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1128|      0|                xmlOutputBufferWrite(buf, 3, "-->");
 1129|      0|            }
 1130|      0|            break;
 1131|       |
 1132|      0|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1132:9): [True: 0, False: 2]
  ------------------
 1133|      0|            xmlOutputBufferWrite(buf, 1, "&");
 1134|      0|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1135|      0|            xmlOutputBufferWrite(buf, 1, ";");
 1136|      0|            break;
 1137|       |
 1138|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1138:9): [True: 0, False: 2]
  ------------------
 1139|      0|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1139:17): [True: 0, False: 0]
  |  Branch (1139:41): [True: 0, False: 0]
  ------------------
 1140|      0|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1141|      0|            } else {
 1142|      0|                start = end = cur->content;
 1143|      0|                while (*end != '\0') {
  ------------------
  |  Branch (1143:24): [True: 0, False: 0]
  ------------------
 1144|      0|                    if ((*end == ']') && (*(end + 1) == ']') &&
  ------------------
  |  Branch (1144:25): [True: 0, False: 0]
  |  Branch (1144:42): [True: 0, False: 0]
  ------------------
 1145|      0|                        (*(end + 2) == '>')) {
  ------------------
  |  Branch (1145:25): [True: 0, False: 0]
  ------------------
 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|      0|                    end++;
 1154|      0|                }
 1155|      0|                if (start != end) {
  ------------------
  |  Branch (1155:21): [True: 0, False: 0]
  ------------------
 1156|      0|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1157|      0|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1158|      0|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1159|      0|                }
 1160|      0|            }
 1161|      0|            break;
 1162|       |
 1163|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1163:9): [True: 0, False: 2]
  ------------------
 1164|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1165|      0|            break;
 1166|       |
 1167|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1167:9): [True: 0, False: 2]
  ------------------
 1168|      0|            xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1169|      0|            break;
 1170|       |
 1171|      0|        default:
  ------------------
  |  Branch (1171:9): [True: 0, False: 2]
  ------------------
 1172|      0|            break;
 1173|      2|        }
 1174|       |
 1175|      2|        while (1) {
  ------------------
  |  Branch (1175:16): [True: 2, Folded]
  ------------------
 1176|      2|            if (cur == root)
  ------------------
  |  Branch (1176:17): [True: 1, False: 1]
  ------------------
 1177|      1|                return;
 1178|      1|            if ((ctxt->format == 1) &&
  ------------------
  |  Branch (1178:17): [True: 0, False: 1]
  ------------------
 1179|      0|                (cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1179:17): [True: 0, False: 0]
  ------------------
 1180|      0|                (cur->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1180:17): [True: 0, False: 0]
  ------------------
 1181|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1182|      1|            if (cur->next != NULL) {
  ------------------
  |  Branch (1182:17): [True: 0, False: 1]
  ------------------
 1183|      0|                cur = cur->next;
 1184|      0|                break;
 1185|      0|            }
 1186|       |
 1187|      1|            cur = parent;
 1188|       |            /* cur->parent was validated when descending. */
 1189|      1|            parent = cur->parent;
 1190|       |
 1191|      1|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1191:17): [True: 1, False: 0]
  ------------------
 1192|      1|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1192:21): [True: 1, False: 0]
  ------------------
 1193|      1|                if (ctxt->format == 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 1]
  ------------------
 1194|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1195|       |
 1196|      1|                xmlOutputBufferWrite(buf, 2, "</");
 1197|      1|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1197:21): [True: 0, False: 1]
  |  Branch (1197:42): [True: 0, False: 0]
  ------------------
 1198|      0|                    xmlOutputBufferWriteString(buf,
 1199|      0|                            (const char *)cur->ns->prefix);
 1200|      0|                    xmlOutputBufferWrite(buf, 1, ":");
 1201|      0|                }
 1202|       |
 1203|      1|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1204|      1|                if (ctxt->format == 2)
  ------------------
  |  Branch (1204:21): [True: 0, False: 1]
  ------------------
 1205|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1206|      1|                xmlOutputBufferWrite(buf, 1, ">");
 1207|       |
 1208|      1|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1208:21): [True: 1, False: 0]
  ------------------
 1209|      1|                    ctxt->format = format;
 1210|       |                    unformattedNode = NULL;
 1211|      1|                }
 1212|      1|            }
 1213|      1|        }
 1214|      1|    }
 1215|      1|}
xmlsave.c:xmlSaveErrMemory:
   60|      8|{
   61|      8|    if (out != NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 8]
  ------------------
   62|      0|        out->error = XML_ERR_NO_MEMORY;
   63|      8|    xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_OUTPUT, NULL);
   64|      8|}
xmlsave.c:xmlSaveCtxtInit:
  153|      1|{
  154|      1|    if (ctxt == NULL) return;
  ------------------
  |  Branch (154:9): [True: 0, False: 1]
  ------------------
  155|       |
  156|      1|    xmlSaveSetIndentString(ctxt, xmlTreeIndentString);
  ------------------
  |  | 1364|      1|    #define xmlTreeIndentString (*__xmlTreeIndentString())
  ------------------
  157|       |
  158|      1|    if (options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (158:9): [True: 1, False: 0]
  ------------------
  159|      1|        ctxt->format = 1;
  160|      0|    else if (options & XML_SAVE_WSNONSIG)
  ------------------
  |  Branch (160:14): [True: 0, False: 0]
  ------------------
  161|      0|        ctxt->format = 2;
  162|       |
  163|      1|    if (((options & XML_SAVE_EMPTY) == 0) &&
  ------------------
  |  Branch (163:9): [True: 1, False: 0]
  ------------------
  164|      1|        (xmlSaveNoEmptyTags))
  ------------------
  |  | 1372|      1|    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
  ------------------
  |  Branch (164:9): [True: 0, False: 1]
  ------------------
  165|      0|	options |= XML_SAVE_NO_EMPTY;
  166|       |
  167|      1|    ctxt->options = options;
  168|      1|}

xmlInitSchemasTypesInternal:
  522|    324|{
  523|    324|    xmlInitMutex(&xmlSchemasTypesMutex);
  524|    324|}
xmlCleanupSchemasTypesInternal:
  528|    323|{
  529|    323|    xmlCleanupMutex(&xmlSchemasTypesMutex);
  530|    323|}
xmlSchemaCleanupTypes:
  895|    646|xmlSchemaCleanupTypes(void) {
  896|    646|    xmlMutexLock(&xmlSchemasTypesMutex);
  897|    646|    if (xmlSchemaTypesInitialized != 0) {
  ------------------
  |  Branch (897:9): [True: 0, False: 646]
  ------------------
  898|      0|        xmlSchemaCleanupTypesInternal();
  899|      0|        xmlSchemaTypesInitialized = 0;
  900|      0|    }
  901|    646|    xmlMutexUnlock(&xmlSchemasTypesMutex);
  902|    646|}

xmlStrndup:
   50|  9.30M|xmlStrndup(const xmlChar *cur, int len) {
   51|  9.30M|    xmlChar *ret;
   52|       |
   53|  9.30M|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (53:9): [True: 0, False: 9.30M]
  |  Branch (53:26): [True: 0, False: 9.30M]
  ------------------
   54|  9.30M|    ret = xmlMalloc((size_t) len + 1);
   55|  9.30M|    if (ret == NULL) {
  ------------------
  |  Branch (55:9): [True: 4, False: 9.30M]
  ------------------
   56|      4|        return(NULL);
   57|      4|    }
   58|  9.30M|    memcpy(ret, cur, len);
   59|  9.30M|    ret[len] = 0;
   60|  9.30M|    return(ret);
   61|  9.30M|}
xmlStrdup:
   72|   321k|xmlStrdup(const xmlChar *cur) {
   73|   321k|    const xmlChar *p = cur;
   74|       |
   75|   321k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (75:9): [True: 0, False: 321k]
  ------------------
   76|  83.1M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (76:12): [True: 82.8M, False: 321k]
  ------------------
   77|   321k|    return(xmlStrndup(cur, p - cur));
   78|   321k|}
xmlStrEqual:
  157|  30.5k|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  158|  30.5k|    if (str1 == str2) return(1);
  ------------------
  |  Branch (158:9): [True: 1, False: 30.5k]
  ------------------
  159|  30.5k|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (159:9): [True: 1, False: 30.5k]
  ------------------
  160|  30.5k|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (160:9): [True: 0, False: 30.5k]
  ------------------
  161|  30.5k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  162|  30.5k|    return(strcmp((const char *)str1, (const char *)str2) == 0);
  163|       |#else
  164|       |    do {
  165|       |        if (*str1++ != *str2) return(0);
  166|       |    } while (*str2++);
  167|       |    return(1);
  168|       |#endif
  169|  30.5k|}
xmlStrncmp:
  206|  26.4M|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  207|  26.4M|    if (len <= 0) return(0);
  ------------------
  |  Branch (207:9): [True: 0, False: 26.4M]
  ------------------
  208|  26.4M|    if (str1 == str2) return(0);
  ------------------
  |  Branch (208:9): [True: 0, False: 26.4M]
  ------------------
  209|  26.4M|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (209:9): [True: 0, False: 26.4M]
  ------------------
  210|  26.4M|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (210:9): [True: 0, False: 26.4M]
  ------------------
  211|  26.4M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  212|  26.4M|    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|  26.4M|}
xmlStrcasecmp:
  266|    262|xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
  267|    262|    register int tmp;
  268|       |
  269|    262|    if (str1 == str2) return(0);
  ------------------
  |  Branch (269:9): [True: 0, False: 262]
  ------------------
  270|    262|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (270:9): [True: 0, False: 262]
  ------------------
  271|    262|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (271:9): [True: 0, False: 262]
  ------------------
  272|    264|    do {
  273|    264|        tmp = casemap[*str1++] - casemap[*str2];
  274|    264|        if (tmp != 0) return(tmp);
  ------------------
  |  Branch (274:13): [True: 262, False: 2]
  ------------------
  275|    264|    } while (*str2++ != 0);
  ------------------
  |  Branch (275:14): [True: 2, False: 0]
  ------------------
  276|      0|    return 0;
  277|    262|}
xmlStrncasecmp:
  289|      3|xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, int len) {
  290|      3|    register int tmp;
  291|       |
  292|      3|    if (len <= 0) return(0);
  ------------------
  |  Branch (292:9): [True: 0, False: 3]
  ------------------
  293|      3|    if (str1 == str2) return(0);
  ------------------
  |  Branch (293:9): [True: 0, False: 3]
  ------------------
  294|      3|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (294:9): [True: 0, False: 3]
  ------------------
  295|      3|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (295:9): [True: 0, False: 3]
  ------------------
  296|      3|    do {
  297|      3|        tmp = casemap[*str1++] - casemap[*str2];
  298|      3|        if (tmp != 0 || --len == 0) return(tmp);
  ------------------
  |  Branch (298:13): [True: 3, False: 0]
  |  Branch (298:25): [True: 0, False: 0]
  ------------------
  299|      3|    } while (*str2++ != 0);
  ------------------
  |  Branch (299:14): [True: 0, False: 0]
  ------------------
  300|      0|    return 0;
  301|      3|}
xmlStrchr:
  312|     12|xmlStrchr(const xmlChar *str, xmlChar val) {
  313|     12|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (313:9): [True: 0, False: 12]
  ------------------
  314|     22|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (314:12): [True: 22, False: 0]
  ------------------
  315|     22|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (315:13): [True: 12, False: 10]
  ------------------
  316|     10|        str++;
  317|     10|    }
  318|      0|    return(NULL);
  319|     12|}
xmlStrstr:
  330|  1.14M|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  331|  1.14M|    int n;
  332|       |
  333|  1.14M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (333:9): [True: 0, False: 1.14M]
  ------------------
  334|  1.14M|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (334:9): [True: 0, False: 1.14M]
  ------------------
  335|  1.14M|    n = xmlStrlen(val);
  336|       |
  337|  1.14M|    if (n == 0) return(str);
  ------------------
  |  Branch (337:9): [True: 0, False: 1.14M]
  ------------------
  338|  2.62M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (338:12): [True: 1.48M, False: 1.14M]
  ------------------
  339|  1.48M|        if (*str == *val) {
  ------------------
  |  Branch (339:13): [True: 3.83k, False: 1.47M]
  ------------------
  340|  3.83k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (340:17): [True: 3.72k, False: 102]
  ------------------
  341|  3.83k|        }
  342|  1.47M|        str++;
  343|  1.47M|    }
  344|  1.14M|    return(NULL);
  345|  1.14M|}
xmlStrlen:
  405|  2.28M|xmlStrlen(const xmlChar *str) {
  406|  2.28M|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (406:18): [True: 2.28M, False: 1]
  ------------------
  407|  2.28M|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (407:12): [True: 0, False: 2.28M]
  ------------------
  408|  2.28M|}
xmlStrncat:
  423|     80|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  424|     80|    int size;
  425|     80|    xmlChar *ret;
  426|       |
  427|     80|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (427:9): [True: 0, False: 80]
  |  Branch (427:26): [True: 8, False: 72]
  ------------------
  428|      8|        return(cur);
  429|       |
  430|     72|    if (len < 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 72]
  ------------------
  431|      0|        if (cur != NULL)
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            xmlFree(cur);
  433|      0|        return(NULL);
  434|      0|    }
  435|       |
  436|     72|    if (cur == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 72]
  ------------------
  437|      0|        return(xmlStrndup(add, len));
  438|       |
  439|     72|    size = xmlStrlen(cur);
  440|     72|    if ((size < 0) || (size > INT_MAX - len)) {
  ------------------
  |  Branch (440:9): [True: 0, False: 72]
  |  Branch (440:23): [True: 0, False: 72]
  ------------------
  441|      0|        xmlFree(cur);
  442|      0|        return(NULL);
  443|      0|    }
  444|     72|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  445|     72|    if (ret == NULL) {
  ------------------
  |  Branch (445:9): [True: 0, False: 72]
  ------------------
  446|      0|        xmlFree(cur);
  447|      0|        return(NULL);
  448|      0|    }
  449|     72|    memcpy(&ret[size], add, len);
  450|     72|    ret[size + len] = 0;
  451|     72|    return(ret);
  452|     72|}
xmlStrcat:
  502|     80|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  503|     80|    const xmlChar *p = add;
  504|       |
  505|     80|    if (add == NULL) return(cur);
  ------------------
  |  Branch (505:9): [True: 0, False: 80]
  ------------------
  506|     80|    if (cur == NULL)
  ------------------
  |  Branch (506:9): [True: 0, False: 80]
  ------------------
  507|      0|        return(xmlStrdup(add));
  508|       |
  509|  3.60M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (509:12): [True: 3.60M, False: 80]
  ------------------
  510|     80|    return(xmlStrncat(cur, add, p - add));
  511|     80|}
xmlStrVASPrintf:
  573|    225|xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
  574|    225|    char empty[1];
  575|    225|    va_list copy;
  576|    225|    xmlChar *buf;
  577|    225|    int res, size;
  578|    225|    int truncated = 0;
  579|       |
  580|    225|    if (out == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 225]
  ------------------
  581|      0|        return(1);
  582|    225|    *out = NULL;
  583|    225|    if (msg == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 225]
  ------------------
  584|      0|        return(1);
  585|    225|    if (maxSize < 32)
  ------------------
  |  Branch (585:9): [True: 0, False: 225]
  ------------------
  586|      0|        maxSize = 32;
  587|       |
  588|    225|    va_copy(copy, ap);
  589|    225|    res = vsnprintf(empty, 1, msg, copy);
  590|    225|    va_end(copy);
  591|       |
  592|    225|    if (res > 0) {
  ------------------
  |  Branch (592:9): [True: 225, False: 0]
  ------------------
  593|       |        /* snprintf seems to work according to C99. */
  594|       |
  595|    225|        if (res < maxSize) {
  ------------------
  |  Branch (595:13): [True: 200, False: 25]
  ------------------
  596|    200|            size = res + 1;
  597|    200|        } else {
  598|     25|            size = maxSize;
  599|     25|            truncated = 1;
  600|     25|        }
  601|    225|        buf = xmlMalloc(size);
  602|    225|        if (buf == NULL)
  ------------------
  |  Branch (602:13): [True: 0, False: 225]
  ------------------
  603|      0|            return(-1);
  604|    225|        if (vsnprintf((char *) buf, size, msg, ap) < 0) {
  ------------------
  |  Branch (604:13): [True: 0, False: 225]
  ------------------
  605|      0|            xmlFree(buf);
  606|      0|            return(1);
  607|      0|        }
  608|    225|    } 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|    225|    if (truncated != 0) {
  ------------------
  |  Branch (658:9): [True: 25, False: 200]
  ------------------
  659|     25|        int i = size - 1;
  660|       |
  661|  27.8k|        while (i > 0) {
  ------------------
  |  Branch (661:16): [True: 27.8k, False: 0]
  ------------------
  662|       |            /* Break after ASCII */
  663|  27.8k|            if (buf[i-1] < 0x80)
  ------------------
  |  Branch (663:17): [True: 13, False: 27.8k]
  ------------------
  664|     13|                break;
  665|  27.8k|            i -= 1;
  666|       |            /* Break before non-ASCII */
  667|  27.8k|            if (buf[i] >= 0xc0)
  ------------------
  |  Branch (667:17): [True: 12, False: 27.8k]
  ------------------
  668|     12|                break;
  669|  27.8k|        }
  670|       |
  671|     25|        buf[i] = 0;
  672|     25|    }
  673|       |
  674|    225|    *out = (xmlChar *) buf;
  675|    225|    return(truncated);
  676|    225|}
xmlUTF8Strlen:
  770|     31|xmlUTF8Strlen(const xmlChar *utf) {
  771|     31|    size_t ret = 0;
  772|       |
  773|     31|    if (utf == NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 31]
  ------------------
  774|      0|        return(-1);
  775|       |
  776|  2.90M|    while (*utf != 0) {
  ------------------
  |  Branch (776:12): [True: 2.90M, False: 31]
  ------------------
  777|  2.90M|        if (utf[0] & 0x80) {
  ------------------
  |  Branch (777:13): [True: 523, False: 2.90M]
  ------------------
  778|    523|            if ((utf[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (778:17): [True: 0, False: 523]
  ------------------
  779|      0|                return(-1);
  780|    523|            if ((utf[0] & 0xe0) == 0xe0) {
  ------------------
  |  Branch (780:17): [True: 252, False: 271]
  ------------------
  781|    252|                if ((utf[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (781:21): [True: 0, False: 252]
  ------------------
  782|      0|                    return(-1);
  783|    252|                if ((utf[0] & 0xf0) == 0xf0) {
  ------------------
  |  Branch (783:21): [True: 215, False: 37]
  ------------------
  784|    215|                    if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (784:25): [True: 0, False: 215]
  |  Branch (784:52): [True: 0, False: 215]
  ------------------
  785|      0|                        return(-1);
  786|    215|                    utf += 4;
  787|    215|                } else {
  788|     37|                    utf += 3;
  789|     37|                }
  790|    271|            } else {
  791|    271|                utf += 2;
  792|    271|            }
  793|  2.90M|        } else {
  794|  2.90M|            utf++;
  795|  2.90M|        }
  796|  2.90M|        ret++;
  797|  2.90M|    }
  798|     31|    return(ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (798:12): [True: 0, False: 31]
  ------------------
  799|     31|}
xmlGetUTF8Char:
  812|  9.86M|xmlGetUTF8Char(const unsigned char *utf, int *len) {
  813|  9.86M|    unsigned int c;
  814|       |
  815|  9.86M|    if (utf == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 9.86M]
  ------------------
  816|      0|        goto error;
  817|  9.86M|    if (len == NULL)
  ------------------
  |  Branch (817:9): [True: 0, False: 9.86M]
  ------------------
  818|      0|        goto error;
  819|       |
  820|  9.86M|    c = utf[0];
  821|  9.86M|    if (c < 0x80) {
  ------------------
  |  Branch (821:9): [True: 9.84M, False: 16.0k]
  ------------------
  822|  9.84M|        if (*len < 1)
  ------------------
  |  Branch (822:13): [True: 0, False: 9.84M]
  ------------------
  823|      0|            goto error;
  824|       |        /* 1-byte code */
  825|  9.84M|        *len = 1;
  826|  9.84M|    } else {
  827|  16.0k|        if ((*len < 2) || ((utf[1] & 0xc0) != 0x80))
  ------------------
  |  Branch (827:13): [True: 0, False: 16.0k]
  |  Branch (827:27): [True: 25, False: 16.0k]
  ------------------
  828|     25|            goto error;
  829|  16.0k|        if (c < 0xe0) {
  ------------------
  |  Branch (829:13): [True: 13.3k, False: 2.69k]
  ------------------
  830|  13.3k|            if (c < 0xc2)
  ------------------
  |  Branch (830:17): [True: 2, False: 13.3k]
  ------------------
  831|      2|                goto error;
  832|       |            /* 2-byte code */
  833|  13.3k|            *len = 2;
  834|  13.3k|            c = (c & 0x1f) << 6;
  835|  13.3k|            c |= utf[1] & 0x3f;
  836|  13.3k|        } else {
  837|  2.69k|            if ((*len < 3) || ((utf[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (837:17): [True: 0, False: 2.69k]
  |  Branch (837:31): [True: 1, False: 2.69k]
  ------------------
  838|      1|                goto error;
  839|  2.69k|            if (c < 0xf0) {
  ------------------
  |  Branch (839:17): [True: 1.07k, False: 1.62k]
  ------------------
  840|       |                /* 3-byte code */
  841|  1.07k|                *len = 3;
  842|  1.07k|                c = (c & 0xf) << 12;
  843|  1.07k|                c |= (utf[1] & 0x3f) << 6;
  844|  1.07k|                c |= utf[2] & 0x3f;
  845|  1.07k|                if ((c < 0x800) || ((c >= 0xd800) && (c < 0xe000)))
  ------------------
  |  Branch (845:21): [True: 0, False: 1.07k]
  |  Branch (845:37): [True: 15, False: 1.06k]
  |  Branch (845:54): [True: 0, False: 15]
  ------------------
  846|      0|                    goto error;
  847|  1.62k|            } else {
  848|  1.62k|                if ((*len < 4) || ((utf[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (848:21): [True: 0, False: 1.62k]
  |  Branch (848:35): [True: 0, False: 1.62k]
  ------------------
  849|      0|                    goto error;
  850|  1.62k|                *len = 4;
  851|       |                /* 4-byte code */
  852|  1.62k|                c = (c & 0x7) << 18;
  853|  1.62k|                c |= (utf[1] & 0x3f) << 12;
  854|  1.62k|                c |= (utf[2] & 0x3f) << 6;
  855|  1.62k|                c |= utf[3] & 0x3f;
  856|  1.62k|                if ((c < 0x10000) || (c >= 0x110000))
  ------------------
  |  Branch (856:21): [True: 0, False: 1.62k]
  |  Branch (856:38): [True: 0, False: 1.62k]
  ------------------
  857|      0|                    goto error;
  858|  1.62k|            }
  859|  2.69k|        }
  860|  16.0k|    }
  861|  9.86M|    return(c);
  862|       |
  863|     28|error:
  864|     28|    if (len != NULL)
  ------------------
  |  Branch (864:9): [True: 28, False: 0]
  ------------------
  865|     28|	*len = 0;
  866|     28|    return(-1);
  867|  9.86M|}
xmlUTF8Strsize:
  933|  4.82M|xmlUTF8Strsize(const xmlChar *utf, int len) {
  934|  4.82M|    const xmlChar *ptr=utf;
  935|  4.82M|    int ch;
  936|  4.82M|    size_t ret;
  937|       |
  938|  4.82M|    if (utf == NULL)
  ------------------
  |  Branch (938:9): [True: 0, False: 4.82M]
  ------------------
  939|      0|        return(0);
  940|       |
  941|  4.82M|    if (len <= 0)
  ------------------
  |  Branch (941:9): [True: 0, False: 4.82M]
  ------------------
  942|      0|        return(0);
  943|       |
  944|  12.5M|    while ( len-- > 0) {
  ------------------
  |  Branch (944:13): [True: 7.71M, False: 4.82M]
  ------------------
  945|  7.71M|        if ( !*ptr )
  ------------------
  |  Branch (945:14): [True: 8, False: 7.71M]
  ------------------
  946|      8|            break;
  947|  7.71M|        ch = *ptr++;
  948|  7.71M|        if ((ch & 0x80))
  ------------------
  |  Branch (948:13): [True: 4.30k, False: 7.70M]
  ------------------
  949|  10.8k|            while ((ch<<=1) & 0x80 ) {
  ------------------
  |  Branch (949:20): [True: 6.58k, False: 4.30k]
  ------------------
  950|  6.58k|		if (*ptr == 0) break;
  ------------------
  |  Branch (950:7): [True: 0, False: 6.58k]
  ------------------
  951|  6.58k|                ptr++;
  952|  6.58k|	    }
  953|  7.71M|    }
  954|  4.82M|    ret = ptr - utf;
  955|  4.82M|    return (ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (955:13): [True: 0, False: 4.82M]
  ------------------
  956|  4.82M|}
xmlUTF8Strndup:
  967|      8|xmlUTF8Strndup(const xmlChar *utf, int len) {
  968|      8|    xmlChar *ret;
  969|      8|    int i;
  970|       |
  971|      8|    if ((utf == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (971:9): [True: 0, False: 8]
  |  Branch (971:26): [True: 0, False: 8]
  ------------------
  972|      8|    i = xmlUTF8Strsize(utf, len);
  973|      8|    ret = xmlMalloc((size_t) i + 1);
  974|      8|    if (ret == NULL) {
  ------------------
  |  Branch (974:9): [True: 0, False: 8]
  ------------------
  975|      0|        return(NULL);
  976|      0|    }
  977|      8|    memcpy(ret, utf, i);
  978|      8|    ret[i] = 0;
  979|      8|    return(ret);
  980|      8|}
xmlUTF8Strpos:
  991|  28.4k|xmlUTF8Strpos(const xmlChar *utf, int pos) {
  992|  28.4k|    int ch;
  993|       |
  994|  28.4k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (994:9): [True: 0, False: 28.4k]
  ------------------
  995|  28.4k|    if (pos < 0)
  ------------------
  |  Branch (995:9): [True: 0, False: 28.4k]
  ------------------
  996|      0|        return(NULL);
  997|  55.8k|    while (pos--) {
  ------------------
  |  Branch (997:12): [True: 27.4k, False: 28.4k]
  ------------------
  998|  27.4k|        ch = *utf++;
  999|  27.4k|        if (ch == 0)
  ------------------
  |  Branch (999:13): [True: 0, False: 27.4k]
  ------------------
 1000|      0|            return(NULL);
 1001|  27.4k|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (1001:14): [True: 0, False: 27.4k]
  ------------------
 1002|       |            /* if not simple ascii, verify proper format */
 1003|      0|            if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1003:18): [True: 0, False: 0]
  ------------------
 1004|      0|                return(NULL);
 1005|       |            /* then skip over remaining bytes for this char */
 1006|      0|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1006:21): [True: 0, False: 0]
  ------------------
 1007|      0|                if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1007:22): [True: 0, False: 0]
  ------------------
 1008|      0|                    return(NULL);
 1009|      0|        }
 1010|  27.4k|    }
 1011|  28.4k|    return((xmlChar *)utf);
 1012|  28.4k|}
xmlUTF8Strloc:
 1023|  2.41M|xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
 1024|  2.41M|    size_t i;
 1025|  2.41M|    int size;
 1026|  2.41M|    int ch;
 1027|       |
 1028|  2.41M|    if (utf==NULL || utfchar==NULL) return -1;
  ------------------
  |  Branch (1028:9): [True: 0, False: 2.41M]
  |  Branch (1028:22): [True: 0, False: 2.41M]
  ------------------
 1029|  2.41M|    size = xmlUTF8Strsize(utfchar, 1);
 1030|  28.8M|        for(i=0; (ch=*utf) != 0; i++) {
  ------------------
  |  Branch (1030:18): [True: 26.4M, False: 2.38M]
  ------------------
 1031|  26.4M|            if (xmlStrncmp(utf, utfchar, size)==0)
  ------------------
  |  Branch (1031:17): [True: 35.7k, False: 26.4M]
  ------------------
 1032|  35.7k|                return(i > INT_MAX ? 0 : i);
  ------------------
  |  Branch (1032:24): [True: 0, False: 35.7k]
  ------------------
 1033|  26.4M|            utf++;
 1034|  26.4M|            if ( ch & 0x80 ) {
  ------------------
  |  Branch (1034:18): [True: 348, False: 26.4M]
  ------------------
 1035|       |                /* if not simple ascii, verify proper format */
 1036|    348|                if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1036:22): [True: 0, False: 348]
  ------------------
 1037|      0|                    return(-1);
 1038|       |                /* then skip over remaining bytes for this char */
 1039|    948|                while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1039:25): [True: 600, False: 348]
  ------------------
 1040|    600|                    if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1040:26): [True: 0, False: 600]
  ------------------
 1041|      0|                        return(-1);
 1042|    348|            }
 1043|  26.4M|        }
 1044|       |
 1045|  2.38M|    return(-1);
 1046|  2.41M|}
xmlUTF8Strsub:
 1060|      8|xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
 1061|      8|    int i;
 1062|      8|    int ch;
 1063|       |
 1064|      8|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1064:9): [True: 0, False: 8]
  ------------------
 1065|      8|    if (start < 0) return(NULL);
  ------------------
  |  Branch (1065:9): [True: 0, False: 8]
  ------------------
 1066|      8|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1066:9): [True: 0, False: 8]
  ------------------
 1067|       |
 1068|       |    /*
 1069|       |     * Skip over any leading chars
 1070|       |     */
 1071|  24.5k|    for (i = 0; i < start; i++) {
  ------------------
  |  Branch (1071:17): [True: 24.5k, False: 8]
  ------------------
 1072|  24.5k|        ch = *utf++;
 1073|  24.5k|        if (ch == 0)
  ------------------
  |  Branch (1073:13): [True: 0, False: 24.5k]
  ------------------
 1074|      0|            return(NULL);
 1075|       |        /* skip over remaining bytes for this char */
 1076|  24.5k|        if (ch & 0x80) {
  ------------------
  |  Branch (1076:13): [True: 30, False: 24.5k]
  ------------------
 1077|     30|            ch <<= 1;
 1078|     90|            while (ch & 0x80) {
  ------------------
  |  Branch (1078:20): [True: 60, False: 30]
  ------------------
 1079|     60|                if (*utf++ == 0)
  ------------------
  |  Branch (1079:21): [True: 0, False: 60]
  ------------------
 1080|      0|                    return(NULL);
 1081|     60|                ch <<= 1;
 1082|     60|            }
 1083|     30|        }
 1084|  24.5k|    }
 1085|       |
 1086|      8|    return(xmlUTF8Strndup(utf, len));
 1087|      8|}

xmlInitXPathInternal:
  201|    324|xmlInitXPathInternal(void) {
  202|    324|    size_t i;
  203|       |
  204|    324|#if defined(NAN) && defined(INFINITY)
  205|    324|    xmlXPathNAN = NAN;
  206|    324|    xmlXPathPINF = INFINITY;
  207|    324|    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|  21.0k|    for (i = 0; i < SF_HASH_SIZE; i++)
  ------------------
  |  |  168|  21.0k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (220:17): [True: 20.7k, False: 324]
  ------------------
  221|  20.7k|        xmlXPathSFHash[i] = UCHAR_MAX;
  222|       |
  223|  9.07k|    for (i = 0; i < NUM_STANDARD_FUNCTIONS; i++) {
  ------------------
  |  |  166|  9.07k|    (sizeof(xmlXPathStandardFunctions) / sizeof(xmlXPathStandardFunctions[0]))
  ------------------
  |  Branch (223:17): [True: 8.74k, False: 324]
  ------------------
  224|  8.74k|        const char *name = xmlXPathStandardFunctions[i].name;
  225|  8.74k|        int bucketIndex = xmlXPathSFComputeHash(BAD_CAST name) % SF_HASH_SIZE;
  ------------------
  |  |   34|  8.74k|#define BAD_CAST (xmlChar *)
  ------------------
                      int bucketIndex = xmlXPathSFComputeHash(BAD_CAST name) % SF_HASH_SIZE;
  ------------------
  |  |  168|  8.74k|#define SF_HASH_SIZE 64
  ------------------
  226|       |
  227|  11.0k|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (227:16): [True: 2.26k, False: 8.74k]
  ------------------
  228|  2.26k|            bucketIndex += 1;
  229|  2.26k|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|  2.26k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (229:17): [True: 0, False: 2.26k]
  ------------------
  230|      0|                bucketIndex = 0;
  231|  2.26k|        }
  232|       |
  233|  8.74k|        xmlXPathSFHash[bucketIndex] = i;
  234|  8.74k|    }
  235|    324|}
xmlXPathIsNaN:
  250|     76|xmlXPathIsNaN(double val) {
  251|     76|#ifdef isnan
  252|     76|    return isnan(val);
  253|       |#else
  254|       |    return !(val == val);
  255|       |#endif
  256|     76|}
xmlXPathIsInf:
  265|     64|xmlXPathIsInf(double val) {
  266|     64|#ifdef isinf
  267|     64|    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
  ------------------
  |  Branch (267:12): [True: 0, False: 64]
  |  Branch (267:26): [True: 0, False: 0]
  ------------------
  268|       |#else
  269|       |    if (val >= xmlXPathPINF)
  270|       |        return 1;
  271|       |    if (val <= -xmlXPathPINF)
  272|       |        return -1;
  273|       |    return 0;
  274|       |#endif
  275|     64|}
xmlXPathErrMemory:
  677|   358k|{
  678|   358k|    if (ctxt == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 358k]
  ------------------
  679|      0|        return;
  680|   358k|    xmlRaiseMemoryError(ctxt->error, NULL, ctxt->userData, XML_FROM_XPATH,
  681|   358k|                        &ctxt->lastError);
  682|   358k|}
xmlXPathPErrMemory:
  691|   358k|{
  692|   358k|    if (ctxt == NULL)
  ------------------
  |  Branch (692:9): [True: 0, False: 358k]
  ------------------
  693|      0|        return;
  694|   358k|    ctxt->error = XPATH_MEMORY_ERROR;
  695|   358k|    xmlXPathErrMemory(ctxt->context);
  696|   358k|}
xmlXPathErr:
  777|  16.4M|xmlXPathErr(xmlXPathParserContext *ctxt, int code) {
  778|  16.4M|    xmlXPathErrFmt(ctxt, code, "%s\n", xmlXPathErrorMessages[code]);
  779|  16.4M|}
xmlXPatherror:
  791|      7|              int line ATTRIBUTE_UNUSED, int no) {
  792|      7|    xmlXPathErr(ctxt, no);
  793|      7|}
xmlXPathFreeCompExpr:
  971|    269|{
  972|    269|    xmlXPathStepOpPtr op;
  973|    269|    int i;
  974|       |
  975|    269|    if (comp == NULL)
  ------------------
  |  Branch (975:9): [True: 77, False: 192]
  ------------------
  976|     77|        return;
  977|    192|    if (comp->dict == NULL) {
  ------------------
  |  Branch (977:9): [True: 192, False: 0]
  ------------------
  978|  53.1M|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (978:14): [True: 53.1M, False: 192]
  ------------------
  979|  53.1M|	    op = &comp->steps[i];
  980|  53.1M|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (980:10): [True: 21.4k, False: 53.0M]
  ------------------
  981|  21.4k|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (981:7): [True: 18.0k, False: 3.33k]
  ------------------
  982|  18.0k|		    xmlXPathFreeObject(op->value4);
  983|  3.33k|		else
  984|  3.33k|		    xmlFree(op->value4);
  985|  21.4k|	    }
  986|  53.1M|	    if (op->value5 != NULL)
  ------------------
  |  Branch (986:10): [True: 1.16M, False: 51.9M]
  ------------------
  987|  1.16M|		xmlFree(op->value5);
  988|  53.1M|	}
  989|    192|    } 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|    192|    if (comp->steps != NULL) {
  ------------------
  |  Branch (999:9): [True: 192, False: 0]
  ------------------
 1000|    192|        xmlFree(comp->steps);
 1001|    192|    }
 1002|       |#ifdef XPATH_STREAMING
 1003|       |    if (comp->stream != NULL) {
 1004|       |        xmlFreePatternList(comp->stream);
 1005|       |    }
 1006|       |#endif
 1007|    192|    if (comp->expr != NULL) {
  ------------------
  |  Branch (1007:9): [True: 115, False: 77]
  ------------------
 1008|    115|        xmlFree(comp->expr);
 1009|    115|    }
 1010|       |
 1011|    192|    xmlFree(comp);
 1012|    192|}
xmlXPathValuePop:
 1979|   645k|{
 1980|   645k|    xmlXPathObjectPtr ret;
 1981|       |
 1982|   645k|    if ((ctxt == NULL) || (ctxt->valueNr <= 0))
  ------------------
  |  Branch (1982:9): [True: 0, False: 645k]
  |  Branch (1982:27): [True: 0, False: 645k]
  ------------------
 1983|      0|        return (NULL);
 1984|       |
 1985|   645k|    ctxt->valueNr--;
 1986|   645k|    if (ctxt->valueNr > 0)
  ------------------
  |  Branch (1986:9): [True: 644k, False: 472]
  ------------------
 1987|   644k|        ctxt->value = ctxt->valueTab[ctxt->valueNr - 1];
 1988|    472|    else
 1989|    472|        ctxt->value = NULL;
 1990|   645k|    ret = ctxt->valueTab[ctxt->valueNr];
 1991|       |    ctxt->valueTab[ctxt->valueNr] = NULL;
 1992|   645k|    return (ret);
 1993|   645k|}
xmlXPathValuePush:
 2007|   645k|{
 2008|   645k|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2008:9): [True: 0, False: 645k]
  ------------------
 2009|   645k|    if (value == NULL) {
  ------------------
  |  Branch (2009:9): [True: 0, False: 645k]
  ------------------
 2010|       |        /*
 2011|       |         * A NULL value typically indicates that a memory allocation failed.
 2012|       |         */
 2013|      0|        xmlXPathPErrMemory(ctxt);
 2014|      0|        return(-1);
 2015|      0|    }
 2016|   645k|    if (ctxt->valueNr >= ctxt->valueMax) {
  ------------------
  |  Branch (2016:9): [True: 222, False: 644k]
  ------------------
 2017|    222|        xmlXPathObjectPtr *tmp;
 2018|    222|        int newSize;
 2019|       |
 2020|    222|        newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]),
 2021|    222|                                  10, XPATH_MAX_STACK_DEPTH);
  ------------------
  |  |   96|    222|#define XPATH_MAX_STACK_DEPTH 1000000
  ------------------
 2022|    222|        if (newSize < 0) {
  ------------------
  |  Branch (2022:13): [True: 0, False: 222]
  ------------------
 2023|      0|            xmlXPathPErrMemory(ctxt);
 2024|      0|            xmlXPathFreeObject(value);
 2025|      0|            return (-1);
 2026|      0|        }
 2027|    222|        tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0]));
 2028|    222|        if (tmp == NULL) {
  ------------------
  |  Branch (2028:13): [True: 0, False: 222]
  ------------------
 2029|      0|            xmlXPathPErrMemory(ctxt);
 2030|      0|            xmlXPathFreeObject(value);
 2031|      0|            return (-1);
 2032|      0|        }
 2033|    222|	ctxt->valueTab = tmp;
 2034|    222|        ctxt->valueMax = newSize;
 2035|    222|    }
 2036|   645k|    ctxt->valueTab[ctxt->valueNr] = value;
 2037|   645k|    ctxt->value = value;
 2038|   645k|    return (ctxt->valueNr++);
 2039|   645k|}
xmlXPathOrderDocElems:
 2364|    192|xmlXPathOrderDocElems(xmlDoc *doc) {
 2365|    192|    XML_INTPTR_T count = 0;
  ------------------
  |  |   52|    192|  #define XML_INTPTR_T intptr_t
  ------------------
 2366|    192|    xmlNodePtr cur;
 2367|       |
 2368|    192|    if (doc == NULL)
  ------------------
  |  Branch (2368:9): [True: 0, False: 192]
  ------------------
 2369|      0|	return(-1);
 2370|    192|    cur = doc->children;
 2371|    576|    while (cur != NULL) {
  ------------------
  |  Branch (2371:12): [True: 384, False: 192]
  ------------------
 2372|    384|	if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (2372:6): [True: 192, False: 192]
  ------------------
 2373|    192|            count += 1;
 2374|    192|            cur->content = XML_INT_TO_PTR(-count);
  ------------------
  |  |   59|    192|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 2375|    192|	    if (cur->children != NULL) {
  ------------------
  |  Branch (2375:10): [True: 192, False: 0]
  ------------------
 2376|    192|		cur = cur->children;
 2377|    192|		continue;
 2378|    192|	    }
 2379|    192|	}
 2380|    192|	if (cur->next != NULL) {
  ------------------
  |  Branch (2380:6): [True: 0, False: 192]
  ------------------
 2381|      0|	    cur = cur->next;
 2382|      0|	    continue;
 2383|      0|	}
 2384|    384|	do {
 2385|    384|	    cur = cur->parent;
 2386|    384|	    if (cur == NULL)
  ------------------
  |  Branch (2386:10): [True: 0, False: 384]
  ------------------
 2387|      0|		break;
 2388|    384|	    if (cur == (xmlNodePtr) doc) {
  ------------------
  |  Branch (2388:10): [True: 192, False: 192]
  ------------------
 2389|    192|		cur = NULL;
 2390|    192|		break;
 2391|    192|	    }
 2392|    192|	    if (cur->next != NULL) {
  ------------------
  |  Branch (2392:10): [True: 0, False: 192]
  ------------------
 2393|      0|		cur = cur->next;
 2394|      0|		break;
 2395|      0|	    }
 2396|    192|	} while (cur != NULL);
  ------------------
  |  Branch (2396:11): [True: 192, False: 0]
  ------------------
 2397|    192|    }
 2398|    192|    return(count);
 2399|    192|}
xmlXPathNodeSetSort:
 2552|     85|xmlXPathNodeSetSort(xmlNodeSet *set) {
 2553|       |#ifndef WITH_TIM_SORT
 2554|       |    int i, j, incr, len;
 2555|       |    xmlNodePtr tmp;
 2556|       |#endif
 2557|       |
 2558|     85|    if (set == NULL)
  ------------------
  |  Branch (2558:9): [True: 0, False: 85]
  ------------------
 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|     85|    libxml_domnode_tim_sort(set->nodeTab, set->nodeNr);
 2590|     85|#endif /* WITH_TIM_SORT */
 2591|     85|}
xmlXPathNodeSetCreate:
 2667|   635k|xmlXPathNodeSetCreate(xmlNode *val) {
 2668|   635k|    xmlNodeSetPtr ret;
 2669|       |
 2670|   635k|    ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
 2671|   635k|    if (ret == NULL)
  ------------------
  |  Branch (2671:9): [True: 0, False: 635k]
  ------------------
 2672|      0|	return(NULL);
 2673|   635k|    memset(ret, 0 , sizeof(xmlNodeSet));
 2674|   635k|    if (val != NULL) {
  ------------------
  |  Branch (2674:9): [True: 317k, False: 318k]
  ------------------
 2675|   317k|        ret->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
  ------------------
  |  | 2593|   317k|#define XML_NODESET_DEFAULT	10
  ------------------
 2676|   317k|					     sizeof(xmlNodePtr));
 2677|   317k|	if (ret->nodeTab == NULL) {
  ------------------
  |  Branch (2677:6): [True: 0, False: 317k]
  ------------------
 2678|      0|	    xmlFree(ret);
 2679|      0|	    return(NULL);
 2680|      0|	}
 2681|   317k|	memset(ret->nodeTab, 0 ,
 2682|   317k|	       XML_NODESET_DEFAULT * sizeof(xmlNodePtr));
  ------------------
  |  | 2593|   317k|#define XML_NODESET_DEFAULT	10
  ------------------
 2683|   317k|        ret->nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|   317k|#define XML_NODESET_DEFAULT	10
  ------------------
 2684|   317k|	if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2684:6): [True: 0, False: 317k]
  ------------------
 2685|      0|	    xmlNsPtr ns = (xmlNsPtr) val;
 2686|      0|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2687|       |
 2688|      0|            if (nsNode == NULL) {
  ------------------
  |  Branch (2688:17): [True: 0, False: 0]
  ------------------
 2689|      0|                xmlXPathFreeNodeSet(ret);
 2690|      0|                return(NULL);
 2691|      0|            }
 2692|      0|	    ret->nodeTab[ret->nodeNr++] = nsNode;
 2693|      0|	} else
 2694|   317k|	    ret->nodeTab[ret->nodeNr++] = val;
 2695|   317k|    }
 2696|   635k|    return(ret);
 2697|   635k|}
xmlXPathNodeSetAddUnique:
 2845|   310k|xmlXPathNodeSetAddUnique(xmlNodeSet *cur, xmlNode *val) {
 2846|   310k|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2846:9): [True: 0, False: 310k]
  |  Branch (2846:26): [True: 0, False: 310k]
  ------------------
 2847|       |
 2848|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2849|       |    /*
 2850|       |     * grow the nodeTab if needed
 2851|       |     */
 2852|   310k|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2852:9): [True: 310k, False: 0]
  ------------------
 2853|   310k|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2853:13): [True: 0, False: 310k]
  ------------------
 2854|      0|            return(-1);
 2855|   310k|    }
 2856|       |
 2857|   310k|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2857:9): [True: 0, False: 310k]
  ------------------
 2858|      0|	xmlNsPtr ns = (xmlNsPtr) val;
 2859|      0|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2860|       |
 2861|      0|        if (nsNode == NULL)
  ------------------
  |  Branch (2861:13): [True: 0, False: 0]
  ------------------
 2862|      0|            return(-1);
 2863|      0|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2864|      0|    } else
 2865|   310k|	cur->nodeTab[cur->nodeNr++] = val;
 2866|   310k|    return(0);
 2867|   310k|}
xmlXPathNodeSetMerge:
 2880|  1.51k|xmlXPathNodeSetMerge(xmlNodeSet *val1, xmlNodeSet *val2) {
 2881|  1.51k|    int i, j, initNr, skip;
 2882|  1.51k|    xmlNodePtr n1, n2;
 2883|       |
 2884|  1.51k|    if (val1 == NULL) {
  ------------------
  |  Branch (2884:9): [True: 0, False: 1.51k]
  ------------------
 2885|      0|	val1 = xmlXPathNodeSetCreate(NULL);
 2886|      0|        if (val1 == NULL)
  ------------------
  |  Branch (2886:13): [True: 0, False: 0]
  ------------------
 2887|      0|            return (NULL);
 2888|      0|    }
 2889|  1.51k|    if (val2 == NULL)
  ------------------
  |  Branch (2889:9): [True: 0, False: 1.51k]
  ------------------
 2890|      0|        return(val1);
 2891|       |
 2892|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2893|  1.51k|    initNr = val1->nodeNr;
 2894|       |
 2895|  3.02k|    for (i = 0;i < val2->nodeNr;i++) {
  ------------------
  |  Branch (2895:16): [True: 1.51k, False: 1.51k]
  ------------------
 2896|  1.51k|	n2 = val2->nodeTab[i];
 2897|       |	/*
 2898|       |	 * check against duplicates
 2899|       |	 */
 2900|  1.51k|	skip = 0;
 2901|  1.54k|	for (j = 0; j < initNr; j++) {
  ------------------
  |  Branch (2901:14): [True: 769, False: 775]
  ------------------
 2902|    769|	    n1 = val1->nodeTab[j];
 2903|    769|	    if (n1 == n2) {
  ------------------
  |  Branch (2903:10): [True: 737, False: 32]
  ------------------
 2904|    737|		skip = 1;
 2905|    737|		break;
 2906|    737|	    } else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2906:17): [True: 0, False: 32]
  ------------------
 2907|      0|		       (n2->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2907:10): [True: 0, False: 0]
  ------------------
 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|    769|	}
 2917|  1.51k|	if (skip)
  ------------------
  |  Branch (2917:6): [True: 737, False: 775]
  ------------------
 2918|    737|	    continue;
 2919|       |
 2920|       |	/*
 2921|       |	 * grow the nodeTab if needed
 2922|       |	 */
 2923|    775|        if (val1->nodeNr >= val1->nodeMax) {
  ------------------
  |  Branch (2923:13): [True: 743, False: 32]
  ------------------
 2924|    743|            if (xmlXPathNodeSetGrow(val1) < 0)
  ------------------
  |  Branch (2924:17): [True: 0, False: 743]
  ------------------
 2925|      0|                goto error;
 2926|    743|        }
 2927|    775|	if (n2->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2927:6): [True: 0, False: 775]
  ------------------
 2928|      0|	    xmlNsPtr ns = (xmlNsPtr) n2;
 2929|      0|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2930|       |
 2931|      0|            if (nsNode == NULL)
  ------------------
  |  Branch (2931:17): [True: 0, False: 0]
  ------------------
 2932|      0|                goto error;
 2933|      0|	    val1->nodeTab[val1->nodeNr++] = nsNode;
 2934|      0|	} else
 2935|    775|	    val1->nodeTab[val1->nodeNr++] = n2;
 2936|    775|    }
 2937|       |
 2938|  1.51k|    return(val1);
 2939|       |
 2940|      0|error:
 2941|      0|    xmlXPathFreeNodeSet(val1);
 2942|       |    return(NULL);
 2943|  1.51k|}
xmlXPathFreeNodeSet:
 3101|   635k|xmlXPathFreeNodeSet(xmlNodeSet *obj) {
 3102|   635k|    if (obj == NULL) return;
  ------------------
  |  Branch (3102:9): [True: 0, False: 635k]
  ------------------
 3103|   635k|    if (obj->nodeTab != NULL) {
  ------------------
  |  Branch (3103:9): [True: 628k, False: 7.04k]
  ------------------
 3104|   628k|	int i;
 3105|       |
 3106|       |	/* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3107|  1.25M|	for (i = 0;i < obj->nodeNr;i++)
  ------------------
  |  Branch (3107:13): [True: 627k, False: 628k]
  ------------------
 3108|   627k|	    if ((obj->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (3108:10): [True: 627k, False: 0]
  ------------------
 3109|   627k|		(obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3109:3): [True: 0, False: 627k]
  ------------------
 3110|      0|		xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
 3111|   628k|	xmlFree(obj->nodeTab);
 3112|   628k|    }
 3113|   635k|    xmlFree(obj);
 3114|   635k|}
xmlXPathNewNodeSet:
 3191|   317k|xmlXPathNewNodeSet(xmlNode *val) {
 3192|   317k|    xmlXPathObjectPtr ret;
 3193|       |
 3194|   317k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3195|   317k|    if (ret == NULL)
  ------------------
  |  Branch (3195:9): [True: 0, False: 317k]
  ------------------
 3196|      0|	return(NULL);
 3197|   317k|    memset(ret, 0 , sizeof(xmlXPathObject));
 3198|   317k|    ret->type = XPATH_NODESET;
 3199|   317k|    ret->boolval = 0;
 3200|   317k|    ret->nodesetval = xmlXPathNodeSetCreate(val);
 3201|   317k|    if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (3201:9): [True: 0, False: 317k]
  ------------------
 3202|      0|        xmlFree(ret);
 3203|      0|        return(NULL);
 3204|      0|    }
 3205|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3206|   317k|    return(ret);
 3207|   317k|}
xmlXPathWrapNodeSet:
 3267|   318k|xmlXPathWrapNodeSet(xmlNodeSet *val) {
 3268|   318k|    xmlXPathObjectPtr ret;
 3269|       |
 3270|   318k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3271|   318k|    if (ret == NULL) {
  ------------------
  |  Branch (3271:9): [True: 0, False: 318k]
  ------------------
 3272|      0|        xmlXPathFreeNodeSet(val);
 3273|      0|	return(NULL);
 3274|      0|    }
 3275|   318k|    memset(ret, 0 , sizeof(xmlXPathObject));
 3276|   318k|    ret->type = XPATH_NODESET;
 3277|   318k|    ret->nodesetval = val;
 3278|   318k|    return(ret);
 3279|   318k|}
xmlXPathFunctionLookup:
 3743|     96|xmlXPathFunctionLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3744|       |    return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
 3745|     96|}
xmlXPathFunctionLookupNS:
 3758|     96|			 const xmlChar *ns_uri) {
 3759|     96|    xmlXPathFunction ret;
 3760|     96|    void *payload;
 3761|       |
 3762|     96|    if (ctxt == NULL)
  ------------------
  |  Branch (3762:9): [True: 0, False: 96]
  ------------------
 3763|      0|	return(NULL);
 3764|     96|    if (name == NULL)
  ------------------
  |  Branch (3764:9): [True: 0, False: 96]
  ------------------
 3765|      0|	return(NULL);
 3766|       |
 3767|     96|    if (ns_uri == NULL) {
  ------------------
  |  Branch (3767:9): [True: 96, False: 0]
  ------------------
 3768|     96|        int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
  ------------------
  |  |  168|     96|#define SF_HASH_SIZE 64
  ------------------
 3769|       |
 3770|    126|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (3770:16): [True: 85, False: 41]
  ------------------
 3771|     85|            int funcIndex = xmlXPathSFHash[bucketIndex];
 3772|       |
 3773|     85|            if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
  ------------------
  |  Branch (3773:17): [True: 55, False: 30]
  ------------------
 3774|     85|                       (char *) name) == 0)
 3775|     55|                return(xmlXPathStandardFunctions[funcIndex].func);
 3776|       |
 3777|     30|            bucketIndex += 1;
 3778|     30|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|     30|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (3778:17): [True: 0, False: 30]
  ------------------
 3779|      0|                bucketIndex = 0;
 3780|     30|        }
 3781|     96|    }
 3782|       |
 3783|     41|    if (ctxt->funcLookupFunc != NULL) {
  ------------------
  |  Branch (3783:9): [True: 0, False: 41]
  ------------------
 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|     41|    if (ctxt->funcHash == NULL)
  ------------------
  |  Branch (3792:9): [True: 41, False: 0]
  ------------------
 3793|     41|	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|     41|}
xmlXPathRegisteredFuncsCleanup:
 3807|    192|xmlXPathRegisteredFuncsCleanup(xmlXPathContext *ctxt) {
 3808|    192|    if (ctxt == NULL)
  ------------------
  |  Branch (3808:9): [True: 0, False: 192]
  ------------------
 3809|      0|	return;
 3810|       |
 3811|    192|    xmlHashFree(ctxt->funcHash, NULL);
 3812|       |    ctxt->funcHash = NULL;
 3813|    192|}
xmlXPathRegisteredVariablesCleanup:
 3942|    192|xmlXPathRegisteredVariablesCleanup(xmlXPathContext *ctxt) {
 3943|    192|    if (ctxt == NULL)
  ------------------
  |  Branch (3943:9): [True: 0, False: 192]
  ------------------
 3944|      0|	return;
 3945|       |
 3946|    192|    xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry);
 3947|       |    ctxt->varHash = NULL;
 3948|    192|}
xmlXPathRegisteredNsCleanup:
 4033|    192|xmlXPathRegisteredNsCleanup(xmlXPathContext *ctxt) {
 4034|    192|    if (ctxt == NULL)
  ------------------
  |  Branch (4034:9): [True: 0, False: 192]
  ------------------
 4035|      0|	return;
 4036|       |
 4037|    192|    xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator);
 4038|       |    ctxt->nsHash = NULL;
 4039|    192|}
xmlXPathNewFloat:
 4056|  19.1k|xmlXPathNewFloat(double val) {
 4057|  19.1k|    xmlXPathObjectPtr ret;
 4058|       |
 4059|  19.1k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4060|  19.1k|    if (ret == NULL)
  ------------------
  |  Branch (4060:9): [True: 0, False: 19.1k]
  ------------------
 4061|      0|	return(NULL);
 4062|  19.1k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4063|  19.1k|    ret->type = XPATH_NUMBER;
 4064|  19.1k|    ret->floatval = val;
 4065|  19.1k|    return(ret);
 4066|  19.1k|}
xmlXPathNewBoolean:
 4075|     30|xmlXPathNewBoolean(int val) {
 4076|     30|    xmlXPathObjectPtr ret;
 4077|       |
 4078|     30|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4079|     30|    if (ret == NULL)
  ------------------
  |  Branch (4079:9): [True: 0, False: 30]
  ------------------
 4080|      0|	return(NULL);
 4081|     30|    memset(ret, 0 , sizeof(xmlXPathObject));
 4082|     30|    ret->type = XPATH_BOOLEAN;
 4083|     30|    ret->boolval = (val != 0);
 4084|     30|    return(ret);
 4085|     30|}
xmlXPathNewString:
 4094|  2.91k|xmlXPathNewString(const xmlChar *val) {
 4095|  2.91k|    xmlXPathObjectPtr ret;
 4096|       |
 4097|  2.91k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4098|  2.91k|    if (ret == NULL)
  ------------------
  |  Branch (4098:9): [True: 0, False: 2.91k]
  ------------------
 4099|      0|	return(NULL);
 4100|  2.91k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4101|  2.91k|    ret->type = XPATH_STRING;
 4102|  2.91k|    if (val == NULL)
  ------------------
  |  Branch (4102:9): [True: 0, False: 2.91k]
  ------------------
 4103|      0|        val = BAD_CAST "";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4104|  2.91k|    ret->stringval = xmlStrdup(val);
 4105|  2.91k|    if (ret->stringval == NULL) {
  ------------------
  |  Branch (4105:9): [True: 0, False: 2.91k]
  ------------------
 4106|      0|        xmlFree(ret);
 4107|      0|        return(NULL);
 4108|      0|    }
 4109|  2.91k|    return(ret);
 4110|  2.91k|}
xmlXPathWrapString:
 4121|    151|xmlXPathWrapString (xmlChar *val) {
 4122|    151|    xmlXPathObjectPtr ret;
 4123|       |
 4124|    151|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4125|    151|    if (ret == NULL) {
  ------------------
  |  Branch (4125:9): [True: 0, False: 151]
  ------------------
 4126|      0|        xmlFree(val);
 4127|      0|	return(NULL);
 4128|      0|    }
 4129|    151|    memset(ret, 0 , sizeof(xmlXPathObject));
 4130|    151|    ret->type = XPATH_STRING;
 4131|    151|    ret->stringval = val;
 4132|    151|    return(ret);
 4133|    151|}
xmlXPathObjectCopy:
 4183|  1.11k|xmlXPathObjectCopy(xmlXPathObject *val) {
 4184|  1.11k|    xmlXPathObjectPtr ret;
 4185|       |
 4186|  1.11k|    if (val == NULL)
  ------------------
  |  Branch (4186:9): [True: 0, False: 1.11k]
  ------------------
 4187|      0|	return(NULL);
 4188|       |
 4189|  1.11k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4190|  1.11k|    if (ret == NULL)
  ------------------
  |  Branch (4190:9): [True: 0, False: 1.11k]
  ------------------
 4191|      0|	return(NULL);
 4192|  1.11k|    memcpy(ret, val , sizeof(xmlXPathObject));
 4193|  1.11k|    switch (val->type) {
 4194|      0|	case XPATH_BOOLEAN:
  ------------------
  |  Branch (4194:2): [True: 0, False: 1.11k]
  ------------------
 4195|  1.05k|	case XPATH_NUMBER:
  ------------------
  |  Branch (4195:2): [True: 1.05k, False: 56]
  ------------------
 4196|  1.05k|	    break;
 4197|     56|	case XPATH_STRING:
  ------------------
  |  Branch (4197:2): [True: 56, False: 1.05k]
  ------------------
 4198|     56|	    ret->stringval = xmlStrdup(val->stringval);
 4199|     56|            if (ret->stringval == NULL) {
  ------------------
  |  Branch (4199:17): [True: 0, False: 56]
  ------------------
 4200|      0|                xmlFree(ret);
 4201|      0|                return(NULL);
 4202|      0|            }
 4203|     56|	    break;
 4204|     56|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4204:2): [True: 0, False: 1.11k]
  ------------------
 4205|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (4205:2): [True: 0, False: 1.11k]
  ------------------
 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: 1.11k]
  ------------------
 4215|      0|	    ret->user = val->user;
 4216|      0|	    break;
 4217|      0|        default:
  ------------------
  |  Branch (4217:9): [True: 0, False: 1.11k]
  ------------------
 4218|      0|            xmlFree(ret);
 4219|      0|            ret = NULL;
 4220|      0|	    break;
 4221|  1.11k|    }
 4222|  1.11k|    return(ret);
 4223|  1.11k|}
xmlXPathFreeObject:
 4231|   659k|xmlXPathFreeObject(xmlXPathObject *obj) {
 4232|   659k|    if (obj == NULL) return;
  ------------------
  |  Branch (4232:9): [True: 130, False: 659k]
  ------------------
 4233|   659k|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (4233:9): [True: 635k, False: 23.3k]
  |  Branch (4233:41): [True: 0, False: 23.3k]
  ------------------
 4234|   635k|        if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4234:13): [True: 635k, False: 0]
  ------------------
 4235|   635k|            xmlXPathFreeNodeSet(obj->nodesetval);
 4236|   635k|    } else if (obj->type == XPATH_STRING) {
  ------------------
  |  Branch (4236:16): [True: 3.12k, False: 20.2k]
  ------------------
 4237|  3.12k|	if (obj->stringval != NULL)
  ------------------
  |  Branch (4237:6): [True: 3.12k, False: 0]
  ------------------
 4238|  3.12k|	    xmlFree(obj->stringval);
 4239|  3.12k|    }
 4240|   659k|    xmlFree(obj);
 4241|   659k|}
xmlXPathCastNumberToString:
 4370|     40|xmlXPathCastNumberToString (double val) {
 4371|     40|    xmlChar *ret;
 4372|     40|    switch (xmlXPathIsInf(val)) {
 4373|      0|    case 1:
  ------------------
  |  Branch (4373:5): [True: 0, False: 40]
  ------------------
 4374|      0|	ret = xmlStrdup((const xmlChar *) "Infinity");
 4375|      0|	break;
 4376|      0|    case -1:
  ------------------
  |  Branch (4376:5): [True: 0, False: 40]
  ------------------
 4377|      0|	ret = xmlStrdup((const xmlChar *) "-Infinity");
 4378|      0|	break;
 4379|     40|    default:
  ------------------
  |  Branch (4379:5): [True: 40, False: 0]
  ------------------
 4380|     40|	if (xmlXPathIsNaN(val)) {
  ------------------
  |  Branch (4380:6): [True: 0, False: 40]
  ------------------
 4381|      0|	    ret = xmlStrdup((const xmlChar *) "NaN");
 4382|     40|	} else if (val == 0) {
  ------------------
  |  Branch (4382:13): [True: 16, False: 24]
  ------------------
 4383|       |            /* Omit sign for negative zero. */
 4384|     16|	    ret = xmlStrdup((const xmlChar *) "0");
 4385|     24|	} else {
 4386|       |	    /* could be improved */
 4387|     24|	    char buf[100];
 4388|     24|	    xmlXPathFormatNumber(val, buf, 99);
 4389|     24|	    buf[99] = 0;
 4390|     24|	    ret = xmlStrdup((const xmlChar *) buf);
 4391|     24|	}
 4392|     40|    }
 4393|     40|    return(ret);
 4394|     40|}
xmlXPathCastNodeToString:
 4403|   308k|xmlXPathCastNodeToString (xmlNode *node) {
 4404|   308k|    return(xmlNodeGetContent(node));
 4405|   308k|}
xmlXPathCastNodeSetToString:
 4414|   313k|xmlXPathCastNodeSetToString (xmlNodeSet *ns) {
 4415|   313k|    if ((ns == NULL) || (ns->nodeNr == 0) || (ns->nodeTab == NULL))
  ------------------
  |  Branch (4415:9): [True: 0, False: 313k]
  |  Branch (4415:25): [True: 5.73k, False: 308k]
  |  Branch (4415:46): [True: 0, False: 308k]
  ------------------
 4416|  5.73k|	return(xmlStrdup((const xmlChar *) ""));
 4417|       |
 4418|   308k|    if (ns->nodeNr > 1)
  ------------------
  |  Branch (4418:9): [True: 32, False: 308k]
  ------------------
 4419|     32|	xmlXPathNodeSetSort(ns);
 4420|   308k|    return(xmlXPathCastNodeToString(ns->nodeTab[0]));
 4421|   313k|}
xmlXPathCastToString:
 4431|    126|xmlXPathCastToString(xmlXPathObject *val) {
 4432|    126|    xmlChar *ret = NULL;
 4433|       |
 4434|    126|    if (val == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 126]
  ------------------
 4435|      0|	return(xmlStrdup((const xmlChar *) ""));
 4436|    126|    switch (val->type) {
  ------------------
  |  Branch (4436:13): [True: 126, False: 0]
  ------------------
 4437|      0|	case XPATH_UNDEFINED:
  ------------------
  |  Branch (4437:2): [True: 0, False: 126]
  ------------------
 4438|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4439|      0|	    break;
 4440|     86|        case XPATH_NODESET:
  ------------------
  |  Branch (4440:9): [True: 86, False: 40]
  ------------------
 4441|     86|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4441:9): [True: 0, False: 126]
  ------------------
 4442|     86|	    ret = xmlXPathCastNodeSetToString(val->nodesetval);
 4443|     86|	    break;
 4444|      0|	case XPATH_STRING:
  ------------------
  |  Branch (4444:2): [True: 0, False: 126]
  ------------------
 4445|      0|	    return(xmlStrdup(val->stringval));
 4446|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (4446:9): [True: 0, False: 126]
  ------------------
 4447|      0|	    ret = xmlXPathCastBooleanToString(val->boolval);
 4448|      0|	    break;
 4449|     40|	case XPATH_NUMBER: {
  ------------------
  |  Branch (4449:2): [True: 40, False: 86]
  ------------------
 4450|     40|	    ret = xmlXPathCastNumberToString(val->floatval);
 4451|     40|	    break;
 4452|     86|	}
 4453|      0|	case XPATH_USERS:
  ------------------
  |  Branch (4453:2): [True: 0, False: 126]
  ------------------
 4454|       |	    /* TODO */
 4455|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4456|      0|	    break;
 4457|    126|    }
 4458|    126|    return(ret);
 4459|    126|}
xmlXPathCastStringToNumber:
 4520|   313k|xmlXPathCastStringToNumber(const xmlChar * val) {
 4521|   313k|    return(xmlXPathStringEvalNumber(val));
 4522|   313k|}
xmlXPathCastStringToBoolean:
 4630|      8|xmlXPathCastStringToBoolean (const xmlChar *val) {
 4631|      8|    if ((val == NULL) || (xmlStrlen(val) == 0))
  ------------------
  |  Branch (4631:9): [True: 0, False: 8]
  |  Branch (4631:26): [True: 0, False: 8]
  ------------------
 4632|      0|	return(0);
 4633|      8|    return(1);
 4634|      8|}
xmlXPathCastNodeSetToBoolean:
 4643|      9|xmlXPathCastNodeSetToBoolean (xmlNodeSet *ns) {
 4644|      9|    if ((ns == NULL) || (ns->nodeNr == 0))
  ------------------
  |  Branch (4644:9): [True: 0, False: 9]
  |  Branch (4644:25): [True: 9, False: 0]
  ------------------
 4645|      9|	return(0);
 4646|      0|    return(1);
 4647|      9|}
xmlXPathCastToBoolean:
 4656|     17|xmlXPathCastToBoolean (xmlXPathObject *val) {
 4657|     17|    int ret = 0;
 4658|       |
 4659|     17|    if (val == NULL)
  ------------------
  |  Branch (4659:9): [True: 0, False: 17]
  ------------------
 4660|      0|	return(0);
 4661|     17|    switch (val->type) {
  ------------------
  |  Branch (4661:13): [True: 17, False: 0]
  ------------------
 4662|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (4662:5): [True: 0, False: 17]
  ------------------
 4663|      0|	ret = 0;
 4664|      0|	break;
 4665|      9|    case XPATH_NODESET:
  ------------------
  |  Branch (4665:5): [True: 9, False: 8]
  ------------------
 4666|      9|    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4666:5): [True: 0, False: 17]
  ------------------
 4667|      9|	ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
 4668|      9|	break;
 4669|      8|    case XPATH_STRING:
  ------------------
  |  Branch (4669:5): [True: 8, False: 9]
  ------------------
 4670|      8|	ret = xmlXPathCastStringToBoolean(val->stringval);
 4671|      8|	break;
 4672|      0|    case XPATH_NUMBER:
  ------------------
  |  Branch (4672:5): [True: 0, False: 17]
  ------------------
 4673|      0|	ret = xmlXPathCastNumberToBoolean(val->floatval);
 4674|      0|	break;
 4675|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4675:5): [True: 0, False: 17]
  ------------------
 4676|      0|	ret = val->boolval;
 4677|      0|	break;
 4678|      0|    case XPATH_USERS:
  ------------------
  |  Branch (4678:5): [True: 0, False: 17]
  ------------------
 4679|       |	/* TODO */
 4680|      0|	ret = 0;
 4681|      0|	break;
 4682|     17|    }
 4683|     17|    return(ret);
 4684|     17|}
xmlXPathNewContext:
 4720|    192|xmlXPathNewContext(xmlDoc *doc) {
 4721|    192|    xmlXPathContextPtr ret;
 4722|       |
 4723|    192|    ret = (xmlXPathContextPtr) xmlMalloc(sizeof(xmlXPathContext));
 4724|    192|    if (ret == NULL)
  ------------------
  |  Branch (4724:9): [True: 0, False: 192]
  ------------------
 4725|      0|	return(NULL);
 4726|    192|    memset(ret, 0 , sizeof(xmlXPathContext));
 4727|    192|    ret->doc = doc;
 4728|    192|    ret->node = NULL;
 4729|       |
 4730|    192|    ret->varHash = NULL;
 4731|       |
 4732|    192|    ret->nb_types = 0;
 4733|    192|    ret->max_types = 0;
 4734|    192|    ret->types = NULL;
 4735|       |
 4736|    192|    ret->nb_axis = 0;
 4737|    192|    ret->max_axis = 0;
 4738|    192|    ret->axis = NULL;
 4739|       |
 4740|    192|    ret->nsHash = NULL;
 4741|    192|    ret->user = NULL;
 4742|       |
 4743|    192|    ret->contextSize = -1;
 4744|    192|    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|    192|    return(ret);
 4754|    192|}
xmlXPathFreeContext:
 4762|    192|xmlXPathFreeContext(xmlXPathContext *ctxt) {
 4763|    192|    if (ctxt == NULL) return;
  ------------------
  |  Branch (4763:9): [True: 0, False: 192]
  ------------------
 4764|       |
 4765|    192|    if (ctxt->cache != NULL)
  ------------------
  |  Branch (4765:9): [True: 0, False: 192]
  ------------------
 4766|      0|	xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
 4767|    192|    xmlXPathRegisteredNsCleanup(ctxt);
 4768|    192|    xmlXPathRegisteredFuncsCleanup(ctxt);
 4769|    192|    xmlXPathRegisteredVariablesCleanup(ctxt);
 4770|    192|    xmlResetError(&ctxt->lastError);
 4771|    192|    xmlFree(ctxt);
 4772|    192|}
xmlXPathNewParserContext:
 4807|    192|xmlXPathNewParserContext(const xmlChar *str, xmlXPathContext *ctxt) {
 4808|    192|    xmlXPathParserContextPtr ret;
 4809|       |
 4810|    192|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4811|    192|    if (ret == NULL) {
  ------------------
  |  Branch (4811:9): [True: 0, False: 192]
  ------------------
 4812|      0|        xmlXPathErrMemory(ctxt);
 4813|      0|	return(NULL);
 4814|      0|    }
 4815|    192|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4816|    192|    ret->cur = ret->base = str;
 4817|    192|    ret->context = ctxt;
 4818|       |
 4819|    192|    ret->comp = xmlXPathNewCompExpr();
 4820|    192|    if (ret->comp == NULL) {
  ------------------
  |  Branch (4820:9): [True: 0, False: 192]
  ------------------
 4821|      0|        xmlXPathErrMemory(ctxt);
 4822|      0|	xmlFree(ret->valueTab);
 4823|      0|	xmlFree(ret);
 4824|      0|	return(NULL);
 4825|      0|    }
 4826|    192|    if ((ctxt != NULL) && (ctxt->dict != NULL)) {
  ------------------
  |  Branch (4826:9): [True: 192, False: 0]
  |  Branch (4826:27): [True: 0, False: 192]
  ------------------
 4827|      0|        ret->comp->dict = ctxt->dict;
 4828|      0|	xmlDictReference(ret->comp->dict);
 4829|      0|    }
 4830|       |
 4831|    192|    return(ret);
 4832|    192|}
xmlXPathFreeParserContext:
 4879|    307|xmlXPathFreeParserContext(xmlXPathParserContext *ctxt) {
 4880|    307|    int i;
 4881|       |
 4882|    307|    if (ctxt == NULL)
  ------------------
  |  Branch (4882:9): [True: 0, False: 307]
  ------------------
 4883|      0|        return;
 4884|       |
 4885|    307|    if (ctxt->valueTab != NULL) {
  ------------------
  |  Branch (4885:9): [True: 115, False: 192]
  ------------------
 4886|    289|        for (i = 0; i < ctxt->valueNr; i++) {
  ------------------
  |  Branch (4886:21): [True: 174, False: 115]
  ------------------
 4887|    174|            if (ctxt->context)
  ------------------
  |  Branch (4887:17): [True: 174, False: 0]
  ------------------
 4888|    174|                xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]);
 4889|      0|            else
 4890|      0|                xmlXPathFreeObject(ctxt->valueTab[i]);
 4891|    174|        }
 4892|    115|        xmlFree(ctxt->valueTab);
 4893|    115|    }
 4894|    307|    if (ctxt->comp != NULL) {
  ------------------
  |  Branch (4894:9): [True: 77, False: 230]
  ------------------
 4895|       |#ifdef XPATH_STREAMING
 4896|       |	if (ctxt->comp->stream != NULL) {
 4897|       |	    xmlFreePatternList(ctxt->comp->stream);
 4898|       |	    ctxt->comp->stream = NULL;
 4899|       |	}
 4900|       |#endif
 4901|     77|	xmlXPathFreeCompExpr(ctxt->comp);
 4902|     77|    }
 4903|    307|    xmlFree(ctxt);
 4904|    307|}
xmlXPathEqualValues:
 5702|     11|xmlXPathEqualValues(xmlXPathParserContext *ctxt) {
 5703|     11|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5704|     11|    int ret = 0;
 5705|       |
 5706|     11|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5706:9): [True: 0, False: 11]
  |  Branch (5706:27): [True: 0, False: 11]
  ------------------
 5707|     11|    arg2 = xmlXPathValuePop(ctxt);
 5708|     11|    arg1 = xmlXPathValuePop(ctxt);
 5709|     11|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5709:9): [True: 0, False: 11]
  |  Branch (5709:27): [True: 0, False: 11]
  ------------------
 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|     11|    if (arg1 == arg2) {
  ------------------
  |  Branch (5717:9): [True: 0, False: 11]
  ------------------
 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|     11|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5725:9): [True: 0, False: 11]
  |  Branch (5725:42): [True: 0, False: 11]
  ------------------
 5726|     11|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5726:7): [True: 0, False: 11]
  |  Branch (5726:40): [True: 0, False: 11]
  ------------------
 5727|       |	/*
 5728|       |	 *Hack it to assure arg1 is the nodeset
 5729|       |	 */
 5730|      0|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5730:6): [True: 0, False: 0]
  |  Branch (5730:39): [True: 0, False: 0]
  ------------------
 5731|      0|		argtmp = arg2;
 5732|      0|		arg2 = arg1;
 5733|      0|		arg1 = argtmp;
 5734|      0|	}
 5735|      0|	switch (arg2->type) {
  ------------------
  |  Branch (5735:10): [True: 0, False: 0]
  ------------------
 5736|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5736:6): [True: 0, False: 0]
  ------------------
 5737|      0|		break;
 5738|      0|	    case XPATH_NODESET:
  ------------------
  |  Branch (5738:6): [True: 0, False: 0]
  ------------------
 5739|      0|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5739:6): [True: 0, False: 0]
  ------------------
 5740|      0|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 0);
 5741|      0|		break;
 5742|      0|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5742:6): [True: 0, False: 0]
  ------------------
 5743|      0|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5743:7): [True: 0, False: 0]
  ------------------
 5744|      0|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5744:5): [True: 0, False: 0]
  ------------------
 5745|      0|		else
 5746|      0|		    ret = 1;
 5747|      0|		ret = (ret == arg2->boolval);
 5748|      0|		break;
 5749|      0|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5749:6): [True: 0, False: 0]
  ------------------
 5750|      0|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 0);
 5751|      0|		break;
 5752|      0|	    case XPATH_STRING:
  ------------------
  |  Branch (5752:6): [True: 0, False: 0]
  ------------------
 5753|      0|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5754|      0|                                                 arg2->stringval, 0);
 5755|      0|		break;
 5756|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5756:6): [True: 0, False: 0]
  ------------------
 5757|       |		/* TODO */
 5758|      0|		break;
 5759|      0|	}
 5760|      0|	xmlXPathReleaseObject(ctxt->context, arg1);
 5761|      0|	xmlXPathReleaseObject(ctxt->context, arg2);
 5762|      0|	return(ret);
 5763|      0|    }
 5764|       |
 5765|     11|    return (xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5766|     11|}
xmlXPathNotEqualValues:
 5775|      1|xmlXPathNotEqualValues(xmlXPathParserContext *ctxt) {
 5776|      1|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5777|      1|    int ret = 0;
 5778|       |
 5779|      1|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5779:9): [True: 0, False: 1]
  |  Branch (5779:27): [True: 0, False: 1]
  ------------------
 5780|      1|    arg2 = xmlXPathValuePop(ctxt);
 5781|      1|    arg1 = xmlXPathValuePop(ctxt);
 5782|      1|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5782:9): [True: 0, False: 1]
  |  Branch (5782:27): [True: 0, False: 1]
  ------------------
 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|      1|    if (arg1 == arg2) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 1]
  ------------------
 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|      1|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5798:9): [True: 0, False: 1]
  |  Branch (5798:42): [True: 0, False: 1]
  ------------------
 5799|      1|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5799:7): [True: 1, False: 0]
  |  Branch (5799:40): [True: 0, False: 0]
  ------------------
 5800|       |	/*
 5801|       |	 *Hack it to assure arg1 is the nodeset
 5802|       |	 */
 5803|      1|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5803:6): [True: 0, False: 1]
  |  Branch (5803:39): [True: 0, False: 0]
  ------------------
 5804|      0|		argtmp = arg2;
 5805|      0|		arg2 = arg1;
 5806|      0|		arg1 = argtmp;
 5807|      0|	}
 5808|      1|	switch (arg2->type) {
  ------------------
  |  Branch (5808:10): [True: 1, False: 0]
  ------------------
 5809|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5809:6): [True: 0, False: 1]
  ------------------
 5810|      0|		break;
 5811|      0|	    case XPATH_NODESET:
  ------------------
  |  Branch (5811:6): [True: 0, False: 1]
  ------------------
 5812|      0|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5812:6): [True: 0, False: 1]
  ------------------
 5813|      0|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 1);
 5814|      0|		break;
 5815|      0|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5815:6): [True: 0, False: 1]
  ------------------
 5816|      0|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5816:7): [True: 0, False: 0]
  ------------------
 5817|      0|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5817:5): [True: 0, False: 0]
  ------------------
 5818|      0|		else
 5819|      0|		    ret = 1;
 5820|      0|		ret = (ret != arg2->boolval);
 5821|      0|		break;
 5822|      0|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5822:6): [True: 0, False: 1]
  ------------------
 5823|      0|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 1);
 5824|      0|		break;
 5825|      1|	    case XPATH_STRING:
  ------------------
  |  Branch (5825:6): [True: 1, False: 0]
  ------------------
 5826|      1|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5827|      1|                                                 arg2->stringval, 1);
 5828|      1|		break;
 5829|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5829:6): [True: 0, False: 1]
  ------------------
 5830|       |		/* TODO */
 5831|      0|		break;
 5832|      1|	}
 5833|      1|	xmlXPathReleaseObject(ctxt->context, arg1);
 5834|      1|	xmlXPathReleaseObject(ctxt->context, arg2);
 5835|      1|	return(ret);
 5836|      1|    }
 5837|       |
 5838|      0|    return (!xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5839|      1|}
xmlXPathCompareValues:
 5864|      2|xmlXPathCompareValues(xmlXPathParserContext *ctxt, int inf, int strict) {
 5865|      2|    int ret = 0, arg1i = 0, arg2i = 0;
 5866|      2|    xmlXPathObjectPtr arg1, arg2;
 5867|       |
 5868|      2|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5868:9): [True: 0, False: 2]
  |  Branch (5868:27): [True: 0, False: 2]
  ------------------
 5869|      2|    arg2 = xmlXPathValuePop(ctxt);
 5870|      2|    arg1 = xmlXPathValuePop(ctxt);
 5871|      2|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5871:9): [True: 0, False: 2]
  |  Branch (5871:27): [True: 0, False: 2]
  ------------------
 5872|      0|	if (arg1 != NULL)
  ------------------
  |  Branch (5872:6): [True: 0, False: 0]
  ------------------
 5873|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5874|      0|	else
 5875|      0|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5876|      0|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5877|      0|    }
 5878|       |
 5879|      2|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5879:9): [True: 1, False: 1]
  |  Branch (5879:42): [True: 0, False: 1]
  ------------------
 5880|      1|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5880:7): [True: 0, False: 1]
  |  Branch (5880:40): [True: 0, False: 1]
  ------------------
 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|      1|	if (((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE)) &&
  ------------------
  |  Branch (5886:7): [True: 1, False: 0]
  |  Branch (5886:40): [True: 0, False: 0]
  ------------------
 5887|      1|	  ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE))){
  ------------------
  |  Branch (5887:5): [True: 0, False: 1]
  |  Branch (5887:38): [True: 0, False: 1]
  ------------------
 5888|      0|	    ret = xmlXPathCompareNodeSets(ctxt, inf, strict, arg1, arg2);
 5889|      1|	} else {
 5890|      1|	    if ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5890:10): [True: 0, False: 1]
  |  Branch (5890:43): [True: 0, False: 1]
  ------------------
 5891|      0|		ret = xmlXPathCompareNodeSetValue(ctxt, inf, strict,
 5892|      0|			                          arg1, arg2);
 5893|      1|	    } else {
 5894|      1|		ret = xmlXPathCompareNodeSetValue(ctxt, !inf, strict,
 5895|      1|			                          arg2, arg1);
 5896|      1|	    }
 5897|      1|	}
 5898|      1|	return(ret);
 5899|      1|    }
 5900|       |
 5901|      1|    if (arg1->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5901:9): [True: 1, False: 0]
  ------------------
 5902|      1|	xmlXPathValuePush(ctxt, arg1);
 5903|      1|	xmlXPathNumberFunction(ctxt, 1);
 5904|      1|	arg1 = xmlXPathValuePop(ctxt);
 5905|      1|    }
 5906|      1|    if (arg2->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5906:9): [True: 1, False: 0]
  ------------------
 5907|      1|	xmlXPathValuePush(ctxt, arg2);
 5908|      1|	xmlXPathNumberFunction(ctxt, 1);
 5909|      1|	arg2 = xmlXPathValuePop(ctxt);
 5910|      1|    }
 5911|      1|    if (ctxt->error)
  ------------------
  |  Branch (5911:9): [True: 0, False: 1]
  ------------------
 5912|      0|        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|      1|    if (xmlXPathIsNaN(arg1->floatval) || xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5918:9): [True: 1, False: 0]
  |  Branch (5918:42): [True: 0, False: 0]
  ------------------
 5919|      1|	ret=0;
 5920|      1|    } else {
 5921|      0|	arg1i=xmlXPathIsInf(arg1->floatval);
 5922|      0|	arg2i=xmlXPathIsInf(arg2->floatval);
 5923|      0|	if (inf && strict) {
  ------------------
  |  Branch (5923:6): [True: 0, False: 0]
  |  Branch (5923:13): [True: 0, False: 0]
  ------------------
 5924|      0|	    if ((arg1i == -1 && arg2i != -1) ||
  ------------------
  |  Branch (5924:11): [True: 0, False: 0]
  |  Branch (5924:26): [True: 0, False: 0]
  ------------------
 5925|      0|		(arg2i == 1 && arg1i != 1)) {
  ------------------
  |  Branch (5925:4): [True: 0, False: 0]
  |  Branch (5925:18): [True: 0, False: 0]
  ------------------
 5926|      0|		ret = 1;
 5927|      0|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5927:17): [True: 0, False: 0]
  |  Branch (5927:31): [True: 0, False: 0]
  ------------------
 5928|      0|		ret = (arg1->floatval < arg2->floatval);
 5929|      0|	    } else {
 5930|      0|		ret = 0;
 5931|      0|	    }
 5932|      0|	}
 5933|      0|	else if (inf && !strict) {
  ------------------
  |  Branch (5933:11): [True: 0, False: 0]
  |  Branch (5933:18): [True: 0, False: 0]
  ------------------
 5934|      0|	    if (arg1i == -1 || arg2i == 1) {
  ------------------
  |  Branch (5934:10): [True: 0, False: 0]
  |  Branch (5934:25): [True: 0, False: 0]
  ------------------
 5935|      0|		ret = 1;
 5936|      0|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5936:17): [True: 0, False: 0]
  |  Branch (5936:31): [True: 0, False: 0]
  ------------------
 5937|      0|		ret = (arg1->floatval <= arg2->floatval);
 5938|      0|	    } else {
 5939|      0|		ret = 0;
 5940|      0|	    }
 5941|      0|	}
 5942|      0|	else if (!inf && strict) {
  ------------------
  |  Branch (5942:11): [True: 0, False: 0]
  |  Branch (5942:19): [True: 0, False: 0]
  ------------------
 5943|      0|	    if ((arg1i == 1 && arg2i != 1) ||
  ------------------
  |  Branch (5943:11): [True: 0, False: 0]
  |  Branch (5943:25): [True: 0, False: 0]
  ------------------
 5944|      0|		(arg2i == -1 && arg1i != -1)) {
  ------------------
  |  Branch (5944:4): [True: 0, False: 0]
  |  Branch (5944:19): [True: 0, False: 0]
  ------------------
 5945|      0|		ret = 1;
 5946|      0|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5946:17): [True: 0, False: 0]
  |  Branch (5946:31): [True: 0, False: 0]
  ------------------
 5947|      0|		ret = (arg1->floatval > arg2->floatval);
 5948|      0|	    } else {
 5949|      0|		ret = 0;
 5950|      0|	    }
 5951|      0|	}
 5952|      0|	else if (!inf && !strict) {
  ------------------
  |  Branch (5952:11): [True: 0, False: 0]
  |  Branch (5952:19): [True: 0, False: 0]
  ------------------
 5953|      0|	    if (arg1i == 1 || arg2i == -1) {
  ------------------
  |  Branch (5953:10): [True: 0, False: 0]
  |  Branch (5953:24): [True: 0, False: 0]
  ------------------
 5954|      0|		ret = 1;
 5955|      0|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5955:17): [True: 0, False: 0]
  |  Branch (5955:31): [True: 0, False: 0]
  ------------------
 5956|      0|		ret = (arg1->floatval >= arg2->floatval);
 5957|      0|	    } else {
 5958|      0|		ret = 0;
 5959|      0|	    }
 5960|      0|	}
 5961|      0|    }
 5962|      1|error:
 5963|      1|    xmlXPathReleaseObject(ctxt->context, arg1);
 5964|      1|    xmlXPathReleaseObject(ctxt->context, arg2);
 5965|      1|    return(ret);
 5966|      1|}
xmlXPathValueFlipSign:
 5976|  1.66k|xmlXPathValueFlipSign(xmlXPathParserContext *ctxt) {
 5977|  1.66k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return;
  ------------------
  |  Branch (5977:9): [True: 0, False: 1.66k]
  |  Branch (5977:27): [True: 0, False: 1.66k]
  ------------------
 5978|  1.66k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.66k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.66k, False: 0]
  |  |  |  Branch (297:34): [True: 1.64k, False: 13]
  |  |  ------------------
  |  |  298|  1.66k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 5979|  1.66k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.66k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 1.66k]
  |  |  |  Branch (261:34): [True: 0, False: 1.66k]
  |  |  ------------------
  |  |  262|  1.66k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 5980|  1.66k|    ctxt->value->floatval = -ctxt->value->floatval;
 5981|  1.66k|}
xmlXPathAddValues:
 5991|  2.07k|xmlXPathAddValues(xmlXPathParserContext *ctxt) {
 5992|  2.07k|    xmlXPathObjectPtr arg;
 5993|  2.07k|    double val;
 5994|       |
 5995|  2.07k|    arg = xmlXPathValuePop(ctxt);
 5996|  2.07k|    if (arg == NULL)
  ------------------
  |  Branch (5996:9): [True: 0, False: 2.07k]
  ------------------
 5997|  2.07k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 5998|  2.07k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 5999|  2.07k|    xmlXPathReleaseObject(ctxt->context, arg);
 6000|  2.07k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  2.07k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 2.07k, False: 0]
  |  |  |  Branch (297:34): [True: 20, False: 2.05k]
  |  |  ------------------
  |  |  298|  2.07k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6001|  2.07k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  2.07k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 2.07k]
  |  |  |  Branch (261:34): [True: 0, False: 2.07k]
  |  |  ------------------
  |  |  262|  2.07k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6002|  2.07k|    ctxt->value->floatval += val;
 6003|  2.07k|}
xmlXPathSubValues:
 6013|  1.95k|xmlXPathSubValues(xmlXPathParserContext *ctxt) {
 6014|  1.95k|    xmlXPathObjectPtr arg;
 6015|  1.95k|    double val;
 6016|       |
 6017|  1.95k|    arg = xmlXPathValuePop(ctxt);
 6018|  1.95k|    if (arg == NULL)
  ------------------
  |  Branch (6018:9): [True: 0, False: 1.95k]
  ------------------
 6019|  1.95k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6020|  1.95k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6021|  1.95k|    xmlXPathReleaseObject(ctxt->context, arg);
 6022|  1.95k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.95k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.95k, False: 0]
  |  |  |  Branch (297:34): [True: 4, False: 1.94k]
  |  |  ------------------
  |  |  298|  1.95k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6023|  1.95k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.95k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 1.95k]
  |  |  |  Branch (261:34): [True: 0, False: 1.95k]
  |  |  ------------------
  |  |  262|  1.95k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6024|  1.95k|    ctxt->value->floatval -= val;
 6025|  1.95k|}
xmlXPathMultValues:
 6035|   310k|xmlXPathMultValues(xmlXPathParserContext *ctxt) {
 6036|   310k|    xmlXPathObjectPtr arg;
 6037|   310k|    double val;
 6038|       |
 6039|   310k|    arg = xmlXPathValuePop(ctxt);
 6040|   310k|    if (arg == NULL)
  ------------------
  |  Branch (6040:9): [True: 0, False: 310k]
  ------------------
 6041|   310k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6042|   310k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6043|   310k|    xmlXPathReleaseObject(ctxt->context, arg);
 6044|   310k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   310k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 310k, False: 0]
  |  |  |  Branch (297:34): [True: 2.22k, False: 308k]
  |  |  ------------------
  |  |  298|   310k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6045|   310k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   310k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 310k]
  |  |  |  Branch (261:34): [True: 0, False: 310k]
  |  |  ------------------
  |  |  262|   310k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6046|   310k|    ctxt->value->floatval *= val;
 6047|   310k|}
xmlXPathDivValues:
 6058|      2|xmlXPathDivValues(xmlXPathParserContext *ctxt) {
 6059|      2|    xmlXPathObjectPtr arg;
 6060|      2|    double val;
 6061|       |
 6062|      2|    arg = xmlXPathValuePop(ctxt);
 6063|      2|    if (arg == NULL)
  ------------------
  |  Branch (6063:9): [True: 0, False: 2]
  ------------------
 6064|      2|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6065|      2|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6066|      2|    xmlXPathReleaseObject(ctxt->context, arg);
 6067|      2|    CAST_TO_NUMBER;
  ------------------
  |  |  297|      2|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 2, False: 0]
  |  |  |  Branch (297:34): [True: 0, False: 2]
  |  |  ------------------
  |  |  298|      2|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6068|      2|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|      2|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 2]
  |  |  |  Branch (261:34): [True: 0, False: 2]
  |  |  ------------------
  |  |  262|      2|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6069|      2|    ctxt->value->floatval /= val;
 6070|      2|}
xmlXPathNextDescendant:
 6271|     75|xmlXPathNextDescendant(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6272|     75|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6272:9): [True: 0, False: 75]
  |  Branch (6272:27): [True: 0, False: 75]
  ------------------
 6273|     75|    if (cur == NULL) {
  ------------------
  |  Branch (6273:9): [True: 4, False: 71]
  ------------------
 6274|      4|	if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6274:6): [True: 0, False: 4]
  ------------------
 6275|      0|	    return(NULL);
 6276|      4|	if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6276:6): [True: 0, False: 4]
  ------------------
 6277|      4|	    (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6277:6): [True: 0, False: 4]
  ------------------
 6278|      0|	    return(NULL);
 6279|       |
 6280|      4|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6280:13): [True: 4, False: 0]
  ------------------
 6281|      4|	    return(ctxt->context->doc->children);
 6282|      0|        return(ctxt->context->node->children);
 6283|      4|    }
 6284|       |
 6285|     71|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (6285:9): [True: 0, False: 71]
  ------------------
 6286|      0|        return(NULL);
 6287|     71|    if (cur->children != NULL) {
  ------------------
  |  Branch (6287:9): [True: 46, False: 25]
  ------------------
 6288|       |	/*
 6289|       |	 * Do not descend on entities declarations
 6290|       |	 */
 6291|     46|	if (cur->children->type != XML_ENTITY_DECL) {
  ------------------
  |  Branch (6291:6): [True: 46, False: 0]
  ------------------
 6292|     46|	    cur = cur->children;
 6293|       |	    /*
 6294|       |	     * Skip DTDs
 6295|       |	     */
 6296|     46|	    if (cur->type != XML_DTD_NODE)
  ------------------
  |  Branch (6296:10): [True: 46, False: 0]
  ------------------
 6297|     46|		return(cur);
 6298|     46|	}
 6299|     46|    }
 6300|       |
 6301|     25|    if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6301:9): [True: 0, False: 25]
  ------------------
 6302|       |
 6303|     25|    while (cur->next != NULL) {
  ------------------
  |  Branch (6303:12): [True: 0, False: 25]
  ------------------
 6304|      0|	cur = cur->next;
 6305|      0|	if ((cur->type != XML_ENTITY_DECL) &&
  ------------------
  |  Branch (6305:6): [True: 0, False: 0]
  ------------------
 6306|      0|	    (cur->type != XML_DTD_NODE))
  ------------------
  |  Branch (6306:6): [True: 0, False: 0]
  ------------------
 6307|      0|	    return(cur);
 6308|      0|    }
 6309|       |
 6310|     50|    do {
 6311|     50|        cur = cur->parent;
 6312|     50|	if (cur == NULL) break;
  ------------------
  |  Branch (6312:6): [True: 0, False: 50]
  ------------------
 6313|     50|	if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6313:6): [True: 25, False: 25]
  ------------------
 6314|     25|	if (cur->next != NULL) {
  ------------------
  |  Branch (6314:6): [True: 0, False: 25]
  ------------------
 6315|      0|	    cur = cur->next;
 6316|      0|	    return(cur);
 6317|      0|	}
 6318|     25|    } while (cur != NULL);
  ------------------
  |  Branch (6318:14): [True: 25, False: 0]
  ------------------
 6319|      0|    return(cur);
 6320|     25|}
xmlXPathNextDescendantOrSelf:
 6334|     84|xmlXPathNextDescendantOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6335|     84|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6335:9): [True: 0, False: 84]
  |  Branch (6335:27): [True: 0, False: 84]
  ------------------
 6336|     84|    if (cur == NULL)
  ------------------
  |  Branch (6336:9): [True: 21, False: 63]
  ------------------
 6337|     21|        return(ctxt->context->node);
 6338|       |
 6339|     63|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6339:9): [True: 0, False: 63]
  ------------------
 6340|      0|        return(NULL);
 6341|     63|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6341:9): [True: 0, False: 63]
  ------------------
 6342|     63|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6342:9): [True: 0, False: 63]
  ------------------
 6343|      0|        return(NULL);
 6344|       |
 6345|     63|    return(xmlXPathNextDescendant(ctxt, cur));
 6346|     63|}
xmlXPathNextParent:
 6357|    105|xmlXPathNextParent(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6358|    105|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6358:9): [True: 0, False: 105]
  |  Branch (6358:27): [True: 0, False: 105]
  ------------------
 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|    105|    if (cur == NULL) {
  ------------------
  |  Branch (6364:9): [True: 63, False: 42]
  ------------------
 6365|     63|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6365:6): [True: 0, False: 63]
  ------------------
 6366|     63|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6366:10): [True: 63, False: 0]
  ------------------
 6367|     21|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6367:13): [True: 21, False: 42]
  ------------------
 6368|     42|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6368:13): [True: 21, False: 42]
  ------------------
 6369|     42|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6369:13): [True: 0, False: 63]
  ------------------
 6370|     42|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6370:13): [True: 0, False: 63]
  ------------------
 6371|     42|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6371:13): [True: 0, False: 63]
  ------------------
 6372|     42|            case XML_PI_NODE:
  ------------------
  |  Branch (6372:13): [True: 0, False: 63]
  ------------------
 6373|     42|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6373:13): [True: 0, False: 63]
  ------------------
 6374|     42|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6374:13): [True: 0, False: 63]
  ------------------
 6375|     42|            case XML_DTD_NODE:
  ------------------
  |  Branch (6375:13): [True: 0, False: 63]
  ------------------
 6376|     42|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6376:6): [True: 0, False: 63]
  ------------------
 6377|     42|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6377:6): [True: 0, False: 63]
  ------------------
 6378|     42|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6378:6): [True: 0, False: 63]
  ------------------
 6379|     42|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6379:6): [True: 0, False: 63]
  ------------------
 6380|     42|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6380:6): [True: 0, False: 63]
  ------------------
 6381|     42|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6381:7): [True: 0, False: 42]
  ------------------
 6382|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6383|     42|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6383:7): [True: 21, False: 21]
  ------------------
 6384|     21|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6384:8): [True: 0, False: 21]
  ------------------
 6385|     21|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6385:8): [True: 0, False: 21]
  ------------------
 6386|     21|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|     21|#define BAD_CAST (xmlChar *)
  ------------------
 6387|      0|		    return(NULL);
 6388|     42|		return(ctxt->context->node->parent);
 6389|      0|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6389:13): [True: 0, False: 63]
  ------------------
 6390|      0|		xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
 6391|       |
 6392|      0|		return(att->parent);
 6393|     42|	    }
 6394|     21|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6394:13): [True: 21, False: 42]
  ------------------
 6395|     21|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6395:13): [True: 0, False: 63]
  ------------------
 6396|     21|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6396:13): [True: 0, False: 63]
  ------------------
 6397|     21|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6397:13): [True: 0, False: 63]
  ------------------
 6398|     21|                return(NULL);
 6399|      0|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6399:6): [True: 0, False: 63]
  ------------------
 6400|      0|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6401|       |
 6402|      0|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6402:7): [True: 0, False: 0]
  ------------------
 6403|      0|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6403:7): [True: 0, False: 0]
  ------------------
 6404|      0|		    return((xmlNodePtr) ns->next);
 6405|      0|                return(NULL);
 6406|      0|	    }
 6407|     63|	}
 6408|     63|    }
 6409|     42|    return(NULL);
 6410|    105|}
xmlXPathRoot:
 6887|  2.76k|xmlXPathRoot(xmlXPathParserContext *ctxt) {
 6888|  2.76k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (6888:9): [True: 0, False: 2.76k]
  |  Branch (6888:27): [True: 0, False: 2.76k]
  ------------------
 6889|      0|	return;
 6890|  2.76k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 6891|  2.76k|                                            (xmlNodePtr) ctxt->context->doc));
 6892|  2.76k|}
xmlXPathLastFunction:
 6911|     14|xmlXPathLastFunction(xmlXPathParserContext *ctxt, int nargs) {
 6912|     42|    CHECK_ARITY(0);
  ------------------
  |  |  280|     14|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 14]
  |  |  ------------------
  |  |  281|     14|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 14]
  |  |  ------------------
  |  |  282|     14|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { 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; }
  |  |  ------------------
  ------------------
 6913|     42|    if (ctxt->context->contextSize >= 0) {
  ------------------
  |  Branch (6913:9): [True: 14, False: 0]
  ------------------
 6914|     14|	xmlXPathValuePush(ctxt,
 6915|     14|	    xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize));
 6916|     14|    } else {
 6917|      0|	XP_ERROR(XPATH_INVALID_CTXT_SIZE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6918|      0|    }
 6919|     42|}
xmlXPathStringFunction:
 7312|    126|xmlXPathStringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7313|    126|    xmlXPathObjectPtr cur;
 7314|    126|    xmlChar *stringval;
 7315|       |
 7316|    126|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7316:9): [True: 0, False: 126]
  ------------------
 7317|    126|    if (nargs == 0) {
  ------------------
  |  Branch (7317:9): [True: 0, False: 126]
  ------------------
 7318|      0|        stringval = xmlXPathCastNodeToString(ctxt->context->node);
 7319|      0|        if (stringval == NULL)
  ------------------
  |  Branch (7319:13): [True: 0, False: 0]
  ------------------
 7320|      0|            xmlXPathPErrMemory(ctxt);
 7321|      0|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval));
 7322|      0|	return;
 7323|      0|    }
 7324|       |
 7325|    504|    CHECK_ARITY(1);
  ------------------
  |  |  280|    126|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 126]
  |  |  ------------------
  |  |  281|    126|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 126]
  |  |  ------------------
  |  |  282|    126|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    126|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 126]
  |  |  ------------------
  |  |  284|    126|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7326|    504|    cur = xmlXPathValuePop(ctxt);
 7327|    504|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7327:9): [True: 0, False: 126]
  ------------------
 7328|    126|    if (cur->type != XPATH_STRING) {
  ------------------
  |  Branch (7328:9): [True: 126, False: 0]
  ------------------
 7329|    126|        stringval = xmlXPathCastToString(cur);
 7330|    126|        if (stringval == NULL)
  ------------------
  |  Branch (7330:13): [True: 0, False: 126]
  ------------------
 7331|      0|            xmlXPathPErrMemory(ctxt);
 7332|    126|        xmlXPathReleaseObject(ctxt->context, cur);
 7333|    126|        cur = xmlXPathCacheWrapString(ctxt, stringval);
 7334|    126|    }
 7335|    126|    xmlXPathValuePush(ctxt, cur);
 7336|    126|}
xmlXPathConcatFunction:
 7388|      8|xmlXPathConcatFunction(xmlXPathParserContext *ctxt, int nargs) {
 7389|      8|    xmlXPathObjectPtr cur, newobj;
 7390|      8|    xmlChar *tmp;
 7391|       |
 7392|      8|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7392:9): [True: 0, False: 8]
  ------------------
 7393|      8|    if (nargs < 2) {
  ------------------
  |  Branch (7393:9): [True: 0, False: 8]
  ------------------
 7394|      0|	CHECK_ARITY(2);
  ------------------
  |  |  280|      0|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { 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|      0|    }
 7396|       |
 7397|      8|    CAST_TO_STRING;
  ------------------
  |  |  290|      8|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 8, False: 0]
  |  |  |  Branch (290:34): [True: 8, False: 0]
  |  |  ------------------
  |  |  291|      8|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7398|      8|    cur = xmlXPathValuePop(ctxt);
 7399|      8|    if ((cur == NULL) || (cur->type != XPATH_STRING)) {
  ------------------
  |  Branch (7399:9): [True: 0, False: 8]
  |  Branch (7399:26): [True: 0, False: 8]
  ------------------
 7400|      0|	xmlXPathReleaseObject(ctxt->context, cur);
 7401|      0|	return;
 7402|      0|    }
 7403|      8|    nargs--;
 7404|       |
 7405|     88|    while (nargs > 0) {
  ------------------
  |  Branch (7405:12): [True: 80, False: 8]
  ------------------
 7406|     80|	CAST_TO_STRING;
  ------------------
  |  |  290|     80|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 80, False: 0]
  |  |  |  Branch (290:34): [True: 72, False: 8]
  |  |  ------------------
  |  |  291|     80|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7407|     80|	newobj = xmlXPathValuePop(ctxt);
 7408|     80|	if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
  ------------------
  |  Branch (7408:6): [True: 0, False: 80]
  |  Branch (7408:26): [True: 0, False: 80]
  ------------------
 7409|      0|	    xmlXPathReleaseObject(ctxt->context, newobj);
 7410|      0|	    xmlXPathReleaseObject(ctxt->context, cur);
 7411|      0|	    XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7412|      0|	}
 7413|     80|	tmp = xmlStrcat(newobj->stringval, cur->stringval);
 7414|     80|        if (tmp == NULL)
  ------------------
  |  Branch (7414:13): [True: 0, False: 80]
  ------------------
 7415|      0|            xmlXPathPErrMemory(ctxt);
 7416|     80|	newobj->stringval = cur->stringval;
 7417|     80|	cur->stringval = tmp;
 7418|     80|	xmlXPathReleaseObject(ctxt->context, newobj);
 7419|     80|	nargs--;
 7420|     80|    }
 7421|      8|    xmlXPathValuePush(ctxt, cur);
 7422|      8|}
xmlXPathSubstringFunction:
 7520|      8|xmlXPathSubstringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7521|      8|    xmlXPathObjectPtr str, start, len;
 7522|      8|    double le=0, in;
 7523|      8|    int i = 1, j = INT_MAX;
 7524|       |
 7525|      8|    if (nargs < 2) {
  ------------------
  |  Branch (7525:9): [True: 0, False: 8]
  ------------------
 7526|      0|	CHECK_ARITY(2);
  ------------------
  |  |  280|      0|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { 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|      0|    }
 7528|      8|    if (nargs > 3) {
  ------------------
  |  Branch (7528:9): [True: 0, False: 8]
  ------------------
 7529|      0|	CHECK_ARITY(3);
  ------------------
  |  |  280|      0|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  281|      0|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  282|      0|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { 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|      0|    }
 7531|       |    /*
 7532|       |     * take care of possible last (position) argument
 7533|       |    */
 7534|      8|    if (nargs == 3) {
  ------------------
  |  Branch (7534:9): [True: 0, False: 8]
  ------------------
 7535|      0|	CAST_TO_NUMBER;
  ------------------
  |  |  297|      0|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 0, False: 0]
  |  |  |  Branch (297:34): [True: 0, False: 0]
  |  |  ------------------
  |  |  298|      0|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7536|      0|	CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|      0|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 0]
  |  |  |  Branch (261:34): [True: 0, False: 0]
  |  |  ------------------
  |  |  262|      0|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7537|      0|	len = xmlXPathValuePop(ctxt);
 7538|      0|	le = len->floatval;
 7539|      0|	xmlXPathReleaseObject(ctxt->context, len);
 7540|      0|    }
 7541|       |
 7542|      8|    CAST_TO_NUMBER;
  ------------------
  |  |  297|      8|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 8, False: 0]
  |  |  |  Branch (297:34): [True: 0, False: 8]
  |  |  ------------------
  |  |  298|      8|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7543|      8|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|      8|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 8]
  |  |  |  Branch (261:34): [True: 0, False: 8]
  |  |  ------------------
  |  |  262|      8|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7544|      8|    start = xmlXPathValuePop(ctxt);
 7545|      8|    in = start->floatval;
 7546|      8|    xmlXPathReleaseObject(ctxt->context, start);
 7547|      8|    CAST_TO_STRING;
  ------------------
  |  |  290|      8|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 8, False: 0]
  |  |  |  Branch (290:34): [True: 0, False: 8]
  |  |  ------------------
  |  |  291|      8|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7548|      8|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|      8|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 8]
  |  |  |  Branch (261:34): [True: 0, False: 8]
  |  |  ------------------
  |  |  262|      8|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7549|      8|    str = xmlXPathValuePop(ctxt);
 7550|       |
 7551|      8|    if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7551:9): [True: 0, False: 8]
  ------------------
 7552|      0|        i = INT_MAX;
 7553|      8|    } else if (in >= 1.0) {
  ------------------
  |  Branch (7553:16): [True: 6, False: 2]
  ------------------
 7554|      6|        i = (int)in;
 7555|      6|        if (in - floor(in) >= 0.5)
  ------------------
  |  Branch (7555:13): [True: 0, False: 6]
  ------------------
 7556|      0|            i += 1;
 7557|      6|    }
 7558|       |
 7559|      8|    if (nargs == 3) {
  ------------------
  |  Branch (7559:9): [True: 0, False: 8]
  ------------------
 7560|      0|        double rin, rle, end;
 7561|       |
 7562|      0|        rin = floor(in);
 7563|      0|        if (in - rin >= 0.5)
  ------------------
  |  Branch (7563:13): [True: 0, False: 0]
  ------------------
 7564|      0|            rin += 1.0;
 7565|       |
 7566|      0|        rle = floor(le);
 7567|      0|        if (le - rle >= 0.5)
  ------------------
  |  Branch (7567:13): [True: 0, False: 0]
  ------------------
 7568|      0|            rle += 1.0;
 7569|       |
 7570|      0|        end = rin + rle;
 7571|      0|        if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7571:13): [True: 0, False: 0]
  ------------------
 7572|      0|            j = 1;
 7573|      0|        } else if (end < INT_MAX) {
  ------------------
  |  Branch (7573:20): [True: 0, False: 0]
  ------------------
 7574|      0|            j = (int)end;
 7575|      0|        }
 7576|      0|    }
 7577|       |
 7578|      8|    i -= 1;
 7579|      8|    j -= 1;
 7580|       |
 7581|      8|    if ((i < j) && (i < xmlUTF8Strlen(str->stringval))) {
  ------------------
  |  Branch (7581:9): [True: 8, False: 0]
  |  Branch (7581:20): [True: 8, False: 0]
  ------------------
 7582|      8|        xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i);
 7583|      8|        if (ret == NULL)
  ------------------
  |  Branch (7583:13): [True: 0, False: 8]
  ------------------
 7584|      0|            xmlXPathPErrMemory(ctxt);
 7585|      8|	xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret));
 7586|      8|	xmlFree(ret);
 7587|      8|    } else {
 7588|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7589|      0|    }
 7590|       |
 7591|      8|    xmlXPathReleaseObject(ctxt->context, str);
 7592|      8|}
xmlXPathSubstringAfterFunction:
 7652|      2|xmlXPathSubstringAfterFunction(xmlXPathParserContext *ctxt, int nargs) {
 7653|      2|    xmlXPathObjectPtr str = NULL;
 7654|      2|    xmlXPathObjectPtr find = NULL;
 7655|      2|    const xmlChar *point;
 7656|      2|    xmlChar *result;
 7657|       |
 7658|      6|    CHECK_ARITY(2);
  ------------------
  |  |  280|      2|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 2]
  |  |  ------------------
  |  |  281|      2|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 2]
  |  |  ------------------
  |  |  282|      2|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      2|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 2]
  |  |  ------------------
  |  |  284|      2|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7659|      6|    CAST_TO_STRING;
  ------------------
  |  |  290|      2|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 2, False: 0]
  |  |  |  Branch (290:34): [True: 0, False: 2]
  |  |  ------------------
  |  |  291|      2|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7660|      6|    find = xmlXPathValuePop(ctxt);
 7661|      6|    CAST_TO_STRING;
  ------------------
  |  |  290|      2|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 2, False: 0]
  |  |  |  Branch (290:34): [True: 0, False: 2]
  |  |  ------------------
  |  |  291|      2|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7662|      6|    str = xmlXPathValuePop(ctxt);
 7663|      6|    if (ctxt->error != 0)
  ------------------
  |  Branch (7663:9): [True: 0, False: 2]
  ------------------
 7664|      0|        goto error;
 7665|       |
 7666|      2|    point = xmlStrstr(str->stringval, find->stringval);
 7667|      2|    if (point == NULL) {
  ------------------
  |  Branch (7667:9): [True: 2, False: 0]
  ------------------
 7668|      2|        result = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 7669|      2|    } else {
 7670|      0|        result = xmlStrdup(point + xmlStrlen(find->stringval));
 7671|      0|    }
 7672|      2|    if (result == NULL) {
  ------------------
  |  Branch (7672:9): [True: 0, False: 2]
  ------------------
 7673|      0|        xmlXPathPErrMemory(ctxt);
 7674|      0|        goto error;
 7675|      0|    }
 7676|      2|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, result));
 7677|       |
 7678|      2|error:
 7679|      2|    xmlXPathReleaseObject(ctxt->context, str);
 7680|      2|    xmlXPathReleaseObject(ctxt->context, find);
 7681|      2|}
xmlXPathTranslateFunction:
 7762|     23|xmlXPathTranslateFunction(xmlXPathParserContext *ctxt, int nargs) {
 7763|     23|    xmlXPathObjectPtr str = NULL;
 7764|     23|    xmlXPathObjectPtr from = NULL;
 7765|     23|    xmlXPathObjectPtr to = NULL;
 7766|     23|    xmlBufPtr target;
 7767|     23|    int offset, max;
 7768|     23|    int ch;
 7769|     23|    const xmlChar *point;
 7770|     23|    xmlChar *cptr, *content;
 7771|       |
 7772|     69|    CHECK_ARITY(3);
  ------------------
  |  |  280|     23|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 23]
  |  |  ------------------
  |  |  281|     23|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 23]
  |  |  ------------------
  |  |  282|     23|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     23|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 23]
  |  |  ------------------
  |  |  284|     23|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7773|       |
 7774|     69|    CAST_TO_STRING;
  ------------------
  |  |  290|     23|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 23, False: 0]
  |  |  |  Branch (290:34): [True: 23, False: 0]
  |  |  ------------------
  |  |  291|     23|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7775|     69|    to = xmlXPathValuePop(ctxt);
 7776|     69|    CAST_TO_STRING;
  ------------------
  |  |  290|     23|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 23, False: 0]
  |  |  |  Branch (290:34): [True: 9, False: 14]
  |  |  ------------------
  |  |  291|     23|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7777|     69|    from = xmlXPathValuePop(ctxt);
 7778|     69|    CAST_TO_STRING;
  ------------------
  |  |  290|     23|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 23, False: 0]
  |  |  |  Branch (290:34): [True: 14, False: 9]
  |  |  ------------------
  |  |  291|     23|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7779|     69|    str = xmlXPathValuePop(ctxt);
 7780|     69|    if (ctxt->error != 0)
  ------------------
  |  Branch (7780:9): [True: 0, False: 23]
  ------------------
 7781|      0|        goto error;
 7782|       |
 7783|       |    /*
 7784|       |     * Account for quadratic runtime
 7785|       |     */
 7786|     23|    if (ctxt->context->opLimit != 0) {
  ------------------
  |  Branch (7786:9): [True: 0, False: 23]
  ------------------
 7787|      0|        unsigned long f1 = xmlStrlen(from->stringval);
 7788|      0|        unsigned long f2 = xmlStrlen(str->stringval);
 7789|       |
 7790|      0|        if ((f1 > 0) && (f2 > 0)) {
  ------------------
  |  Branch (7790:13): [True: 0, False: 0]
  |  Branch (7790:25): [True: 0, False: 0]
  ------------------
 7791|      0|            unsigned long p;
 7792|       |
 7793|      0|            f1 = f1 / 10 + 1;
 7794|      0|            f2 = f2 / 10 + 1;
 7795|      0|            p = f1 > ULONG_MAX / f2 ? ULONG_MAX : f1 * f2;
  ------------------
  |  Branch (7795:17): [True: 0, False: 0]
  ------------------
 7796|      0|            if (xmlXPathCheckOpLimit(ctxt, p) < 0)
  ------------------
  |  Branch (7796:17): [True: 0, False: 0]
  ------------------
 7797|      0|                goto error;
 7798|      0|        }
 7799|      0|    }
 7800|       |
 7801|     23|    target = xmlBufCreate(50);
 7802|     23|    if (target == NULL) {
  ------------------
  |  Branch (7802:9): [True: 0, False: 23]
  ------------------
 7803|      0|        xmlXPathPErrMemory(ctxt);
 7804|      0|        goto error;
 7805|      0|    }
 7806|       |
 7807|     23|    max = xmlUTF8Strlen(to->stringval);
 7808|  2.41M|    for (cptr = str->stringval; (ch=*cptr); ) {
  ------------------
  |  Branch (7808:33): [True: 2.41M, False: 23]
  ------------------
 7809|  2.41M|        offset = xmlUTF8Strloc(from->stringval, cptr);
 7810|  2.41M|        if (offset >= 0) {
  ------------------
  |  Branch (7810:13): [True: 35.7k, False: 2.38M]
  ------------------
 7811|  35.7k|            if (offset < max) {
  ------------------
  |  Branch (7811:17): [True: 28.4k, False: 7.25k]
  ------------------
 7812|  28.4k|                point = xmlUTF8Strpos(to->stringval, offset);
 7813|  28.4k|                if (point)
  ------------------
  |  Branch (7813:21): [True: 28.4k, False: 0]
  ------------------
 7814|  28.4k|                    xmlBufAdd(target, point, xmlUTF8Strsize(point, 1));
 7815|  28.4k|            }
 7816|  35.7k|        } else
 7817|  2.38M|            xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1));
 7818|       |
 7819|       |        /* Step to next character in input */
 7820|  2.41M|        cptr++;
 7821|  2.41M|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (7821:14): [True: 1.90k, False: 2.41M]
  ------------------
 7822|       |            /* if not simple ascii, verify proper format */
 7823|  1.90k|            if ( (ch & 0xc0) != 0xc0 ) {
  ------------------
  |  Branch (7823:18): [True: 0, False: 1.90k]
  ------------------
 7824|      0|                xmlXPathErr(ctxt, XPATH_INVALID_CHAR_ERROR);
 7825|      0|                break;
 7826|      0|            }
 7827|       |            /* then skip over remaining bytes for this char */
 7828|  4.73k|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (7828:21): [True: 2.82k, False: 1.90k]
  ------------------
 7829|  2.82k|                if ( (*cptr++ & 0xc0) != 0x80 ) {
  ------------------
  |  Branch (7829:22): [True: 0, False: 2.82k]
  ------------------
 7830|      0|                    xmlXPathErr(ctxt, XPATH_INVALID_CHAR_ERROR);
 7831|      0|                    break;
 7832|      0|                }
 7833|  1.90k|            if (ch & 0x80) /* must have had error encountered */
  ------------------
  |  Branch (7833:17): [True: 0, False: 1.90k]
  ------------------
 7834|      0|                break;
 7835|  1.90k|        }
 7836|  2.41M|    }
 7837|       |
 7838|     23|    content = xmlBufDetach(target);
 7839|     23|    if (content == NULL)
  ------------------
  |  Branch (7839:9): [True: 0, False: 23]
  ------------------
 7840|      0|        xmlXPathPErrMemory(ctxt);
 7841|     23|    else
 7842|     23|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
 7843|     23|    xmlBufFree(target);
 7844|     23|error:
 7845|     23|    xmlXPathReleaseObject(ctxt->context, str);
 7846|     23|    xmlXPathReleaseObject(ctxt->context, from);
 7847|     23|    xmlXPathReleaseObject(ctxt->context, to);
 7848|     23|}
xmlXPathBooleanFunction:
 7863|     17|xmlXPathBooleanFunction(xmlXPathParserContext *ctxt, int nargs) {
 7864|     17|    xmlXPathObjectPtr cur;
 7865|       |
 7866|     51|    CHECK_ARITY(1);
  ------------------
  |  |  280|     17|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 17]
  |  |  ------------------
  |  |  281|     17|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 17]
  |  |  ------------------
  |  |  282|     17|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     17|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 17]
  |  |  ------------------
  |  |  284|     17|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7867|     51|    cur = xmlXPathValuePop(ctxt);
 7868|     51|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7868:9): [True: 0, False: 17]
  ------------------
 7869|     17|    if (cur->type != XPATH_BOOLEAN) {
  ------------------
  |  Branch (7869:9): [True: 17, False: 0]
  ------------------
 7870|     17|        int boolval = xmlXPathCastToBoolean(cur);
 7871|       |
 7872|     17|        xmlXPathReleaseObject(ctxt->context, cur);
 7873|     17|        cur = xmlXPathCacheNewBoolean(ctxt, boolval);
 7874|     17|    }
 7875|     17|    xmlXPathValuePush(ctxt, cur);
 7876|     17|}
xmlXPathNumberFunction:
 7987|  3.89k|xmlXPathNumberFunction(xmlXPathParserContext *ctxt, int nargs) {
 7988|  3.89k|    xmlXPathObjectPtr cur;
 7989|  3.89k|    double res;
 7990|       |
 7991|  3.89k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7991:9): [True: 0, False: 3.89k]
  ------------------
 7992|  3.89k|    if (nargs == 0) {
  ------------------
  |  Branch (7992:9): [True: 0, False: 3.89k]
  ------------------
 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|  15.5k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  3.89k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 3.89k]
  |  |  ------------------
  |  |  281|  3.89k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 3.89k]
  |  |  ------------------
  |  |  282|  3.89k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  3.89k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 3.89k]
  |  |  ------------------
  |  |  284|  3.89k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8008|  15.5k|    cur = xmlXPathValuePop(ctxt);
 8009|  15.5k|    if (cur->type != XPATH_NUMBER) {
  ------------------
  |  Branch (8009:9): [True: 3.89k, False: 0]
  ------------------
 8010|  3.89k|        double floatval;
 8011|       |
 8012|  3.89k|        floatval = xmlXPathCastToNumberInternal(ctxt, cur);
 8013|  3.89k|        xmlXPathReleaseObject(ctxt->context, cur);
 8014|  3.89k|        cur = xmlXPathCacheNewFloat(ctxt, floatval);
 8015|  3.89k|    }
 8016|  15.5k|    xmlXPathValuePush(ctxt, cur);
 8017|  15.5k|}
xmlXPathParseNCName:
 8147|  1.19M|xmlXPathParseNCName(xmlXPathParserContext *ctxt) {
 8148|  1.19M|    const xmlChar *end;
 8149|  1.19M|    xmlChar *ret;
 8150|       |
 8151|  1.19M|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8151:9): [True: 0, False: 1.19M]
  |  Branch (8151:27): [True: 0, False: 1.19M]
  ------------------
 8152|       |
 8153|  1.19M|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|  1.19M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|  1.19M|#define XML_SCAN_NC         1
  ------------------
 8154|  1.19M|    if (end == NULL) {
  ------------------
  |  Branch (8154:9): [True: 2, False: 1.19M]
  ------------------
 8155|      2|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      2|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8156|      0|    }
 8157|  1.19M|    if (end == ctxt->cur)
  ------------------
  |  Branch (8157:9): [True: 7.21k, False: 1.18M]
  ------------------
 8158|  7.21k|        return(NULL);
 8159|       |
 8160|  1.18M|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8161|  1.18M|    if (ret == NULL)
  ------------------
  |  Branch (8161:9): [True: 0, False: 1.18M]
  ------------------
 8162|      0|        xmlXPathPErrMemory(ctxt);
 8163|  1.18M|    ctxt->cur = end;
 8164|  1.18M|    return(ret);
 8165|  1.19M|}
xmlXPathStringEvalNumber:
 8236|   313k|xmlXPathStringEvalNumber(const xmlChar *str) {
 8237|   313k|    const xmlChar *cur = str;
 8238|   313k|    double ret;
 8239|   313k|    int ok = 0;
 8240|   313k|    int isneg = 0;
 8241|   313k|    int exponent = 0;
 8242|   313k|    int is_exponent_negative = 0;
 8243|   313k|#ifdef __GNUC__
 8244|   313k|    unsigned long tmp = 0;
 8245|   313k|    double temp;
 8246|   313k|#endif
 8247|   313k|    if (cur == NULL) return(0);
  ------------------
  |  Branch (8247:9): [True: 0, False: 313k]
  ------------------
 8248|   313k|    while (IS_BLANK_CH(*cur)) cur++;
 8249|   313k|    if (*cur == '-') {
  ------------------
  |  Branch (8249:9): [True: 0, False: 313k]
  ------------------
 8250|      0|	isneg = 1;
 8251|      0|	cur++;
 8252|      0|    }
 8253|   313k|    if ((*cur != '.') && ((*cur < '0') || (*cur > '9'))) {
  ------------------
  |  Branch (8253:9): [True: 313k, False: 0]
  |  Branch (8253:27): [True: 5.69k, False: 308k]
  |  Branch (8253:43): [True: 308k, False: 1]
  ------------------
 8254|   313k|        return(xmlXPathNAN);
 8255|   313k|    }
 8256|       |
 8257|      1|#ifdef __GNUC__
 8258|       |    /*
 8259|       |     * tmp/temp is a workaround against a gcc compiler bug
 8260|       |     * http://veillard.com/gcc.bug
 8261|       |     */
 8262|      1|    ret = 0;
 8263|      2|    while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8263:12): [True: 1, False: 1]
  |  Branch (8263:29): [True: 1, False: 0]
  ------------------
 8264|      1|	ret = ret * 10;
 8265|      1|	tmp = (*cur - '0');
 8266|      1|	ok = 1;
 8267|      1|	cur++;
 8268|      1|	temp = (double) tmp;
 8269|      1|	ret = ret + temp;
 8270|      1|    }
 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|      1|    if (*cur == '.') {
  ------------------
  |  Branch (8280:9): [True: 0, False: 1]
  ------------------
 8281|      0|	int v, frac = 0, max;
 8282|      0|	double fraction = 0;
 8283|       |
 8284|      0|        cur++;
 8285|      0|	if (((*cur < '0') || (*cur > '9')) && (!ok)) {
  ------------------
  |  Branch (8285:7): [True: 0, False: 0]
  |  Branch (8285:23): [True: 0, False: 0]
  |  Branch (8285:40): [True: 0, False: 0]
  ------------------
 8286|      0|	    return(xmlXPathNAN);
 8287|      0|	}
 8288|      0|        while (*cur == '0') {
  ------------------
  |  Branch (8288:16): [True: 0, False: 0]
  ------------------
 8289|      0|	    frac = frac + 1;
 8290|      0|	    cur++;
 8291|      0|        }
 8292|      0|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|      0|#define MAX_FRAC 20
  ------------------
 8293|      0|	while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) {
  ------------------
  |  Branch (8293:10): [True: 0, False: 0]
  |  Branch (8293:27): [True: 0, False: 0]
  |  Branch (8293:45): [True: 0, False: 0]
  ------------------
 8294|      0|	    v = (*cur - '0');
 8295|      0|	    fraction = fraction * 10 + v;
 8296|      0|	    frac = frac + 1;
 8297|      0|	    cur++;
 8298|      0|	}
 8299|      0|	fraction /= pow(10.0, frac);
 8300|      0|	ret = ret + fraction;
 8301|      0|	while ((*cur >= '0') && (*cur <= '9'))
  ------------------
  |  Branch (8301:9): [True: 0, False: 0]
  |  Branch (8301:26): [True: 0, False: 0]
  ------------------
 8302|      0|	    cur++;
 8303|      0|    }
 8304|      1|    if ((*cur == 'e') || (*cur == 'E')) {
  ------------------
  |  Branch (8304:9): [True: 0, False: 1]
  |  Branch (8304:26): [True: 0, False: 1]
  ------------------
 8305|      0|      cur++;
 8306|      0|      if (*cur == '-') {
  ------------------
  |  Branch (8306:11): [True: 0, False: 0]
  ------------------
 8307|      0|	is_exponent_negative = 1;
 8308|      0|	cur++;
 8309|      0|      } else if (*cur == '+') {
  ------------------
  |  Branch (8309:18): [True: 0, False: 0]
  ------------------
 8310|      0|        cur++;
 8311|      0|      }
 8312|      0|      while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8312:14): [True: 0, False: 0]
  |  Branch (8312:31): [True: 0, False: 0]
  ------------------
 8313|      0|        if (exponent < 1000000)
  ------------------
  |  Branch (8313:13): [True: 0, False: 0]
  ------------------
 8314|      0|	  exponent = exponent * 10 + (*cur - '0');
 8315|      0|	cur++;
 8316|      0|      }
 8317|      0|    }
 8318|      4|    while (IS_BLANK_CH(*cur)) cur++;
 8319|      1|    if (*cur != 0) return(xmlXPathNAN);
  ------------------
  |  Branch (8319:9): [True: 1, False: 0]
  ------------------
 8320|      0|    if (isneg) ret = -ret;
  ------------------
  |  Branch (8320:9): [True: 0, False: 0]
  ------------------
 8321|      0|    if (is_exponent_negative) exponent = -exponent;
  ------------------
  |  Branch (8321:9): [True: 0, False: 0]
  ------------------
 8322|      0|    ret *= pow(10.0, (double)exponent);
 8323|      0|    return(ret);
 8324|      1|}
xmlXPathIsNodeType:
 8548|    404|xmlXPathIsNodeType(const xmlChar *name) {
 8549|    404|    if (name == NULL)
  ------------------
  |  Branch (8549:9): [True: 0, False: 404]
  ------------------
 8550|      0|	return(0);
 8551|       |
 8552|    404|    if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|    404|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8552:9): [True: 0, False: 404]
  ------------------
 8553|      0|	return(1);
 8554|    404|    if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|    404|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8554:9): [True: 0, False: 404]
  ------------------
 8555|      0|	return(1);
 8556|    404|    if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    404|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8556:9): [True: 0, False: 404]
  ------------------
 8557|      0|	return(1);
 8558|    404|    if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|    404|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8558:9): [True: 0, False: 404]
  ------------------
 8559|      0|	return(1);
 8560|    404|    return(0);
 8561|    404|}
xmlXPathEvaluatePredicateResult:
11626|    758|                                xmlXPathObject *res) {
11627|    758|    if ((ctxt == NULL) || (res == NULL)) return(0);
  ------------------
  |  Branch (11627:9): [True: 0, False: 758]
  |  Branch (11627:27): [True: 0, False: 758]
  ------------------
11628|    758|    switch (res->type) {
11629|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (11629:9): [True: 0, False: 758]
  ------------------
11630|      0|	    return(res->boolval);
11631|    499|        case XPATH_NUMBER:
  ------------------
  |  Branch (11631:9): [True: 499, False: 259]
  ------------------
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|    499|	    return(res->floatval == ctxt->context->proximityPosition);
11637|      0|#endif
11638|    259|        case XPATH_NODESET:
  ------------------
  |  Branch (11638:9): [True: 259, False: 499]
  ------------------
11639|    259|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (11639:9): [True: 0, False: 758]
  ------------------
11640|    259|	    if (res->nodesetval == NULL)
  ------------------
  |  Branch (11640:10): [True: 0, False: 259]
  ------------------
11641|      0|		return(0);
11642|    259|	    return(res->nodesetval->nodeNr != 0);
11643|      0|        case XPATH_STRING:
  ------------------
  |  Branch (11643:9): [True: 0, False: 758]
  ------------------
11644|      0|	    return((res->stringval != NULL) && (res->stringval[0] != 0));
  ------------------
  |  Branch (11644:13): [True: 0, False: 0]
  |  Branch (11644:41): [True: 0, False: 0]
  ------------------
11645|      0|        default:
  ------------------
  |  Branch (11645:9): [True: 0, False: 758]
  ------------------
11646|      0|	    break;
11647|    758|    }
11648|      0|    return(0);
11649|    758|}
xmlXPathCtxtCompile:
11822|    192|xmlXPathCtxtCompile(xmlXPathContext *ctxt, const xmlChar *str) {
11823|    192|    xmlXPathParserContextPtr pctxt;
11824|    192|    xmlXPathContextPtr tmpctxt = NULL;
11825|    192|    xmlXPathCompExprPtr comp;
11826|    192|    int oldDepth = 0;
11827|       |
11828|    192|    if (str == NULL)
  ------------------
  |  Branch (11828:9): [True: 0, False: 192]
  ------------------
11829|      0|        return(NULL);
11830|       |
11831|       |#ifdef XPATH_STREAMING
11832|       |    comp = xmlXPathTryStreamCompile(ctxt, str);
11833|       |    if (comp != NULL)
11834|       |        return(comp);
11835|       |#endif
11836|       |
11837|    192|    xmlInitParser();
11838|       |
11839|       |    /*
11840|       |     * We need an xmlXPathContext for the depth check.
11841|       |     */
11842|    192|    if (ctxt == NULL) {
  ------------------
  |  Branch (11842:9): [True: 0, False: 192]
  ------------------
11843|      0|        tmpctxt = xmlXPathNewContext(NULL);
11844|      0|        if (tmpctxt == NULL)
  ------------------
  |  Branch (11844:13): [True: 0, False: 0]
  ------------------
11845|      0|            return(NULL);
11846|      0|        ctxt = tmpctxt;
11847|      0|    }
11848|       |
11849|    192|    pctxt = xmlXPathNewParserContext(str, ctxt);
11850|    192|    if (pctxt == NULL) {
  ------------------
  |  Branch (11850:9): [True: 0, False: 192]
  ------------------
11851|      0|        if (tmpctxt != NULL)
  ------------------
  |  Branch (11851:13): [True: 0, False: 0]
  ------------------
11852|      0|            xmlXPathFreeContext(tmpctxt);
11853|      0|        return NULL;
11854|      0|    }
11855|       |
11856|    192|    oldDepth = ctxt->depth;
11857|    192|    xmlXPathCompileExpr(pctxt, 1);
11858|    192|    ctxt->depth = oldDepth;
11859|       |
11860|    192|    if( pctxt->error != XPATH_EXPRESSION_OK )
  ------------------
  |  Branch (11860:9): [True: 70, False: 122]
  ------------------
11861|     70|    {
11862|     70|        xmlXPathFreeParserContext(pctxt);
11863|     70|        if (tmpctxt != NULL)
  ------------------
  |  Branch (11863:13): [True: 0, False: 70]
  ------------------
11864|      0|            xmlXPathFreeContext(tmpctxt);
11865|     70|        return(NULL);
11866|     70|    }
11867|       |
11868|    122|    if (*pctxt->cur != 0) {
  ------------------
  |  Branch (11868:9): [True: 7, False: 115]
  ------------------
11869|       |	/*
11870|       |	 * aleksey: in some cases this line prints *second* error message
11871|       |	 * (see bug #78858) and probably this should be fixed.
11872|       |	 * However, we are not sure that all error messages are printed
11873|       |	 * out in other places. It's not critical so we leave it as-is for now
11874|       |	 */
11875|      7|	xmlXPatherror(pctxt, __FILE__, __LINE__, XPATH_EXPR_ERROR);
11876|      7|	comp = NULL;
11877|    115|    } else {
11878|    115|	comp = pctxt->comp;
11879|    115|	if ((comp->nbStep > 1) && (comp->last >= 0)) {
  ------------------
  |  Branch (11879:6): [True: 115, False: 0]
  |  Branch (11879:28): [True: 115, False: 0]
  ------------------
11880|    115|            if (ctxt != NULL)
  ------------------
  |  Branch (11880:17): [True: 115, False: 0]
  ------------------
11881|    115|                oldDepth = ctxt->depth;
11882|    115|	    xmlXPathOptimizeExpression(pctxt, &comp->steps[comp->last]);
11883|    115|            if (ctxt != NULL)
  ------------------
  |  Branch (11883:17): [True: 115, False: 0]
  ------------------
11884|    115|                ctxt->depth = oldDepth;
11885|    115|	}
11886|    115|	pctxt->comp = NULL;
11887|    115|    }
11888|    122|    xmlXPathFreeParserContext(pctxt);
11889|    122|    if (tmpctxt != NULL)
  ------------------
  |  Branch (11889:9): [True: 0, False: 122]
  ------------------
11890|      0|        xmlXPathFreeContext(tmpctxt);
11891|       |
11892|    122|    if (comp != NULL) {
  ------------------
  |  Branch (11892:9): [True: 115, False: 7]
  ------------------
11893|    115|	comp->expr = xmlStrdup(str);
11894|    115|    }
11895|    122|    return(comp);
11896|    192|}
xmlXPathCompiledEval:
11970|    115|{
11971|    115|    xmlXPathObjectPtr res = NULL;
11972|       |
11973|    115|    xmlXPathCompiledEvalInternal(comp, ctx, &res, 0);
11974|    115|    return(res);
11975|    115|}
xpath.c:xmlXPathSFComputeHash:
  186|  8.84k|xmlXPathSFComputeHash(const xmlChar *name) {
  187|  8.84k|    unsigned hashValue = 5381;
  188|  8.84k|    const xmlChar *ptr;
  189|       |
  190|  76.3k|    for (ptr = name; *ptr; ptr++)
  ------------------
  |  Branch (190:22): [True: 67.4k, False: 8.84k]
  ------------------
  191|  67.4k|        hashValue = hashValue * 33 + *ptr;
  192|       |
  193|  8.84k|    return(hashValue);
  194|  8.84k|}
xpath.c:wrap_cmp:
  606|     85|    {
  607|     85|        int res = xmlXPathCmpNodesExt(x, y);
  608|     85|        return res == -2 ? res : -res;
  ------------------
  |  Branch (608:16): [True: 0, False: 85]
  ------------------
  609|     85|    }
xpath.c:xmlXPathCmpNodesExt:
  309|     85|xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
  310|     85|    int depth1, depth2;
  311|     85|    int misc = 0, precedence1 = 0, precedence2 = 0;
  312|     85|    xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
  313|     85|    xmlNodePtr cur, root;
  314|     85|    XML_INTPTR_T l1, l2;
  ------------------
  |  |   52|     85|  #define XML_INTPTR_T intptr_t
  ------------------
  315|       |
  316|     85|    if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (316:9): [True: 0, False: 85]
  |  Branch (316:28): [True: 0, False: 85]
  ------------------
  317|      0|	return(-2);
  318|       |
  319|     85|    if (node1 == node2)
  ------------------
  |  Branch (319:9): [True: 0, False: 85]
  ------------------
  320|      0|	return(0);
  321|       |
  322|       |    /*
  323|       |     * a couple of optimizations which will avoid computations in most cases
  324|       |     */
  325|     85|    switch (node1->type) {
  326|      0|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (326:2): [True: 0, False: 85]
  ------------------
  327|      0|	    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (327:10): [True: 0, False: 0]
  ------------------
  328|      0|		if ((0 > 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))
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 0, False: 0]
  ------------------
  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|      0|		    goto turtle_comparison;
  340|      0|	    }
  341|      0|	    break;
  342|      0|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (342:2): [True: 0, False: 85]
  ------------------
  343|      0|	    precedence1 = 1; /* element is owner */
  344|      0|	    miscNode1 = node1;
  345|      0|	    node1 = node1->parent;
  346|      0|	    misc = 1;
  347|      0|	    break;
  348|      0|	case XML_TEXT_NODE:
  ------------------
  |  Branch (348:2): [True: 0, False: 85]
  ------------------
  349|      0|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (349:2): [True: 0, False: 85]
  ------------------
  350|      0|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (350:2): [True: 0, False: 85]
  ------------------
  351|      0|	case XML_PI_NODE: {
  ------------------
  |  Branch (351:2): [True: 0, False: 85]
  ------------------
  352|      0|	    miscNode1 = node1;
  353|       |	    /*
  354|       |	    * Find nearest element node.
  355|       |	    */
  356|      0|	    if (node1->prev != NULL) {
  ------------------
  |  Branch (356:10): [True: 0, False: 0]
  ------------------
  357|      0|		do {
  358|      0|		    node1 = node1->prev;
  359|      0|		    if (node1->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (359:11): [True: 0, False: 0]
  ------------------
  360|      0|			precedence1 = 3; /* element in prev-sibl axis */
  361|      0|			break;
  362|      0|		    }
  363|      0|		    if (node1->prev == NULL) {
  ------------------
  |  Branch (363:11): [True: 0, False: 0]
  ------------------
  364|      0|			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|      0|			node1 = node1->parent;
  370|      0|			break;
  371|      0|		    }
  372|      0|		} while (1);
  ------------------
  |  Branch (372:12): [True: 0, Folded]
  ------------------
  373|      0|	    } else {
  374|      0|		precedence1 = 2; /* element is parent */
  375|      0|		node1 = node1->parent;
  376|      0|	    }
  377|      0|	    if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (377:10): [True: 0, False: 0]
  |  Branch (377:29): [True: 0, False: 0]
  ------------------
  378|      0|		(0 <= 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))
  |  |  ------------------
  ------------------
  |  Branch (378:3): [True: 0, False: 0]
  ------------------
  379|       |		/*
  380|       |		* Fallback for whatever case.
  381|       |		*/
  382|      0|		node1 = miscNode1;
  383|      0|		precedence1 = 0;
  384|      0|	    } else
  385|      0|		misc = 1;
  386|      0|	}
  387|      0|	    break;
  388|      0|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (388:2): [True: 0, False: 85]
  ------------------
  389|       |	    /*
  390|       |	    * TODO: why do we return 1 for namespace nodes?
  391|       |	    */
  392|      0|	    return(1);
  393|     85|	default:
  ------------------
  |  Branch (393:2): [True: 85, False: 0]
  ------------------
  394|     85|	    break;
  395|     85|    }
  396|     85|    switch (node2->type) {
  397|     85|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (397:2): [True: 85, False: 0]
  ------------------
  398|     85|	    break;
  399|      0|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (399:2): [True: 0, False: 85]
  ------------------
  400|      0|	    precedence2 = 1; /* element is owner */
  401|      0|	    miscNode2 = node2;
  402|      0|	    node2 = node2->parent;
  403|      0|	    misc = 1;
  404|      0|	    break;
  405|      0|	case XML_TEXT_NODE:
  ------------------
  |  Branch (405:2): [True: 0, False: 85]
  ------------------
  406|      0|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (406:2): [True: 0, False: 85]
  ------------------
  407|      0|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (407:2): [True: 0, False: 85]
  ------------------
  408|      0|	case XML_PI_NODE: {
  ------------------
  |  Branch (408:2): [True: 0, False: 85]
  ------------------
  409|      0|	    miscNode2 = node2;
  410|      0|	    if (node2->prev != NULL) {
  ------------------
  |  Branch (410:10): [True: 0, False: 0]
  ------------------
  411|      0|		do {
  412|      0|		    node2 = node2->prev;
  413|      0|		    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (413:11): [True: 0, False: 0]
  ------------------
  414|      0|			precedence2 = 3; /* element in prev-sibl axis */
  415|      0|			break;
  416|      0|		    }
  417|      0|		    if (node2->prev == NULL) {
  ------------------
  |  Branch (417:11): [True: 0, False: 0]
  ------------------
  418|      0|			precedence2 = 2; /* element is parent */
  419|      0|			node2 = node2->parent;
  420|      0|			break;
  421|      0|		    }
  422|      0|		} while (1);
  ------------------
  |  Branch (422:12): [True: 0, Folded]
  ------------------
  423|      0|	    } else {
  424|      0|		precedence2 = 2; /* element is parent */
  425|      0|		node2 = node2->parent;
  426|      0|	    }
  427|      0|	    if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (427:10): [True: 0, False: 0]
  |  Branch (427:29): [True: 0, False: 0]
  ------------------
  428|      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 (428:3): [True: 0, False: 0]
  ------------------
  429|      0|	    {
  430|      0|		node2 = miscNode2;
  431|      0|		precedence2 = 0;
  432|      0|	    } else
  433|      0|		misc = 1;
  434|      0|	}
  435|      0|	    break;
  436|      0|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (436:2): [True: 0, False: 85]
  ------------------
  437|      0|	    return(1);
  438|      0|	default:
  ------------------
  |  Branch (438:2): [True: 0, False: 85]
  ------------------
  439|      0|	    break;
  440|     85|    }
  441|     85|    if (misc) {
  ------------------
  |  Branch (441:9): [True: 0, False: 85]
  ------------------
  442|      0|	if (node1 == node2) {
  ------------------
  |  Branch (442:6): [True: 0, False: 0]
  ------------------
  443|      0|	    if (precedence1 == precedence2) {
  ------------------
  |  Branch (443:10): [True: 0, False: 0]
  ------------------
  444|       |		/*
  445|       |		* The ugly case; but normally there aren't many
  446|       |		* adjacent non-element nodes around.
  447|       |		*/
  448|      0|		cur = miscNode2->prev;
  449|      0|		while (cur != NULL) {
  ------------------
  |  Branch (449:10): [True: 0, False: 0]
  ------------------
  450|      0|		    if (cur == miscNode1)
  ------------------
  |  Branch (450:11): [True: 0, False: 0]
  ------------------
  451|      0|			return(1);
  452|      0|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (452:11): [True: 0, False: 0]
  ------------------
  453|      0|			return(-1);
  454|      0|		    cur = cur->prev;
  455|      0|		}
  456|      0|		return (-1);
  457|      0|	    } 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|      0|		if (precedence1 < precedence2)
  ------------------
  |  Branch (463:7): [True: 0, False: 0]
  ------------------
  464|      0|		    return(1);
  465|      0|		else
  466|      0|		    return(-1);
  467|      0|	    }
  468|      0|	}
  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|      0|	if ((precedence2 == 3) && (precedence1 > 1)) {
  ------------------
  |  Branch (478:6): [True: 0, False: 0]
  |  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|      0|	if ((precedence1 == 3) && (precedence2 > 1)) {
  ------------------
  |  Branch (486:6): [True: 0, False: 0]
  |  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|      0|    }
  495|       |
  496|       |    /*
  497|       |     * Speedup using document order if available.
  498|       |     */
  499|     85|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (499:9): [True: 0, False: 85]
  ------------------
  500|      0|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (500:2): [True: 0, False: 0]
  ------------------
  501|      0|	(0 > 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))
  |  |  ------------------
  ------------------
  |  Branch (501:2): [True: 0, False: 0]
  ------------------
  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|     85|turtle_comparison:
  514|       |
  515|     85|    if (node1 == node2->prev)
  ------------------
  |  Branch (515:9): [True: 0, False: 85]
  ------------------
  516|      0|	return(1);
  517|     85|    if (node1 == node2->next)
  ------------------
  |  Branch (517:9): [True: 0, False: 85]
  ------------------
  518|      0|	return(-1);
  519|       |    /*
  520|       |     * compute depth to root
  521|       |     */
  522|     85|    for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (522:35): [True: 85, False: 0]
  ------------------
  523|     85|	if (cur->parent == node1)
  ------------------
  |  Branch (523:6): [True: 85, False: 0]
  ------------------
  524|     85|	    return(1);
  525|      0|	depth2++;
  526|      0|    }
  527|      0|    root = cur;
  528|      0|    for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (528:35): [True: 0, False: 0]
  ------------------
  529|      0|	if (cur->parent == node2)
  ------------------
  |  Branch (529:6): [True: 0, False: 0]
  ------------------
  530|      0|	    return(-1);
  531|      0|	depth1++;
  532|      0|    }
  533|       |    /*
  534|       |     * Distinct document (or distinct entities :-( ) case.
  535|       |     */
  536|      0|    if (root != cur) {
  ------------------
  |  Branch (536:9): [True: 0, False: 0]
  ------------------
  537|      0|	return(-2);
  538|      0|    }
  539|       |    /*
  540|       |     * get the nearest common ancestor.
  541|       |     */
  542|      0|    while (depth1 > depth2) {
  ------------------
  |  Branch (542:12): [True: 0, False: 0]
  ------------------
  543|      0|	depth1--;
  544|      0|	node1 = node1->parent;
  545|      0|    }
  546|      0|    while (depth2 > depth1) {
  ------------------
  |  Branch (546:12): [True: 0, False: 0]
  ------------------
  547|      0|	depth2--;
  548|      0|	node2 = node2->parent;
  549|      0|    }
  550|      0|    while (node1->parent != node2->parent) {
  ------------------
  |  Branch (550:12): [True: 0, False: 0]
  ------------------
  551|      0|	node1 = node1->parent;
  552|      0|	node2 = node2->parent;
  553|       |	/* should not happen but just in case ... */
  554|      0|	if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (554:6): [True: 0, False: 0]
  |  Branch (554:25): [True: 0, False: 0]
  ------------------
  555|      0|	    return(-2);
  556|      0|    }
  557|       |    /*
  558|       |     * Find who's first.
  559|       |     */
  560|      0|    if (node1 == node2->prev)
  ------------------
  |  Branch (560:9): [True: 0, False: 0]
  ------------------
  561|      0|	return(1);
  562|      0|    if (node1 == node2->next)
  ------------------
  |  Branch (562:9): [True: 0, False: 0]
  ------------------
  563|      0|	return(-1);
  564|       |    /*
  565|       |     * Speedup using document order if available.
  566|       |     */
  567|      0|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (567:9): [True: 0, False: 0]
  ------------------
  568|      0|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (568:2): [True: 0, False: 0]
  ------------------
  569|      0|	(0 > 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))
  |  |  ------------------
  ------------------
  |  Branch (569:2): [True: 0, False: 0]
  ------------------
  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|      0|    for (cur = node1->next;cur != NULL;cur = cur->next)
  ------------------
  |  Branch (581:28): [True: 0, False: 0]
  ------------------
  582|      0|	if (cur == node2)
  ------------------
  |  Branch (582:6): [True: 0, False: 0]
  ------------------
  583|      0|	    return(1);
  584|      0|    return(-1); /* assume there is no sibling list corruption */
  585|      0|}
xpath.c:xmlXPathErrFmt:
  707|  16.4M|xmlXPathErrFmt(xmlXPathParserContext *ctxt, int code, const char *fmt, ...) {
  708|  16.4M|    va_list ap;
  709|  16.4M|    xmlStructuredErrorFunc schannel = NULL;
  710|  16.4M|    xmlGenericErrorFunc channel = NULL;
  711|  16.4M|    void *data = NULL;
  712|  16.4M|    xmlNodePtr node = NULL;
  713|  16.4M|    int res;
  714|       |
  715|  16.4M|    if (ctxt == NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 16.4M]
  ------------------
  716|      0|        return;
  717|  16.4M|    if ((code < 0) || (code > MAXERRNO))
  ------------------
  |  |  668|  16.4M|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|  16.4M|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  |  Branch (717:9): [True: 0, False: 16.4M]
  |  Branch (717:23): [True: 0, False: 16.4M]
  ------------------
  718|      0|	code = MAXERRNO;
  ------------------
  |  |  668|      0|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|      0|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  719|       |    /* Only report the first error */
  720|  16.4M|    if (ctxt->error != 0)
  ------------------
  |  Branch (720:9): [True: 16.4M, False: 127]
  ------------------
  721|  16.4M|        return;
  722|       |
  723|    127|    ctxt->error = code;
  724|       |
  725|    127|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (725:9): [True: 127, False: 0]
  ------------------
  726|    127|        xmlErrorPtr err = &ctxt->context->lastError;
  727|       |
  728|       |        /* Don't overwrite memory error. */
  729|    127|        if (err->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (729:13): [True: 0, False: 127]
  ------------------
  730|      0|            return;
  731|       |
  732|       |        /* cleanup current last error */
  733|    127|        xmlResetError(err);
  734|       |
  735|    127|        err->domain = XML_FROM_XPATH;
  736|    127|        err->code = code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK;
  737|    127|        err->level = XML_ERR_ERROR;
  738|    127|        if (ctxt->base != NULL) {
  ------------------
  |  Branch (738:13): [True: 74, False: 53]
  ------------------
  739|     74|            err->str1 = (char *) xmlStrdup(ctxt->base);
  740|     74|            if (err->str1 == NULL) {
  ------------------
  |  Branch (740:17): [True: 0, False: 74]
  ------------------
  741|      0|                xmlXPathPErrMemory(ctxt);
  742|      0|                return;
  743|      0|            }
  744|     74|        }
  745|    127|        err->int1 = ctxt->cur - ctxt->base;
  746|    127|        err->node = ctxt->context->debugNode;
  747|       |
  748|    127|        schannel = ctxt->context->error;
  749|    127|        data = ctxt->context->userData;
  750|    127|        node = ctxt->context->debugNode;
  751|    127|    }
  752|       |
  753|    127|    if (schannel == NULL) {
  ------------------
  |  Branch (753:9): [True: 127, False: 0]
  ------------------
  754|    127|        channel = xmlGenericError;
  ------------------
  |  |  976|    127|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  755|    127|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|    127|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  756|    127|    }
  757|       |
  758|    127|    va_start(ap, fmt);
  759|    127|    res = xmlVRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
  760|    127|                         code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
  761|    127|                         XML_ERR_ERROR, NULL, 0,
  762|    127|                         (const char *) ctxt->base, NULL, NULL,
  763|    127|                         ctxt->cur - ctxt->base, 0,
  764|    127|                         fmt, ap);
  765|    127|    va_end(ap);
  766|    127|    if (res < 0)
  ------------------
  |  Branch (766:9): [True: 0, False: 127]
  ------------------
  767|      0|        xmlXPathPErrMemory(ctxt);
  768|    127|}
xpath.c:xmlXPathCastToNumberInternal:
 1931|   318k|                             xmlXPathObjectPtr val) {
 1932|   318k|    double ret = 0.0;
 1933|       |
 1934|   318k|    if (val == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 318k]
  ------------------
 1935|      0|	return(xmlXPathNAN);
 1936|   318k|    switch (val->type) {
  ------------------
  |  Branch (1936:13): [True: 318k, False: 0]
  ------------------
 1937|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1937:5): [True: 0, False: 318k]
  ------------------
 1938|      0|	ret = xmlXPathNAN;
 1939|      0|	break;
 1940|   313k|    case XPATH_NODESET:
  ------------------
  |  Branch (1940:5): [True: 313k, False: 4.74k]
  ------------------
 1941|   313k|    case XPATH_XSLT_TREE: {
  ------------------
  |  Branch (1941:5): [True: 0, False: 318k]
  ------------------
 1942|   313k|        xmlChar *str;
 1943|       |
 1944|   313k|	str = xmlXPathCastNodeSetToString(val->nodesetval);
 1945|   313k|        if (str == NULL) {
  ------------------
  |  Branch (1945:13): [True: 0, False: 313k]
  ------------------
 1946|      0|            xmlXPathPErrMemory(ctxt);
 1947|      0|            ret = xmlXPathNAN;
 1948|   313k|        } else {
 1949|   313k|	    ret = xmlXPathCastStringToNumber(str);
 1950|   313k|            xmlFree(str);
 1951|   313k|        }
 1952|   313k|	break;
 1953|   313k|    }
 1954|     13|    case XPATH_STRING:
  ------------------
  |  Branch (1954:5): [True: 13, False: 318k]
  ------------------
 1955|     13|	ret = xmlXPathCastStringToNumber(val->stringval);
 1956|     13|	break;
 1957|  4.73k|    case XPATH_NUMBER:
  ------------------
  |  Branch (1957:5): [True: 4.73k, False: 313k]
  ------------------
 1958|  4.73k|	ret = val->floatval;
 1959|  4.73k|	break;
 1960|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1960:5): [True: 0, False: 318k]
  ------------------
 1961|      0|	ret = xmlXPathCastBooleanToNumber(val->boolval);
 1962|      0|	break;
 1963|      0|    case XPATH_USERS:
  ------------------
  |  Branch (1963:5): [True: 0, False: 318k]
  ------------------
 1964|       |	/* TODO */
 1965|      0|	ret = xmlXPathNAN;
 1966|      0|	break;
 1967|   318k|    }
 1968|   318k|    return(ret);
 1969|   318k|}
xpath.c:xmlXPathNodeSetGrow:
 2735|   311k|xmlXPathNodeSetGrow(xmlNodeSetPtr cur) {
 2736|   311k|    xmlNodePtr *temp;
 2737|   311k|    int newSize;
 2738|       |
 2739|   311k|    newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]),
 2740|   311k|                              XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  | 2593|   311k|#define XML_NODESET_DEFAULT	10
  ------------------
                                            XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  |  105|   311k|#define XPATH_MAX_NODESET_LENGTH 10000000
  ------------------
 2741|   311k|    if (newSize < 0)
  ------------------
  |  Branch (2741:9): [True: 0, False: 311k]
  ------------------
 2742|      0|        return(-1);
 2743|   311k|    temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0]));
 2744|   311k|    if (temp == NULL)
  ------------------
  |  Branch (2744:9): [True: 0, False: 311k]
  ------------------
 2745|      0|        return(-1);
 2746|   311k|    cur->nodeMax = newSize;
 2747|   311k|    cur->nodeTab = temp;
 2748|       |
 2749|   311k|    return(0);
 2750|   311k|}
xpath.c:xmlXPathReleaseObject:
 4257|   640k|{
 4258|   640k|    if (obj == NULL)
  ------------------
  |  Branch (4258:9): [True: 0, False: 640k]
  ------------------
 4259|      0|	return;
 4260|   640k|    if ((ctxt == NULL) || (ctxt->cache == NULL)) {
  ------------------
  |  Branch (4260:9): [True: 0, False: 640k]
  |  Branch (4260:27): [True: 640k, False: 0]
  ------------------
 4261|   640k|	 xmlXPathFreeObject(obj);
 4262|   640k|    } 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|   640k|}
xpath.c:xmlXPathFormatNumber:
 2229|     24|{
 2230|     24|    switch (xmlXPathIsInf(number)) {
 2231|      0|    case 1:
  ------------------
  |  Branch (2231:5): [True: 0, False: 24]
  ------------------
 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: 24]
  ------------------
 2236|      0|	if (buffersize > (int)sizeof("-Infinity"))
  ------------------
  |  Branch (2236:6): [True: 0, False: 0]
  ------------------
 2237|      0|	    snprintf(buffer, buffersize, "-Infinity");
 2238|      0|	break;
 2239|     24|    default:
  ------------------
  |  Branch (2239:5): [True: 24, False: 0]
  ------------------
 2240|     24|	if (xmlXPathIsNaN(number)) {
  ------------------
  |  Branch (2240:6): [True: 0, False: 24]
  ------------------
 2241|      0|	    if (buffersize > (int)sizeof("NaN"))
  ------------------
  |  Branch (2241:10): [True: 0, False: 0]
  ------------------
 2242|      0|		snprintf(buffer, buffersize, "NaN");
 2243|     24|	} else if (number == 0) {
  ------------------
  |  Branch (2243:13): [True: 0, False: 24]
  ------------------
 2244|       |            /* Omit sign for negative zero. */
 2245|      0|	    snprintf(buffer, buffersize, "0");
 2246|     24|	} else if ((number > INT_MIN) && (number < INT_MAX) &&
  ------------------
  |  Branch (2246:13): [True: 24, False: 0]
  |  Branch (2246:35): [True: 19, False: 5]
  ------------------
 2247|     19|                   (number == (int) number)) {
  ------------------
  |  Branch (2247:20): [True: 19, False: 0]
  ------------------
 2248|     19|	    char work[30];
 2249|     19|	    char *ptr, *cur;
 2250|     19|	    int value = (int) number;
 2251|       |
 2252|     19|            ptr = &buffer[0];
 2253|     19|	    if (value == 0) {
  ------------------
  |  Branch (2253:10): [True: 0, False: 19]
  ------------------
 2254|      0|		*ptr++ = '0';
 2255|     19|	    } else {
 2256|     19|		snprintf(work, 29, "%d", value);
 2257|     19|		cur = &work[0];
 2258|     50|		while ((*cur) && (ptr - buffer < buffersize)) {
  ------------------
  |  Branch (2258:10): [True: 31, False: 19]
  |  Branch (2258:20): [True: 31, False: 0]
  ------------------
 2259|     31|		    *ptr++ = *cur++;
 2260|     31|		}
 2261|     19|	    }
 2262|     19|	    if (ptr - buffer < buffersize) {
  ------------------
  |  Branch (2262:10): [True: 19, False: 0]
  ------------------
 2263|     19|		*ptr = 0;
 2264|     19|	    } else if (buffersize > 0) {
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|		ptr--;
 2266|      0|		*ptr = 0;
 2267|      0|	    }
 2268|     19|	} 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|      5|	    char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
 2279|      5|	    int integer_place, fraction_place;
 2280|      5|	    char *ptr;
 2281|      5|	    char *after_fraction;
 2282|      5|	    double absolute_value;
 2283|      5|	    int size;
 2284|       |
 2285|      5|	    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|      5|	    if ( ((absolute_value > UPPER_DOUBLE) ||
  ------------------
  |  | 2212|      5|#define UPPER_DOUBLE 1E9
  ------------------
  |  Branch (2292:12): [True: 5, False: 0]
  ------------------
 2293|      0|		  (absolute_value < LOWER_DOUBLE)) &&
  ------------------
  |  | 2213|      0|#define LOWER_DOUBLE 1E-5
  ------------------
  |  Branch (2293:5): [True: 0, False: 0]
  ------------------
 2294|      5|		 (absolute_value != 0.0) ) {
  ------------------
  |  Branch (2294:4): [True: 5, False: 0]
  ------------------
 2295|       |		/* Use scientific notation */
 2296|      5|		integer_place = DBL_DIG + EXPONENT_DIGITS + 1;
  ------------------
  |  | 2218|      5|#define EXPONENT_DIGITS (3 + 2)
  ------------------
 2297|      5|		fraction_place = DBL_DIG - 1;
 2298|      5|		size = snprintf(work, sizeof(work),"%*.*e",
 2299|      5|			 integer_place, fraction_place, number);
 2300|     25|		while ((size > 0) && (work[size] != 'e')) size--;
  ------------------
  |  Branch (2300:10): [True: 25, False: 0]
  |  Branch (2300:24): [True: 20, False: 5]
  ------------------
 2301|       |
 2302|      5|	    }
 2303|      0|	    else {
 2304|       |		/* Use regular notation */
 2305|      0|		if (absolute_value > 0.0) {
  ------------------
  |  Branch (2305:7): [True: 0, False: 0]
  ------------------
 2306|      0|		    integer_place = (int)log10(absolute_value);
 2307|      0|		    if (integer_place > 0)
  ------------------
  |  Branch (2307:11): [True: 0, False: 0]
  ------------------
 2308|      0|		        fraction_place = DBL_DIG - integer_place - 1;
 2309|      0|		    else
 2310|      0|		        fraction_place = DBL_DIG - integer_place;
 2311|      0|		} else {
 2312|      0|		    fraction_place = 1;
 2313|      0|		}
 2314|      0|		size = snprintf(work, sizeof(work), "%0.*f",
 2315|      0|				fraction_place, number);
 2316|      0|	    }
 2317|       |
 2318|       |	    /* Remove leading spaces sometimes inserted by snprintf */
 2319|     10|	    while (work[0] == ' ') {
  ------------------
  |  Branch (2319:13): [True: 5, False: 5]
  ------------------
 2320|    105|	        for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
  ------------------
  |  Branch (2320:30): [True: 100, False: 5]
  ------------------
 2321|      5|		size--;
 2322|      5|	    }
 2323|       |
 2324|       |	    /* Remove fractional trailing zeroes */
 2325|      5|	    after_fraction = work + size;
 2326|      5|	    ptr = after_fraction;
 2327|     25|	    while (*(--ptr) == '0')
  ------------------
  |  Branch (2327:13): [True: 20, False: 5]
  ------------------
 2328|     20|		;
 2329|      5|	    if (*ptr != '.')
  ------------------
  |  Branch (2329:10): [True: 5, False: 0]
  ------------------
 2330|      5|	        ptr++;
 2331|     25|	    while ((*ptr++ = *after_fraction++) != 0);
  ------------------
  |  Branch (2331:13): [True: 20, False: 5]
  ------------------
 2332|       |
 2333|       |	    /* Finally copy result back to caller */
 2334|      5|	    size = strlen(work) + 1;
 2335|      5|	    if (size > buffersize) {
  ------------------
  |  Branch (2335:10): [True: 0, False: 5]
  ------------------
 2336|      0|		work[buffersize - 1] = 0;
 2337|      0|		size = buffersize;
 2338|      0|	    }
 2339|      5|	    memmove(buffer, work, size);
 2340|      5|	}
 2341|     24|	break;
 2342|     24|    }
 2343|     24|}
xpath.c:xmlXPathNewCompExpr:
  940|    192|xmlXPathNewCompExpr(void) {
  941|    192|    xmlXPathCompExprPtr cur;
  942|       |
  943|    192|    cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
  944|    192|    if (cur == NULL)
  ------------------
  |  Branch (944:9): [True: 0, False: 192]
  ------------------
  945|      0|	return(NULL);
  946|    192|    memset(cur, 0, sizeof(xmlXPathCompExpr));
  947|    192|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  948|    192|    cur->maxStep = 1;
  949|       |#else
  950|       |    cur->maxStep = 10;
  951|       |#endif
  952|    192|    cur->nbStep = 0;
  953|    192|    cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
  954|    192|	                                   sizeof(xmlXPathStepOp));
  955|    192|    if (cur->steps == NULL) {
  ------------------
  |  Branch (955:9): [True: 0, False: 192]
  ------------------
  956|      0|	xmlFree(cur);
  957|      0|	return(NULL);
  958|      0|    }
  959|    192|    memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
  960|    192|    cur->last = -1;
  961|    192|    return(cur);
  962|    192|}
xpath.c:xmlXPathEqualNodeSetString:
 5314|      1|{
 5315|      1|    int i;
 5316|      1|    xmlNodeSetPtr ns;
 5317|      1|    xmlChar *str2;
 5318|      1|    unsigned int hash;
 5319|       |
 5320|      1|    if ((str == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5320:9): [True: 0, False: 1]
  |  Branch (5320:26): [True: 0, False: 1]
  ------------------
 5321|      1|        ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5321:10): [True: 0, False: 1]
  |  Branch (5321:42): [True: 0, False: 0]
  ------------------
 5322|      0|        return (0);
 5323|      1|    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|      1|    if ((ns == NULL) || (ns->nodeNr <= 0) )
  ------------------
  |  Branch (5328:9): [True: 0, False: 1]
  |  Branch (5328:25): [True: 1, False: 0]
  ------------------
 5329|      1|        return (0);
 5330|      0|    hash = xmlXPathStringHash(str);
 5331|      0|    for (i = 0; i < ns->nodeNr; i++) {
  ------------------
  |  Branch (5331:17): [True: 0, False: 0]
  ------------------
 5332|      0|        if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
  ------------------
  |  Branch (5332:13): [True: 0, False: 0]
  ------------------
 5333|      0|            str2 = xmlNodeGetContent(ns->nodeTab[i]);
 5334|      0|            if (str2 == NULL) {
  ------------------
  |  Branch (5334:17): [True: 0, False: 0]
  ------------------
 5335|      0|                xmlXPathPErrMemory(ctxt);
 5336|      0|                return(0);
 5337|      0|            }
 5338|      0|            if (xmlStrEqual(str, str2)) {
  ------------------
  |  Branch (5338:17): [True: 0, False: 0]
  ------------------
 5339|      0|                xmlFree(str2);
 5340|      0|		if (neq)
  ------------------
  |  Branch (5340:7): [True: 0, False: 0]
  ------------------
 5341|      0|		    continue;
 5342|      0|                return (1);
 5343|      0|            } else if (neq) {
  ------------------
  |  Branch (5343:24): [True: 0, False: 0]
  ------------------
 5344|      0|		xmlFree(str2);
 5345|      0|		return (1);
 5346|      0|	    }
 5347|      0|            xmlFree(str2);
 5348|      0|        } else if (neq)
  ------------------
  |  Branch (5348:20): [True: 0, False: 0]
  ------------------
 5349|      0|	    return (1);
 5350|      0|    }
 5351|      0|    return (0);
 5352|      0|}
xpath.c:xmlXPathEqualValuesCommon:
 5540|     11|  xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5541|     11|    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|     11|    switch (arg1->type) {
  ------------------
  |  Branch (5546:13): [True: 11, False: 0]
  ------------------
 5547|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5547:9): [True: 0, False: 11]
  ------------------
 5548|      0|	    break;
 5549|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5549:9): [True: 0, False: 11]
  ------------------
 5550|      0|	    switch (arg2->type) {
  ------------------
  |  Branch (5550:14): [True: 0, False: 0]
  ------------------
 5551|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5551:10): [True: 0, False: 0]
  ------------------
 5552|      0|		    break;
 5553|      0|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5553:3): [True: 0, False: 0]
  ------------------
 5554|      0|		    ret = (arg1->boolval == arg2->boolval);
 5555|      0|		    break;
 5556|      0|		case XPATH_NUMBER:
  ------------------
  |  Branch (5556:3): [True: 0, False: 0]
  ------------------
 5557|      0|		    ret = (arg1->boolval ==
 5558|      0|			   xmlXPathCastNumberToBoolean(arg2->floatval));
 5559|      0|		    break;
 5560|      0|		case XPATH_STRING:
  ------------------
  |  Branch (5560:3): [True: 0, False: 0]
  ------------------
 5561|      0|		    if ((arg2->stringval == NULL) ||
  ------------------
  |  Branch (5561:11): [True: 0, False: 0]
  ------------------
 5562|      0|			(arg2->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5562:4): [True: 0, False: 0]
  ------------------
 5563|      0|		    else
 5564|      0|			ret = 1;
 5565|      0|		    ret = (arg1->boolval == ret);
 5566|      0|		    break;
 5567|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5567:3): [True: 0, False: 0]
  ------------------
 5568|       |		    /* TODO */
 5569|      0|		    break;
 5570|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5570:3): [True: 0, False: 0]
  ------------------
 5571|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5571:3): [True: 0, False: 0]
  ------------------
 5572|      0|		    break;
 5573|      0|	    }
 5574|      0|	    break;
 5575|     11|        case XPATH_NUMBER:
  ------------------
  |  Branch (5575:9): [True: 11, False: 0]
  ------------------
 5576|     11|	    switch (arg2->type) {
  ------------------
  |  Branch (5576:14): [True: 11, False: 0]
  ------------------
 5577|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5577:10): [True: 0, False: 11]
  ------------------
 5578|      0|		    break;
 5579|      0|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5579:3): [True: 0, False: 11]
  ------------------
 5580|      0|		    ret = (arg2->boolval==
 5581|      0|			   xmlXPathCastNumberToBoolean(arg1->floatval));
 5582|      0|		    break;
 5583|      0|		case XPATH_STRING:
  ------------------
  |  Branch (5583:3): [True: 0, False: 11]
  ------------------
 5584|      0|		    xmlXPathValuePush(ctxt, arg2);
 5585|      0|		    xmlXPathNumberFunction(ctxt, 1);
 5586|      0|		    arg2 = xmlXPathValuePop(ctxt);
 5587|      0|                    if (ctxt->error)
  ------------------
  |  Branch (5587:25): [True: 0, False: 0]
  ------------------
 5588|      0|                        break;
 5589|       |                    /* Falls through. */
 5590|     11|		case XPATH_NUMBER:
  ------------------
  |  Branch (5590:3): [True: 11, False: 0]
  ------------------
 5591|       |		    /* Hand check NaN and Infinity equalities */
 5592|     11|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5592:11): [True: 11, False: 0]
  ------------------
 5593|     11|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5593:8): [True: 0, False: 0]
  ------------------
 5594|     11|		        ret = 0;
 5595|     11|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5595:18): [True: 0, False: 0]
  ------------------
 5596|      0|		        if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5596:15): [True: 0, False: 0]
  ------------------
 5597|      0|			    ret = 1;
 5598|      0|			else
 5599|      0|			    ret = 0;
 5600|      0|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5600:18): [True: 0, False: 0]
  ------------------
 5601|      0|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5601:8): [True: 0, False: 0]
  ------------------
 5602|      0|			    ret = 1;
 5603|      0|			else
 5604|      0|			    ret = 0;
 5605|      0|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5605:18): [True: 0, False: 0]
  ------------------
 5606|      0|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5606:8): [True: 0, False: 0]
  ------------------
 5607|      0|			    ret = 1;
 5608|      0|			else
 5609|      0|			    ret = 0;
 5610|      0|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5610:18): [True: 0, False: 0]
  ------------------
 5611|      0|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5611:8): [True: 0, False: 0]
  ------------------
 5612|      0|			    ret = 1;
 5613|      0|			else
 5614|      0|			    ret = 0;
 5615|      0|		    } else {
 5616|      0|		        ret = (arg1->floatval == arg2->floatval);
 5617|      0|		    }
 5618|     11|		    break;
 5619|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5619:3): [True: 0, False: 11]
  ------------------
 5620|       |		    /* TODO */
 5621|      0|		    break;
 5622|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5622:3): [True: 0, False: 11]
  ------------------
 5623|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5623:3): [True: 0, False: 11]
  ------------------
 5624|      0|		    break;
 5625|     11|	    }
 5626|     11|	    break;
 5627|     11|        case XPATH_STRING:
  ------------------
  |  Branch (5627:9): [True: 0, False: 11]
  ------------------
 5628|      0|	    switch (arg2->type) {
  ------------------
  |  Branch (5628:14): [True: 0, False: 0]
  ------------------
 5629|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5629:10): [True: 0, False: 0]
  ------------------
 5630|      0|		    break;
 5631|      0|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5631:3): [True: 0, False: 0]
  ------------------
 5632|      0|		    if ((arg1->stringval == NULL) ||
  ------------------
  |  Branch (5632:11): [True: 0, False: 0]
  ------------------
 5633|      0|			(arg1->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5633:4): [True: 0, False: 0]
  ------------------
 5634|      0|		    else
 5635|      0|			ret = 1;
 5636|      0|		    ret = (arg2->boolval == ret);
 5637|      0|		    break;
 5638|      0|		case XPATH_STRING:
  ------------------
  |  Branch (5638:3): [True: 0, False: 0]
  ------------------
 5639|      0|		    ret = xmlStrEqual(arg1->stringval, arg2->stringval);
 5640|      0|		    break;
 5641|      0|		case XPATH_NUMBER:
  ------------------
  |  Branch (5641:3): [True: 0, False: 0]
  ------------------
 5642|      0|		    xmlXPathValuePush(ctxt, arg1);
 5643|      0|		    xmlXPathNumberFunction(ctxt, 1);
 5644|      0|		    arg1 = xmlXPathValuePop(ctxt);
 5645|      0|                    if (ctxt->error)
  ------------------
  |  Branch (5645:25): [True: 0, False: 0]
  ------------------
 5646|      0|                        break;
 5647|       |		    /* Hand check NaN and Infinity equalities */
 5648|      0|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5648:11): [True: 0, False: 0]
  ------------------
 5649|      0|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5649:8): [True: 0, False: 0]
  ------------------
 5650|      0|		        ret = 0;
 5651|      0|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5651:18): [True: 0, False: 0]
  ------------------
 5652|      0|			if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5652:8): [True: 0, False: 0]
  ------------------
 5653|      0|			    ret = 1;
 5654|      0|			else
 5655|      0|			    ret = 0;
 5656|      0|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5656:18): [True: 0, False: 0]
  ------------------
 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|      0|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5661:18): [True: 0, False: 0]
  ------------------
 5662|      0|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5662:8): [True: 0, False: 0]
  ------------------
 5663|      0|			    ret = 1;
 5664|      0|			else
 5665|      0|			    ret = 0;
 5666|      0|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5666:18): [True: 0, False: 0]
  ------------------
 5667|      0|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5667:8): [True: 0, False: 0]
  ------------------
 5668|      0|			    ret = 1;
 5669|      0|			else
 5670|      0|			    ret = 0;
 5671|      0|		    } else {
 5672|      0|		        ret = (arg1->floatval == arg2->floatval);
 5673|      0|		    }
 5674|      0|		    break;
 5675|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5675:3): [True: 0, False: 0]
  ------------------
 5676|       |		    /* TODO */
 5677|      0|		    break;
 5678|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5678:3): [True: 0, False: 0]
  ------------------
 5679|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5679:3): [True: 0, False: 0]
  ------------------
 5680|      0|		    break;
 5681|      0|	    }
 5682|      0|	    break;
 5683|      0|        case XPATH_USERS:
  ------------------
  |  Branch (5683:9): [True: 0, False: 11]
  ------------------
 5684|       |	    /* TODO */
 5685|      0|	    break;
 5686|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (5686:2): [True: 0, False: 11]
  ------------------
 5687|      0|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5687:2): [True: 0, False: 11]
  ------------------
 5688|      0|	    break;
 5689|     11|    }
 5690|     11|    xmlXPathReleaseObject(ctxt->context, arg1);
 5691|     11|    xmlXPathReleaseObject(ctxt->context, arg2);
 5692|     11|    return(ret);
 5693|     11|}
xpath.c:xmlXPathCompareNodeSetValue:
 5272|      1|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
 5273|      1|    if ((val == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5273:9): [True: 0, False: 1]
  |  Branch (5273:26): [True: 0, False: 1]
  ------------------
 5274|      1|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5274:3): [True: 0, False: 1]
  |  Branch (5274:35): [True: 0, False: 0]
  ------------------
 5275|      0|        return(0);
 5276|       |
 5277|      1|    switch(val->type) {
 5278|      0|        case XPATH_NUMBER:
  ------------------
  |  Branch (5278:9): [True: 0, False: 1]
  ------------------
 5279|      0|	    return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
 5280|      0|        case XPATH_NODESET:
  ------------------
  |  Branch (5280:9): [True: 0, False: 1]
  ------------------
 5281|      0|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5281:9): [True: 0, False: 1]
  ------------------
 5282|      0|	    return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
 5283|      1|        case XPATH_STRING:
  ------------------
  |  Branch (5283:9): [True: 1, False: 0]
  ------------------
 5284|      1|	    return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
 5285|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5285:9): [True: 0, False: 1]
  ------------------
 5286|      0|	    xmlXPathValuePush(ctxt, arg);
 5287|      0|	    xmlXPathBooleanFunction(ctxt, 1);
 5288|      0|	    xmlXPathValuePush(ctxt, val);
 5289|      0|	    return(xmlXPathCompareValues(ctxt, inf, strict));
 5290|      0|	default:
  ------------------
  |  Branch (5290:2): [True: 0, False: 1]
  ------------------
 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|      1|    }
 5295|      0|    return(0);
 5296|      1|}
xpath.c:xmlXPathCacheObjectCopy:
 1881|  1.11k|{
 1882|  1.11k|    xmlXPathObjectPtr ret;
 1883|  1.11k|    xmlXPathContextPtr ctxt = pctxt->context;
 1884|       |
 1885|  1.11k|    if (val == NULL)
  ------------------
  |  Branch (1885:9): [True: 0, False: 1.11k]
  ------------------
 1886|      0|	return(NULL);
 1887|       |
 1888|  1.11k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1888:9): [True: 1.11k, False: 0]
  |  Branch (1888:27): [True: 0, False: 1.11k]
  ------------------
 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|  1.11k|    ret = xmlXPathObjectCopy(val);
 1911|  1.11k|    if (ret == NULL)
  ------------------
  |  Branch (1911:9): [True: 0, False: 1.11k]
  ------------------
 1912|      0|        xmlXPathPErrMemory(pctxt);
 1913|  1.11k|    return(ret);
 1914|  1.11k|}
xpath.c:xmlXPathCompareNodeSetString:
 5115|      1|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr s) {
 5116|      1|    int i, ret = 0;
 5117|      1|    xmlNodeSetPtr ns;
 5118|      1|    xmlChar *str2;
 5119|       |
 5120|      1|    if ((s == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5120:9): [True: 0, False: 1]
  |  Branch (5120:24): [True: 0, False: 1]
  ------------------
 5121|      1|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5121:3): [True: 0, False: 1]
  |  Branch (5121:35): [True: 0, False: 0]
  ------------------
 5122|      0|	xmlXPathReleaseObject(ctxt->context, arg);
 5123|      0|	xmlXPathReleaseObject(ctxt->context, s);
 5124|      0|        return(0);
 5125|      0|    }
 5126|      1|    ns = arg->nodesetval;
 5127|      1|    if (ns != NULL) {
  ------------------
  |  Branch (5127:9): [True: 1, False: 0]
  ------------------
 5128|      2|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5128:13): [True: 1, False: 1]
  ------------------
 5129|      1|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5130|      1|	     if (str2 != NULL) {
  ------------------
  |  Branch (5130:11): [True: 1, False: 0]
  ------------------
 5131|      1|		 xmlXPathValuePush(ctxt,
 5132|      1|			   xmlXPathCacheNewString(ctxt, str2));
 5133|      1|		 xmlFree(str2);
 5134|      1|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s));
 5135|      1|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5136|      1|		 if (ret)
  ------------------
  |  Branch (5136:8): [True: 0, False: 1]
  ------------------
 5137|      0|		     break;
 5138|      1|	     } else {
 5139|      0|                 xmlXPathPErrMemory(ctxt);
 5140|      0|             }
 5141|      1|	}
 5142|      1|    }
 5143|      1|    xmlXPathReleaseObject(ctxt->context, arg);
 5144|      1|    xmlXPathReleaseObject(ctxt->context, s);
 5145|      1|    return(ret);
 5146|      1|}
xpath.c:xmlXPathCacheNewNodeSet:
 1689|   317k|{
 1690|   317k|    xmlXPathObjectPtr ret;
 1691|   317k|    xmlXPathContextPtr ctxt = pctxt->context;
 1692|       |
 1693|   317k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1693:9): [True: 317k, False: 0]
  |  Branch (1693:27): [True: 0, False: 317k]
  ------------------
 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|   317k|    ret = xmlXPathNewNodeSet(val);
 1741|   317k|    if (ret == NULL)
  ------------------
  |  Branch (1741:9): [True: 0, False: 317k]
  ------------------
 1742|      0|        xmlXPathPErrMemory(pctxt);
 1743|   317k|    return(ret);
 1744|   317k|}
xpath.c:xmlXPathCacheNewFloat:
 1847|  19.1k|{
 1848|  19.1k|    xmlXPathObjectPtr ret;
 1849|  19.1k|    xmlXPathContextPtr ctxt = pctxt->context;
 1850|       |
 1851|  19.1k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1851:9): [True: 19.1k, False: 0]
  |  Branch (1851:27): [True: 0, False: 19.1k]
  ------------------
 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|  19.1k|    ret = xmlXPathNewFloat(val);
 1866|  19.1k|    if (ret == NULL)
  ------------------
  |  Branch (1866:9): [True: 0, False: 19.1k]
  ------------------
 1867|      0|        xmlXPathPErrMemory(pctxt);
 1868|  19.1k|    return(ret);
 1869|  19.1k|}
xpath.c:xmlXPathCacheWrapNodeSet:
 1620|   318k|{
 1621|   318k|    xmlXPathObjectPtr ret;
 1622|   318k|    xmlXPathContextPtr ctxt = pctxt->context;
 1623|       |
 1624|   318k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1624:9): [True: 318k, False: 0]
  |  Branch (1624:27): [True: 0, False: 318k]
  ------------------
 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|   318k|    ret = xmlXPathWrapNodeSet(val);
 1640|   318k|    if (ret == NULL)
  ------------------
  |  Branch (1640:9): [True: 0, False: 318k]
  ------------------
 1641|      0|        xmlXPathPErrMemory(pctxt);
 1642|   318k|    return(ret);
 1643|   318k|}
xpath.c:xmlXPathCacheNewString:
 1756|  2.91k|{
 1757|  2.91k|    xmlXPathObjectPtr ret;
 1758|  2.91k|    xmlXPathContextPtr ctxt = pctxt->context;
 1759|       |
 1760|  2.91k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1760:9): [True: 2.91k, False: 0]
  |  Branch (1760:27): [True: 0, False: 2.91k]
  ------------------
 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|  2.91k|    ret = xmlXPathNewString(val);
 1784|  2.91k|    if (ret == NULL)
  ------------------
  |  Branch (1784:9): [True: 0, False: 2.91k]
  ------------------
 1785|      0|        xmlXPathPErrMemory(pctxt);
 1786|  2.91k|    return(ret);
 1787|  2.91k|}
xpath.c:xmlXPathCacheWrapString:
 1655|    151|{
 1656|    151|    xmlXPathObjectPtr ret;
 1657|    151|    xmlXPathContextPtr ctxt = pctxt->context;
 1658|       |
 1659|    151|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1659:9): [True: 151, False: 0]
  |  Branch (1659:27): [True: 0, False: 151]
  ------------------
 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|    151|    ret = xmlXPathWrapString(val);
 1673|    151|    if (ret == NULL)
  ------------------
  |  Branch (1673:9): [True: 0, False: 151]
  ------------------
 1674|      0|        xmlXPathPErrMemory(pctxt);
 1675|    151|    return(ret);
 1676|    151|}
xpath.c:xmlXPathCacheNewBoolean:
 1813|     30|{
 1814|     30|    xmlXPathObjectPtr ret;
 1815|     30|    xmlXPathContextPtr ctxt = pctxt->context;
 1816|       |
 1817|     30|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1817:9): [True: 30, False: 0]
  |  Branch (1817:27): [True: 0, False: 30]
  ------------------
 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|     30|    ret = xmlXPathNewBoolean(val);
 1832|     30|    if (ret == NULL)
  ------------------
  |  Branch (1832:9): [True: 0, False: 30]
  ------------------
 1833|      0|        xmlXPathPErrMemory(pctxt);
 1834|     30|    return(ret);
 1835|     30|}
xpath.c:xmlXPathCompileExpr:
 9088|  1.13M|xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
 9089|  1.13M|    xmlXPathContextPtr xpctxt = ctxt->context;
 9090|       |
 9091|  1.13M|    if (xpctxt != NULL) {
  ------------------
  |  Branch (9091:9): [True: 1.13M, False: 0]
  ------------------
 9092|  1.13M|        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.13M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9092:13): [True: 0, False: 1.13M]
  ------------------
 9093|  1.13M|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9094|       |        /*
 9095|       |         * Parsing a single '(' pushes about 10 functions on the call stack
 9096|       |         * before recursing!
 9097|       |         */
 9098|  1.13M|        xpctxt->depth += 10;
 9099|  1.13M|    }
 9100|       |
 9101|  1.13M|    xmlXPathCompAndExpr(ctxt);
 9102|  1.13M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.13M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 358, False: 1.13M]
  |  |  ------------------
  ------------------
 9103|  1.13M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.13M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.13M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9104|  1.13M|    while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2193|  1.13M|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2195|      9|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9104:12): [True: 9, False: 1.13M]
  |  Branch (9104:28): [True: 9, False: 0]
  ------------------
 9105|      9|	int op1 = ctxt->comp->last;
 9106|      9|        SKIP(2);
  ------------------
  |  | 2194|      9|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9107|      9|	SKIP_BLANKS;
  ------------------
  |  | 2199|      9|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9108|      9|        xmlXPathCompAndExpr(ctxt);
 9109|      9|	CHECK_ERROR;
  ------------------
  |  |  230|      9|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 0, False: 9]
  |  |  ------------------
  ------------------
 9110|      9|	PUSH_BINARY_EXPR(XPATH_OP_OR, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|      9|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|      9|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|      9|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9111|      9|	SKIP_BLANKS;
  ------------------
  |  | 2199|      9|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      9|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9112|      9|    }
 9113|  1.13M|    if ((sort) && (ctxt->comp->steps[ctxt->comp->last].op != XPATH_OP_VALUE)) {
  ------------------
  |  Branch (9113:9): [True: 1.12M, False: 5.27k]
  |  Branch (9113:19): [True: 1.12M, False: 1.62k]
  ------------------
 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|  1.12M|	PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0);
  ------------------
  |  | 1091|  1.12M|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  1.12M|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 9121|  1.12M|    }
 9122|       |
 9123|  1.13M|    if (xpctxt != NULL)
  ------------------
  |  Branch (9123:9): [True: 1.13M, False: 0]
  ------------------
 9124|  1.13M|        xpctxt->depth -= 10;
 9125|  1.13M|}
xpath.c:xmlXPathCompAndExpr:
 9062|  1.13M|xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
 9063|  1.13M|    xmlXPathCompEqualityExpr(ctxt);
 9064|  1.13M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.13M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 356, False: 1.13M]
  |  |  ------------------
  ------------------
 9065|  1.13M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.13M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.13M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9066|  1.13M|    while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2193|  1.13M|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|      2|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|      2|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9066:12): [True: 2, False: 1.13M]
  |  Branch (9066:28): [True: 2, False: 0]
  |  Branch (9066:47): [True: 2, False: 0]
  ------------------
 9067|      2|	int op1 = ctxt->comp->last;
 9068|      2|        SKIP(3);
  ------------------
  |  | 2194|      2|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9069|      2|	SKIP_BLANKS;
  ------------------
  |  | 2199|      2|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9070|      2|        xmlXPathCompEqualityExpr(ctxt);
 9071|      2|	CHECK_ERROR;
  ------------------
  |  |  230|      2|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2, False: 0]
  |  |  ------------------
  ------------------
 9072|      0|	PUSH_BINARY_EXPR(XPATH_OP_AND, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|      0|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|      0|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|      0|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9073|      0|	SKIP_BLANKS;
  ------------------
  |  | 2199|      0|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9074|      0|    }
 9075|  1.13M|}
xpath.c:xmlXPathCompEqualityExpr:
 9033|  1.13M|xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
 9034|  1.13M|    xmlXPathCompRelationalExpr(ctxt);
 9035|  1.13M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.13M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 297, False: 1.13M]
  |  |  ------------------
  ------------------
 9036|  1.13M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.13M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.13M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9037|  1.13M|    while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  1.13M|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  1.13M|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2195|      6|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9037:12): [True: 6.34k, False: 1.13M]
  |  Branch (9037:29): [True: 6, False: 1.13M]
  |  Branch (9037:45): [True: 6, False: 0]
  ------------------
 9038|  6.35k|	int eq;
 9039|  6.35k|	int op1 = ctxt->comp->last;
 9040|       |
 9041|  6.35k|        if (CUR == '=') eq = 1;
  ------------------
  |  | 2193|  6.35k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9041:13): [True: 6.34k, False: 6]
  ------------------
 9042|      6|	else eq = 0;
 9043|  6.35k|	NEXT;
  ------------------
  |  | 2202|  6.35k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 6.35k, False: 0]
  |  |  ------------------
  ------------------
 9044|  6.35k|	if (!eq) NEXT;
  ------------------
  |  | 2202|      6|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9044:6): [True: 6, False: 6.34k]
  ------------------
 9045|  6.35k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  6.35k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    104|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 104, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9046|  6.35k|        xmlXPathCompRelationalExpr(ctxt);
 9047|  6.35k|	CHECK_ERROR;
  ------------------
  |  |  230|  6.35k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 61, False: 6.29k]
  |  |  ------------------
  ------------------
 9048|  6.29k|	PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0);
  ------------------
  |  | 1094|  6.29k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  6.29k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  6.29k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9049|  6.29k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  6.29k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.29k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9050|  6.29k|    }
 9051|  1.13M|}
xpath.c:xmlXPathCompRelationalExpr:
 8996|  1.13M|xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
 8997|  1.13M|    xmlXPathCompAdditiveExpr(ctxt);
 8998|  1.13M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.13M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 314, False: 1.13M]
  |  |  ------------------
  ------------------
 8999|  1.13M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.13M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.13M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9000|  1.14M|    while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|  1.14M|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|  1.13M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9000:12): [True: 8.62k, False: 1.13M]
  |  Branch (9000:28): [True: 1.14k, False: 1.13M]
  ------------------
 9001|  9.77k|	int inf, strict;
 9002|  9.77k|	int op1 = ctxt->comp->last;
 9003|       |
 9004|  9.77k|        if (CUR == '<') inf = 1;
  ------------------
  |  | 2193|  9.77k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9004:13): [True: 8.62k, False: 1.14k]
  ------------------
 9005|  1.14k|	else inf = 0;
 9006|  9.77k|	if (NXT(1) == '=') strict = 0;
  ------------------
  |  | 2195|  9.77k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9006:6): [True: 1.07k, False: 8.69k]
  ------------------
 9007|  8.69k|	else strict = 1;
 9008|  9.77k|	NEXT;
  ------------------
  |  | 2202|  9.77k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.77k, False: 0]
  |  |  ------------------
  ------------------
 9009|  9.77k|	if (!strict) NEXT;
  ------------------
  |  | 2202|  1.07k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.07k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9009:6): [True: 1.07k, False: 8.69k]
  ------------------
 9010|  9.77k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  9.77k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    198|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 198, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9011|  9.77k|        xmlXPathCompAdditiveExpr(ctxt);
 9012|  9.77k|	CHECK_ERROR;
  ------------------
  |  |  230|  9.77k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 44, False: 9.73k]
  |  |  ------------------
  ------------------
 9013|  9.73k|	PUSH_BINARY_EXPR(XPATH_OP_CMP, op1, ctxt->comp->last, inf, strict);
  ------------------
  |  | 1094|  9.73k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  9.73k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  9.73k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9014|  9.73k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  9.73k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.73k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9015|  9.73k|    }
 9016|  1.13M|}
xpath.c:xmlXPathCompAdditiveExpr:
 8958|  1.14M|xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
 8959|       |
 8960|  1.14M|    xmlXPathCompMultiplicativeExpr(ctxt);
 8961|  1.14M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.14M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 266, False: 1.14M]
  |  |  ------------------
  ------------------
 8962|  1.14M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.14M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.14M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8963|  1.16M|    while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|  1.16M|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|  1.15M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8963:12): [True: 6.71k, False: 1.15M]
  |  Branch (8963:28): [True: 8.58k, False: 1.14M]
  ------------------
 8964|  15.2k|	int plus;
 8965|  15.2k|	int op1 = ctxt->comp->last;
 8966|       |
 8967|  15.2k|        if (CUR == '+') plus = 1;
  ------------------
  |  | 2193|  15.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8967:13): [True: 6.71k, False: 8.58k]
  ------------------
 8968|  8.58k|	else plus = 0;
 8969|  15.2k|	NEXT;
  ------------------
  |  | 2202|  15.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 15.2k, False: 0]
  |  |  ------------------
  ------------------
 8970|  15.2k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  15.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|     39|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 39, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8971|  15.2k|        xmlXPathCompMultiplicativeExpr(ctxt);
 8972|  15.2k|	CHECK_ERROR;
  ------------------
  |  |  230|  15.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 92, False: 15.2k]
  |  |  ------------------
  ------------------
 8973|  15.2k|	PUSH_BINARY_EXPR(XPATH_OP_PLUS, op1, ctxt->comp->last, plus, 0);
  ------------------
  |  | 1094|  15.2k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  15.2k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  15.2k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8974|  15.2k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  15.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  15.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8975|  15.2k|    }
 8976|  1.14M|}
xpath.c:xmlXPathCompMultiplicativeExpr:
 8919|  1.16M|xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
 8920|  1.16M|    xmlXPathCompUnaryExpr(ctxt);
 8921|  1.16M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.16M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 242, False: 1.16M]
  |  |  ------------------
  ------------------
 8922|  1.16M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.16M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.16M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8923|  6.43M|    while ((CUR == '*') ||
  ------------------
  |  | 2193|  6.43M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8923:12): [True: 5.27M, False: 1.16M]
  ------------------
 8924|  1.16M|           ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2193|  1.16M|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|      6|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|      6|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8924:13): [True: 6, False: 1.16M]
  |  Branch (8924:29): [True: 6, False: 0]
  |  Branch (8924:48): [True: 6, False: 0]
  ------------------
 8925|  5.27M|           ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2193|  1.16M|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|      0|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|      0|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8925:13): [True: 0, False: 1.16M]
  |  Branch (8925:29): [True: 0, False: 0]
  |  Branch (8925:48): [True: 0, False: 0]
  ------------------
 8926|  5.27M|	int op = -1;
 8927|  5.27M|	int op1 = ctxt->comp->last;
 8928|       |
 8929|  5.27M|        if (CUR == '*') {
  ------------------
  |  | 2193|  5.27M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8929:13): [True: 5.27M, False: 6]
  ------------------
 8930|  5.27M|	    op = 0;
 8931|  5.27M|	    NEXT;
  ------------------
  |  | 2202|  5.27M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.27M, False: 0]
  |  |  ------------------
  ------------------
 8932|  5.27M|	} else if (CUR == 'd') {
  ------------------
  |  | 2193|      6|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8932:13): [True: 6, False: 0]
  ------------------
 8933|      6|	    op = 1;
 8934|      6|	    SKIP(3);
  ------------------
  |  | 2194|      6|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8935|      6|	} else if (CUR == 'm') {
  ------------------
  |  | 2193|      0|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8935:13): [True: 0, False: 0]
  ------------------
 8936|      0|	    op = 2;
 8937|      0|	    SKIP(3);
  ------------------
  |  | 2194|      0|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8938|      0|	}
 8939|  5.27M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  5.27M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    853|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 853, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8940|  5.27M|        xmlXPathCompUnaryExpr(ctxt);
 8941|  5.27M|	CHECK_ERROR;
  ------------------
  |  |  230|  5.27M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 116, False: 5.27M]
  |  |  ------------------
  ------------------
 8942|  5.27M|	PUSH_BINARY_EXPR(XPATH_OP_MULT, op1, ctxt->comp->last, op, 0);
  ------------------
  |  | 1094|  5.27M|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  5.27M|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  5.27M|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8943|  5.27M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  5.27M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.27M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8944|  5.27M|    }
 8945|  1.16M|}
xpath.c:xmlXPathCompUnaryExpr:
 8884|  6.43M|xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
 8885|  6.43M|    int minus = 0;
 8886|  6.43M|    int found = 0;
 8887|       |
 8888|  6.43M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.43M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      3|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8889|  6.45M|    while (CUR == '-') {
  ------------------
  |  | 2193|  6.45M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8889:12): [True: 16.8k, False: 6.43M]
  ------------------
 8890|  16.8k|        minus = 1 - minus;
 8891|  16.8k|	found = 1;
 8892|  16.8k|	NEXT;
  ------------------
  |  | 2202|  16.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 16.8k, False: 0]
  |  |  ------------------
  ------------------
 8893|  16.8k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  16.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8894|  16.8k|    }
 8895|       |
 8896|  6.43M|    xmlXPathCompUnionExpr(ctxt);
 8897|  6.43M|    CHECK_ERROR;
  ------------------
  |  |  230|  6.43M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 358, False: 6.43M]
  |  |  ------------------
  ------------------
 8898|  6.43M|    if (found) {
  ------------------
  |  Branch (8898:9): [True: 9.27k, False: 6.42M]
  ------------------
 8899|  9.27k|	if (minus)
  ------------------
  |  Branch (8899:6): [True: 3.91k, False: 5.36k]
  ------------------
 8900|  3.91k|	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 2, 0);
  ------------------
  |  | 1091|  3.91k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  3.91k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8901|  5.36k|	else
 8902|       |	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 3, 0);
  ------------------
  |  | 1091|  5.36k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  5.36k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8903|  9.27k|    }
 8904|  6.43M|}
xpath.c:xmlXPathCompUnionExpr:
 8856|  6.43M|xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
 8857|  6.43M|    xmlXPathCompPathExpr(ctxt);
 8858|  6.43M|    CHECK_ERROR;
  ------------------
  |  |  230|  6.43M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 298, False: 6.43M]
  |  |  ------------------
  ------------------
 8859|  6.43M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.43M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.43M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8860|  22.9M|    while (CUR == '|') {
  ------------------
  |  | 2193|  22.9M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8860:12): [True: 16.5M, False: 6.43M]
  ------------------
 8861|  16.5M|	int op1 = ctxt->comp->last;
 8862|  16.5M|	PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  16.5M|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  16.5M|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8863|       |
 8864|  16.5M|	NEXT;
  ------------------
  |  | 2202|  16.5M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 16.5M, False: 0]
  |  |  ------------------
  ------------------
 8865|  16.5M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  16.5M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    630|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 630, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8866|  16.5M|	xmlXPathCompPathExpr(ctxt);
 8867|       |
 8868|  16.5M|	PUSH_BINARY_EXPR(XPATH_OP_UNION, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  16.5M|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  16.5M|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  16.5M|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8869|       |
 8870|  16.5M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  16.5M|    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|  16.5M|    }
 8872|  6.43M|}
xpath.c:xmlXPathCompPathExpr:
 8734|  22.9M|xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 8735|  22.9M|    int lc = 1;           /* Should we branch to LocationPath ?         */
 8736|  22.9M|    xmlChar *name = NULL; /* we may have to preparse a name to find out */
 8737|       |
 8738|  22.9M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  22.9M|    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|  22.9M|    if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|  22.9M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|  22.9M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8739:9): [True: 8.02k, False: 22.9M]
  |  Branch (8739:25): [True: 4.74k, False: 22.9M]
  ------------------
 8740|  22.9M|	(IS_ASCII_DIGIT(CUR)) ||
  ------------------
  |  |  230|  22.9M|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 17.6M, False: 5.27M]
  |  |  |  Branch (230:45): [True: 15.2k, False: 17.6M]
  |  |  ------------------
  ------------------
 8741|  22.9M|        (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|  22.9M|#define CUR (*ctxt->cur)
  ------------------
                      (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|  22.9M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8741:9): [True: 1.66k, False: 22.9M]
  |  Branch (8741:26): [True: 1.25k, False: 22.9M]
  ------------------
 8742|  22.9M|	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  22.9M|#define CUR (*ctxt->cur)
  ------------------
              	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|    639|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 159, False: 480]
  |  |  |  Branch (230:45): [True: 0, False: 159]
  |  |  ------------------
  ------------------
  |  Branch (8742:3): [True: 639, False: 22.9M]
  ------------------
 8743|  30.9k|	lc = 0;
 8744|  22.9M|    } else if (CUR == '*') {
  ------------------
  |  | 2193|  22.9M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8744:16): [True: 5.27M, False: 17.6M]
  ------------------
 8745|       |	/* relative or absolute location path */
 8746|  5.27M|	lc = 1;
 8747|  17.6M|    } else if (CUR == '/') {
  ------------------
  |  | 2193|  17.6M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8747:16): [True: 3.64k, False: 17.6M]
  ------------------
 8748|       |	/* relative or absolute location path */
 8749|  3.64k|	lc = 1;
 8750|  17.6M|    } else if (CUR == '@') {
  ------------------
  |  | 2193|  17.6M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8750:16): [True: 2.08k, False: 17.6M]
  ------------------
 8751|       |	/* relative abbreviated attribute location path */
 8752|  2.08k|	lc = 1;
 8753|  17.6M|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  17.6M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8753:16): [True: 639, False: 17.6M]
  ------------------
 8754|       |	/* relative abbreviated attribute location path */
 8755|    639|	lc = 1;
 8756|  17.6M|    } 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|  17.6M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  17.6M|    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|  17.6M|	name = xmlXPathScanName(ctxt);
 8770|  17.6M|	if ((name != NULL) && (xmlStrstr(name, (xmlChar *) "::") != NULL)) {
  ------------------
  |  Branch (8770:6): [True: 1.14M, False: 16.4M]
  |  Branch (8770:24): [True: 3.72k, False: 1.14M]
  ------------------
 8771|  3.72k|	    lc = 1;
 8772|  3.72k|	    xmlFree(name);
 8773|  17.6M|	} else if (name != NULL) {
  ------------------
  |  Branch (8773:13): [True: 1.14M, False: 16.4M]
  ------------------
 8774|  1.14M|	    int len =xmlStrlen(name);
 8775|       |
 8776|       |
 8777|  1.14M|	    while (NXT(len) != 0) {
  ------------------
  |  | 2195|  1.14M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8777:13): [True: 1.14M, False: 2]
  ------------------
 8778|  1.14M|		if (NXT(len) == '/') {
  ------------------
  |  | 2195|  1.14M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8778:7): [True: 468, False: 1.14M]
  ------------------
 8779|       |		    /* element name */
 8780|    468|		    lc = 1;
 8781|    468|		    break;
 8782|  1.14M|		} else if (IS_BLANK_CH(NXT(len))) {
  ------------------
  |  |  137|  1.14M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.14M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 83, False: 1.14M]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.14M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.14M, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 255, False: 1.14M]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.14M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 8, False: 1.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8783|       |		    /* ignore blanks */
 8784|    346|		    ;
 8785|  1.14M|		} else if (NXT(len) == ':') {
  ------------------
  |  | 2195|  1.14M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8785:14): [True: 1, False: 1.14M]
  ------------------
 8786|      1|		    lc = 1;
 8787|      1|		    break;
 8788|  1.14M|		} else if ((NXT(len) == '(')) {
  ------------------
  |  | 2195|  1.14M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8788:14): [True: 404, False: 1.14M]
  ------------------
 8789|       |		    /* Node Type or Function */
 8790|    404|		    if (xmlXPathIsNodeType(name)) {
  ------------------
  |  Branch (8790:11): [True: 0, False: 404]
  ------------------
 8791|      0|			lc = 1;
 8792|    404|		    } else {
 8793|    404|			lc = 0;
 8794|    404|		    }
 8795|    404|                    break;
 8796|  1.14M|		} else if ((NXT(len) == '[')) {
  ------------------
  |  | 2195|  1.14M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8796:14): [True: 1.37k, False: 1.14M]
  ------------------
 8797|       |		    /* element name */
 8798|  1.37k|		    lc = 1;
 8799|  1.37k|		    break;
 8800|  1.14M|		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  1.14M|#define NXT(val) ctxt->cur[(val)]
  ------------------
              		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  1.13M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8800:14): [True: 5.95k, False: 1.13M]
  |  Branch (8800:35): [True: 138, False: 1.13M]
  ------------------
 8801|  1.13M|			   (NXT(len) == '=')) {
  ------------------
  |  | 2195|  1.13M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8801:7): [True: 6.16k, False: 1.12M]
  ------------------
 8802|  12.2k|		    lc = 1;
 8803|  12.2k|		    break;
 8804|  1.12M|		} else {
 8805|  1.12M|		    lc = 1;
 8806|  1.12M|		    break;
 8807|  1.12M|		}
 8808|    346|		len++;
 8809|    346|	    }
 8810|  1.14M|	    if (NXT(len) == 0) {
  ------------------
  |  | 2195|  1.14M|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8810:10): [True: 2, False: 1.14M]
  ------------------
 8811|       |		/* element name */
 8812|      2|		lc = 1;
 8813|      2|	    }
 8814|  1.14M|	    xmlFree(name);
 8815|  16.4M|	} else {
 8816|       |	    /* make sure all cases are covered explicitly */
 8817|  16.4M|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  16.4M|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8818|      0|	}
 8819|  17.6M|    }
 8820|       |
 8821|  6.45M|    if (lc) {
  ------------------
  |  Branch (8821:9): [True: 6.42M, False: 31.3k]
  ------------------
 8822|  6.42M|	if (CUR == '/') {
  ------------------
  |  | 2193|  6.42M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8822:6): [True: 3.64k, False: 6.42M]
  ------------------
 8823|  3.64k|	    PUSH_LEAVE_EXPR(XPATH_OP_ROOT, 0, 0);
  ------------------
  |  | 1088|  3.64k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  3.64k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8824|  6.42M|	} else {
 8825|  6.42M|	    PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  6.42M|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  6.42M|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8826|  6.42M|	}
 8827|  6.42M|	xmlXPathCompLocationPath(ctxt);
 8828|  6.42M|    } else {
 8829|  31.3k|	xmlXPathCompFilterExpr(ctxt);
 8830|  31.3k|	CHECK_ERROR;
  ------------------
  |  |  230|  31.3k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 6.13k, False: 25.1k]
  |  |  ------------------
  ------------------
 8831|  25.1k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  25.1k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|     60|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8831:6): [True: 60, False: 25.1k]
  |  Branch (8831:22): [True: 29, False: 31]
  ------------------
 8832|     29|	    SKIP(2);
  ------------------
  |  | 2194|     29|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8833|     29|	    SKIP_BLANKS;
  ------------------
  |  | 2199|     29|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8834|       |
 8835|     29|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|     29|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|     29|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 8836|     29|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 8837|       |
 8838|     29|	    xmlXPathCompRelativeLocationPath(ctxt);
 8839|  25.1k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  25.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8839:13): [True: 31, False: 25.1k]
  ------------------
 8840|     31|	    xmlXPathCompRelativeLocationPath(ctxt);
 8841|     31|	}
 8842|  25.1k|    }
 8843|  6.44M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.44M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.45M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8844|  6.44M|}
xpath.c:xmlXPathScanName:
 8705|  17.6M|xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
 8706|  17.6M|    const xmlChar *end;
 8707|  17.6M|    xmlChar *ret;
 8708|       |
 8709|  17.6M|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  17.6M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8710|  17.6M|    if (end == NULL) {
  ------------------
  |  Branch (8710:9): [True: 1, False: 17.6M]
  ------------------
 8711|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8712|      0|    }
 8713|  17.6M|    if (end == ctxt->cur)
  ------------------
  |  Branch (8713:9): [True: 16.4M, False: 1.14M]
  ------------------
 8714|  16.4M|        return(NULL);
 8715|       |
 8716|  1.14M|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8717|  1.14M|    if (ret == NULL)
  ------------------
  |  Branch (8717:9): [True: 0, False: 1.14M]
  ------------------
 8718|      0|        xmlXPathPErrMemory(ctxt);
 8719|  1.14M|    return(ret);
 8720|  17.6M|}
xpath.c:xmlXPathCompLocationPath:
 9524|  6.42M|xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
 9525|  6.42M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.42M|    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|  6.42M|    if (CUR != '/') {
  ------------------
  |  | 2193|  6.42M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9526:9): [True: 6.42M, False: 3.64k]
  ------------------
 9527|  6.42M|        xmlXPathCompRelativeLocationPath(ctxt);
 9528|  6.42M|    } else {
 9529|  7.13k|	while (CUR == '/') {
  ------------------
  |  | 2193|  7.13k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9529:9): [True: 3.64k, False: 3.48k]
  ------------------
 9530|  3.64k|	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  3.64k|#define CUR (*ctxt->cur)
  ------------------
              	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  3.64k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9530:10): [True: 3.64k, False: 0]
  |  Branch (9530:26): [True: 213, False: 3.43k]
  ------------------
 9531|    213|		SKIP(2);
  ------------------
  |  | 2194|    213|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9532|    213|		SKIP_BLANKS;
  ------------------
  |  | 2199|    213|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    198|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 198, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9533|    213|		PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|    213|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    213|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9534|    213|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9535|    213|		xmlXPathCompRelativeLocationPath(ctxt);
 9536|  3.43k|	    } else if (CUR == '/') {
  ------------------
  |  | 2193|  3.43k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9536:17): [True: 3.43k, False: 0]
  ------------------
 9537|  3.43k|		NEXT;
  ------------------
  |  | 2202|  3.43k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.43k, False: 0]
  |  |  ------------------
  ------------------
 9538|  3.43k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  3.43k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.21k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9539|  3.43k|		if ((CUR != 0) &&
  ------------------
  |  | 2193|  3.43k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9539:7): [True: 3.43k, False: 2]
  ------------------
 9540|  3.43k|		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  |  222|  3.43k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 964, False: 2.46k]
  |  |  ------------------
  |  |  223|  3.43k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 808, False: 156]
  |  |  ------------------
  ------------------
              		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  | 2193|  2.62k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9540:34): [True: 1, False: 2.62k]
  ------------------
 9541|  2.62k|                     (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  2.62k|#define CUR (*ctxt->cur)
  ------------------
                                   (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  2.62k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9541:22): [True: 0, False: 2.62k]
  |  Branch (9541:38): [True: 93, False: 2.53k]
  ------------------
 9542|  2.53k|		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  2.53k|#define CUR (*ctxt->cur)
  ------------------
              		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  2.53k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9542:8): [True: 0, False: 2.53k]
  |  Branch (9542:24): [True: 1.99k, False: 541]
  ------------------
 9543|  2.89k|		    xmlXPathCompRelativeLocationPath(ctxt);
 9544|  3.43k|	    }
 9545|  3.64k|	    CHECK_ERROR;
  ------------------
  |  |  230|  3.64k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 165, False: 3.48k]
  |  |  ------------------
  ------------------
 9546|  3.64k|	}
 9547|  3.64k|    }
 9548|  6.42M|}
xpath.c:xmlXPathCompFilterExpr:
 8683|  31.3k|xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
 8684|  31.3k|    xmlXPathCompPrimaryExpr(ctxt);
 8685|  31.3k|    CHECK_ERROR;
  ------------------
  |  |  230|  31.3k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 6.09k, False: 25.2k]
  |  |  ------------------
  ------------------
 8686|  25.2k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  25.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  31.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8687|       |
 8688|  25.5k|    while (CUR == '[') {
  ------------------
  |  | 2193|  25.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8688:12): [True: 335, False: 25.2k]
  ------------------
 8689|    335|	xmlXPathCompPredicate(ctxt, 1);
 8690|    335|	SKIP_BLANKS;
  ------------------
  |  | 2199|    335|    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|    335|    }
 8692|       |
 8693|       |
 8694|  25.2k|}
xpath.c:xmlXPathCompPrimaryExpr:
 8645|  31.3k|xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
 8646|  31.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  31.3k|    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|  31.3k|    if (CUR == '$') xmlXPathCompVariableReference(ctxt);
  ------------------
  |  | 2193|  31.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8647:9): [True: 8.02k, False: 23.2k]
  ------------------
 8648|  23.2k|    else if (CUR == '(') {
  ------------------
  |  | 2193|  23.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8648:14): [True: 4.74k, False: 18.5k]
  ------------------
 8649|  4.74k|	NEXT;
  ------------------
  |  | 2202|  4.74k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.74k, False: 0]
  |  |  ------------------
  ------------------
 8650|  4.74k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.74k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|     14|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8651|  4.74k|	xmlXPathCompileExpr(ctxt, 1);
 8652|  4.74k|	CHECK_ERROR;
  ------------------
  |  |  230|  4.74k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 37, False: 4.70k]
  |  |  ------------------
  ------------------
 8653|  4.70k|	if (CUR != ')') {
  ------------------
  |  | 2193|  4.70k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8653:6): [True: 0, False: 4.70k]
  ------------------
 8654|      0|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8655|      0|	}
 8656|  4.70k|	NEXT;
  ------------------
  |  | 2202|  4.70k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.70k, False: 0]
  |  |  ------------------
  ------------------
 8657|  4.70k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.70k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.70k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8658|  18.5k|    } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  37.0k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 15.6k, False: 2.91k]
  |  |  |  Branch (230:45): [True: 15.2k, False: 404]
  |  |  ------------------
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  3.31k|#define CUR (*ctxt->cur)
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|      0|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 0, False: 0]
  |  |  |  Branch (230:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (8658:40): [True: 0, False: 3.31k]
  ------------------
 8659|  15.2k|	xmlXPathCompNumber(ctxt);
 8660|  15.2k|    } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  3.31k|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  1.65k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8660:16): [True: 1.66k, False: 1.65k]
  |  Branch (8660:33): [True: 1.25k, False: 404]
  ------------------
 8661|  2.91k|	xmlXPathCompLiteral(ctxt);
 8662|  2.91k|    } else {
 8663|    404|	xmlXPathCompFunctionCall(ctxt);
 8664|    404|    }
 8665|  31.2k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  31.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  32.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 817, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8666|  31.2k|}
xpath.c:xmlXPathCompVariableReference:
 8511|  8.02k|xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
 8512|  8.02k|    xmlChar *name;
 8513|  8.02k|    xmlChar *prefix;
 8514|       |
 8515|  8.02k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  8.02k|    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|  8.02k|    if (CUR != '$') {
  ------------------
  |  | 2193|  8.02k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8516:9): [True: 0, False: 8.02k]
  ------------------
 8517|      0|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8518|      0|    }
 8519|  8.02k|    NEXT;
  ------------------
  |  | 2202|  8.02k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 8.02k, False: 0]
  |  |  ------------------
  ------------------
 8520|  8.02k|    name = xmlXPathParseQName(ctxt, &prefix);
 8521|  8.02k|    if (name == NULL) {
  ------------------
  |  Branch (8521:9): [True: 4.78k, False: 3.23k]
  ------------------
 8522|  4.78k|        xmlFree(prefix);
 8523|  4.78k|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|  4.78k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8524|      0|    }
 8525|  3.23k|    ctxt->comp->last = -1;
 8526|  3.23k|    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  3.23k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  3.23k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8526:9): [True: 218, False: 3.02k]
  ------------------
 8527|    218|        xmlFree(prefix);
 8528|    218|        xmlFree(name);
 8529|    218|    }
 8530|  3.23k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  3.23k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.23k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8531|  3.23k|    if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
  ------------------
  |  |  241|  3.23k|#define XML_XPATH_NOVAR	  (1<<1)
  ------------------
  |  Branch (8531:9): [True: 3.23k, False: 0]
  |  Branch (8531:36): [True: 0, False: 3.23k]
  ------------------
 8532|      0|	XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8533|      0|    }
 8534|  3.23k|}
xpath.c:xmlXPathParseQName:
 8178|  8.43k|xmlXPathParseQName(xmlXPathParserContextPtr ctxt, xmlChar **prefix) {
 8179|  8.43k|    xmlChar *ret = NULL;
 8180|       |
 8181|  8.43k|    *prefix = NULL;
 8182|  8.43k|    ret = xmlXPathParseNCName(ctxt);
 8183|  8.43k|    if (ret && CUR == ':') {
  ------------------
  |  | 2193|  8.09k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8183:9): [True: 8.09k, False: 340]
  |  Branch (8183:16): [True: 5.35k, False: 2.73k]
  ------------------
 8184|  5.35k|        *prefix = ret;
 8185|  5.35k|	NEXT;
  ------------------
  |  | 2202|  5.35k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.35k, False: 0]
  |  |  ------------------
  ------------------
 8186|  5.35k|	ret = xmlXPathParseNCName(ctxt);
 8187|  5.35k|    }
 8188|  8.43k|    return(ret);
 8189|  8.43k|}
xpath.c:xmlXPathCompNumber:
 8337|  15.2k|{
 8338|  15.2k|    double ret = 0.0;
 8339|  15.2k|    int ok = 0;
 8340|  15.2k|    int exponent = 0;
 8341|  15.2k|    int is_exponent_negative = 0;
 8342|  15.2k|    xmlXPathObjectPtr num;
 8343|  15.2k|#ifdef __GNUC__
 8344|  15.2k|    unsigned long tmp = 0;
 8345|  15.2k|    double temp;
 8346|  15.2k|#endif
 8347|       |
 8348|  15.2k|    CHECK_ERROR;
  ------------------
  |  |  230|  15.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4, False: 15.2k]
  |  |  ------------------
  ------------------
 8349|  15.2k|    if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  15.2k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  15.2k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  15.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8349:9): [True: 15.2k, False: 0]
  |  Branch (8349:26): [True: 0, False: 15.2k]
  |  Branch (8349:41): [True: 0, False: 15.2k]
  ------------------
 8350|      0|        XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8351|      0|    }
 8352|  15.2k|#ifdef __GNUC__
 8353|       |    /*
 8354|       |     * tmp/temp is a workaround against a gcc compiler bug
 8355|       |     * http://veillard.com/gcc.bug
 8356|       |     */
 8357|  15.2k|    ret = 0;
 8358|  36.1k|    while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  36.1k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  31.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8358:12): [True: 31.0k, False: 5.05k]
  |  Branch (8358:28): [True: 20.8k, False: 10.1k]
  ------------------
 8359|  20.8k|	ret = ret * 10;
 8360|  20.8k|	tmp = (CUR - '0');
  ------------------
  |  | 2193|  20.8k|#define CUR (*ctxt->cur)
  ------------------
 8361|  20.8k|        ok = 1;
 8362|  20.8k|        NEXT;
  ------------------
  |  | 2202|  20.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 20.8k, False: 0]
  |  |  ------------------
  ------------------
 8363|  20.8k|	temp = (double) tmp;
 8364|  20.8k|	ret = ret + temp;
 8365|  20.8k|    }
 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|  15.2k|    if (CUR == '.') {
  ------------------
  |  | 2193|  15.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8374:9): [True: 18, False: 15.1k]
  ------------------
 8375|     18|	int v, frac = 0, max;
 8376|     18|	double fraction = 0;
 8377|       |
 8378|     18|        NEXT;
  ------------------
  |  | 2202|     18|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18, False: 0]
  |  |  ------------------
  ------------------
 8379|     18|        if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|     18|#define CUR (*ctxt->cur)
  ------------------
                      if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|      0|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8379:14): [True: 18, False: 0]
  |  Branch (8379:29): [True: 0, False: 0]
  |  Branch (8379:45): [True: 0, False: 18]
  ------------------
 8380|      0|            XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8381|      0|        }
 8382|     18|        while (CUR == '0') {
  ------------------
  |  | 2193|     18|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8382:16): [True: 0, False: 18]
  ------------------
 8383|      0|            frac = frac + 1;
 8384|      0|            NEXT;
  ------------------
  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8385|      0|        }
 8386|     18|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|     18|#define MAX_FRAC 20
  ------------------
 8387|     18|        while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|     18|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|      0|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8387:16): [True: 0, False: 18]
  |  Branch (8387:32): [True: 0, False: 0]
  |  Branch (8387:48): [True: 0, False: 0]
  ------------------
 8388|      0|	    v = (CUR - '0');
  ------------------
  |  | 2193|      0|#define CUR (*ctxt->cur)
  ------------------
 8389|      0|	    fraction = fraction * 10 + v;
 8390|      0|	    frac = frac + 1;
 8391|      0|            NEXT;
  ------------------
  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8392|      0|        }
 8393|     18|        fraction /= pow(10.0, frac);
 8394|     18|        ret = ret + fraction;
 8395|     18|        while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|     18|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|      0|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8395:16): [True: 0, False: 18]
  |  Branch (8395:32): [True: 0, False: 0]
  ------------------
 8396|      0|            NEXT;
  ------------------
  |  | 2202|     18|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8397|     18|    }
 8398|  15.2k|    if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  15.2k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  15.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8398:9): [True: 0, False: 15.2k]
  |  Branch (8398:25): [True: 6.59k, False: 8.62k]
  ------------------
 8399|  6.59k|        NEXT;
  ------------------
  |  | 2202|  6.59k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 6.59k, False: 0]
  |  |  ------------------
  ------------------
 8400|  6.59k|        if (CUR == '-') {
  ------------------
  |  | 2193|  6.59k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8400:13): [True: 5.54k, False: 1.04k]
  ------------------
 8401|  5.54k|            is_exponent_negative = 1;
 8402|  5.54k|            NEXT;
  ------------------
  |  | 2202|  5.54k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.54k, False: 0]
  |  |  ------------------
  ------------------
 8403|  5.54k|        } else if (CUR == '+') {
  ------------------
  |  | 2193|  1.04k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8403:20): [True: 164, False: 882]
  ------------------
 8404|    164|	    NEXT;
  ------------------
  |  | 2202|    164|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 164, False: 0]
  |  |  ------------------
  ------------------
 8405|    164|	}
 8406|  11.0k|        while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  11.0k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  5.90k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8406:16): [True: 5.90k, False: 5.13k]
  |  Branch (8406:32): [True: 4.44k, False: 1.45k]
  ------------------
 8407|  4.44k|            if (exponent < 1000000)
  ------------------
  |  Branch (8407:17): [True: 4.42k, False: 16]
  ------------------
 8408|  4.42k|                exponent = exponent * 10 + (CUR - '0');
  ------------------
  |  | 2193|  4.42k|#define CUR (*ctxt->cur)
  ------------------
 8409|  4.44k|            NEXT;
  ------------------
  |  | 2202|  4.44k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.44k, False: 0]
  |  |  ------------------
  ------------------
 8410|  4.44k|        }
 8411|  6.59k|        if (is_exponent_negative)
  ------------------
  |  Branch (8411:13): [True: 5.54k, False: 1.04k]
  ------------------
 8412|  5.54k|            exponent = -exponent;
 8413|  6.59k|        ret *= pow(10.0, (double) exponent);
 8414|  6.59k|    }
 8415|  15.2k|    num = xmlXPathCacheNewFloat(ctxt, ret);
 8416|  15.2k|    if (num == NULL) {
  ------------------
  |  Branch (8416:9): [True: 0, False: 15.2k]
  ------------------
 8417|      0|	ctxt->error = XPATH_MEMORY_ERROR;
 8418|  15.2k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
  ------------------
  |  | 1085|  15.2k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  15.2k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8418:16): [True: 2, False: 15.2k]
  ------------------
 8419|  15.2k|                              NULL) == -1) {
 8420|      2|        xmlXPathReleaseObject(ctxt->context, num);
 8421|      2|    }
 8422|  15.2k|}
xpath.c:xmlXPathCompLiteral:
 8478|  2.91k|xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
 8479|  2.91k|    xmlChar *ret = NULL;
 8480|  2.91k|    xmlXPathObjectPtr lit;
 8481|       |
 8482|  2.91k|    ret = xmlXPathParseLiteral(ctxt);
 8483|  2.91k|    if (ret == NULL)
  ------------------
  |  Branch (8483:9): [True: 5, False: 2.90k]
  ------------------
 8484|      5|        return;
 8485|  2.90k|    lit = xmlXPathCacheNewString(ctxt, ret);
 8486|  2.90k|    if (lit == NULL) {
  ------------------
  |  Branch (8486:9): [True: 0, False: 2.90k]
  ------------------
 8487|      0|        ctxt->error = XPATH_MEMORY_ERROR;
 8488|  2.90k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
  ------------------
  |  | 1085|  2.90k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  2.90k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8488:16): [True: 26, False: 2.88k]
  ------------------
 8489|  2.90k|                              NULL) == -1) {
 8490|     26|        xmlXPathReleaseObject(ctxt->context, lit);
 8491|     26|    }
 8492|  2.90k|    xmlFree(ret);
 8493|  2.90k|}
xpath.c:xmlXPathParseLiteral:
 8434|  2.91k|xmlXPathParseLiteral(xmlXPathParserContextPtr ctxt) {
 8435|  2.91k|    const xmlChar *q;
 8436|  2.91k|    xmlChar *ret = NULL;
 8437|  2.91k|    int quote;
 8438|       |
 8439|  2.91k|    if (CUR == '"') {
  ------------------
  |  | 2193|  2.91k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8439:9): [True: 1.25k, False: 1.66k]
  ------------------
 8440|  1.25k|        quote = '"';
 8441|  1.66k|    } else if (CUR == '\'') {
  ------------------
  |  | 2193|  1.66k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8441:16): [True: 1.66k, False: 0]
  ------------------
 8442|  1.66k|        quote = '\'';
 8443|  1.66k|    } else {
 8444|      0|	XP_ERRORNULL(XPATH_START_LITERAL_ERROR);
  ------------------
  |  |  633|      0|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8445|      0|    }
 8446|       |
 8447|  2.91k|    NEXT;
  ------------------
  |  | 2202|  2.91k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.91k, False: 0]
  |  |  ------------------
  ------------------
 8448|  2.91k|    q = CUR_PTR;
  ------------------
  |  | 2196|  2.91k|#define CUR_PTR ctxt->cur
  ------------------
 8449|  9.85M|    while (CUR != quote) {
  ------------------
  |  | 2193|  9.85M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8449:12): [True: 9.84M, False: 2.90k]
  ------------------
 8450|  9.84M|        int ch;
 8451|  9.84M|        int len = 4;
 8452|       |
 8453|  9.84M|        if (CUR == 0)
  ------------------
  |  | 2193|  9.84M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8453:13): [True: 0, False: 9.84M]
  ------------------
 8454|  9.84M|            XP_ERRORNULL(XPATH_UNFINISHED_LITERAL_ERROR);
  ------------------
  |  |  633|      0|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8455|  9.84M|        ch = xmlGetUTF8Char(CUR_PTR, &len);
  ------------------
  |  | 2196|  9.84M|#define CUR_PTR ctxt->cur
  ------------------
 8456|  9.84M|        if ((ch < 0) || (IS_CHAR(ch) == 0))
  ------------------
  |  |  115|  9.84M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  9.84M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 9.84M, False: 2.91k]
  |  |  |  |  ------------------
  |  |  |  |  118|  9.84M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  9.84M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 9.84M, False: 1]
  |  |  |  |  |  |  |  Branch (108:44): [True: 310k, False: 9.53M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  9.84M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 1.96k, False: 9.53M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  9.84M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 9.53M, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  9.84M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.91k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.56k, False: 349]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.91k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 349, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1, False: 348]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.91k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 348, False: 0]
  |  |  |  |  |  Branch (121:27): [True: 348, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8456:13): [True: 2, False: 9.84M]
  |  Branch (8456:25): [True: 3, False: 9.84M]
  ------------------
 8457|  9.84M|            XP_ERRORNULL(XPATH_INVALID_CHAR_ERROR);
  ------------------
  |  |  633|      5|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8458|  9.84M|        CUR_PTR += len;
  ------------------
  |  | 2196|  9.84M|#define CUR_PTR ctxt->cur
  ------------------
 8459|  9.84M|    }
 8460|  2.90k|    ret = xmlStrndup(q, CUR_PTR - q);
  ------------------
  |  | 2196|  2.90k|#define CUR_PTR ctxt->cur
  ------------------
 8461|  2.90k|    if (ret == NULL)
  ------------------
  |  Branch (8461:9): [True: 0, False: 2.90k]
  ------------------
 8462|      0|        xmlXPathPErrMemory(ctxt);
 8463|  2.90k|    NEXT;
  ------------------
  |  | 2202|  2.90k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.90k, False: 0]
  |  |  ------------------
  ------------------
 8464|  2.90k|    return(ret);
 8465|  2.91k|}
xpath.c:xmlXPathCompFunctionCall:
 8573|    404|xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
 8574|    404|    xmlChar *name;
 8575|    404|    xmlChar *prefix;
 8576|    404|    int nbargs = 0;
 8577|    404|    int sort = 1;
 8578|       |
 8579|    404|    name = xmlXPathParseQName(ctxt, &prefix);
 8580|    404|    if (name == NULL) {
  ------------------
  |  Branch (8580:9): [True: 0, False: 404]
  ------------------
 8581|      0|	xmlFree(prefix);
 8582|      0|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8583|      0|    }
 8584|    404|    SKIP_BLANKS;
  ------------------
  |  | 2199|    404|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    404|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8585|       |
 8586|    404|    if (CUR != '(') {
  ------------------
  |  | 2193|    404|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8586:9): [True: 0, False: 404]
  ------------------
 8587|      0|	xmlFree(name);
 8588|      0|	xmlFree(prefix);
 8589|      0|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8590|      0|    }
 8591|    404|    NEXT;
  ------------------
  |  | 2202|    404|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 404, False: 0]
  |  |  ------------------
  ------------------
 8592|    404|    SKIP_BLANKS;
  ------------------
  |  | 2199|    404|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    404|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8593|       |
 8594|       |    /*
 8595|       |    * Optimization for count(): we don't need the node-set to be sorted.
 8596|       |    */
 8597|    404|    if ((prefix == NULL) && (name[0] == 'c') &&
  ------------------
  |  Branch (8597:9): [True: 332, False: 72]
  |  Branch (8597:29): [True: 15, False: 317]
  ------------------
 8598|     15|	xmlStrEqual(name, BAD_CAST "count"))
  ------------------
  |  |   34|     15|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8598:2): [True: 0, False: 15]
  ------------------
 8599|      0|    {
 8600|      0|	sort = 0;
 8601|      0|    }
 8602|    404|    ctxt->comp->last = -1;
 8603|    404|    if (CUR != ')') {
  ------------------
  |  | 2193|    404|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8603:9): [True: 313, False: 91]
  ------------------
 8604|  1.12M|	while (CUR != 0) {
  ------------------
  |  | 2193|  1.12M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8604:9): [True: 1.12M, False: 38]
  ------------------
 8605|  1.12M|	    int op1 = ctxt->comp->last;
 8606|  1.12M|	    ctxt->comp->last = -1;
 8607|  1.12M|	    xmlXPathCompileExpr(ctxt, sort);
 8608|  1.12M|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (8608:10): [True: 100, False: 1.12M]
  ------------------
 8609|    100|		xmlFree(name);
 8610|    100|		xmlFree(prefix);
 8611|    100|		return;
 8612|    100|	    }
 8613|  1.12M|	    PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  1.12M|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  1.12M|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  1.12M|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8614|  1.12M|	    nbargs++;
 8615|  1.12M|	    if (CUR == ')') break;
  ------------------
  |  | 2193|  1.12M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8615:10): [True: 170, False: 1.12M]
  ------------------
 8616|  1.12M|	    if (CUR != ',') {
  ------------------
  |  | 2193|  1.12M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8616:10): [True: 5, False: 1.12M]
  ------------------
 8617|      5|		xmlFree(name);
 8618|      5|		xmlFree(prefix);
 8619|      5|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8620|      0|	    }
 8621|  1.12M|	    NEXT;
  ------------------
  |  | 2202|  1.12M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.12M, False: 0]
  |  |  ------------------
  ------------------
 8622|  1.12M|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.12M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.12M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8623|  1.12M|	}
 8624|    313|    }
 8625|    299|    if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|    299|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    299|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8625:9): [True: 1, False: 298]
  ------------------
 8626|      1|        xmlFree(prefix);
 8627|      1|        xmlFree(name);
 8628|      1|    }
 8629|    299|    NEXT;
  ------------------
  |  | 2202|    299|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 261, False: 38]
  |  |  ------------------
  ------------------
 8630|    299|    SKIP_BLANKS;
  ------------------
  |  | 2199|    299|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    300|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8631|    299|}
xpath.c:xmlXPathCompPredicate:
 9137|  5.73k|xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
 9138|  5.73k|    int op1 = ctxt->comp->last;
 9139|       |
 9140|  5.73k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  5.73k|    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|  5.73k|    if (CUR != '[') {
  ------------------
  |  | 2193|  5.73k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9141:9): [True: 0, False: 5.73k]
  ------------------
 9142|      0|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9143|      0|    }
 9144|  5.73k|    NEXT;
  ------------------
  |  | 2202|  5.73k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.73k, False: 0]
  |  |  ------------------
  ------------------
 9145|  5.73k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  8.66k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  14.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.66k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9146|       |
 9147|  5.73k|    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|  5.73k|    if (! filter)
  ------------------
  |  Branch (9157:9): [True: 5.39k, False: 335]
  ------------------
 9158|  5.39k|	xmlXPathCompileExpr(ctxt, 0);
 9159|    335|    else
 9160|    335|	xmlXPathCompileExpr(ctxt, 1);
 9161|  5.73k|    CHECK_ERROR;
  ------------------
  |  |  230|  5.73k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 151, False: 5.58k]
  |  |  ------------------
  ------------------
 9162|       |
 9163|  5.58k|    if (CUR != ']') {
  ------------------
  |  | 2193|  5.58k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9163:9): [True: 2, False: 5.58k]
  ------------------
 9164|      2|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9165|      0|    }
 9166|       |
 9167|  5.58k|    if (filter)
  ------------------
  |  Branch (9167:9): [True: 301, False: 5.27k]
  ------------------
 9168|    301|	PUSH_BINARY_EXPR(XPATH_OP_FILTER, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|    301|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|    301|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|    301|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9169|  5.27k|    else
 9170|  5.27k|	PUSH_BINARY_EXPR(XPATH_OP_PREDICATE, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  5.27k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  5.27k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  5.27k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9171|       |
 9172|  5.58k|    NEXT;
  ------------------
  |  | 2202|  5.58k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.58k, False: 0]
  |  |  ------------------
  ------------------
 9173|  5.58k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  7.66k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  13.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.66k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9174|  5.58k|}
xpath.c:xmlXPathCompRelativeLocationPath:
 9481|  6.42M|(xmlXPathParserContextPtr ctxt) {
 9482|  6.42M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.42M|    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|  6.42M|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  6.42M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|     33|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9483:9): [True: 33, False: 6.42M]
  |  Branch (9483:25): [True: 0, False: 33]
  ------------------
 9484|      0|	SKIP(2);
  ------------------
  |  | 2194|      0|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9485|      0|	SKIP_BLANKS;
  ------------------
  |  | 2199|      0|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9486|      0|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|      0|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|      0|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9487|      0|		         NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9488|  6.42M|    } else if (CUR == '/') {
  ------------------
  |  | 2193|  6.42M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9488:16): [True: 33, False: 6.42M]
  ------------------
 9489|     33|	    NEXT;
  ------------------
  |  | 2202|     33|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 33, False: 0]
  |  |  ------------------
  ------------------
 9490|     33|	SKIP_BLANKS;
  ------------------
  |  | 2199|     81|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|     81|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 81, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9491|     33|    }
 9492|  6.42M|    xmlXPathCompStep(ctxt);
 9493|  6.42M|    CHECK_ERROR;
  ------------------
  |  |  230|  6.42M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 7.51k, False: 6.41M]
  |  |  ------------------
  ------------------
 9494|  6.41M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.41M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.42M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9495|  6.44M|    while (CUR == '/') {
  ------------------
  |  | 2193|  6.44M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9495:12): [True: 27.0k, False: 6.41M]
  ------------------
 9496|  27.0k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  27.0k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  27.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9496:6): [True: 27.0k, False: 0]
  |  Branch (9496:22): [True: 1.17k, False: 25.8k]
  ------------------
 9497|  1.17k|	    SKIP(2);
  ------------------
  |  | 2194|  1.17k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9498|  1.17k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  2.43k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.43k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.43k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9499|  1.17k|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  1.17k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.17k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9500|  1.17k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9501|  1.17k|	    xmlXPathCompStep(ctxt);
 9502|  25.8k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  25.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9502:13): [True: 25.8k, False: 0]
  ------------------
 9503|  25.8k|	    NEXT;
  ------------------
  |  | 2202|  25.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 25.8k, False: 0]
  |  |  ------------------
  ------------------
 9504|  25.8k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  25.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|     31|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 31, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9505|  25.8k|	    xmlXPathCompStep(ctxt);
 9506|  25.8k|	}
 9507|  27.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  27.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9508|  27.0k|    }
 9509|  6.41M|}
xpath.c:xmlXPathCompStep:
 9390|  6.45M|xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
 9391|  6.45M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.45M|    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|  6.45M|    if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2193|  6.45M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2195|  2.73k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9392:9): [True: 2.73k, False: 6.44M]
  |  Branch (9392:25): [True: 211, False: 2.52k]
  ------------------
 9393|    211|	SKIP(2);
  ------------------
  |  | 2194|    211|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9394|    211|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.29k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.29k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.29k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9395|    211|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
  ------------------
  |  | 1085|    211|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    211|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9396|    211|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9397|  6.45M|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  6.45M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9397:16): [True: 2.52k, False: 6.44M]
  ------------------
 9398|  2.52k|	NEXT;
  ------------------
  |  | 2202|  2.52k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.52k, False: 0]
  |  |  ------------------
  ------------------
 9399|  2.52k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  2.52k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    175|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 175, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9400|  6.44M|    } else {
 9401|  6.44M|	xmlChar *name = NULL;
 9402|  6.44M|	xmlChar *prefix = NULL;
 9403|  6.44M|	xmlXPathTestVal test = (xmlXPathTestVal) 0;
 9404|  6.44M|	xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
 9405|  6.44M|	xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
 9406|  6.44M|	int op1;
 9407|       |
 9408|  6.44M|	if (CUR == '*') {
  ------------------
  |  | 2193|  6.44M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9408:6): [True: 5.27M, False: 1.17M]
  ------------------
 9409|  5.27M|	    axis = AXIS_CHILD;
 9410|  5.27M|	} else {
 9411|  1.17M|	    if (name == NULL)
  ------------------
  |  Branch (9411:10): [True: 1.17M, False: 0]
  ------------------
 9412|  1.17M|		name = xmlXPathParseNCName(ctxt);
 9413|  1.17M|	    if (name != NULL) {
  ------------------
  |  Branch (9413:10): [True: 1.17M, False: 2.42k]
  ------------------
 9414|  1.17M|		axis = xmlXPathIsAxisName(name);
 9415|  1.17M|		if (axis != 0) {
  ------------------
  |  Branch (9415:7): [True: 3.76k, False: 1.16M]
  ------------------
 9416|  3.76k|		    SKIP_BLANKS;
  ------------------
  |  | 2199|  3.76k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      2|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9417|  3.76k|		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2193|  3.76k|#define CUR (*ctxt->cur)
  ------------------
              		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2195|  3.73k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9417:11): [True: 3.73k, False: 28]
  |  Branch (9417:27): [True: 3.73k, False: 3]
  ------------------
 9418|  3.73k|			SKIP(2);
  ------------------
  |  | 2194|  3.73k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9419|  3.73k|			xmlFree(name);
 9420|  3.73k|			name = NULL;
 9421|  3.73k|		    } else {
 9422|       |			/* an element name can conflict with an axis one :-\ */
 9423|     31|			axis = AXIS_CHILD;
 9424|     31|		    }
 9425|  1.16M|		} else {
 9426|  1.16M|		    axis = AXIS_CHILD;
 9427|  1.16M|		}
 9428|  1.17M|	    } else if (CUR == '@') {
  ------------------
  |  | 2193|  2.42k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9428:17): [True: 2.40k, False: 21]
  ------------------
 9429|  2.40k|		NEXT;
  ------------------
  |  | 2202|  2.40k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.40k, False: 0]
  |  |  ------------------
  ------------------
 9430|  2.40k|		axis = AXIS_ATTRIBUTE;
 9431|  2.40k|	    } else {
 9432|     21|		axis = AXIS_CHILD;
 9433|     21|	    }
 9434|  1.17M|	}
 9435|       |
 9436|  6.44M|        if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (9436:13): [True: 7.37k, False: 6.44M]
  ------------------
 9437|  7.37k|            xmlFree(name);
 9438|  7.37k|            return;
 9439|  7.37k|        }
 9440|       |
 9441|  6.44M|	name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
 9442|  6.44M|	if (test == 0)
  ------------------
  |  Branch (9442:6): [True: 10, False: 6.44M]
  ------------------
 9443|     10|	    return;
 9444|       |
 9445|  6.44M|        if ((prefix != NULL) && (ctxt->context != NULL) &&
  ------------------
  |  Branch (9445:13): [True: 17, False: 6.44M]
  |  Branch (9445:33): [True: 17, False: 0]
  ------------------
 9446|     17|	    (ctxt->context->flags & XML_XPATH_CHECKNS)) {
  ------------------
  |  |  237|     17|#define XML_XPATH_CHECKNS (1<<0)
  ------------------
  |  Branch (9446:6): [True: 0, False: 17]
  ------------------
 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|  6.44M|	op1 = ctxt->comp->last;
 9454|  6.44M|	ctxt->comp->last = -1;
 9455|       |
 9456|  6.44M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  6.44M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.44M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.27k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9457|  6.44M|	while (CUR == '[') {
  ------------------
  |  | 2193|  6.44M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9457:9): [True: 5.39k, False: 6.44M]
  ------------------
 9458|  5.39k|	    xmlXPathCompPredicate(ctxt, 0);
 9459|  5.39k|	}
 9460|       |
 9461|  6.44M|        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
  ------------------
  |  | 1082|  6.44M|    xmlXPathCompExprAdd(ctxt, (op1), (op2),			\
  |  | 1083|  6.44M|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (9461:13): [True: 104, False: 6.44M]
  ------------------
 9462|  6.44M|                           test, type, (void *)prefix, (void *)name) == -1) {
 9463|    104|            xmlFree(prefix);
 9464|    104|            xmlFree(name);
 9465|    104|        }
 9466|  6.44M|    }
 9467|  6.45M|}
xpath.c:xmlXPathIsAxisName:
 9321|  1.17M|xmlXPathIsAxisName(const xmlChar *name) {
 9322|  1.17M|    xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
 9323|  1.17M|    switch (name[0]) {
  ------------------
  |  Branch (9323:13): [True: 14.6k, False: 1.15M]
  ------------------
 9324|     53|	case 'a':
  ------------------
  |  Branch (9324:2): [True: 53, False: 1.17M]
  ------------------
 9325|     53|	    if (xmlStrEqual(name, BAD_CAST "ancestor"))
  ------------------
  |  |   34|     53|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9325:10): [True: 0, False: 53]
  ------------------
 9326|      0|		ret = AXIS_ANCESTOR;
 9327|     53|	    if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
  ------------------
  |  |   34|     53|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9327:10): [True: 0, False: 53]
  ------------------
 9328|      0|		ret = AXIS_ANCESTOR_OR_SELF;
 9329|     53|	    if (xmlStrEqual(name, BAD_CAST "attribute"))
  ------------------
  |  |   34|     53|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9329:10): [True: 1, False: 52]
  ------------------
 9330|      1|		ret = AXIS_ATTRIBUTE;
 9331|     53|	    break;
 9332|  7.35k|	case 'c':
  ------------------
  |  Branch (9332:2): [True: 7.35k, False: 1.16M]
  ------------------
 9333|  7.35k|	    if (xmlStrEqual(name, BAD_CAST "child"))
  ------------------
  |  |   34|  7.35k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9333:10): [True: 20, False: 7.33k]
  ------------------
 9334|     20|		ret = AXIS_CHILD;
 9335|  7.35k|	    break;
 9336|  3.60k|	case 'd':
  ------------------
  |  Branch (9336:2): [True: 3.60k, False: 1.16M]
  ------------------
 9337|  3.60k|	    if (xmlStrEqual(name, BAD_CAST "descendant"))
  ------------------
  |  |   34|  3.60k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9337:10): [True: 3.57k, False: 36]
  ------------------
 9338|  3.57k|		ret = AXIS_DESCENDANT;
 9339|  3.60k|	    if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
  ------------------
  |  |   34|  3.60k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9339:10): [True: 8, False: 3.60k]
  ------------------
 9340|      8|		ret = AXIS_DESCENDANT_OR_SELF;
 9341|  3.60k|	    break;
 9342|    114|	case 'f':
  ------------------
  |  Branch (9342:2): [True: 114, False: 1.17M]
  ------------------
 9343|    114|	    if (xmlStrEqual(name, BAD_CAST "following"))
  ------------------
  |  |   34|    114|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9343:10): [True: 0, False: 114]
  ------------------
 9344|      0|		ret = AXIS_FOLLOWING;
 9345|    114|	    if (xmlStrEqual(name, BAD_CAST "following-sibling"))
  ------------------
  |  |   34|    114|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9345:10): [True: 0, False: 114]
  ------------------
 9346|      0|		ret = AXIS_FOLLOWING_SIBLING;
 9347|    114|	    break;
 9348|    325|	case 'n':
  ------------------
  |  Branch (9348:2): [True: 325, False: 1.17M]
  ------------------
 9349|    325|	    if (xmlStrEqual(name, BAD_CAST "namespace"))
  ------------------
  |  |   34|    325|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9349:10): [True: 1, False: 324]
  ------------------
 9350|      1|		ret = AXIS_NAMESPACE;
 9351|    325|	    break;
 9352|  2.72k|	case 'p':
  ------------------
  |  Branch (9352:2): [True: 2.72k, False: 1.16M]
  ------------------
 9353|  2.72k|	    if (xmlStrEqual(name, BAD_CAST "parent"))
  ------------------
  |  |   34|  2.72k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9353:10): [True: 32, False: 2.69k]
  ------------------
 9354|     32|		ret = AXIS_PARENT;
 9355|  2.72k|	    if (xmlStrEqual(name, BAD_CAST "preceding"))
  ------------------
  |  |   34|  2.72k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9355:10): [True: 34, False: 2.68k]
  ------------------
 9356|     34|		ret = AXIS_PRECEDING;
 9357|  2.72k|	    if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
  ------------------
  |  |   34|  2.72k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9357:10): [True: 0, False: 2.72k]
  ------------------
 9358|      0|		ret = AXIS_PRECEDING_SIBLING;
 9359|  2.72k|	    break;
 9360|    439|	case 's':
  ------------------
  |  Branch (9360:2): [True: 439, False: 1.17M]
  ------------------
 9361|    439|	    if (xmlStrEqual(name, BAD_CAST "self"))
  ------------------
  |  |   34|    439|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9361:10): [True: 98, False: 341]
  ------------------
 9362|     98|		ret = AXIS_SELF;
 9363|    439|	    break;
 9364|  1.17M|    }
 9365|  1.17M|    return(ret);
 9366|  1.17M|}
xpath.c:xmlXPathCompNodeTest:
 9201|  6.44M|		     xmlChar *name) {
 9202|  6.44M|    int blanks;
 9203|       |
 9204|  6.44M|    if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
  ------------------
  |  Branch (9204:9): [True: 0, False: 6.44M]
  |  Branch (9204:27): [True: 0, False: 6.44M]
  |  Branch (9204:45): [True: 0, False: 6.44M]
  ------------------
 9205|      0|	return(NULL);
 9206|      0|    }
 9207|  6.44M|    *type = (xmlXPathTypeVal) 0;
 9208|  6.44M|    *test = (xmlXPathTestVal) 0;
 9209|  6.44M|    *prefix = NULL;
 9210|  6.44M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.44M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.44M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9211|       |
 9212|  6.44M|    if ((name == NULL) && (CUR == '*')) {
  ------------------
  |  | 2193|  5.28M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9212:9): [True: 5.28M, False: 1.15M]
  |  Branch (9212:27): [True: 5.27M, False: 6.01k]
  ------------------
 9213|       |	/*
 9214|       |	 * All elements
 9215|       |	 */
 9216|  5.27M|	NEXT;
  ------------------
  |  | 2202|  5.27M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.27M, False: 0]
  |  |  ------------------
  ------------------
 9217|  5.27M|	*test = NODE_TEST_ALL;
 9218|  5.27M|	return(NULL);
 9219|  5.27M|    }
 9220|       |
 9221|  1.16M|    if (name == NULL)
  ------------------
  |  Branch (9221:9): [True: 6.01k, False: 1.15M]
  ------------------
 9222|  6.01k|	name = xmlXPathParseNCName(ctxt);
 9223|  1.16M|    if (name == NULL) {
  ------------------
  |  Branch (9223:9): [True: 10, False: 1.16M]
  ------------------
 9224|     10|	XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     10|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9225|      0|    }
 9226|       |
 9227|  1.16M|    blanks = IS_BLANK_CH(CUR);
  ------------------
  |  |  137|  1.16M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.16M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 7, False: 1.16M]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.16M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.16M, False: 48]
  |  |  |  |  |  Branch (91:23): [True: 0, False: 1.16M]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.16M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 1.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9228|  1.16M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.16M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.16M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9229|  1.16M|    if (CUR == '(') {
  ------------------
  |  | 2193|  1.16M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9229:9): [True: 105, False: 1.16M]
  ------------------
 9230|    105|	NEXT;
  ------------------
  |  | 2202|    105|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 105, False: 0]
  |  |  ------------------
  ------------------
 9231|       |	/*
 9232|       |	 * NodeType or PI search
 9233|       |	 */
 9234|    105|	if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    105|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9234:6): [True: 7, False: 98]
  ------------------
 9235|      7|	    *type = NODE_TYPE_COMMENT;
 9236|     98|	else if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|     98|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9236:11): [True: 28, False: 70]
  ------------------
 9237|     28|	    *type = NODE_TYPE_NODE;
 9238|     70|	else if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|     70|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9238:11): [True: 5, False: 65]
  ------------------
 9239|      5|	    *type = NODE_TYPE_PI;
 9240|     65|	else if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|     65|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9240:11): [True: 65, False: 0]
  ------------------
 9241|     65|	    *type = NODE_TYPE_TEXT;
 9242|      0|	else {
 9243|      0|	    if (name != NULL)
  ------------------
  |  Branch (9243:10): [True: 0, False: 0]
  ------------------
 9244|      0|		xmlFree(name);
 9245|      0|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      0|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9246|      0|	}
 9247|       |
 9248|    105|	*test = NODE_TEST_TYPE;
 9249|       |
 9250|    105|	SKIP_BLANKS;
  ------------------
  |  | 2199|    105|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    105|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9251|    105|	if (*type == NODE_TYPE_PI) {
  ------------------
  |  Branch (9251:6): [True: 5, False: 100]
  ------------------
 9252|       |	    /*
 9253|       |	     * Specific case: search a PI by name.
 9254|       |	     */
 9255|      5|	    if (name != NULL)
  ------------------
  |  Branch (9255:10): [True: 5, False: 0]
  ------------------
 9256|      5|		xmlFree(name);
 9257|      5|	    name = NULL;
 9258|      5|	    if (CUR != ')') {
  ------------------
  |  | 2193|      5|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9258:10): [True: 0, False: 5]
  ------------------
 9259|      0|		name = xmlXPathParseLiteral(ctxt);
 9260|      0|		*test = NODE_TEST_PI;
 9261|      0|		SKIP_BLANKS;
  ------------------
  |  | 2199|      0|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9262|      0|	    }
 9263|      5|	}
 9264|    105|	if (CUR != ')') {
  ------------------
  |  | 2193|    105|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9264:6): [True: 0, False: 105]
  ------------------
 9265|      0|	    if (name != NULL)
  ------------------
  |  Branch (9265:10): [True: 0, False: 0]
  ------------------
 9266|      0|		xmlFree(name);
 9267|      0|	    XP_ERRORNULL(XPATH_UNCLOSED_ERROR);
  ------------------
  |  |  633|      0|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9268|      0|	}
 9269|    105|	NEXT;
  ------------------
  |  | 2202|    105|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 105, False: 0]
  |  |  ------------------
  ------------------
 9270|    105|	return(name);
 9271|    105|    }
 9272|  1.16M|    *test = NODE_TEST_NAME;
 9273|  1.16M|    if ((!blanks) && (CUR == ':')) {
  ------------------
  |  | 2193|  1.16M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9273:9): [True: 1.16M, False: 7]
  |  Branch (9273:22): [True: 17, False: 1.16M]
  ------------------
 9274|     17|	NEXT;
  ------------------
  |  | 2202|     17|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 17, 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|     17|	*prefix = name;
 9284|       |
 9285|     17|	if (CUR == '*') {
  ------------------
  |  | 2193|     17|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9285:6): [True: 0, False: 17]
  ------------------
 9286|       |	    /*
 9287|       |	     * All elements
 9288|       |	     */
 9289|      0|	    NEXT;
  ------------------
  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9290|      0|	    *test = NODE_TEST_ALL;
 9291|      0|	    return(NULL);
 9292|      0|	}
 9293|       |
 9294|     17|	name = xmlXPathParseNCName(ctxt);
 9295|     17|	if (name == NULL) {
  ------------------
  |  Branch (9295:6): [True: 2, False: 15]
  ------------------
 9296|      2|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      2|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9297|      0|	}
 9298|     17|    }
 9299|  1.16M|    return(name);
 9300|  1.16M|}
xpath.c:xmlXPathCompExprAdd:
 1031|  53.4M|   int value2, int value3, void *value4, void *value5) {
 1032|  53.4M|    xmlXPathCompExprPtr comp = ctxt->comp;
 1033|  53.4M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1033:9): [True: 362k, False: 53.1M]
  ------------------
 1034|   362k|	xmlXPathStepOp *real;
 1035|   362k|        int newSize;
 1036|       |
 1037|   362k|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]),
 1038|   362k|                                  10, XPATH_MAX_STEPS);
  ------------------
  |  |   88|   362k|#define XPATH_MAX_STEPS 1000000
  ------------------
 1039|   362k|        if (newSize < 0) {
  ------------------
  |  Branch (1039:13): [True: 358k, False: 3.84k]
  ------------------
 1040|   358k|	    xmlXPathPErrMemory(ctxt);
 1041|   358k|	    return(-1);
 1042|   358k|        }
 1043|  3.84k|	real = xmlRealloc(comp->steps, newSize * sizeof(real[0]));
 1044|  3.84k|	if (real == NULL) {
  ------------------
  |  Branch (1044:6): [True: 0, False: 3.84k]
  ------------------
 1045|      0|	    xmlXPathPErrMemory(ctxt);
 1046|      0|	    return(-1);
 1047|      0|	}
 1048|  3.84k|	comp->steps = real;
 1049|  3.84k|	comp->maxStep = newSize;
 1050|  3.84k|    }
 1051|  53.1M|    comp->last = comp->nbStep;
 1052|  53.1M|    comp->steps[comp->nbStep].ch1 = ch1;
 1053|  53.1M|    comp->steps[comp->nbStep].ch2 = ch2;
 1054|  53.1M|    comp->steps[comp->nbStep].op = op;
 1055|  53.1M|    comp->steps[comp->nbStep].value = value;
 1056|  53.1M|    comp->steps[comp->nbStep].value2 = value2;
 1057|  53.1M|    comp->steps[comp->nbStep].value3 = value3;
 1058|  53.1M|    if ((comp->dict != NULL) &&
  ------------------
  |  Branch (1058:9): [True: 0, False: 53.1M]
  ------------------
 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|  53.1M|    } else {
 1074|  53.1M|	comp->steps[comp->nbStep].value4 = value4;
 1075|  53.1M|	comp->steps[comp->nbStep].value5 = value5;
 1076|  53.1M|    }
 1077|       |    comp->steps[comp->nbStep].cache = NULL;
 1078|  53.1M|    return(comp->nbStep++);
 1079|  53.4M|}
xpath.c:xmlXPathOptimizeExpression:
11740|  3.14M|{
11741|  3.14M|    xmlXPathCompExprPtr comp = pctxt->comp;
11742|  3.14M|    xmlXPathContextPtr ctxt;
11743|       |
11744|       |    /*
11745|       |    * Try to rewrite "descendant-or-self::node()/foo" to an optimized
11746|       |    * internal representation.
11747|       |    */
11748|       |
11749|  3.14M|    if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11749:9): [True: 1.04M, False: 2.10M]
  ------------------
11750|  1.04M|        (op->ch1 != -1) &&
  ------------------
  |  Branch (11750:9): [True: 1.04M, False: 0]
  ------------------
11751|  1.04M|        (op->ch2 == -1 /* no predicate */))
  ------------------
  |  Branch (11751:9): [True: 1.03M, False: 2.43k]
  ------------------
11752|  1.03M|    {
11753|  1.03M|        xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
11754|       |
11755|  1.03M|        if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11755:13): [True: 1.55k, False: 1.03M]
  ------------------
11756|  1.55k|            ((xmlXPathAxisVal) prevop->value ==
  ------------------
  |  Branch (11756:13): [True: 36, False: 1.51k]
  ------------------
11757|  1.55k|                AXIS_DESCENDANT_OR_SELF) &&
11758|     36|            (prevop->ch2 == -1) &&
  ------------------
  |  Branch (11758:13): [True: 36, False: 0]
  ------------------
11759|     36|            ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
  ------------------
  |  Branch (11759:13): [True: 36, False: 0]
  ------------------
11760|     36|            ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE))
  ------------------
  |  Branch (11760:13): [True: 36, False: 0]
  ------------------
11761|     36|        {
11762|       |            /*
11763|       |            * This is a "descendant-or-self::node()" without predicates.
11764|       |            * Try to eliminate it.
11765|       |            */
11766|       |
11767|     36|            switch ((xmlXPathAxisVal) op->value) {
11768|     15|                case AXIS_CHILD:
  ------------------
  |  Branch (11768:17): [True: 15, False: 21]
  ------------------
11769|     15|                case AXIS_DESCENDANT:
  ------------------
  |  Branch (11769:17): [True: 0, False: 36]
  ------------------
11770|       |                    /*
11771|       |                    * Convert "descendant-or-self::node()/child::" or
11772|       |                    * "descendant-or-self::node()/descendant::" to
11773|       |                    * "descendant::"
11774|       |                    */
11775|     15|                    op->ch1   = prevop->ch1;
11776|     15|                    op->value = AXIS_DESCENDANT;
11777|     15|                    break;
11778|      0|                case AXIS_SELF:
  ------------------
  |  Branch (11778:17): [True: 0, False: 36]
  ------------------
11779|      0|                case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (11779:17): [True: 0, False: 36]
  ------------------
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|      0|                    op->ch1   = prevop->ch1;
11786|      0|                    op->value = AXIS_DESCENDANT_OR_SELF;
11787|      0|                    break;
11788|     21|                default:
  ------------------
  |  Branch (11788:17): [True: 21, False: 15]
  ------------------
11789|     21|                    break;
11790|     36|            }
11791|     36|	}
11792|  1.03M|    }
11793|       |
11794|       |    /* OP_VALUE has invalid ch1. */
11795|  3.14M|    if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (11795:9): [True: 6.31k, False: 3.14M]
  ------------------
11796|  6.31k|        return;
11797|       |
11798|       |    /* Recurse */
11799|  3.14M|    ctxt = pctxt->context;
11800|  3.14M|    if (ctxt != NULL) {
  ------------------
  |  Branch (11800:9): [True: 3.14M, False: 0]
  ------------------
11801|  3.14M|        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  3.14M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (11801:13): [True: 4.62k, False: 3.13M]
  ------------------
11802|  4.62k|            return;
11803|  3.13M|        ctxt->depth += 1;
11804|  3.13M|    }
11805|  3.13M|    if (op->ch1 != -1)
  ------------------
  |  Branch (11805:9): [True: 2.10M, False: 1.03M]
  ------------------
11806|  2.10M|        xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]);
11807|  3.13M|    if (op->ch2 != -1)
  ------------------
  |  Branch (11807:9): [True: 1.04M, False: 2.08M]
  ------------------
11808|  1.04M|	xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]);
11809|  3.13M|    if (ctxt != NULL)
  ------------------
  |  Branch (11809:9): [True: 3.13M, False: 0]
  ------------------
11810|  3.13M|        ctxt->depth -= 1;
11811|  3.13M|}
xpath.c:xmlXPathCompiledEvalInternal:
11926|    115|{
11927|    115|    xmlXPathParserContextPtr pctxt;
11928|    115|    xmlXPathObjectPtr resObj = NULL;
11929|    115|    int res;
11930|       |
11931|    115|    if (comp == NULL)
  ------------------
  |  Branch (11931:9): [True: 0, False: 115]
  ------------------
11932|      0|	return(-1);
11933|    115|    xmlInitParser();
11934|       |
11935|    115|    xmlResetError(&ctxt->lastError);
11936|       |
11937|    115|    pctxt = xmlXPathCompParserContext(comp, ctxt);
11938|    115|    if (pctxt == NULL)
  ------------------
  |  Branch (11938:9): [True: 0, False: 115]
  ------------------
11939|      0|        return(-1);
11940|    115|    res = xmlXPathRunEval(pctxt, toBool);
11941|       |
11942|    115|    if (pctxt->error == XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (11942:9): [True: 62, False: 53]
  ------------------
11943|     62|        if (pctxt->valueNr != ((toBool) ? 0 : 1))
  ------------------
  |  Branch (11943:13): [True: 0, False: 62]
  |  Branch (11943:32): [True: 0, False: 62]
  ------------------
11944|      0|            xmlXPathErr(pctxt, XPATH_STACK_ERROR);
11945|     62|        else if (!toBool)
  ------------------
  |  Branch (11945:18): [True: 62, False: 0]
  ------------------
11946|     62|            resObj = xmlXPathValuePop(pctxt);
11947|     62|    }
11948|       |
11949|    115|    if (resObjPtr)
  ------------------
  |  Branch (11949:9): [True: 115, False: 0]
  ------------------
11950|    115|        *resObjPtr = resObj;
11951|      0|    else
11952|      0|        xmlXPathReleaseObject(ctxt, resObj);
11953|       |
11954|    115|    pctxt->comp = NULL;
11955|    115|    xmlXPathFreeParserContext(pctxt);
11956|       |
11957|    115|    return(res);
11958|    115|}
xpath.c:xmlXPathCompParserContext:
 4842|    115|xmlXPathCompParserContext(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctxt) {
 4843|    115|    xmlXPathParserContextPtr ret;
 4844|       |
 4845|    115|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4846|    115|    if (ret == NULL) {
  ------------------
  |  Branch (4846:9): [True: 0, False: 115]
  ------------------
 4847|      0|        xmlXPathErrMemory(ctxt);
 4848|      0|	return(NULL);
 4849|      0|    }
 4850|    115|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4851|       |
 4852|       |    /* Allocate the value stack */
 4853|    115|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 4854|    115|    ret->valueMax = 1;
 4855|       |#else
 4856|       |    ret->valueMax = 10;
 4857|       |#endif
 4858|    115|    ret->valueTab = xmlMalloc(ret->valueMax * sizeof(xmlXPathObjectPtr));
 4859|    115|    if (ret->valueTab == NULL) {
  ------------------
  |  Branch (4859:9): [True: 0, False: 115]
  ------------------
 4860|      0|	xmlFree(ret);
 4861|      0|	xmlXPathErrMemory(ctxt);
 4862|      0|	return(NULL);
 4863|      0|    }
 4864|    115|    ret->valueNr = 0;
 4865|    115|    ret->value = NULL;
 4866|       |
 4867|    115|    ret->context = ctxt;
 4868|    115|    ret->comp = comp;
 4869|       |
 4870|    115|    return(ret);
 4871|    115|}
xpath.c:xmlXPathRunEval:
11496|    115|{
11497|    115|    xmlXPathCompExprPtr comp;
11498|    115|    int oldDepth;
11499|       |
11500|    115|    if ((ctxt == NULL) || (ctxt->comp == NULL))
  ------------------
  |  Branch (11500:9): [True: 0, False: 115]
  |  Branch (11500:27): [True: 0, False: 115]
  ------------------
11501|      0|	return(-1);
11502|       |
11503|    115|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11503:9): [True: 0, False: 115]
  ------------------
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|    115|    comp = ctxt->comp;
11553|    115|    if (comp->last < 0) {
  ------------------
  |  Branch (11553:9): [True: 0, False: 115]
  ------------------
11554|      0|        xmlXPathErr(ctxt, XPATH_STACK_ERROR);
11555|      0|	return(-1);
11556|      0|    }
11557|    115|    oldDepth = ctxt->context->depth;
11558|    115|    if (toBool)
  ------------------
  |  Branch (11558:9): [True: 0, False: 115]
  ------------------
11559|      0|	return(xmlXPathCompOpEvalToBoolean(ctxt,
11560|      0|	    &comp->steps[comp->last], 0));
11561|    115|    else
11562|    115|	xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
11563|    115|    ctxt->context->depth = oldDepth;
11564|       |
11565|    115|    return(0);
11566|    115|}
xpath.c:xmlXPathCompOpEvalToBoolean:
11177|    762|{
11178|    762|    xmlXPathObjectPtr resObj = NULL;
11179|       |
11180|    846|start:
11181|    846|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|    846|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 846]
  |  |  |  Branch (818:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
11182|      0|        return(0);
11183|       |    /* comp = ctxt->comp; */
11184|    846|    switch (op->op) {
11185|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (11185:9): [True: 0, False: 846]
  ------------------
11186|      0|            return (0);
11187|    475|	case XPATH_OP_VALUE:
  ------------------
  |  Branch (11187:2): [True: 475, False: 371]
  ------------------
11188|    475|	    resObj = (xmlXPathObjectPtr) op->value4;
11189|    475|	    if (isPredicate)
  ------------------
  |  Branch (11189:10): [True: 475, False: 0]
  ------------------
11190|    475|		return(xmlXPathEvaluatePredicateResult(ctxt, resObj));
11191|      0|	    return(xmlXPathCastToBoolean(resObj));
11192|     84|	case XPATH_OP_SORT:
  ------------------
  |  Branch (11192:2): [True: 84, False: 762]
  ------------------
11193|       |	    /*
11194|       |	    * We don't need sorting for boolean results. Skip this one.
11195|       |	    */
11196|     84|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11196:17): [True: 84, False: 0]
  ------------------
11197|     84|		op = &ctxt->comp->steps[op->ch1];
11198|     84|		goto start;
11199|     84|	    }
11200|      0|	    return(0);
11201|    217|	case XPATH_OP_COLLECT:
  ------------------
  |  Branch (11201:2): [True: 217, False: 629]
  ------------------
11202|    217|	    if (op->ch1 == -1)
  ------------------
  |  Branch (11202:10): [True: 0, False: 217]
  ------------------
11203|      0|		return(0);
11204|       |
11205|    217|            xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]);
11206|    217|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11206:10): [True: 0, False: 217]
  ------------------
11207|      0|		return(-1);
11208|       |
11209|    217|            xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1);
11210|    217|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11210:10): [True: 0, False: 217]
  ------------------
11211|      0|		return(-1);
11212|       |
11213|    217|	    resObj = xmlXPathValuePop(ctxt);
11214|    217|	    if (resObj == NULL)
  ------------------
  |  Branch (11214:10): [True: 0, False: 217]
  ------------------
11215|      0|		return(-1);
11216|    217|	    break;
11217|    217|	default:
  ------------------
  |  Branch (11217:2): [True: 70, False: 776]
  ------------------
11218|       |	    /*
11219|       |	    * Fallback to call xmlXPathCompOpEval().
11220|       |	    */
11221|     70|	    xmlXPathCompOpEval(ctxt, op);
11222|     70|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11222:10): [True: 4, False: 66]
  ------------------
11223|      4|		return(-1);
11224|       |
11225|     66|	    resObj = xmlXPathValuePop(ctxt);
11226|     66|	    if (resObj == NULL)
  ------------------
  |  Branch (11226:10): [True: 0, False: 66]
  ------------------
11227|      0|		return(-1);
11228|     66|	    break;
11229|    846|    }
11230|       |
11231|    283|    if (resObj) {
  ------------------
  |  Branch (11231:9): [True: 283, False: 0]
  ------------------
11232|    283|	int res;
11233|       |
11234|    283|	if (resObj->type == XPATH_BOOLEAN) {
  ------------------
  |  Branch (11234:6): [True: 0, False: 283]
  ------------------
11235|      0|	    res = resObj->boolval;
11236|    283|	} else if (isPredicate) {
  ------------------
  |  Branch (11236:13): [True: 283, 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|    283|	    res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
11246|    283|	} else {
11247|      0|	    res = xmlXPathCastToBoolean(resObj);
11248|      0|	}
11249|    283|	xmlXPathReleaseObject(ctxt->context, resObj);
11250|    283|	return(res);
11251|    283|    }
11252|       |
11253|      0|    return(0);
11254|    283|}
xpath.c:xmlXPathNodeCollectAndTest:
 9793|   318k|{
 9794|       |
 9795|   318k|#define XP_TEST_HIT \
 9796|   318k|    if (hasAxisRange != 0) { \
 9797|   318k|	if (++pos == maxPos) { \
 9798|   318k|	    if (addNode(seq, cur) < 0) \
 9799|   318k|	        xmlXPathPErrMemory(ctxt); \
 9800|   318k|	    goto axis_range_end; } \
 9801|   318k|    } else { \
 9802|   318k|	if (addNode(seq, cur) < 0) \
 9803|   318k|	    xmlXPathPErrMemory(ctxt); \
 9804|   318k|	if (breakOnFirstHit) goto first_hit; }
 9805|       |
 9806|   318k|#define XP_TEST_HIT_NS \
 9807|   318k|    if (hasAxisRange != 0) { \
 9808|   318k|	if (++pos == maxPos) { \
 9809|   318k|	    hasNsNodes = 1; \
 9810|   318k|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9811|   318k|	        xmlXPathPErrMemory(ctxt); \
 9812|   318k|	goto axis_range_end; } \
 9813|   318k|    } else { \
 9814|   318k|	hasNsNodes = 1; \
 9815|   318k|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9816|   318k|	    xmlXPathPErrMemory(ctxt); \
 9817|   318k|	if (breakOnFirstHit) goto first_hit; }
 9818|       |
 9819|   318k|    xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value;
 9820|   318k|    xmlXPathTestVal test = (xmlXPathTestVal) op->value2;
 9821|   318k|    xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3;
 9822|   318k|    const xmlChar *prefix = op->value4;
 9823|   318k|    const xmlChar *name = op->value5;
 9824|   318k|    const xmlChar *URI = NULL;
 9825|       |
 9826|   318k|    int total = 0, hasNsNodes = 0;
 9827|       |    /* The popped object holding the context nodes */
 9828|   318k|    xmlXPathObjectPtr obj;
 9829|       |    /* The set of context nodes for the node tests */
 9830|   318k|    xmlNodeSetPtr contextSeq;
 9831|   318k|    int contextIdx;
 9832|   318k|    xmlNodePtr contextNode;
 9833|       |    /* The final resulting node set wrt to all context nodes */
 9834|   318k|    xmlNodeSetPtr outSeq;
 9835|       |    /*
 9836|       |    * The temporary resulting node set wrt 1 context node.
 9837|       |    * Used to feed predicate evaluation.
 9838|       |    */
 9839|   318k|    xmlNodeSetPtr seq;
 9840|   318k|    xmlNodePtr cur;
 9841|       |    /* First predicate operator */
 9842|   318k|    xmlXPathStepOpPtr predOp;
 9843|   318k|    int maxPos; /* The requested position() (when a "[n]" predicate) */
 9844|   318k|    int hasPredicateRange, hasAxisRange, pos;
 9845|   318k|    int breakOnFirstHit;
 9846|       |
 9847|   318k|    xmlXPathTraversalFunction next = NULL;
 9848|   318k|    int (*addNode) (xmlNodeSetPtr, xmlNodePtr);
 9849|   318k|    xmlXPathNodeSetMergeFunction mergeAndClear;
 9850|   318k|    xmlNodePtr oldContextNode;
 9851|   318k|    xmlXPathContextPtr xpctxt = ctxt->context;
 9852|       |
 9853|       |
 9854|   318k|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|   318k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 318k]
  |  |  |  Branch (271:34): [True: 0, False: 318k]
  |  |  ------------------
  |  |  272|   318k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
 9855|   318k|    obj = xmlXPathValuePop(ctxt);
 9856|       |    /*
 9857|       |    * Setup namespaces.
 9858|       |    */
 9859|   318k|    if (prefix != NULL) {
  ------------------
  |  Branch (9859:9): [True: 0, False: 318k]
  ------------------
 9860|      0|        URI = xmlXPathNsLookup(xpctxt, prefix);
 9861|      0|        if (URI == NULL) {
  ------------------
  |  Branch (9861:13): [True: 0, False: 0]
  ------------------
 9862|      0|	    xmlXPathReleaseObject(xpctxt, obj);
 9863|      0|            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9864|      0|                           "Undefined namespace prefix: %s\n", prefix);
 9865|      0|            return 0;
 9866|      0|	}
 9867|      0|    }
 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|   318k|    mergeAndClear = xmlXPathNodeSetMergeAndClear;
 9882|   318k|    switch (axis) {
  ------------------
  |  Branch (9882:13): [True: 318k, False: 0]
  ------------------
 9883|      0|        case AXIS_ANCESTOR:
  ------------------
  |  Branch (9883:9): [True: 0, False: 318k]
  ------------------
 9884|      0|            first = NULL;
 9885|      0|            next = xmlXPathNextAncestor;
 9886|      0|            break;
 9887|      0|        case AXIS_ANCESTOR_OR_SELF:
  ------------------
  |  Branch (9887:9): [True: 0, False: 318k]
  ------------------
 9888|      0|            first = NULL;
 9889|      0|            next = xmlXPathNextAncestorOrSelf;
 9890|      0|            break;
 9891|      0|        case AXIS_ATTRIBUTE:
  ------------------
  |  Branch (9891:9): [True: 0, False: 318k]
  ------------------
 9892|      0|            first = NULL;
 9893|      0|	    last = NULL;
 9894|      0|            next = xmlXPathNextAttribute;
 9895|      0|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9896|      0|            break;
 9897|   318k|        case AXIS_CHILD:
  ------------------
  |  Branch (9897:9): [True: 318k, False: 303]
  ------------------
 9898|   318k|	    last = NULL;
 9899|   318k|	    if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
  ------------------
  |  Branch (9899:11): [True: 5.62k, False: 312k]
  |  Branch (9899:39): [True: 312k, False: 0]
  ------------------
 9900|   318k|		(type == NODE_TYPE_NODE))
  ------------------
  |  Branch (9900:3): [True: 318k, False: 0]
  ------------------
 9901|   318k|	    {
 9902|       |		/*
 9903|       |		* Optimization if an element node type is 'element'.
 9904|       |		*/
 9905|   318k|		next = xmlXPathNextChildElement;
 9906|   318k|	    } else
 9907|      0|		next = xmlXPathNextChild;
 9908|   318k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9909|   318k|            break;
 9910|      4|        case AXIS_DESCENDANT:
  ------------------
  |  Branch (9910:9): [True: 4, False: 318k]
  ------------------
 9911|      4|	    last = NULL;
 9912|      4|            next = xmlXPathNextDescendant;
 9913|      4|            break;
 9914|    264|        case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (9914:9): [True: 264, False: 318k]
  ------------------
 9915|    264|	    last = NULL;
 9916|    264|            next = xmlXPathNextDescendantOrSelf;
 9917|    264|            break;
 9918|      0|        case AXIS_FOLLOWING:
  ------------------
  |  Branch (9918:9): [True: 0, False: 318k]
  ------------------
 9919|      0|	    last = NULL;
 9920|      0|            next = xmlXPathNextFollowing;
 9921|      0|            break;
 9922|      0|        case AXIS_FOLLOWING_SIBLING:
  ------------------
  |  Branch (9922:9): [True: 0, False: 318k]
  ------------------
 9923|      0|	    last = NULL;
 9924|      0|            next = xmlXPathNextFollowingSibling;
 9925|      0|            break;
 9926|      0|        case AXIS_NAMESPACE:
  ------------------
  |  Branch (9926:9): [True: 0, False: 318k]
  ------------------
 9927|      0|            first = NULL;
 9928|      0|	    last = NULL;
 9929|      0|            next = (xmlXPathTraversalFunction) xmlXPathNextNamespace;
 9930|      0|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9931|      0|            break;
 9932|     21|        case AXIS_PARENT:
  ------------------
  |  Branch (9932:9): [True: 21, False: 318k]
  ------------------
 9933|     21|            first = NULL;
 9934|     21|            next = xmlXPathNextParent;
 9935|     21|            break;
 9936|     14|        case AXIS_PRECEDING:
  ------------------
  |  Branch (9936:9): [True: 14, False: 318k]
  ------------------
 9937|     14|            first = NULL;
 9938|     14|            next = xmlXPathNextPrecedingInternal;
 9939|     14|            break;
 9940|      0|        case AXIS_PRECEDING_SIBLING:
  ------------------
  |  Branch (9940:9): [True: 0, False: 318k]
  ------------------
 9941|      0|            first = NULL;
 9942|      0|            next = xmlXPathNextPrecedingSibling;
 9943|      0|            break;
 9944|      0|        case AXIS_SELF:
  ------------------
  |  Branch (9944:9): [True: 0, False: 318k]
  ------------------
 9945|      0|            first = NULL;
 9946|      0|	    last = NULL;
 9947|      0|            next = xmlXPathNextSelf;
 9948|      0|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9949|      0|            break;
 9950|   318k|    }
 9951|       |
 9952|   318k|    if (next == NULL) {
  ------------------
  |  Branch (9952:9): [True: 0, False: 318k]
  ------------------
 9953|      0|	xmlXPathReleaseObject(xpctxt, obj);
 9954|      0|        return(0);
 9955|      0|    }
 9956|   318k|    contextSeq = obj->nodesetval;
 9957|   318k|    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
  ------------------
  |  Branch (9957:9): [True: 0, False: 318k]
  |  Branch (9957:33): [True: 488, False: 318k]
  ------------------
 9958|    488|        xmlXPathValuePush(ctxt, obj);
 9959|    488|        return(0);
 9960|    488|    }
 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|   318k|    maxPos = 0;
 9980|   318k|    predOp = NULL;
 9981|   318k|    hasPredicateRange = 0;
 9982|   318k|    hasAxisRange = 0;
 9983|   318k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9983:9): [True: 2.40k, False: 315k]
  ------------------
 9984|       |	/*
 9985|       |	* There's at least one predicate. 16 == XPATH_OP_PREDICATE
 9986|       |	*/
 9987|  2.40k|	predOp = &ctxt->comp->steps[op->ch2];
 9988|  2.40k|	if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) {
  ------------------
  |  Branch (9988:6): [True: 2.34k, False: 57]
  ------------------
 9989|  2.34k|	    if (predOp->ch1 != -1) {
  ------------------
  |  Branch (9989:10): [True: 952, False: 1.39k]
  ------------------
 9990|       |		/*
 9991|       |		* Use the next inner predicate operator.
 9992|       |		*/
 9993|    952|		predOp = &ctxt->comp->steps[predOp->ch1];
 9994|    952|		hasPredicateRange = 1;
 9995|  1.39k|	    } else {
 9996|       |		/*
 9997|       |		* There's no other predicate than the [n] predicate.
 9998|       |		*/
 9999|  1.39k|		predOp = NULL;
10000|  1.39k|		hasAxisRange = 1;
10001|  1.39k|	    }
10002|  2.34k|	}
10003|  2.40k|    }
10004|   318k|    breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
  ------------------
  |  Branch (10004:24): [True: 217, False: 317k]
  |  Branch (10004:36): [True: 217, False: 0]
  ------------------
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|   318k|    oldContextNode = xpctxt->node;
10019|   318k|    addNode = xmlXPathNodeSetAddUnique;
10020|   318k|    outSeq = NULL;
10021|   318k|    seq = NULL;
10022|   318k|    contextNode = NULL;
10023|   318k|    contextIdx = 0;
10024|       |
10025|       |
10026|   636k|    while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) &&
  ------------------
  |  Branch (10026:13): [True: 318k, False: 318k]
  |  Branch (10026:50): [True: 0, False: 318k]
  ------------------
10027|   318k|           (ctxt->error == XPATH_EXPRESSION_OK)) {
  ------------------
  |  Branch (10027:12): [True: 318k, False: 0]
  ------------------
10028|   318k|	xpctxt->node = contextSeq->nodeTab[contextIdx++];
10029|       |
10030|   318k|	if (seq == NULL) {
  ------------------
  |  Branch (10030:6): [True: 318k, False: 21]
  ------------------
10031|   318k|	    seq = xmlXPathNodeSetCreate(NULL);
10032|   318k|	    if (seq == NULL) {
  ------------------
  |  Branch (10032:10): [True: 0, False: 318k]
  ------------------
10033|      0|                xmlXPathPErrMemory(ctxt);
10034|      0|		total = 0;
10035|      0|		goto error;
10036|      0|	    }
10037|   318k|	}
10038|       |	/*
10039|       |	* Traverse the axis and test the nodes.
10040|       |	*/
10041|   318k|	pos = 0;
10042|   318k|	cur = NULL;
10043|   318k|	hasNsNodes = 0;
10044|   632k|        do {
10045|   632k|            if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   632k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 632k]
  |  |  |  Branch (818:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10046|      0|                goto error;
10047|       |
10048|   632k|            cur = next(ctxt, cur);
10049|   632k|            if (cur == NULL)
  ------------------
  |  Branch (10049:17): [True: 317k, False: 314k]
  ------------------
10050|   317k|                break;
10051|       |
10052|       |	    /*
10053|       |	    * QUESTION TODO: What does the "first" and "last" stuff do?
10054|       |	    */
10055|   314k|            if ((first != NULL) && (*first != NULL)) {
  ------------------
  |  Branch (10055:17): [True: 0, False: 314k]
  |  Branch (10055:36): [True: 0, False: 0]
  ------------------
10056|      0|		if (*first == cur)
  ------------------
  |  Branch (10056:7): [True: 0, False: 0]
  ------------------
10057|      0|		    break;
10058|      0|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10058:7): [True: 0, False: 0]
  ------------------
10059|      0|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10060|      0|		    (xmlXPathCmpNodesExt(*first, cur) >= 0))
  ------------------
  |  Branch (10060:7): [True: 0, False: 0]
  ------------------
10061|       |#else
10062|       |		    (xmlXPathCmpNodes(*first, cur) >= 0))
10063|       |#endif
10064|      0|		{
10065|      0|		    break;
10066|      0|		}
10067|      0|	    }
10068|   314k|	    if ((last != NULL) && (*last != NULL)) {
  ------------------
  |  Branch (10068:10): [True: 0, False: 314k]
  |  Branch (10068:28): [True: 0, False: 0]
  ------------------
10069|      0|		if (*last == cur)
  ------------------
  |  Branch (10069:7): [True: 0, False: 0]
  ------------------
10070|      0|		    break;
10071|      0|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10071:7): [True: 0, False: 0]
  ------------------
10072|      0|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10073|      0|		    (xmlXPathCmpNodesExt(cur, *last) >= 0))
  ------------------
  |  Branch (10073:7): [True: 0, False: 0]
  ------------------
10074|       |#else
10075|       |		    (xmlXPathCmpNodes(cur, *last) >= 0))
10076|       |#endif
10077|      0|		{
10078|      0|		    break;
10079|      0|		}
10080|      0|	    }
10081|       |
10082|   314k|            total++;
10083|       |
10084|   314k|	    switch (test) {
  ------------------
  |  Branch (10084:14): [True: 314k, False: 0]
  ------------------
10085|      0|                case NODE_TEST_NONE:
  ------------------
  |  Branch (10085:17): [True: 0, False: 314k]
  ------------------
10086|      0|		    total = 0;
10087|      0|		    goto error;
10088|    113|                case NODE_TEST_TYPE:
  ------------------
  |  Branch (10088:17): [True: 113, False: 314k]
  ------------------
10089|    113|		    if (type == NODE_TYPE_NODE) {
  ------------------
  |  Branch (10089:11): [True: 105, False: 8]
  ------------------
10090|    105|			switch (cur->type) {
10091|     42|			    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (10091:8): [True: 42, False: 63]
  ------------------
10092|     42|			    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (10092:8): [True: 0, False: 105]
  ------------------
10093|     84|			    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10093:8): [True: 42, False: 63]
  ------------------
10094|     84|			    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (10094:8): [True: 0, False: 105]
  ------------------
10095|     84|			    case XML_PI_NODE:
  ------------------
  |  Branch (10095:8): [True: 0, False: 105]
  ------------------
10096|     84|			    case XML_COMMENT_NODE:
  ------------------
  |  Branch (10096:8): [True: 0, False: 105]
  ------------------
10097|     84|			    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (10097:8): [True: 0, False: 105]
  ------------------
10098|    105|			    case XML_TEXT_NODE:
  ------------------
  |  Branch (10098:8): [True: 21, False: 84]
  ------------------
10099|    105|				XP_TEST_HIT
  ------------------
  |  | 9796|    105|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 105]
  |  |  ------------------
  |  | 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|    105|    } else { \
  |  | 9802|    105|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 105]
  |  |  ------------------
  |  | 9803|    105|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    105|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 105]
  |  |  ------------------
  ------------------
10100|    105|				break;
10101|    105|			    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (10101:8): [True: 0, False: 105]
  ------------------
10102|      0|				if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10102:9): [True: 0, False: 0]
  ------------------
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|      0|				} else {
10105|      0|	                            hasNsNodes = 1;
10106|      0|				    XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10107|      0|				}
10108|      0|				break;
10109|      0|                            }
10110|      0|			    default:
  ------------------
  |  Branch (10110:8): [True: 0, False: 105]
  ------------------
10111|      0|				break;
10112|    105|			}
10113|    105|		    } else if (cur->type == (xmlElementType) type) {
  ------------------
  |  Branch (10113:18): [True: 0, False: 8]
  ------------------
10114|      0|			if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10114:8): [True: 0, False: 0]
  ------------------
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|      0|			else
10117|      0|			    XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10118|      8|		    } else if ((type == NODE_TYPE_TEXT) &&
  ------------------
  |  Branch (10118:18): [True: 0, False: 8]
  ------------------
10119|      0|			 (cur->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (10119:5): [True: 0, False: 0]
  ------------------
10120|      0|		    {
10121|      0|			XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10122|      0|		    }
10123|    113|		    break;
10124|    113|                case NODE_TEST_PI:
  ------------------
  |  Branch (10124:17): [True: 0, False: 314k]
  ------------------
10125|      0|                    if ((cur->type == XML_PI_NODE) &&
  ------------------
  |  Branch (10125:25): [True: 0, False: 0]
  ------------------
10126|      0|                        ((name == NULL) || xmlStrEqual(name, cur->name)))
  ------------------
  |  Branch (10126:26): [True: 0, False: 0]
  |  Branch (10126:44): [True: 0, False: 0]
  ------------------
10127|      0|		    {
10128|      0|			XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10129|      0|                    }
10130|      0|                    break;
10131|   310k|                case NODE_TEST_ALL:
  ------------------
  |  Branch (10131:17): [True: 310k, False: 4.74k]
  ------------------
10132|   310k|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10132:25): [True: 0, False: 310k]
  ------------------
10133|      0|                        if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10133:29): [True: 0, False: 0]
  ------------------
10134|      0|			{
10135|      0|                            if (prefix == NULL)
  ------------------
  |  Branch (10135:33): [True: 0, False: 0]
  ------------------
10136|      0|			    {
10137|      0|				XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10138|      0|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10138:40): [True: 0, False: 0]
  ------------------
10139|      0|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10139:5): [True: 0, False: 0]
  ------------------
10140|      0|			    {
10141|      0|				XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10142|      0|                            }
10143|      0|                        }
10144|   310k|                    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10144:32): [True: 0, False: 310k]
  ------------------
10145|      0|                        if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10145:29): [True: 0, False: 0]
  ------------------
10146|      0|			{
10147|      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]
  |  |  ------------------
  ------------------
10148|      0|                        }
10149|   310k|                    } else {
10150|   310k|                        if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (10150:29): [True: 310k, False: 0]
  ------------------
10151|   310k|                            if (prefix == NULL)
  ------------------
  |  Branch (10151:33): [True: 310k, False: 0]
  ------------------
10152|   310k|			    {
10153|   310k|				XP_TEST_HIT
  ------------------
  |  | 9796|   310k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 669, False: 309k]
  |  |  ------------------
  |  | 9797|    669|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 669, False: 0]
  |  |  ------------------
  |  | 9798|    669|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 0, False: 669]
  |  |  ------------------
  |  | 9799|    669|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    669|	    goto axis_range_end; } \
  |  | 9801|   309k|    } else { \
  |  | 9802|   309k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 309k]
  |  |  ------------------
  |  | 9803|   309k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   309k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 309k]
  |  |  ------------------
  ------------------
10154|       |
10155|   310k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10155:40): [True: 0, False: 0]
  ------------------
10156|      0|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10156:5): [True: 0, False: 0]
  ------------------
10157|      0|			    {
10158|      0|				XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10159|      0|                            }
10160|   310k|                        }
10161|   310k|                    }
10162|   309k|                    break;
10163|   309k|                case NODE_TEST_NS:{
  ------------------
  |  Branch (10163:17): [True: 0, False: 314k]
  ------------------
10164|       |                        /* TODO */
10165|      0|                        break;
10166|   310k|                    }
10167|  4.63k|                case NODE_TEST_NAME:
  ------------------
  |  Branch (10167:17): [True: 4.63k, False: 310k]
  ------------------
10168|  4.63k|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10168:25): [True: 0, False: 4.63k]
  ------------------
10169|      0|                        if (cur->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10169:29): [True: 0, False: 0]
  ------------------
10170|      0|			    break;
10171|  4.63k|		    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10171:18): [True: 0, False: 4.63k]
  ------------------
10172|      0|                        if (cur->type != XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10172:29): [True: 0, False: 0]
  ------------------
10173|      0|			    break;
10174|  4.63k|		    } else {
10175|  4.63k|		        if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (10175:15): [True: 0, False: 4.63k]
  ------------------
10176|      0|			    break;
10177|  4.63k|		    }
10178|  4.63k|                    switch (cur->type) {
10179|  4.63k|                        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10179:25): [True: 4.63k, False: 0]
  ------------------
10180|  4.63k|                            if (xmlStrEqual(name, cur->name)) {
  ------------------
  |  Branch (10180:33): [True: 0, False: 4.63k]
  ------------------
10181|      0|                                if (prefix == NULL) {
  ------------------
  |  Branch (10181:37): [True: 0, False: 0]
  ------------------
10182|      0|                                    if (cur->ns == NULL)
  ------------------
  |  Branch (10182:41): [True: 0, False: 0]
  ------------------
10183|      0|				    {
10184|      0|					XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10185|      0|                                    }
10186|      0|                                } else {
10187|      0|                                    if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10187:41): [True: 0, False: 0]
  ------------------
10188|      0|                                        (xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10188:41): [True: 0, False: 0]
  ------------------
10189|      0|				    {
10190|      0|					XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10191|      0|                                    }
10192|      0|                                }
10193|      0|                            }
10194|  4.63k|                            break;
10195|  4.63k|                        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (10195:25): [True: 0, False: 4.63k]
  ------------------
10196|      0|                                xmlAttrPtr attr = (xmlAttrPtr) cur;
10197|       |
10198|      0|                                if (xmlStrEqual(name, attr->name)) {
  ------------------
  |  Branch (10198:37): [True: 0, False: 0]
  ------------------
10199|      0|                                    if (prefix == NULL) {
  ------------------
  |  Branch (10199:41): [True: 0, False: 0]
  ------------------
10200|      0|                                        if ((attr->ns == NULL) ||
  ------------------
  |  Branch (10200:45): [True: 0, False: 0]
  ------------------
10201|      0|                                            (attr->ns->prefix == NULL))
  ------------------
  |  Branch (10201:45): [True: 0, False: 0]
  ------------------
10202|      0|					{
10203|      0|					    XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10204|      0|                                        }
10205|      0|                                    } else {
10206|      0|                                        if ((attr->ns != NULL) &&
  ------------------
  |  Branch (10206:45): [True: 0, False: 0]
  ------------------
10207|      0|                                            (xmlStrEqual(URI,
  ------------------
  |  Branch (10207:45): [True: 0, False: 0]
  ------------------
10208|      0|					      attr->ns->href)))
10209|      0|					{
10210|      0|					    XP_TEST_HIT
  ------------------
  |  | 9796|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 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|      0|    } else { \
  |  | 9802|      0|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9803|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10211|      0|                                        }
10212|      0|                                    }
10213|      0|                                }
10214|      0|                                break;
10215|      0|                            }
10216|      0|                        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (10216:25): [True: 0, False: 4.63k]
  ------------------
10217|      0|                            if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (10217:33): [True: 0, False: 0]
  ------------------
10218|      0|                                xmlNsPtr ns = (xmlNsPtr) cur;
10219|       |
10220|      0|                                if ((ns->prefix != NULL) && (name != NULL)
  ------------------
  |  Branch (10220:37): [True: 0, False: 0]
  |  Branch (10220:61): [True: 0, False: 0]
  ------------------
10221|      0|                                    && (xmlStrEqual(ns->prefix, name)))
  ------------------
  |  Branch (10221:40): [True: 0, False: 0]
  ------------------
10222|      0|				{
10223|      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]
  |  |  ------------------
  ------------------
10224|      0|                                }
10225|      0|                            }
10226|      0|                            break;
10227|      0|                        default:
  ------------------
  |  Branch (10227:25): [True: 0, False: 4.63k]
  ------------------
10228|      0|                            break;
10229|  4.63k|                    }
10230|  4.63k|                    break;
10231|   314k|	    } /* switch(test) */
10232|   314k|        } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK));
  ------------------
  |  Branch (10232:18): [True: 314k, False: 0]
  |  Branch (10232:35): [True: 314k, False: 0]
  ------------------
10233|       |
10234|   317k|	goto apply_predicates;
10235|       |
10236|   317k|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|    669|	if (outSeq == NULL) {
  ------------------
  |  Branch (10243:6): [True: 669, False: 0]
  ------------------
10244|    669|	    outSeq = seq;
10245|    669|	    seq = NULL;
10246|    669|	} else {
10247|      0|	    outSeq = mergeAndClear(outSeq, seq);
10248|      0|            if (outSeq == NULL)
  ------------------
  |  Branch (10248:17): [True: 0, False: 0]
  ------------------
10249|      0|                xmlXPathPErrMemory(ctxt);
10250|      0|        }
10251|       |	/*
10252|       |	* Break if only a true/false result was requested.
10253|       |	*/
10254|    669|	if (toBool)
  ------------------
  |  Branch (10254:6): [True: 0, False: 669]
  ------------------
10255|      0|	    break;
10256|    669|	continue;
10257|       |
10258|    669|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|      0|	if (outSeq == NULL) {
  ------------------
  |  Branch (10263:6): [True: 0, False: 0]
  ------------------
10264|      0|	    outSeq = seq;
10265|      0|	    seq = NULL;
10266|      0|	} 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|      0|	break;
10272|       |
10273|   317k|apply_predicates: /* --------------------------------------------------- */
10274|   317k|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10274:13): [True: 0, False: 317k]
  ------------------
10275|      0|	    goto error;
10276|       |
10277|       |        /*
10278|       |	* Apply predicates.
10279|       |	*/
10280|   317k|        if ((predOp != NULL) && (seq->nodeNr > 0)) {
  ------------------
  |  Branch (10280:13): [True: 1.00k, False: 316k]
  |  Branch (10280:33): [True: 979, False: 30]
  ------------------
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|    979|	    if (hasPredicateRange != 0)
  ------------------
  |  Branch (10309:10): [True: 947, False: 32]
  ------------------
10310|    947|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos,
10311|    947|					    hasNsNodes);
10312|     32|	    else
10313|     32|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr,
10314|     32|					    hasNsNodes);
10315|       |
10316|    979|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (10316:10): [True: 4, False: 975]
  ------------------
10317|      4|		total = 0;
10318|      4|		goto error;
10319|      4|	    }
10320|    979|        }
10321|       |
10322|   317k|        if (seq->nodeNr > 0) {
  ------------------
  |  Branch (10322:13): [True: 308k, False: 8.77k]
  ------------------
10323|       |	    /*
10324|       |	    * Add to result set.
10325|       |	    */
10326|   308k|	    if (outSeq == NULL) {
  ------------------
  |  Branch (10326:10): [True: 308k, False: 21]
  ------------------
10327|   308k|		outSeq = seq;
10328|   308k|		seq = NULL;
10329|   308k|	    } else {
10330|     21|		outSeq = mergeAndClear(outSeq, seq);
10331|     21|                if (outSeq == NULL)
  ------------------
  |  Branch (10331:21): [True: 0, False: 21]
  ------------------
10332|      0|                    xmlXPathPErrMemory(ctxt);
10333|     21|	    }
10334|       |
10335|   308k|            if (toBool)
  ------------------
  |  Branch (10335:17): [True: 0, False: 308k]
  ------------------
10336|      0|                break;
10337|   308k|	}
10338|   317k|    }
10339|       |
10340|   318k|error:
10341|   318k|    if ((obj->boolval) && (obj->user != NULL)) {
  ------------------
  |  Branch (10341:9): [True: 0, False: 318k]
  |  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|   318k|    xmlXPathReleaseObject(xpctxt, obj);
10353|       |
10354|       |    /*
10355|       |    * Ensure we return at least an empty set.
10356|       |    */
10357|   318k|    if (outSeq == NULL) {
  ------------------
  |  Branch (10357:9): [True: 8.75k, False: 309k]
  ------------------
10358|  8.75k|	if ((seq != NULL) && (seq->nodeNr == 0)) {
  ------------------
  |  Branch (10358:6): [True: 8.75k, False: 0]
  |  Branch (10358:23): [True: 8.75k, False: 0]
  ------------------
10359|  8.75k|	    outSeq = seq;
10360|  8.75k|        } else {
10361|      0|	    outSeq = xmlXPathNodeSetCreate(NULL);
10362|      0|            if (outSeq == NULL)
  ------------------
  |  Branch (10362:17): [True: 0, False: 0]
  ------------------
10363|      0|                xmlXPathPErrMemory(ctxt);
10364|      0|        }
10365|  8.75k|    }
10366|   318k|    if ((seq != NULL) && (seq != outSeq)) {
  ------------------
  |  Branch (10366:9): [True: 8.77k, False: 309k]
  |  Branch (10366:26): [True: 21, False: 8.75k]
  ------------------
10367|     21|	 xmlXPathFreeNodeSet(seq);
10368|     21|    }
10369|       |    /*
10370|       |    * Hand over the result. Better to push the set also in
10371|       |    * case of errors.
10372|       |    */
10373|   318k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq));
10374|       |    /*
10375|       |    * Reset the context node.
10376|       |    */
10377|   318k|    xpctxt->node = oldContextNode;
10378|       |    /*
10379|       |    * When traversing the namespace axis in "toBool" mode, it's
10380|       |    * possible that tmpNsList wasn't freed.
10381|       |    */
10382|   318k|    if (xpctxt->tmpNsList != NULL) {
  ------------------
  |  Branch (10382:9): [True: 0, False: 318k]
  ------------------
10383|      0|        xmlFree(xpctxt->tmpNsList);
10384|      0|        xpctxt->tmpNsList = NULL;
10385|      0|    }
10386|       |
10387|   318k|    return(total);
10388|   318k|}
xpath.c:xmlXPathNodeSetMergeAndClear:
 2958|     21|{
 2959|     21|    {
 2960|     21|	int i, j, initNbSet1;
 2961|     21|	xmlNodePtr n1, n2;
 2962|       |
 2963|     21|	initNbSet1 = set1->nodeNr;
 2964|     42|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (2964:13): [True: 21, False: 21]
  ------------------
 2965|     21|	    n2 = set2->nodeTab[i];
 2966|       |	    /*
 2967|       |	    * Skip duplicates.
 2968|       |	    */
 2969|     42|	    for (j = 0; j < initNbSet1; j++) {
  ------------------
  |  Branch (2969:18): [True: 21, False: 21]
  ------------------
 2970|     21|		n1 = set1->nodeTab[j];
 2971|     21|		if (n1 == n2) {
  ------------------
  |  Branch (2971:7): [True: 0, False: 21]
  ------------------
 2972|      0|		    goto skip_node;
 2973|     21|		} else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2973:14): [True: 0, False: 21]
  ------------------
 2974|      0|		    (n2->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2974:7): [True: 0, False: 0]
  ------------------
 2975|      0|		{
 2976|      0|		    if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2976:11): [True: 0, False: 0]
  ------------------
 2977|      0|			(xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2977:4): [True: 0, False: 0]
  ------------------
 2978|      0|			((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|      0|		}
 2987|     21|	    }
 2988|       |	    /*
 2989|       |	    * grow the nodeTab if needed
 2990|       |	    */
 2991|     21|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (2991:17): [True: 21, False: 0]
  ------------------
 2992|     21|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (2992:21): [True: 0, False: 21]
  ------------------
 2993|      0|                    goto error;
 2994|     21|            }
 2995|     21|	    set1->nodeTab[set1->nodeNr++] = n2;
 2996|     21|skip_node:
 2997|     21|            set2->nodeTab[i] = NULL;
 2998|     21|	}
 2999|     21|    }
 3000|     21|    set2->nodeNr = 0;
 3001|     21|    return(set1);
 3002|       |
 3003|      0|error:
 3004|      0|    xmlXPathFreeNodeSet(set1);
 3005|      0|    xmlXPathNodeSetClear(set2, 1);
 3006|       |    return(NULL);
 3007|     21|}
xpath.c:xmlXPathNodeSetClear:
 3154|    481|{
 3155|    481|    xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes);
 3156|    481|}
xpath.c:xmlXPathNodeSetClearFromPos:
 3127|    481|{
 3128|    481|    if ((set == NULL) || (pos >= set->nodeNr))
  ------------------
  |  Branch (3128:9): [True: 0, False: 481]
  |  Branch (3128:26): [True: 0, False: 481]
  ------------------
 3129|      0|	return;
 3130|    481|    else if ((hasNsNodes)) {
  ------------------
  |  Branch (3130:14): [True: 0, False: 481]
  ------------------
 3131|      0|	int i;
 3132|      0|	xmlNodePtr node;
 3133|       |
 3134|      0|	for (i = pos; i < set->nodeNr; i++) {
  ------------------
  |  Branch (3134:16): [True: 0, False: 0]
  ------------------
 3135|      0|	    node = set->nodeTab[i];
 3136|      0|	    if ((node != NULL) &&
  ------------------
  |  Branch (3136:10): [True: 0, False: 0]
  ------------------
 3137|      0|		(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3137:3): [True: 0, False: 0]
  ------------------
 3138|      0|		xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3139|      0|	}
 3140|      0|    }
 3141|    481|    set->nodeNr = pos;
 3142|    481|}
xpath.c:xmlXPathNextChildElement:
 6200|   632k|xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
 6201|   632k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6201:9): [True: 0, False: 632k]
  |  Branch (6201:27): [True: 0, False: 632k]
  ------------------
 6202|   632k|    if (cur == NULL) {
  ------------------
  |  Branch (6202:9): [True: 318k, False: 314k]
  ------------------
 6203|   318k|	cur = ctxt->context->node;
 6204|   318k|	if (cur == NULL) return(NULL);
  ------------------
  |  Branch (6204:6): [True: 0, False: 318k]
  ------------------
 6205|       |	/*
 6206|       |	* Get the first element child.
 6207|       |	*/
 6208|   318k|	switch (cur->type) {
 6209|  3.14k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6209:13): [True: 3.14k, False: 314k]
  ------------------
 6210|  3.14k|	    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6210:6): [True: 0, False: 318k]
  ------------------
 6211|  3.14k|	    case XML_ENTITY_REF_NODE: /* URGENT TODO: entify-refs as well? */
  ------------------
  |  Branch (6211:6): [True: 0, False: 318k]
  ------------------
 6212|  3.14k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6212:13): [True: 0, False: 318k]
  ------------------
 6213|  3.14k|		cur = cur->children;
 6214|  3.14k|		if (cur != NULL) {
  ------------------
  |  Branch (6214:7): [True: 3.14k, False: 0]
  ------------------
 6215|  3.14k|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6215:11): [True: 0, False: 3.14k]
  ------------------
 6216|      0|			return(cur);
 6217|  3.14k|		    do {
 6218|  3.14k|			cur = cur->next;
 6219|  3.14k|		    } while ((cur != NULL) &&
  ------------------
  |  Branch (6219:16): [True: 0, False: 3.14k]
  ------------------
 6220|      0|			(cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6220:4): [True: 0, False: 0]
  ------------------
 6221|  3.14k|		    return(cur);
 6222|  3.14k|		}
 6223|      0|		return(NULL);
 6224|   314k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6224:13): [True: 314k, False: 3.14k]
  ------------------
 6225|   314k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6225:13): [True: 0, False: 318k]
  ------------------
 6226|   314k|		return(xmlDocGetRootElement((xmlDocPtr) cur));
 6227|      0|	    default:
  ------------------
  |  Branch (6227:6): [True: 0, False: 318k]
  ------------------
 6228|      0|		return(NULL);
 6229|   318k|	}
 6230|      0|	return(NULL);
 6231|   318k|    }
 6232|       |    /*
 6233|       |    * Get the next sibling element node.
 6234|       |    */
 6235|   314k|    switch (cur->type) {
 6236|   314k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6236:2): [True: 314k, False: 0]
  ------------------
 6237|   314k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6237:2): [True: 0, False: 314k]
  ------------------
 6238|   314k|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6238:2): [True: 0, False: 314k]
  ------------------
 6239|   314k|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6239:2): [True: 0, False: 314k]
  ------------------
 6240|   314k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6240:2): [True: 0, False: 314k]
  ------------------
 6241|   314k|	case XML_PI_NODE:
  ------------------
  |  Branch (6241:2): [True: 0, False: 314k]
  ------------------
 6242|   314k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6242:2): [True: 0, False: 314k]
  ------------------
 6243|   314k|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6243:2): [True: 0, False: 314k]
  ------------------
 6244|   314k|	    break;
 6245|       |	/* case XML_DTD_NODE: */ /* URGENT TODO: DTD-node as well? */
 6246|      0|	default:
  ------------------
  |  Branch (6246:2): [True: 0, False: 314k]
  ------------------
 6247|      0|	    return(NULL);
 6248|   314k|    }
 6249|   314k|    if (cur->next != NULL) {
  ------------------
  |  Branch (6249:9): [True: 0, False: 314k]
  ------------------
 6250|      0|	if (cur->next->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6250:6): [True: 0, False: 0]
  ------------------
 6251|      0|	    return(cur->next);
 6252|      0|	cur = cur->next;
 6253|      0|	do {
 6254|      0|	    cur = cur->next;
 6255|      0|	} while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6255:11): [True: 0, False: 0]
  |  Branch (6255:28): [True: 0, False: 0]
  ------------------
 6256|      0|	return(cur);
 6257|      0|    }
 6258|   314k|    return(NULL);
 6259|   314k|}
xpath.c:xmlXPathNextPrecedingInternal:
 6756|     14|{
 6757|     14|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6757:9): [True: 0, False: 14]
  |  Branch (6757:27): [True: 0, False: 14]
  ------------------
 6758|     14|    if (cur == NULL) {
  ------------------
  |  Branch (6758:9): [True: 14, False: 0]
  ------------------
 6759|     14|        cur = ctxt->context->node;
 6760|     14|        if (cur == NULL)
  ------------------
  |  Branch (6760:13): [True: 0, False: 14]
  ------------------
 6761|      0|            return (NULL);
 6762|     14|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6762:13): [True: 0, False: 14]
  ------------------
 6763|      0|            cur = cur->parent;
 6764|     14|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6764:20): [True: 0, False: 14]
  ------------------
 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|     14|        ctxt->ancestor = cur->parent;
 6773|     14|    }
 6774|       |
 6775|     14|    if (cur->type == XML_NAMESPACE_DECL || cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6775:9): [True: 0, False: 14]
  |  Branch (6775:44): [True: 14, False: 0]
  ------------------
 6776|     14|        return(NULL);
 6777|       |
 6778|      0|    if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
  ------------------
  |  Branch (6778:9): [True: 0, False: 0]
  |  Branch (6778:32): [True: 0, False: 0]
  ------------------
 6779|      0|	cur = cur->prev;
 6780|       |
 6781|      0|    while (cur->prev == NULL) {
  ------------------
  |  Branch (6781:12): [True: 0, False: 0]
  ------------------
 6782|      0|        cur = cur->parent;
 6783|      0|        if (cur == NULL)
  ------------------
  |  Branch (6783:13): [True: 0, False: 0]
  ------------------
 6784|      0|            return (NULL);
 6785|      0|        if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6785:13): [True: 0, False: 0]
  ------------------
 6786|      0|            return (NULL);
 6787|      0|        if (cur != ctxt->ancestor)
  ------------------
  |  Branch (6787:13): [True: 0, False: 0]
  ------------------
 6788|      0|            return (cur);
 6789|      0|        ctxt->ancestor = cur->parent;
 6790|      0|    }
 6791|       |
 6792|      0|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6792:9): [True: 0, False: 0]
  ------------------
 6793|      0|        return(NULL);
 6794|       |
 6795|      0|    cur = cur->prev;
 6796|      0|    while (cur->last != NULL)
  ------------------
  |  Branch (6796:12): [True: 0, False: 0]
  ------------------
 6797|      0|        cur = cur->last;
 6798|      0|    return (cur);
 6799|      0|}
xpath.c:xmlXPathIsPositionalPredicate:
 9736|  2.40k|{
 9737|       |
 9738|  2.40k|    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|  2.40k|    if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
  ------------------
  |  Branch (9753:9): [True: 0, False: 2.40k]
  |  Branch (9753:43): [True: 0, False: 0]
  ------------------
 9754|      0|	return(0);
 9755|       |
 9756|  2.40k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9756:9): [True: 2.40k, False: 0]
  ------------------
 9757|  2.40k|	exprOp = &ctxt->comp->steps[op->ch2];
 9758|  2.40k|    } else
 9759|      0|	return(0);
 9760|       |
 9761|  2.40k|    if ((exprOp != NULL) &&
  ------------------
  |  Branch (9761:9): [True: 2.40k, False: 0]
  ------------------
 9762|  2.40k|	(exprOp->op == XPATH_OP_VALUE) &&
  ------------------
  |  Branch (9762:2): [True: 2.36k, False: 40]
  ------------------
 9763|  2.36k|	(exprOp->value4 != NULL) &&
  ------------------
  |  Branch (9763:2): [True: 2.36k, False: 0]
  ------------------
 9764|  2.36k|	(((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER))
  ------------------
  |  Branch (9764:2): [True: 2.36k, False: 0]
  ------------------
 9765|  2.36k|    {
 9766|  2.36k|        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|  2.36k|        if ((floatval > INT_MIN) && (floatval < INT_MAX)) {
  ------------------
  |  Branch (9779:13): [True: 2.36k, False: 0]
  |  Branch (9779:37): [True: 2.34k, False: 17]
  ------------------
 9780|  2.34k|	    *maxPos = (int) floatval;
 9781|  2.34k|            if (floatval == (double) *maxPos)
  ------------------
  |  Branch (9781:17): [True: 2.34k, False: 0]
  ------------------
 9782|  2.34k|                return(1);
 9783|  2.34k|        }
 9784|  2.36k|    }
 9785|     57|    return(0);
 9786|  2.40k|}
xpath.c:xmlXPathCompOpEvalPredicate:
 9710|  1.46k|{
 9711|  1.46k|    if (op->ch1 != -1) {
  ------------------
  |  Branch (9711:9): [True: 489, False: 979]
  ------------------
 9712|    489|	xmlXPathCompExprPtr comp = ctxt->comp;
 9713|       |	/*
 9714|       |	* Process inner predicates first.
 9715|       |	*/
 9716|    489|	if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) {
  ------------------
  |  Branch (9716:6): [True: 0, False: 489]
  ------------------
 9717|      0|            XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9718|      0|	}
 9719|    489|        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|    489|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9719:13): [True: 0, False: 489]
  ------------------
 9720|    489|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9721|    489|        ctxt->context->depth += 1;
 9722|    489|	xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
 9723|    489|                                    1, set->nodeNr, hasNsNodes);
 9724|    489|        ctxt->context->depth -= 1;
 9725|    489|	CHECK_ERROR;
  ------------------
  |  |  230|    489|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2, False: 487]
  |  |  ------------------
  ------------------
 9726|    489|    }
 9727|       |
 9728|  1.46k|    if (op->ch2 != -1)
  ------------------
  |  Branch (9728:9): [True: 1.46k, False: 0]
  ------------------
 9729|  1.46k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes);
 9730|  1.46k|}
xpath.c:xmlXPathNodeSetFilter:
 9577|  1.75k|{
 9578|  1.75k|    xmlXPathContextPtr xpctxt;
 9579|  1.75k|    xmlNodePtr oldnode;
 9580|  1.75k|    xmlDocPtr olddoc;
 9581|  1.75k|    xmlXPathStepOpPtr filterOp;
 9582|  1.75k|    int oldcs, oldpp;
 9583|  1.75k|    int i, j, pos;
 9584|       |
 9585|  1.75k|    if ((set == NULL) || (set->nodeNr == 0))
  ------------------
  |  Branch (9585:9): [True: 0, False: 1.75k]
  |  Branch (9585:26): [True: 537, False: 1.22k]
  ------------------
 9586|    537|        return;
 9587|       |
 9588|       |    /*
 9589|       |    * Check if the node set contains a sufficient number of nodes for
 9590|       |    * the requested range.
 9591|       |    */
 9592|  1.22k|    if (set->nodeNr < minPos) {
  ------------------
  |  Branch (9592:9): [True: 481, False: 741]
  ------------------
 9593|    481|        xmlXPathNodeSetClear(set, hasNsNodes);
 9594|    481|        return;
 9595|    481|    }
 9596|       |
 9597|    741|    xpctxt = ctxt->context;
 9598|    741|    oldnode = xpctxt->node;
 9599|    741|    olddoc = xpctxt->doc;
 9600|    741|    oldcs = xpctxt->contextSize;
 9601|    741|    oldpp = xpctxt->proximityPosition;
 9602|    741|    filterOp = &ctxt->comp->steps[filterOpIndex];
 9603|       |
 9604|    741|    xpctxt->contextSize = set->nodeNr;
 9605|       |
 9606|  1.26k|    for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9606:33): [True: 762, False: 501]
  ------------------
 9607|    762|        xmlNodePtr node = set->nodeTab[i];
 9608|    762|        int res;
 9609|       |
 9610|    762|        xpctxt->node = node;
 9611|    762|        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|    762|        if ((node->type != XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (9619:13): [True: 762, False: 0]
  ------------------
 9620|    762|            (node->doc != NULL))
  ------------------
  |  Branch (9620:13): [True: 762, False: 0]
  ------------------
 9621|    762|            xpctxt->doc = node->doc;
 9622|       |
 9623|    762|        res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 9624|       |
 9625|    762|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (9625:13): [True: 4, False: 758]
  ------------------
 9626|      4|            break;
 9627|    758|        if (res < 0) {
  ------------------
  |  Branch (9627:13): [True: 0, False: 758]
  ------------------
 9628|       |            /* Shouldn't happen */
 9629|      0|            xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
 9630|      0|            break;
 9631|      0|        }
 9632|       |
 9633|    758|        if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
  ------------------
  |  Branch (9633:13): [True: 477, False: 281]
  |  Branch (9633:28): [True: 477, False: 0]
  |  Branch (9633:47): [True: 236, False: 241]
  ------------------
 9634|    236|            if (i != j) {
  ------------------
  |  Branch (9634:17): [True: 0, False: 236]
  ------------------
 9635|      0|                set->nodeTab[j] = node;
 9636|      0|                set->nodeTab[i] = NULL;
 9637|      0|            }
 9638|       |
 9639|    236|            j += 1;
 9640|    522|        } else {
 9641|       |            /* Remove the entry from the initial node set. */
 9642|    522|            set->nodeTab[i] = NULL;
 9643|    522|            if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (9643:17): [True: 0, False: 522]
  ------------------
 9644|      0|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9645|    522|        }
 9646|       |
 9647|    758|        if (res != 0) {
  ------------------
  |  Branch (9647:13): [True: 477, False: 281]
  ------------------
 9648|    477|            if (pos == maxPos) {
  ------------------
  |  Branch (9648:17): [True: 236, False: 241]
  ------------------
 9649|    236|                i += 1;
 9650|    236|                break;
 9651|    236|            }
 9652|       |
 9653|    241|            pos += 1;
 9654|    241|        }
 9655|    758|    }
 9656|       |
 9657|       |    /* Free remaining nodes. */
 9658|    741|    if (hasNsNodes) {
  ------------------
  |  Branch (9658:9): [True: 21, False: 720]
  ------------------
 9659|     21|        for (; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9659:16): [True: 0, False: 21]
  ------------------
 9660|      0|            xmlNodePtr node = set->nodeTab[i];
 9661|      0|            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (9661:17): [True: 0, False: 0]
  |  Branch (9661:35): [True: 0, False: 0]
  ------------------
 9662|      0|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9663|      0|        }
 9664|     21|    }
 9665|       |
 9666|    741|    set->nodeNr = j;
 9667|       |
 9668|       |    /* If too many elements were removed, shrink table to preserve memory. */
 9669|    741|    if ((set->nodeMax > XML_NODESET_DEFAULT) &&
  ------------------
  |  | 2593|    741|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9669:9): [True: 0, False: 741]
  ------------------
 9670|      0|        (set->nodeNr < set->nodeMax / 2)) {
  ------------------
  |  Branch (9670:9): [True: 0, False: 0]
  ------------------
 9671|      0|        xmlNodePtr *tmp;
 9672|      0|        int nodeMax = set->nodeNr;
 9673|       |
 9674|      0|        if (nodeMax < XML_NODESET_DEFAULT)
  ------------------
  |  | 2593|      0|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9674:13): [True: 0, False: 0]
  ------------------
 9675|      0|            nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|      0|#define XML_NODESET_DEFAULT	10
  ------------------
 9676|      0|        tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab,
 9677|      0|                nodeMax * sizeof(xmlNodePtr));
 9678|      0|        if (tmp == NULL) {
  ------------------
  |  Branch (9678:13): [True: 0, False: 0]
  ------------------
 9679|      0|            xmlXPathPErrMemory(ctxt);
 9680|      0|        } else {
 9681|      0|            set->nodeTab = tmp;
 9682|      0|            set->nodeMax = nodeMax;
 9683|      0|        }
 9684|      0|    }
 9685|       |
 9686|    741|    xpctxt->node = oldnode;
 9687|    741|    xpctxt->doc = olddoc;
 9688|    741|    xpctxt->contextSize = oldcs;
 9689|    741|    xpctxt->proximityPosition = oldpp;
 9690|    741|}
xpath.c:xmlXPathCompOpEval:
10750|   964k|{
10751|   964k|    int total = 0;
10752|   964k|    int equal, ret;
10753|   964k|    xmlXPathCompExprPtr comp;
10754|   964k|    xmlXPathObjectPtr arg1, arg2;
10755|       |
10756|   964k|    CHECK_ERROR0;
  ------------------
  |  |  236|   964k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 964k]
  |  |  ------------------
  ------------------
10757|   964k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   964k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 964k]
  |  |  |  Branch (818:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10758|      0|        return(0);
10759|   964k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|   964k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10759:9): [True: 12, False: 964k]
  ------------------
10760|   964k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|     12|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10761|   964k|    ctxt->context->depth += 1;
10762|   964k|    comp = ctxt->comp;
10763|   964k|    switch (op->op) {
10764|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10764:9): [True: 0, False: 964k]
  ------------------
10765|      0|            break;
10766|      0|        case XPATH_OP_AND:
  ------------------
  |  Branch (10766:9): [True: 0, False: 964k]
  ------------------
10767|      0|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10768|      0|	    CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10769|      0|            xmlXPathBooleanFunction(ctxt, 1);
10770|      0|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
  ------------------
  |  Branch (10770:17): [True: 0, False: 0]
  |  Branch (10770:42): [True: 0, False: 0]
  ------------------
10771|      0|                break;
10772|      0|            arg2 = xmlXPathValuePop(ctxt);
10773|      0|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10774|      0|	    if (ctxt->error) {
  ------------------
  |  Branch (10774:10): [True: 0, False: 0]
  ------------------
10775|      0|		xmlXPathFreeObject(arg2);
10776|      0|		break;
10777|      0|	    }
10778|      0|            xmlXPathBooleanFunction(ctxt, 1);
10779|      0|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10779:17): [True: 0, False: 0]
  ------------------
10780|      0|                ctxt->value->boolval &= arg2->boolval;
10781|      0|	    xmlXPathReleaseObject(ctxt->context, arg2);
10782|      0|            break;
10783|      9|        case XPATH_OP_OR:
  ------------------
  |  Branch (10783:9): [True: 9, False: 964k]
  ------------------
10784|      9|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10785|      9|	    CHECK_ERROR0;
  ------------------
  |  |  236|      9|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 9]
  |  |  ------------------
  ------------------
10786|      9|            xmlXPathBooleanFunction(ctxt, 1);
10787|      9|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
  ------------------
  |  Branch (10787:17): [True: 0, False: 9]
  |  Branch (10787:42): [True: 0, False: 9]
  ------------------
10788|      0|                break;
10789|      9|            arg2 = xmlXPathValuePop(ctxt);
10790|      9|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10791|      9|	    if (ctxt->error) {
  ------------------
  |  Branch (10791:10): [True: 1, False: 8]
  ------------------
10792|      1|		xmlXPathFreeObject(arg2);
10793|      1|		break;
10794|      1|	    }
10795|      8|            xmlXPathBooleanFunction(ctxt, 1);
10796|      8|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10796:17): [True: 8, False: 0]
  ------------------
10797|      8|                ctxt->value->boolval |= arg2->boolval;
10798|      8|	    xmlXPathReleaseObject(ctxt->context, arg2);
10799|      8|            break;
10800|     12|        case XPATH_OP_EQUAL:
  ------------------
  |  Branch (10800:9): [True: 12, False: 964k]
  ------------------
10801|     12|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10802|     12|	    CHECK_ERROR0;
  ------------------
  |  |  236|     12|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 12]
  |  |  ------------------
  ------------------
10803|     12|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10804|     12|	    CHECK_ERROR0;
  ------------------
  |  |  236|     12|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 12]
  |  |  ------------------
  ------------------
10805|     12|	    if (op->value)
  ------------------
  |  Branch (10805:10): [True: 11, False: 1]
  ------------------
10806|     11|		equal = xmlXPathEqualValues(ctxt);
10807|      1|	    else
10808|      1|		equal = xmlXPathNotEqualValues(ctxt);
10809|     12|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal));
10810|     12|            break;
10811|      5|        case XPATH_OP_CMP:
  ------------------
  |  Branch (10811:9): [True: 5, False: 964k]
  ------------------
10812|      5|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10813|      5|	    CHECK_ERROR0;
  ------------------
  |  |  236|      5|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 5]
  |  |  ------------------
  ------------------
10814|      5|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10815|      5|	    CHECK_ERROR0;
  ------------------
  |  |  236|      5|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4, False: 1]
  |  |  ------------------
  ------------------
10816|      1|            ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
10817|      1|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
10818|      1|            break;
10819|  5.79k|        case XPATH_OP_PLUS:
  ------------------
  |  Branch (10819:9): [True: 5.79k, False: 958k]
  ------------------
10820|  5.79k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10821|  5.79k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  5.79k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 56, False: 5.73k]
  |  |  ------------------
  ------------------
10822|  5.73k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (10822:17): [True: 4.07k, False: 1.66k]
  ------------------
10823|  4.07k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10824|  4.07k|	    }
10825|  5.73k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  5.73k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 50, False: 5.68k]
  |  |  ------------------
  ------------------
10826|  5.68k|            if (op->value == 0)
  ------------------
  |  Branch (10826:17): [True: 1.95k, False: 3.73k]
  ------------------
10827|  1.95k|                xmlXPathSubValues(ctxt);
10828|  3.73k|            else if (op->value == 1)
  ------------------
  |  Branch (10828:22): [True: 2.07k, False: 1.66k]
  ------------------
10829|  2.07k|                xmlXPathAddValues(ctxt);
10830|  1.66k|            else if (op->value == 2)
  ------------------
  |  Branch (10830:22): [True: 1.66k, False: 1]
  ------------------
10831|  1.66k|                xmlXPathValueFlipSign(ctxt);
10832|      1|            else if (op->value == 3) {
  ------------------
  |  Branch (10832:22): [True: 1, False: 0]
  ------------------
10833|      1|                CAST_TO_NUMBER;
  ------------------
  |  |  297|      1|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1, False: 0]
  |  |  |  Branch (297:34): [True: 1, False: 0]
  |  |  ------------------
  |  |  298|      1|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
10834|      1|                CHECK_TYPE0(XPATH_NUMBER);
  ------------------
  |  |  271|      1|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1]
  |  |  |  Branch (271:34): [True: 0, False: 1]
  |  |  ------------------
  |  |  272|      1|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10835|      1|            }
10836|  5.68k|            break;
10837|   312k|        case XPATH_OP_MULT:
  ------------------
  |  Branch (10837:9): [True: 312k, False: 651k]
  ------------------
10838|   312k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10839|   312k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   312k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.87k, False: 310k]
  |  |  ------------------
  ------------------
10840|   310k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10841|   310k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   310k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 310k]
  |  |  ------------------
  ------------------
10842|   310k|            if (op->value == 0)
  ------------------
  |  Branch (10842:17): [True: 310k, False: 2]
  ------------------
10843|   310k|                xmlXPathMultValues(ctxt);
10844|      2|            else if (op->value == 1)
  ------------------
  |  Branch (10844:22): [True: 2, False: 0]
  ------------------
10845|      2|                xmlXPathDivValues(ctxt);
10846|      0|            else if (op->value == 2)
  ------------------
  |  Branch (10846:22): [True: 0, False: 0]
  ------------------
10847|      0|                xmlXPathModValues(ctxt);
10848|   310k|            break;
10849|  3.54k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10849:9): [True: 3.54k, False: 960k]
  ------------------
10850|  3.54k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10851|  3.54k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  3.54k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 46, False: 3.50k]
  |  |  ------------------
  ------------------
10852|  3.50k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10853|  3.50k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  3.50k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4, False: 3.49k]
  |  |  ------------------
  ------------------
10854|       |
10855|  3.49k|            arg2 = xmlXPathValuePop(ctxt);
10856|  3.49k|            arg1 = xmlXPathValuePop(ctxt);
10857|  3.49k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10857:17): [True: 0, False: 3.49k]
  |  Branch (10857:35): [True: 0, False: 3.49k]
  ------------------
10858|  3.49k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10858:17): [True: 0, False: 3.49k]
  |  Branch (10858:35): [True: 0, False: 3.49k]
  ------------------
10859|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10860|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10861|      0|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10862|      0|            }
10863|  3.49k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10863:17): [True: 0, False: 3.49k]
  ------------------
10864|      0|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10864:19): [True: 0, False: 0]
  ------------------
10865|      0|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10865:19): [True: 0, False: 0]
  ------------------
10866|      0|                                        arg1->nodesetval->nodeNr) < 0)) ||
10867|      0|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10867:19): [True: 0, False: 0]
  ------------------
10868|      0|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10868:19): [True: 0, False: 0]
  ------------------
10869|      0|                                        arg2->nodesetval->nodeNr) < 0)))) {
10870|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10871|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10872|      0|                break;
10873|      0|            }
10874|       |
10875|  3.49k|	    if (((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10875:11): [True: 3.49k, False: 0]
  ------------------
10876|  3.49k|		 (arg2->nodesetval->nodeNr != 0)))
  ------------------
  |  Branch (10876:4): [True: 1.51k, False: 1.98k]
  ------------------
10877|  1.51k|	    {
10878|  1.51k|		arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10879|  1.51k|							arg2->nodesetval);
10880|  1.51k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10880:21): [True: 0, False: 1.51k]
  ------------------
10881|      0|                    xmlXPathPErrMemory(ctxt);
10882|  1.51k|	    }
10883|       |
10884|  3.49k|            xmlXPathValuePush(ctxt, arg1);
10885|  3.49k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10886|  3.49k|            break;
10887|  2.76k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10887:9): [True: 2.76k, False: 961k]
  ------------------
10888|  2.76k|            xmlXPathRoot(ctxt);
10889|  2.76k|            break;
10890|   314k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10890:9): [True: 314k, False: 649k]
  ------------------
10891|   314k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10891:17): [True: 0, False: 314k]
  ------------------
10892|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10893|   314k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   314k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 314k]
  |  |  ------------------
  ------------------
10894|   314k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10894:17): [True: 0, False: 314k]
  ------------------
10895|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10896|   314k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   314k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 314k]
  |  |  ------------------
  ------------------
10897|   314k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10898|   314k|                                                    ctxt->context->node));
10899|   314k|            break;
10900|   319k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10900:9): [True: 319k, False: 644k]
  ------------------
10901|   319k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10901:21): [True: 0, False: 319k]
  ------------------
10902|      0|                    break;
10903|       |
10904|   319k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10905|   319k|		CHECK_ERROR0;
  ------------------
  |  |  236|   319k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 998, False: 318k]
  |  |  ------------------
  ------------------
10906|       |
10907|   318k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0);
10908|   318k|                break;
10909|   319k|            }
10910|  1.11k|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10910:9): [True: 1.11k, False: 963k]
  ------------------
10911|  1.11k|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10912|  1.11k|            break;
10913|      0|        case XPATH_OP_VARIABLE:{
  ------------------
  |  Branch (10913:9): [True: 0, False: 964k]
  ------------------
10914|      0|		xmlXPathObjectPtr val;
10915|       |
10916|      0|                if (op->ch1 != -1)
  ------------------
  |  Branch (10916:21): [True: 0, False: 0]
  ------------------
10917|      0|                    total +=
10918|      0|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10919|      0|                if (op->value5 == NULL) {
  ------------------
  |  Branch (10919:21): [True: 0, False: 0]
  ------------------
10920|      0|		    val = xmlXPathVariableLookup(ctxt->context, op->value4);
10921|      0|		    if (val == NULL) {
  ------------------
  |  Branch (10921:11): [True: 0, False: 0]
  ------------------
10922|      0|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10923|      0|                                       "Undefined variable: %s\n", op->value4);
10924|      0|                        return 0;
10925|      0|                    }
10926|      0|                    xmlXPathValuePush(ctxt, val);
10927|      0|		} else {
10928|      0|                    const xmlChar *URI;
10929|       |
10930|      0|                    URI = xmlXPathNsLookup(ctxt->context, op->value5);
10931|      0|                    if (URI == NULL) {
  ------------------
  |  Branch (10931:25): [True: 0, False: 0]
  ------------------
10932|      0|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10933|      0|                                       "Undefined namespace prefix: %s\n",
10934|      0|                                       op->value5);
10935|      0|                        return 0;
10936|      0|                    }
10937|      0|		    val = xmlXPathVariableLookupNS(ctxt->context,
10938|      0|                                                       op->value4, URI);
10939|      0|		    if (val == NULL) {
  ------------------
  |  Branch (10939:11): [True: 0, False: 0]
  ------------------
10940|      0|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10941|      0|                                       "Undefined variable: %s:%s\n",
10942|      0|                                       op->value5, op->value4);
10943|      0|                        return 0;
10944|      0|                    }
10945|      0|                    xmlXPathValuePush(ctxt, val);
10946|      0|                }
10947|      0|                break;
10948|      0|            }
10949|    194|        case XPATH_OP_FUNCTION:{
  ------------------
  |  Branch (10949:9): [True: 194, False: 964k]
  ------------------
10950|    194|                xmlXPathFunction func;
10951|    194|                const xmlChar *oldFunc, *oldFuncURI;
10952|    194|		int i;
10953|    194|                int frame;
10954|       |
10955|    194|                frame = ctxt->valueNr;
10956|    194|                if (op->ch1 != -1) {
  ------------------
  |  Branch (10956:21): [True: 180, False: 14]
  ------------------
10957|    180|                    total +=
10958|    180|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10959|    180|                    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10959:25): [True: 98, False: 82]
  ------------------
10960|     98|                        break;
10961|    180|                }
10962|     96|		if (ctxt->valueNr < frame + op->value)
  ------------------
  |  Branch (10962:7): [True: 0, False: 96]
  ------------------
10963|     96|		    XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10964|    385|		for (i = 0; i < op->value; i++) {
  ------------------
  |  Branch (10964:15): [True: 289, False: 96]
  ------------------
10965|    289|		    if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL)
  ------------------
  |  Branch (10965:11): [True: 0, False: 289]
  ------------------
10966|    289|			XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10967|    289|                }
10968|     96|                if (op->cache != NULL)
  ------------------
  |  Branch (10968:21): [True: 0, False: 96]
  ------------------
10969|      0|                    func = op->cache;
10970|     96|                else {
10971|     96|                    const xmlChar *URI = NULL;
10972|       |
10973|     96|                    if (op->value5 == NULL) {
  ------------------
  |  Branch (10973:25): [True: 96, False: 0]
  ------------------
10974|     96|                        func = xmlXPathFunctionLookup(ctxt->context,
10975|     96|                                                      op->value4);
10976|     96|                        if (func == NULL) {
  ------------------
  |  Branch (10976:29): [True: 41, False: 55]
  ------------------
10977|     41|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10978|     41|                                           "Unregistered function: %s\n",
10979|     41|                                           op->value4);
10980|     41|                            return 0;
10981|     41|                        }
10982|     96|                    } else {
10983|      0|                        URI = xmlXPathNsLookup(ctxt->context, op->value5);
10984|      0|                        if (URI == NULL) {
  ------------------
  |  Branch (10984:29): [True: 0, False: 0]
  ------------------
10985|      0|                            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10986|      0|                                           "Undefined namespace prefix: %s\n",
10987|      0|                                           op->value5);
10988|      0|                            return 0;
10989|      0|                        }
10990|      0|                        func = xmlXPathFunctionLookupNS(ctxt->context,
10991|      0|                                                        op->value4, URI);
10992|      0|                        if (func == NULL) {
  ------------------
  |  Branch (10992:29): [True: 0, False: 0]
  ------------------
10993|      0|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10994|      0|                                           "Unregistered function: %s:%s\n",
10995|      0|                                           op->value5, op->value4);
10996|      0|                            return 0;
10997|      0|                        }
10998|      0|                    }
10999|     55|                    op->cache = func;
11000|     55|                    op->cacheURI = (void *) URI;
11001|     55|                }
11002|     55|                oldFunc = ctxt->context->function;
11003|     55|                oldFuncURI = ctxt->context->functionURI;
11004|     55|                ctxt->context->function = op->value4;
11005|     55|                ctxt->context->functionURI = op->cacheURI;
11006|     55|                func(ctxt, op->value);
11007|     55|                ctxt->context->function = oldFunc;
11008|     55|                ctxt->context->functionURI = oldFuncURI;
11009|     55|                if ((ctxt->error == XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (11009:21): [True: 55, False: 0]
  ------------------
11010|     55|                    (ctxt->valueNr != frame + 1))
  ------------------
  |  Branch (11010:21): [True: 0, False: 55]
  ------------------
11011|     55|                    XP_ERROR0(XPATH_STACK_ERROR);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11012|     55|                break;
11013|     55|            }
11014|  3.36k|        case XPATH_OP_ARG:
  ------------------
  |  Branch (11014:9): [True: 3.36k, False: 960k]
  ------------------
11015|  3.36k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11015:17): [True: 3.19k, False: 174]
  ------------------
11016|  3.19k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11017|  3.19k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  3.19k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 2.98k, False: 207]
  |  |  ------------------
  ------------------
11018|  3.19k|            }
11019|    381|            if (op->ch2 != -1) {
  ------------------
  |  Branch (11019:17): [True: 381, False: 0]
  ------------------
11020|    381|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
11021|    381|	        CHECK_ERROR0;
  ------------------
  |  |  236|    381|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 92, False: 289]
  |  |  ------------------
  ------------------
11022|    381|	    }
11023|    289|            break;
11024|    289|        case XPATH_OP_PREDICATE:
  ------------------
  |  Branch (11024:9): [True: 0, False: 964k]
  ------------------
11025|    293|        case XPATH_OP_FILTER:{
  ------------------
  |  Branch (11025:9): [True: 293, False: 963k]
  ------------------
11026|    293|                xmlXPathObjectPtr obj;
11027|    293|                xmlNodeSetPtr set;
11028|       |
11029|       |                /*
11030|       |                 * Optimization for ()[1] selection i.e. the first elem
11031|       |                 */
11032|    293|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11032:21): [True: 293, False: 0]
  |  Branch (11032:40): [True: 293, False: 0]
  ------------------
11033|    293|#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|    293|                    ((comp->steps[op->ch1].op == XPATH_OP_SORT) || /* 18 */
  ------------------
  |  Branch (11043:22): [True: 77, False: 216]
  ------------------
11044|    216|		     (comp->steps[op->ch1].op == XPATH_OP_FILTER)) && /* 17 */
  ------------------
  |  Branch (11044:8): [True: 216, False: 0]
  ------------------
11045|       |#else
11046|       |		    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
11047|       |#endif
11048|    293|                    (comp->steps[op->ch2].op == XPATH_OP_VALUE)) { /* 12 */
  ------------------
  |  Branch (11048:21): [True: 182, False: 111]
  ------------------
11049|    182|                    xmlXPathObjectPtr val;
11050|       |
11051|    182|                    val = comp->steps[op->ch2].value4;
11052|    182|                    if ((val != NULL) && (val->type == XPATH_NUMBER) &&
  ------------------
  |  Branch (11052:25): [True: 182, False: 0]
  |  Branch (11052:42): [True: 148, False: 34]
  ------------------
11053|    148|                        (val->floatval == 1.0)) {
  ------------------
  |  Branch (11053:25): [True: 58, False: 90]
  ------------------
11054|     58|                        xmlNodePtr first = NULL;
11055|       |
11056|     58|                        total +=
11057|     58|                            xmlXPathCompOpEvalFirst(ctxt,
11058|     58|                                                    &comp->steps[op->ch1],
11059|     58|                                                    &first);
11060|     58|			CHECK_ERROR0;
  ------------------
  |  |  236|     58|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 58]
  |  |  ------------------
  ------------------
11061|       |                        /*
11062|       |                         * The nodeset should be in document order,
11063|       |                         * Keep only the first value
11064|       |                         */
11065|     58|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11065:29): [True: 58, False: 0]
  ------------------
11066|     58|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11066:29): [True: 58, False: 0]
  ------------------
11067|     58|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11067:29): [True: 58, False: 0]
  ------------------
11068|     58|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11068:29): [True: 0, False: 58]
  ------------------
11069|      0|                            xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval,
11070|      0|                                                        1, 1);
11071|     58|                        break;
11072|     58|                    }
11073|    182|                }
11074|       |                /*
11075|       |                 * Optimization for ()[last()] selection i.e. the last elem
11076|       |                 */
11077|    235|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11077:21): [True: 235, False: 0]
  |  Branch (11077:40): [True: 235, False: 0]
  ------------------
11078|    235|                    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (11078:21): [True: 77, False: 158]
  ------------------
11079|     77|                    (comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (11079:21): [True: 71, False: 6]
  ------------------
11080|     71|                    int f = comp->steps[op->ch2].ch1;
11081|       |
11082|     71|                    if ((f != -1) &&
  ------------------
  |  Branch (11082:25): [True: 71, False: 0]
  ------------------
11083|     71|                        (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (11083:25): [True: 18, False: 53]
  ------------------
11084|     18|                        (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (11084:25): [True: 18, False: 0]
  ------------------
11085|     18|                        (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (11085:25): [True: 0, False: 18]
  ------------------
11086|      0|                        (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (11086:25): [True: 0, False: 0]
  ------------------
11087|      0|                        (xmlStrEqual
  ------------------
  |  Branch (11087:25): [True: 0, False: 0]
  ------------------
11088|      0|                         (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
11089|      0|                        xmlNodePtr last = NULL;
11090|       |
11091|      0|                        total +=
11092|      0|                            xmlXPathCompOpEvalLast(ctxt,
11093|      0|                                                   &comp->steps[op->ch1],
11094|      0|                                                   &last);
11095|      0|			CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
11096|       |                        /*
11097|       |                         * The nodeset should be in document order,
11098|       |                         * Keep only the last value
11099|       |                         */
11100|      0|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11100:29): [True: 0, False: 0]
  ------------------
11101|      0|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11101:29): [True: 0, False: 0]
  ------------------
11102|      0|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11102:29): [True: 0, False: 0]
  ------------------
11103|      0|                            (ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (11103:29): [True: 0, False: 0]
  ------------------
11104|      0|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11104:29): [True: 0, False: 0]
  ------------------
11105|      0|                            xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
11106|      0|                        break;
11107|      0|                    }
11108|     71|                }
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|    235|                if (op->ch1 != -1)
  ------------------
  |  Branch (11120:21): [True: 235, False: 0]
  ------------------
11121|    235|                    total +=
11122|    235|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11123|    235|		CHECK_ERROR0;
  ------------------
  |  |  236|    235|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 235]
  |  |  ------------------
  ------------------
11124|    235|                if (op->ch2 == -1)
  ------------------
  |  Branch (11124:21): [True: 0, False: 235]
  ------------------
11125|      0|                    break;
11126|    235|                if (ctxt->value == NULL)
  ------------------
  |  Branch (11126:21): [True: 0, False: 235]
  ------------------
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|    235|                CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|    235|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 235]
  |  |  |  Branch (271:34): [True: 0, False: 235]
  |  |  ------------------
  |  |  272|    235|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
11136|    235|                obj = xmlXPathValuePop(ctxt);
11137|    235|                set = obj->nodesetval;
11138|    235|                if (set != NULL)
  ------------------
  |  Branch (11138:21): [True: 235, False: 0]
  ------------------
11139|    235|                    xmlXPathNodeSetFilter(ctxt, set, op->ch2,
11140|    235|                                          1, set->nodeNr, 1);
11141|    235|                xmlXPathValuePush(ctxt, obj);
11142|    235|                break;
11143|    235|            }
11144|    513|        case XPATH_OP_SORT:
  ------------------
  |  Branch (11144:9): [True: 513, False: 963k]
  ------------------
11145|    513|            if (op->ch1 != -1)
  ------------------
  |  Branch (11145:17): [True: 513, False: 0]
  ------------------
11146|    513|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11147|    513|	    CHECK_ERROR0;
  ------------------
  |  |  236|    513|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 145, False: 368]
  |  |  ------------------
  ------------------
11148|    368|            if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11148:17): [True: 368, False: 0]
  ------------------
11149|    368|                (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11149:17): [True: 228, False: 140]
  ------------------
11150|    228|                (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11150:17): [True: 228, False: 0]
  ------------------
11151|    228|		(ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11151:3): [True: 53, False: 175]
  ------------------
11152|     53|	    {
11153|     53|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
11154|     53|	    }
11155|    368|            break;
11156|      0|        default:
  ------------------
  |  Branch (11156:9): [True: 0, False: 964k]
  ------------------
11157|      0|            XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11158|      0|            break;
11159|   964k|    }
11160|       |
11161|   957k|    ctxt->context->depth -= 1;
11162|   957k|    return (total);
11163|   964k|}
xpath.c:xmlXPathCompOpEvalFirst:
10406|     58|{
10407|     58|    int total = 0, cur;
10408|     58|    xmlXPathCompExprPtr comp;
10409|     58|    xmlXPathObjectPtr arg1, arg2;
10410|       |
10411|     58|    CHECK_ERROR0;
  ------------------
  |  |  236|     58|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 58]
  |  |  ------------------
  ------------------
10412|     58|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|     58|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 0, False: 58]
  |  |  |  Branch (818:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10413|      0|        return(0);
10414|     58|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|     58|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10414:9): [True: 0, False: 58]
  ------------------
10415|     58|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10416|     58|    ctxt->context->depth += 1;
10417|     58|    comp = ctxt->comp;
10418|     58|    switch (op->op) {
10419|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10419:9): [True: 0, False: 58]
  ------------------
10420|      0|            break;
10421|      0|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10421:9): [True: 0, False: 58]
  ------------------
10422|      0|            total =
10423|      0|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10424|      0|                                        first);
10425|      0|	    CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10426|      0|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10426:17): [True: 0, False: 0]
  ------------------
10427|      0|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10427:20): [True: 0, False: 0]
  ------------------
10428|      0|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10428:20): [True: 0, False: 0]
  ------------------
10429|      0|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10429:20): [True: 0, False: 0]
  ------------------
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|      0|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10440:7): [True: 0, False: 0]
  ------------------
10441|      0|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10442|      0|                *first = ctxt->value->nodesetval->nodeTab[0];
10443|      0|            }
10444|      0|            cur =
10445|      0|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch2],
10446|      0|                                        first);
10447|      0|	    CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10448|       |
10449|      0|            arg2 = xmlXPathValuePop(ctxt);
10450|      0|            arg1 = xmlXPathValuePop(ctxt);
10451|      0|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10451:17): [True: 0, False: 0]
  |  Branch (10451:35): [True: 0, False: 0]
  ------------------
10452|      0|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10452:17): [True: 0, False: 0]
  |  Branch (10452:35): [True: 0, False: 0]
  ------------------
10453|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10454|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10455|      0|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10456|      0|            }
10457|      0|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10457:17): [True: 0, False: 0]
  ------------------
10458|      0|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10458:19): [True: 0, False: 0]
  ------------------
10459|      0|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10459:19): [True: 0, False: 0]
  ------------------
10460|      0|                                        arg1->nodesetval->nodeNr) < 0)) ||
10461|      0|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10461:19): [True: 0, False: 0]
  ------------------
10462|      0|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10462:19): [True: 0, False: 0]
  ------------------
10463|      0|                                        arg2->nodesetval->nodeNr) < 0)))) {
10464|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10465|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10466|      0|                break;
10467|      0|            }
10468|       |
10469|      0|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10469:17): [True: 0, False: 0]
  ------------------
10470|      0|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10470:17): [True: 0, False: 0]
  ------------------
10471|      0|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10472|      0|                                                        arg2->nodesetval);
10473|      0|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10473:21): [True: 0, False: 0]
  ------------------
10474|      0|                    xmlXPathPErrMemory(ctxt);
10475|      0|            }
10476|      0|            xmlXPathValuePush(ctxt, arg1);
10477|      0|	    xmlXPathReleaseObject(ctxt->context, arg2);
10478|      0|            total += cur;
10479|      0|            break;
10480|      0|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10480:9): [True: 0, False: 58]
  ------------------
10481|      0|            xmlXPathRoot(ctxt);
10482|      0|            break;
10483|      0|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10483:9): [True: 0, False: 58]
  ------------------
10484|      0|            if (op->ch1 != -1)
  ------------------
  |  Branch (10484:17): [True: 0, False: 0]
  ------------------
10485|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10486|      0|	    CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10487|      0|            if (op->ch2 != -1)
  ------------------
  |  Branch (10487:17): [True: 0, False: 0]
  ------------------
10488|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10489|      0|	    CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10490|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10491|      0|		ctxt->context->node));
10492|      0|            break;
10493|      0|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10493:9): [True: 0, False: 58]
  ------------------
10494|      0|                if (op->ch1 == -1)
  ------------------
  |  Branch (10494:21): [True: 0, False: 0]
  ------------------
10495|      0|                    break;
10496|       |
10497|      0|                total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10498|      0|		CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10499|       |
10500|      0|                total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0);
10501|      0|                break;
10502|      0|            }
10503|      0|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10503:9): [True: 0, False: 58]
  ------------------
10504|      0|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10505|      0|            break;
10506|      0|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10506:9): [True: 0, False: 58]
  ------------------
10507|      0|            if (op->ch1 != -1)
  ------------------
  |  Branch (10507:17): [True: 0, False: 0]
  ------------------
10508|      0|                total +=
10509|      0|                    xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10510|      0|                                            first);
10511|      0|	    CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10512|      0|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10512:17): [True: 0, False: 0]
  ------------------
10513|      0|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10513:20): [True: 0, False: 0]
  ------------------
10514|      0|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10514:20): [True: 0, False: 0]
  ------------------
10515|      0|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10515:6): [True: 0, False: 0]
  ------------------
10516|      0|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10517|      0|            break;
10518|      0|#ifdef XP_OPTIMIZED_FILTER_FIRST
10519|     58|	case XPATH_OP_FILTER:
  ------------------
  |  Branch (10519:2): [True: 58, False: 0]
  ------------------
10520|     58|                total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first);
10521|     58|            break;
10522|      0|#endif
10523|      0|        default:
  ------------------
  |  Branch (10523:9): [True: 0, False: 58]
  ------------------
10524|      0|            total += xmlXPathCompOpEval(ctxt, op);
10525|      0|            break;
10526|     58|    }
10527|       |
10528|     58|    ctxt->context->depth -= 1;
10529|     58|    return(total);
10530|     58|}
xpath.c:xmlXPathCompOpEvalFilterFirst:
10668|     58|{
10669|     58|    int total = 0;
10670|     58|    xmlXPathCompExprPtr comp;
10671|     58|    xmlXPathObjectPtr obj;
10672|     58|    xmlNodeSetPtr set;
10673|       |
10674|     58|    CHECK_ERROR0;
  ------------------
  |  |  236|     58|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 58]
  |  |  ------------------
  ------------------
10675|     58|    comp = ctxt->comp;
10676|       |    /*
10677|       |    * Optimization for ()[last()] selection i.e. the last elem
10678|       |    */
10679|     58|    if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (10679:9): [True: 58, False: 0]
  |  Branch (10679:28): [True: 58, False: 0]
  ------------------
10680|     58|	(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (10680:2): [True: 30, False: 28]
  ------------------
10681|     30|	(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (10681:2): [True: 30, False: 0]
  ------------------
10682|     30|	int f = comp->steps[op->ch2].ch1;
10683|       |
10684|     30|	if ((f != -1) &&
  ------------------
  |  Branch (10684:6): [True: 30, False: 0]
  ------------------
10685|     30|	    (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (10685:6): [True: 24, False: 6]
  ------------------
10686|     24|	    (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (10686:6): [True: 24, False: 0]
  ------------------
10687|     24|	    (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (10687:6): [True: 0, False: 24]
  ------------------
10688|      0|	    (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (10688:6): [True: 0, False: 0]
  ------------------
10689|      0|	    (xmlStrEqual
  ------------------
  |  Branch (10689:6): [True: 0, False: 0]
  ------------------
10690|      0|	    (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
10691|      0|	    xmlNodePtr last = NULL;
10692|       |
10693|      0|	    total +=
10694|      0|		xmlXPathCompOpEvalLast(ctxt,
10695|      0|		    &comp->steps[op->ch1],
10696|      0|		    &last);
10697|      0|	    CHECK_ERROR0;
  ------------------
  |  |  236|      0|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10698|       |	    /*
10699|       |	    * The nodeset should be in document order,
10700|       |	    * Keep only the last value
10701|       |	    */
10702|      0|	    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (10702:10): [True: 0, False: 0]
  ------------------
10703|      0|		(ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (10703:3): [True: 0, False: 0]
  ------------------
10704|      0|		(ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (10704:3): [True: 0, False: 0]
  ------------------
10705|      0|		(ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (10705:3): [True: 0, False: 0]
  ------------------
10706|      0|		(ctxt->value->nodesetval->nodeNr > 1)) {
  ------------------
  |  Branch (10706:3): [True: 0, False: 0]
  ------------------
10707|      0|                xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
10708|      0|		*first = *(ctxt->value->nodesetval->nodeTab);
10709|      0|	    }
10710|      0|	    return (total);
10711|      0|	}
10712|     30|    }
10713|       |
10714|     58|    if (op->ch1 != -1)
  ------------------
  |  Branch (10714:9): [True: 58, False: 0]
  ------------------
10715|     58|	total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10716|     58|    CHECK_ERROR0;
  ------------------
  |  |  236|     58|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 58]
  |  |  ------------------
  ------------------
10717|     58|    if (op->ch2 == -1)
  ------------------
  |  Branch (10717:9): [True: 0, False: 58]
  ------------------
10718|      0|	return (total);
10719|     58|    if (ctxt->value == NULL)
  ------------------
  |  Branch (10719:9): [True: 0, False: 58]
  ------------------
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|     58|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|     58|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 58]
  |  |  |  Branch (271:34): [True: 0, False: 58]
  |  |  ------------------
  |  |  272|     58|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10728|     58|    obj = xmlXPathValuePop(ctxt);
10729|     58|    set = obj->nodesetval;
10730|     58|    if (set != NULL) {
  ------------------
  |  Branch (10730:9): [True: 58, False: 0]
  ------------------
10731|     58|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1);
10732|     58|        if (set->nodeNr > 0)
  ------------------
  |  Branch (10732:13): [True: 0, False: 58]
  ------------------
10733|      0|            *first = set->nodeTab[0];
10734|     58|    }
10735|     58|    xmlXPathValuePush(ctxt, obj);
10736|       |
10737|     58|    return (total);
10738|     58|}

