__xmlInitializeDict:
  160|      2|int __xmlInitializeDict(void) {
  161|      2|    xmlInitMutex(&xmlDictMutex);
  162|       |
  163|       |#ifdef DICT_RANDOMIZATION
  164|       |#ifdef HAVE_RAND_R
  165|       |    rand_seed = time(NULL);
  166|       |    rand_r(& rand_seed);
  167|       |#else
  168|       |    srand(time(NULL));
  169|       |#endif
  170|       |#endif
  171|      2|    return(1);
  172|      2|}

xmlInitEncodingInternal:
 1488|      2|xmlInitEncodingInternal(void) {
 1489|      2|    unsigned short int tst = 0x1234;
 1490|      2|    unsigned char *ptr = (unsigned char *) &tst;
 1491|       |
 1492|      2|    if (*ptr == 0x12) xmlLittleEndian = 0;
  ------------------
  |  Branch (1492:9): [True: 0, False: 2]
  ------------------
 1493|      2|    else xmlLittleEndian = 1;
 1494|      2|}

xmlSetGenericErrorFunc:
  115|      2|xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
  116|      2|    xmlGenericErrorContext = ctx;
  ------------------
  |  |  366|      2|#define xmlGenericErrorContext \
  |  |  367|      2|(*(__xmlGenericErrorContext()))
  ------------------
  117|      2|    if (handler != NULL)
  ------------------
  |  Branch (117:9): [True: 2, False: 0]
  ------------------
  118|      2|	xmlGenericError = handler;
  ------------------
  |  |  350|      2|#define xmlGenericError \
  |  |  351|      2|(*(__xmlGenericError()))
  ------------------
  119|      0|    else
  120|      0|	xmlGenericError = xmlGenericErrorDefaultFunc;
  ------------------
  |  |  350|      0|#define xmlGenericError \
  |  |  351|      0|(*(__xmlGenericError()))
  ------------------
  121|      2|}
__xmlRaiseError:
  476|  6.42k|{
  477|  6.42k|    xmlParserCtxtPtr ctxt = NULL;
  478|  6.42k|    xmlNodePtr node = (xmlNodePtr) nod;
  479|  6.42k|    char *str = NULL;
  480|  6.42k|    xmlParserInputPtr input = NULL;
  481|  6.42k|    xmlErrorPtr to = &xmlLastError;
  ------------------
  |  |  271|  6.42k|#define xmlLastError \
  |  |  272|  6.42k|(*(__xmlLastError()))
  ------------------
  482|  6.42k|    xmlNodePtr baseptr = NULL;
  483|       |
  484|  6.42k|    if (code == XML_ERR_OK)
  ------------------
  |  Branch (484:9): [True: 0, False: 6.42k]
  ------------------
  485|      0|        return;
  486|  6.42k|    if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING))
  ------------------
  |  |  382|  6.42k|#define xmlGetWarningsDefaultValue \
  |  |  383|  6.42k|(*(__xmlGetWarningsDefaultValue()))
  ------------------
  |  Branch (486:9): [True: 0, False: 6.42k]
  |  Branch (486:46): [True: 0, False: 0]
  ------------------
  487|      0|        return;
  488|  6.42k|    if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||
  ------------------
  |  Branch (488:9): [True: 0, False: 6.42k]
  |  Branch (488:40): [True: 0, False: 6.42k]
  ------------------
  489|  6.42k|        (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) ||
  ------------------
  |  Branch (489:9): [True: 0, False: 6.42k]
  |  Branch (489:37): [True: 0, False: 6.42k]
  ------------------
  490|  6.42k|	(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
  ------------------
  |  Branch (490:2): [True: 0, False: 6.42k]
  |  Branch (490:29): [True: 0, False: 6.42k]
  ------------------
  491|      0|	ctxt = (xmlParserCtxtPtr) ctx;
  492|       |
  493|      0|        if (ctxt != NULL) {
  ------------------
  |  Branch (493:13): [True: 0, False: 0]
  ------------------
  494|      0|            if (level == XML_ERR_WARNING) {
  ------------------
  |  Branch (494:17): [True: 0, False: 0]
  ------------------
  495|      0|                if (ctxt->nbWarnings >= XML_MAX_ERRORS)
  ------------------
  |  |   21|      0|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (495:21): [True: 0, False: 0]
  ------------------
  496|      0|                    return;
  497|      0|                ctxt->nbWarnings += 1;
  498|      0|            } else {
  499|      0|                if (ctxt->nbErrors >= XML_MAX_ERRORS)
  ------------------
  |  |   21|      0|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (499:21): [True: 0, False: 0]
  ------------------
  500|      0|                    return;
  501|      0|                ctxt->nbErrors += 1;
  502|      0|            }
  503|       |
  504|      0|            if ((schannel == NULL) && (ctxt->sax != NULL) &&
  ------------------
  |  Branch (504:17): [True: 0, False: 0]
  |  Branch (504:39): [True: 0, False: 0]
  ------------------
  505|      0|                (ctxt->sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  672|      0|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (505:17): [True: 0, False: 0]
  ------------------
  506|      0|                (ctxt->sax->serror != NULL)) {
  ------------------
  |  Branch (506:17): [True: 0, False: 0]
  ------------------
  507|      0|                schannel = ctxt->sax->serror;
  508|      0|                data = ctxt->userData;
  509|      0|            }
  510|      0|        }
  511|      0|    }
  512|       |    /*
  513|       |     * Check if structured error handler set
  514|       |     */
  515|  6.42k|    if (schannel == NULL) {
  ------------------
  |  Branch (515:9): [True: 6.42k, False: 0]
  ------------------
  516|  6.42k|	schannel = xmlStructuredError;
  ------------------
  |  |  358|  6.42k|#define xmlStructuredError \
  |  |  359|  6.42k|(*(__xmlStructuredError()))
  ------------------
  517|       |	/*
  518|       |	 * if user has defined handler, change data ptr to user's choice
  519|       |	 */
  520|  6.42k|	if (schannel != NULL)
  ------------------
  |  Branch (520:6): [True: 0, False: 6.42k]
  ------------------
  521|      0|	    data = xmlStructuredErrorContext;
  ------------------
  |  |  374|      0|#define xmlStructuredErrorContext \
  |  |  375|      0|(*(__xmlStructuredErrorContext()))
  ------------------
  522|  6.42k|    }
  523|       |    /*
  524|       |     * Formatting the message
  525|       |     */
  526|  6.42k|    if (msg == NULL) {
  ------------------
  |  Branch (526:9): [True: 0, False: 6.42k]
  ------------------
  527|      0|        str = (char *) xmlStrdup(BAD_CAST "No error message provided");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
  528|  6.42k|    } else {
  529|  6.42k|        XML_GET_VAR_STR(msg, str);
  ------------------
  |  |   23|  6.42k|#define XML_GET_VAR_STR(msg, str) {				\
  |  |   24|  6.42k|    int       size, prev_size = -1;				\
  |  |   25|  6.42k|    int       chars;						\
  |  |   26|  6.42k|    char      *larger;						\
  |  |   27|  6.42k|    va_list   ap;						\
  |  |   28|  6.42k|								\
  |  |   29|  6.42k|    str = (char *) xmlMalloc(150);				\
  |  |   30|  6.42k|    if (str != NULL) {						\
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 6.42k]
  |  |  ------------------
  |  |   31|      0|								\
  |  |   32|      0|    size = 150;							\
  |  |   33|      0|								\
  |  |   34|      0|    while (size < 64000) {					\
  |  |  ------------------
  |  |  |  Branch (34:12): [True: 0, False: 0]
  |  |  ------------------
  |  |   35|      0|	va_start(ap, msg);					\
  |  |   36|      0|	chars = vsnprintf(str, size, msg, ap);			\
  |  |   37|      0|	va_end(ap);						\
  |  |   38|      0|	if ((chars > -1) && (chars < size)) {			\
  |  |  ------------------
  |  |  |  Branch (38:6): [True: 0, False: 0]
  |  |  |  Branch (38:22): [True: 0, False: 0]
  |  |  ------------------
  |  |   39|      0|	    if (prev_size == chars) {				\
  |  |  ------------------
  |  |  |  Branch (39:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   40|      0|		break;						\
  |  |   41|      0|	    } else {						\
  |  |   42|      0|		prev_size = chars;				\
  |  |   43|      0|	    }							\
  |  |   44|      0|	}							\
  |  |   45|      0|	if (chars > -1)						\
  |  |  ------------------
  |  |  |  Branch (45:6): [True: 0, False: 0]
  |  |  ------------------
  |  |   46|      0|	    size += chars + 1;					\
  |  |   47|      0|	else							\
  |  |   48|      0|	    size += 100;					\
  |  |   49|      0|	if ((larger = (char *) xmlRealloc(str, size)) == NULL) {\
  |  |  ------------------
  |  |  |  Branch (49:6): [True: 0, False: 0]
  |  |  ------------------
  |  |   50|      0|	    break;						\
  |  |   51|      0|	}							\
  |  |   52|      0|	str = larger;						\
  |  |   53|      0|    }}								\
  |  |   54|  6.42k|}
  ------------------
  530|  6.42k|    }
  531|       |
  532|       |    /*
  533|       |     * specific processing if a parser context is provided
  534|       |     */
  535|  6.42k|    if (ctxt != NULL) {
  ------------------
  |  Branch (535:9): [True: 0, False: 6.42k]
  ------------------
  536|      0|        if (file == NULL) {
  ------------------
  |  Branch (536:13): [True: 0, False: 0]
  ------------------
  537|      0|            input = ctxt->input;
  538|      0|            if ((input != NULL) && (input->filename == NULL) &&
  ------------------
  |  Branch (538:17): [True: 0, False: 0]
  |  Branch (538:36): [True: 0, False: 0]
  ------------------
  539|      0|                (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (539:17): [True: 0, False: 0]
  ------------------
  540|      0|                input = ctxt->inputTab[ctxt->inputNr - 2];
  541|      0|            }
  542|      0|            if (input != NULL) {
  ------------------
  |  Branch (542:17): [True: 0, False: 0]
  ------------------
  543|      0|                file = input->filename;
  544|      0|                line = input->line;
  545|      0|                col = input->col;
  546|      0|            }
  547|      0|        }
  548|      0|        to = &ctxt->lastError;
  549|  6.42k|    } else if ((node != NULL) && (file == NULL)) {
  ------------------
  |  Branch (549:16): [True: 0, False: 6.42k]
  |  Branch (549:34): [True: 0, False: 0]
  ------------------
  550|      0|	int i;
  551|       |
  552|      0|	if ((node->doc != NULL) && (node->doc->URL != NULL)) {
  ------------------
  |  Branch (552:6): [True: 0, False: 0]
  |  Branch (552:29): [True: 0, False: 0]
  ------------------
  553|      0|	    baseptr = node;
  554|       |/*	    file = (const char *) node->doc->URL; */
  555|      0|	}
  556|      0|	for (i = 0;
  557|      0|	     ((i < 10) && (node != NULL) && (node->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (557:8): [True: 0, False: 0]
  |  Branch (557:20): [True: 0, False: 0]
  |  Branch (557:38): [True: 0, False: 0]
  ------------------
  558|      0|	     i++)
  559|      0|	     node = node->parent;
  560|      0|        if ((baseptr == NULL) && (node != NULL) &&
  ------------------
  |  Branch (560:13): [True: 0, False: 0]
  |  Branch (560:34): [True: 0, False: 0]
  ------------------
  561|      0|	    (node->doc != NULL) && (node->doc->URL != NULL))
  ------------------
  |  Branch (561:6): [True: 0, False: 0]
  |  Branch (561:29): [True: 0, False: 0]
  ------------------
  562|      0|	    baseptr = node;
  563|       |
  564|      0|	if ((node != NULL) && (node->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (564:6): [True: 0, False: 0]
  |  Branch (564:24): [True: 0, False: 0]
  ------------------
  565|      0|	    line = node->line;
  566|      0|	if ((line == 0) || (line == 65535))
  ------------------
  |  Branch (566:6): [True: 0, False: 0]
  |  Branch (566:21): [True: 0, False: 0]
  ------------------
  567|      0|	    line = xmlGetLineNo(node);
  568|      0|    }
  569|       |
  570|       |    /*
  571|       |     * Save the information about the error
  572|       |     */
  573|  6.42k|    xmlResetError(to);
  574|  6.42k|    to->domain = domain;
  575|  6.42k|    to->code = code;
  576|  6.42k|    to->message = str;
  577|  6.42k|    to->level = level;
  578|  6.42k|    if (file != NULL)
  ------------------
  |  Branch (578:9): [True: 0, False: 6.42k]
  ------------------
  579|      0|        to->file = (char *) xmlStrdup((const xmlChar *) file);
  580|  6.42k|    else if (baseptr != NULL) {
  ------------------
  |  Branch (580:14): [True: 0, False: 6.42k]
  ------------------
  581|      0|#ifdef LIBXML_XINCLUDE_ENABLED
  582|       |	/*
  583|       |	 * We check if the error is within an XInclude section and,
  584|       |	 * if so, attempt to print out the href of the XInclude instead
  585|       |	 * of the usual "base" (doc->URL) for the node (bug 152623).
  586|       |	 */
  587|      0|        xmlNodePtr prev = baseptr;
  588|      0|        char *href = NULL;
  589|      0|	int inclcount = 0;
  590|      0|	while (prev != NULL) {
  ------------------
  |  Branch (590:9): [True: 0, False: 0]
  ------------------
  591|      0|	    if (prev->prev == NULL)
  ------------------
  |  Branch (591:10): [True: 0, False: 0]
  ------------------
  592|      0|	        prev = prev->parent;
  593|      0|	    else {
  594|      0|	        prev = prev->prev;
  595|      0|		if (prev->type == XML_XINCLUDE_START) {
  ------------------
  |  Branch (595:7): [True: 0, False: 0]
  ------------------
  596|      0|		    if (inclcount > 0) {
  ------------------
  |  Branch (596:11): [True: 0, False: 0]
  ------------------
  597|      0|                        --inclcount;
  598|      0|                    } else {
  599|      0|                        href = (char *) xmlGetProp(prev, BAD_CAST "href");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
  600|      0|                        if (href != NULL)
  ------------------
  |  Branch (600:29): [True: 0, False: 0]
  ------------------
  601|      0|		            break;
  602|      0|                    }
  603|      0|		} else if (prev->type == XML_XINCLUDE_END)
  ------------------
  |  Branch (603:14): [True: 0, False: 0]
  ------------------
  604|      0|		    inclcount++;
  605|      0|	    }
  606|      0|	}
  607|      0|        if (href != NULL)
  ------------------
  |  Branch (607:13): [True: 0, False: 0]
  ------------------
  608|      0|            to->file = href;
  609|      0|	else
  610|      0|#endif
  611|      0|	    to->file = (char *) xmlStrdup(baseptr->doc->URL);
  612|      0|	if ((to->file == NULL) && (node != NULL) && (node->doc != NULL)) {
  ------------------
  |  Branch (612:6): [True: 0, False: 0]
  |  Branch (612:28): [True: 0, False: 0]
  |  Branch (612:46): [True: 0, False: 0]
  ------------------
  613|      0|	    to->file = (char *) xmlStrdup(node->doc->URL);
  614|      0|	}
  615|      0|    }
  616|  6.42k|    to->line = line;
  617|  6.42k|    if (str1 != NULL)
  ------------------
  |  Branch (617:9): [True: 6.42k, False: 0]
  ------------------
  618|  6.42k|        to->str1 = (char *) xmlStrdup((const xmlChar *) str1);
  619|  6.42k|    if (str2 != NULL)
  ------------------
  |  Branch (619:9): [True: 0, False: 6.42k]
  ------------------
  620|      0|        to->str2 = (char *) xmlStrdup((const xmlChar *) str2);
  621|  6.42k|    if (str3 != NULL)
  ------------------
  |  Branch (621:9): [True: 0, False: 6.42k]
  ------------------
  622|      0|        to->str3 = (char *) xmlStrdup((const xmlChar *) str3);
  623|  6.42k|    to->int1 = int1;
  624|  6.42k|    to->int2 = col;
  625|  6.42k|    to->node = node;
  626|  6.42k|    to->ctxt = ctx;
  627|       |
  628|  6.42k|    if (to != &xmlLastError)
  ------------------
  |  |  271|  6.42k|#define xmlLastError \
  |  |  272|  6.42k|(*(__xmlLastError()))
  ------------------
  |  Branch (628:9): [True: 0, False: 6.42k]
  ------------------
  629|      0|        xmlCopyError(to,&xmlLastError);
  ------------------
  |  |  271|      0|#define xmlLastError \
  |  |  272|      0|(*(__xmlLastError()))
  ------------------
  630|       |
  631|  6.42k|    if (schannel != NULL) {
  ------------------
  |  Branch (631:9): [True: 0, False: 6.42k]
  ------------------
  632|      0|	schannel(data, to);
  633|      0|	return;
  634|      0|    }
  635|       |
  636|       |    /*
  637|       |     * Find the callback channel if channel param is NULL
  638|       |     */
  639|  6.42k|    if ((ctxt != NULL) && (channel == NULL) &&
  ------------------
  |  Branch (639:9): [True: 0, False: 6.42k]
  |  Branch (639:27): [True: 0, False: 0]
  ------------------
  640|  6.42k|        (xmlStructuredError == NULL) && (ctxt->sax != NULL)) {
  ------------------
  |  |  358|      0|#define xmlStructuredError \
  |  |  359|      0|(*(__xmlStructuredError()))
  ------------------
  |  Branch (640:9): [True: 0, False: 0]
  |  Branch (640:41): [True: 0, False: 0]
  ------------------
  641|      0|        if (level == XML_ERR_WARNING)
  ------------------
  |  Branch (641:13): [True: 0, False: 0]
  ------------------
  642|      0|	    channel = ctxt->sax->warning;
  643|      0|        else
  644|      0|	    channel = ctxt->sax->error;
  645|      0|	data = ctxt->userData;
  646|  6.42k|    } else if (channel == NULL) {
  ------------------
  |  Branch (646:16): [True: 6.42k, False: 0]
  ------------------
  647|  6.42k|	channel = xmlGenericError;
  ------------------
  |  |  350|  6.42k|#define xmlGenericError \
  |  |  351|  6.42k|(*(__xmlGenericError()))
  ------------------
  648|  6.42k|	if (ctxt != NULL) {
  ------------------
  |  Branch (648:6): [True: 0, False: 6.42k]
  ------------------
  649|      0|	    data = ctxt;
  650|  6.42k|	} else {
  651|  6.42k|	    data = xmlGenericErrorContext;
  ------------------
  |  |  366|  6.42k|#define xmlGenericErrorContext \
  |  |  367|  6.42k|(*(__xmlGenericErrorContext()))
  ------------------
  652|  6.42k|	}
  653|  6.42k|    }
  654|  6.42k|    if (channel == NULL)
  ------------------
  |  Branch (654:9): [True: 0, False: 6.42k]
  ------------------
  655|      0|        return;
  656|       |
  657|  6.42k|    if ((channel == xmlParserError) ||
  ------------------
  |  Branch (657:9): [True: 0, False: 6.42k]
  ------------------
  658|  6.42k|        (channel == xmlParserWarning) ||
  ------------------
  |  Branch (658:9): [True: 0, False: 6.42k]
  ------------------
  659|  6.42k|	(channel == xmlParserValidityError) ||
  ------------------
  |  Branch (659:2): [True: 0, False: 6.42k]
  ------------------
  660|  6.42k|	(channel == xmlParserValidityWarning))
  ------------------
  |  Branch (660:2): [True: 0, False: 6.42k]
  ------------------
  661|      0|	xmlReportError(to, ctxt, str, NULL, NULL);
  662|  6.42k|    else if (((void(*)(void)) channel == (void(*)(void)) fprintf) ||
  ------------------
  |  Branch (662:14): [True: 0, False: 6.42k]
  ------------------
  663|  6.42k|             (channel == xmlGenericErrorDefaultFunc))
  ------------------
  |  Branch (663:14): [True: 0, False: 6.42k]
  ------------------
  664|      0|	xmlReportError(to, ctxt, str, channel, data);
  665|  6.42k|    else
  666|  6.42k|	channel(data, "%s", str);
  667|  6.42k|}
xmlResetError:
  902|  6.42k|{
  903|  6.42k|    if (err == NULL)
  ------------------
  |  Branch (903:9): [True: 0, False: 6.42k]
  ------------------
  904|      0|        return;
  905|  6.42k|    if (err->code == XML_ERR_OK)
  ------------------
  |  Branch (905:9): [True: 1, False: 6.42k]
  ------------------
  906|      1|        return;
  907|  6.42k|    if (err->message != NULL)
  ------------------
  |  Branch (907:9): [True: 0, False: 6.42k]
  ------------------
  908|      0|        xmlFree(err->message);
  909|  6.42k|    if (err->file != NULL)
  ------------------
  |  Branch (909:9): [True: 0, False: 6.42k]
  ------------------
  910|      0|        xmlFree(err->file);
  911|  6.42k|    if (err->str1 != NULL)
  ------------------
  |  Branch (911:9): [True: 0, False: 6.42k]
  ------------------
  912|      0|        xmlFree(err->str1);
  913|  6.42k|    if (err->str2 != NULL)
  ------------------
  |  Branch (913:9): [True: 0, False: 6.42k]
  ------------------
  914|      0|        xmlFree(err->str2);
  915|  6.42k|    if (err->str3 != NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 6.42k]
  ------------------
  916|      0|        xmlFree(err->str3);
  917|  6.42k|    memset(err, 0, sizeof(xmlError));
  918|  6.42k|    err->code = XML_ERR_OK;
  919|  6.42k|}

xmlFuzzErrorFunc:
   55|  6.42k|                 ...) {
   56|  6.42k|}
xmlFuzzMemSetup:
  100|      2|xmlFuzzMemSetup(void) {
  101|      2|    xmlMemSetup(free, xmlFuzzMalloc, xmlFuzzRealloc, xmlMemStrdup);
  102|      2|}
xmlFuzzMemSetLimit:
  105|  8.57k|xmlFuzzMemSetLimit(size_t limit) {
  106|  8.57k|    fuzzNumAllocs = 0;
  107|  8.57k|    fuzzMaxAllocs = limit ? limit + XML_FUZZ_MALLOC_OFFSET : 0;
  ------------------
  |  |   68|  4.21k|#define XML_FUZZ_MALLOC_OFFSET  0
  ------------------
  |  Branch (107:21): [True: 4.21k, False: 4.35k]
  ------------------
  108|  8.57k|}
xmlFuzzDataInit:
  116|  4.28k|xmlFuzzDataInit(const char *data, size_t size) {
  117|  4.28k|    fuzzData.data = data;
  118|  4.28k|    fuzzData.size = size;
  119|  4.28k|    fuzzData.ptr = data;
  120|  4.28k|    fuzzData.remaining = size;
  121|       |
  122|  4.28k|    fuzzData.outBuf = xmlMalloc(size + 1);
  123|  4.28k|    fuzzData.outPtr = fuzzData.outBuf;
  124|       |
  125|  4.28k|    fuzzData.entities = xmlHashCreate(8);
  126|  4.28k|    fuzzData.mainUrl = NULL;
  127|  4.28k|    fuzzData.mainEntity = NULL;
  128|  4.28k|}
xmlFuzzDataCleanup:
  136|  4.28k|xmlFuzzDataCleanup(void) {
  137|  4.28k|    xmlFree(fuzzData.outBuf);
  138|  4.28k|    xmlHashFree(fuzzData.entities, xmlHashDefaultDeallocator);
  139|  4.28k|}
xmlFuzzReadInt:
  172|  4.28k|xmlFuzzReadInt(int size) {
  173|  4.28k|    size_t ret = 0;
  174|       |
  175|  21.4k|    while ((size > 0) && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (175:12): [True: 17.1k, False: 4.27k]
  |  Branch (175:26): [True: 17.1k, False: 7]
  ------------------
  176|  17.1k|        unsigned char c = (unsigned char) *fuzzData.ptr++;
  177|  17.1k|        fuzzData.remaining--;
  178|  17.1k|        ret = (ret << 8) | c;
  179|  17.1k|        size--;
  180|  17.1k|    }
  181|       |
  182|  4.28k|    return ret;
  183|  4.28k|}
xmlFuzzReadString:
  236|  8.57k|xmlFuzzReadString(size_t *size) {
  237|  8.57k|    const char *out = fuzzData.outPtr;
  238|       |
  239|   585k|    while (fuzzData.remaining > 0) {
  ------------------
  |  Branch (239:12): [True: 578k, False: 7.34k]
  ------------------
  240|   578k|        int c = *fuzzData.ptr++;
  241|   578k|        fuzzData.remaining--;
  242|       |
  243|   578k|        if ((c == '\\') && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (243:13): [True: 2.48k, False: 575k]
  |  Branch (243:28): [True: 2.45k, False: 37]
  ------------------
  244|  2.45k|            int c2 = *fuzzData.ptr;
  245|       |
  246|  2.45k|            if (c2 == '\n') {
  ------------------
  |  Branch (246:17): [True: 1.22k, False: 1.22k]
  ------------------
  247|  1.22k|                fuzzData.ptr++;
  248|  1.22k|                fuzzData.remaining--;
  249|  1.22k|                if (size != NULL)
  ------------------
  |  Branch (249:21): [True: 0, False: 1.22k]
  ------------------
  250|      0|                    *size = fuzzData.outPtr - out;
  251|  1.22k|                *fuzzData.outPtr++ = '\0';
  252|  1.22k|                return(out);
  253|  1.22k|            }
  254|  1.22k|            if (c2 == '\\') {
  ------------------
  |  Branch (254:17): [True: 823, False: 405]
  ------------------
  255|    823|                fuzzData.ptr++;
  256|    823|                fuzzData.remaining--;
  257|    823|            }
  258|  1.22k|        }
  259|       |
  260|   576k|        *fuzzData.outPtr++ = c;
  261|   576k|    }
  262|       |
  263|  7.34k|    if (fuzzData.outPtr > out) {
  ------------------
  |  Branch (263:9): [True: 4.27k, False: 3.07k]
  ------------------
  264|  4.27k|        if (size != NULL)
  ------------------
  |  Branch (264:13): [True: 0, False: 4.27k]
  ------------------
  265|      0|            *size = fuzzData.outPtr - out;
  266|  4.27k|        *fuzzData.outPtr++ = '\0';
  267|  4.27k|        return(out);
  268|  4.27k|    }
  269|       |
  270|  3.07k|    if (size != NULL)
  ------------------
  |  Branch (270:9): [True: 0, False: 3.07k]
  ------------------
  271|      0|        *size = 0;
  272|  3.07k|    return(NULL);
  273|  7.34k|}
fuzz.c:xmlFuzzMalloc:
   72|   126k|xmlFuzzMalloc(size_t size) {
   73|   126k|    if (fuzzMaxAllocs > 0) {
  ------------------
  |  Branch (73:9): [True: 111k, False: 14.6k]
  ------------------
   74|   111k|        if (fuzzNumAllocs >= fuzzMaxAllocs - 1)
  ------------------
  |  Branch (74:13): [True: 23.0k, False: 88.7k]
  ------------------
   75|       |#if XML_FUZZ_MALLOC_ABORT
   76|       |            abort();
   77|       |#else
   78|  23.0k|            return(NULL);
   79|  88.7k|#endif
   80|  88.7k|        fuzzNumAllocs += 1;
   81|  88.7k|    }
   82|   103k|    return malloc(size);
   83|   126k|}
fuzz.c:xmlFuzzRealloc:
   86|  7.05k|xmlFuzzRealloc(void *ptr, size_t size) {
   87|  7.05k|    if (fuzzMaxAllocs > 0) {
  ------------------
  |  Branch (87:9): [True: 6.89k, False: 155]
  ------------------
   88|  6.89k|        if (fuzzNumAllocs >= fuzzMaxAllocs - 1)
  ------------------
  |  Branch (88:13): [True: 73, False: 6.82k]
  ------------------
   89|       |#if XML_FUZZ_MALLOC_ABORT
   90|       |            abort();
   91|       |#else
   92|     73|            return(NULL);
   93|  6.82k|#endif
   94|  6.82k|        fuzzNumAllocs += 1;
   95|  6.82k|    }
   96|  6.98k|    return realloc(ptr, size);
   97|  7.05k|}

LLVMFuzzerInitialize:
   12|      2|                     char ***argv ATTRIBUTE_UNUSED) {
   13|      2|    xmlFuzzMemSetup();
   14|      2|    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
   15|       |
   16|      2|    return 0;
   17|      2|}
LLVMFuzzerTestOneInput:
   20|  4.29k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
   21|  4.29k|    xmlURIPtr uri;
   22|  4.29k|    size_t maxAlloc;
   23|  4.29k|    const char *str1, *str2;
   24|  4.29k|    char *copy;
   25|       |
   26|  4.29k|    if (size > 10000)
  ------------------
  |  Branch (26:9): [True: 7, False: 4.28k]
  ------------------
   27|      7|        return(0);
   28|       |
   29|  4.28k|    xmlFuzzDataInit(data, size);
   30|  4.28k|    maxAlloc = xmlFuzzReadInt(4) % (size * 8 + 1);
   31|  4.28k|    str1 = xmlFuzzReadString(NULL);
   32|  4.28k|    str2 = xmlFuzzReadString(NULL);
   33|       |
   34|  4.28k|    xmlFuzzMemSetLimit(maxAlloc);
   35|       |
   36|  4.28k|    uri = xmlParseURI(str1);
   37|  4.28k|    xmlFree(xmlSaveUri(uri));
   38|  4.28k|    xmlFreeURI(uri);
   39|       |
   40|  4.28k|    uri = xmlParseURIRaw(str1, 1);
   41|  4.28k|    xmlFree(xmlSaveUri(uri));
   42|  4.28k|    xmlFreeURI(uri);
   43|       |
   44|  4.28k|    xmlFree(xmlURIUnescapeString(str1, -1, NULL));
   45|  4.28k|    xmlFree(xmlURIEscape(BAD_CAST str1));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
   46|  4.28k|    xmlFree(xmlCanonicPath(BAD_CAST str1));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
   47|  4.28k|    xmlFree(xmlPathToURI(BAD_CAST str1));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
   48|       |
   49|  4.28k|    xmlFree(xmlBuildURI(BAD_CAST str2, BAD_CAST str1));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
                  xmlFree(xmlBuildURI(BAD_CAST str2, BAD_CAST str1));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
   50|  4.28k|    xmlFree(xmlBuildRelativeURI(BAD_CAST str2, BAD_CAST str1));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
                  xmlFree(xmlBuildRelativeURI(BAD_CAST str2, BAD_CAST str1));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
   51|  4.28k|    xmlFree(xmlURIEscapeStr(BAD_CAST str1, BAD_CAST str2));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
                  xmlFree(xmlURIEscapeStr(BAD_CAST str1, BAD_CAST str2));
  ------------------
  |  |   35|  4.28k|#define BAD_CAST (xmlChar *)
  ------------------
   52|       |
   53|  4.28k|    copy = (char *) xmlCharStrdup(str1);
   54|  4.28k|    xmlNormalizeURIPath(copy);
   55|  4.28k|    xmlFree(copy);
   56|       |
   57|  4.28k|    xmlFuzzMemSetLimit(0);
   58|  4.28k|    xmlFuzzDataCleanup();
   59|       |
   60|  4.28k|    return 0;
   61|  4.29k|}

xmlInitGlobalsInternal:
   59|      2|void xmlInitGlobalsInternal(void) {
   60|      2|    xmlInitMutex(&xmlThrDefMutex);
   61|      2|}
__xmlLastError:
  724|  12.8k|__xmlLastError(void) {
  725|  12.8k|    if (IS_MAIN_THREAD)
  ------------------
  |  |   35|  12.8k|#define IS_MAIN_THREAD (xmlIsMainThread())
  |  |  ------------------
  |  |  |  Branch (35:24): [True: 12.8k, False: 0]
  |  |  ------------------
  ------------------
  726|  12.8k|	return (&xmlLastError);
  727|      0|    else
  728|      0|	return (&xmlGetGlobalState()->xmlLastError);
  729|  12.8k|}
__xmlGenericError:
  872|  6.42k|__xmlGenericError(void) {
  873|  6.42k|    if (IS_MAIN_THREAD)
  ------------------
  |  |   35|  6.42k|#define IS_MAIN_THREAD (xmlIsMainThread())
  |  |  ------------------
  |  |  |  Branch (35:24): [True: 6.42k, False: 0]
  |  |  ------------------
  ------------------
  874|  6.42k|	return (&xmlGenericError);
  875|      0|    else
  876|      0|	return (&xmlGetGlobalState()->xmlGenericError);
  877|  6.42k|}
__xmlStructuredError:
  881|  6.42k|__xmlStructuredError(void) {
  882|  6.42k|    if (IS_MAIN_THREAD)
  ------------------
  |  |   35|  6.42k|#define IS_MAIN_THREAD (xmlIsMainThread())
  |  |  ------------------
  |  |  |  Branch (35:24): [True: 6.42k, False: 0]
  |  |  ------------------
  ------------------
  883|  6.42k|	return (&xmlStructuredError);
  884|      0|    else
  885|      0|	return (&xmlGetGlobalState()->xmlStructuredError);
  886|  6.42k|}
__xmlGenericErrorContext:
  890|  6.42k|__xmlGenericErrorContext(void) {
  891|  6.42k|    if (IS_MAIN_THREAD)
  ------------------
  |  |   35|  6.42k|#define IS_MAIN_THREAD (xmlIsMainThread())
  |  |  ------------------
  |  |  |  Branch (35:24): [True: 6.42k, False: 0]
  |  |  ------------------
  ------------------
  892|  6.42k|	return (&xmlGenericErrorContext);
  893|      0|    else
  894|      0|	return (&xmlGetGlobalState()->xmlGenericErrorContext);
  895|  6.42k|}
__xmlGetWarningsDefaultValue:
  908|  6.42k|__xmlGetWarningsDefaultValue(void) {
  909|  6.42k|    if (IS_MAIN_THREAD)
  ------------------
  |  |   35|  6.42k|#define IS_MAIN_THREAD (xmlIsMainThread())
  |  |  ------------------
  |  |  |  Branch (35:24): [True: 6.42k, False: 0]
  |  |  ------------------
  ------------------
  910|  6.42k|	return (&xmlGetWarningsDefaultValue);
  911|      0|    else
  912|      0|	return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
  913|  6.42k|}
globals.c:xmlPosixStrdup:
  131|    338|xmlPosixStrdup(const char *cur) {
  132|    338|    return((char*) xmlCharStrdup(cur));
  133|    338|}

xmlHashCreate:
  180|  4.28k|xmlHashCreate(int size) {
  181|  4.28k|    xmlHashTablePtr table;
  182|       |
  183|  4.28k|    xmlInitParser();
  184|       |
  185|  4.28k|    if (size <= 0)
  ------------------
  |  Branch (185:9): [True: 0, False: 4.28k]
  ------------------
  186|      0|        size = 256;
  187|       |
  188|  4.28k|    table = xmlMalloc(sizeof(xmlHashTable));
  189|  4.28k|    if (table) {
  ------------------
  |  Branch (189:9): [True: 4.28k, False: 0]
  ------------------
  190|  4.28k|        table->dict = NULL;
  191|  4.28k|        table->size = size;
  192|  4.28k|	table->nbElems = 0;
  193|  4.28k|        table->table = xmlMalloc(size * sizeof(xmlHashEntry));
  194|  4.28k|        if (table->table) {
  ------------------
  |  Branch (194:13): [True: 4.28k, False: 0]
  ------------------
  195|  4.28k|	    memset(table->table, 0, size * sizeof(xmlHashEntry));
  196|       |#ifdef HASH_RANDOMIZATION
  197|       |            table->random_seed = __xmlRandom();
  198|       |#endif
  199|  4.28k|	    return(table);
  200|  4.28k|        }
  201|      0|        xmlFree(table);
  202|      0|    }
  203|      0|    return(NULL);
  204|  4.28k|}
xmlHashFree:
  328|  4.28k|xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f) {
  329|  4.28k|    int i;
  330|  4.28k|    xmlHashEntryPtr iter;
  331|  4.28k|    xmlHashEntryPtr next;
  332|  4.28k|    int inside_table = 0;
  333|  4.28k|    int nbElems;
  334|       |
  335|  4.28k|    if (table == NULL)
  ------------------
  |  Branch (335:9): [True: 0, False: 4.28k]
  ------------------
  336|      0|	return;
  337|  4.28k|    if (table->table) {
  ------------------
  |  Branch (337:9): [True: 4.28k, False: 0]
  ------------------
  338|  4.28k|	nbElems = table->nbElems;
  339|  4.28k|	for(i = 0; (i < table->size) && (nbElems > 0); i++) {
  ------------------
  |  Branch (339:13): [True: 4.28k, False: 0]
  |  Branch (339:34): [True: 0, False: 4.28k]
  ------------------
  340|      0|	    iter = &(table->table[i]);
  341|      0|	    if (iter->valid == 0)
  ------------------
  |  Branch (341:10): [True: 0, False: 0]
  ------------------
  342|      0|		continue;
  343|      0|	    inside_table = 1;
  344|      0|	    while (iter) {
  ------------------
  |  Branch (344:13): [True: 0, False: 0]
  ------------------
  345|      0|		next = iter->next;
  346|      0|		if ((f != NULL) && (iter->payload != NULL))
  ------------------
  |  Branch (346:7): [True: 0, False: 0]
  |  Branch (346:22): [True: 0, False: 0]
  ------------------
  347|      0|		    f(iter->payload, iter->name);
  348|      0|		if (table->dict == NULL) {
  ------------------
  |  Branch (348:7): [True: 0, False: 0]
  ------------------
  349|      0|		    if (iter->name)
  ------------------
  |  Branch (349:11): [True: 0, False: 0]
  ------------------
  350|      0|			xmlFree(iter->name);
  351|      0|		    if (iter->name2)
  ------------------
  |  Branch (351:11): [True: 0, False: 0]
  ------------------
  352|      0|			xmlFree(iter->name2);
  353|      0|		    if (iter->name3)
  ------------------
  |  Branch (353:11): [True: 0, False: 0]
  ------------------
  354|      0|			xmlFree(iter->name3);
  355|      0|		}
  356|      0|		iter->payload = NULL;
  357|      0|		if (!inside_table)
  ------------------
  |  Branch (357:7): [True: 0, False: 0]
  ------------------
  358|      0|		    xmlFree(iter);
  359|      0|		nbElems--;
  360|      0|		inside_table = 0;
  361|      0|		iter = next;
  362|      0|	    }
  363|      0|	}
  364|  4.28k|	xmlFree(table->table);
  365|  4.28k|    }
  366|  4.28k|    if (table->dict)
  ------------------
  |  Branch (366:9): [True: 0, False: 4.28k]
  ------------------
  367|      0|        xmlDictFree(table->dict);
  368|  4.28k|    xmlFree(table);
  369|  4.28k|}

xmlInitParser:
14108|  42.8k|xmlInitParser(void) {
14109|       |    /*
14110|       |     * Note that the initialization code must not make memory allocations.
14111|       |     */
14112|  42.8k|    if (xmlParserInitialized != 0)
  ------------------
  |  Branch (14112:9): [True: 42.8k, False: 2]
  ------------------
14113|  42.8k|	return;
14114|       |
14115|      2|#ifdef LIBXML_THREAD_ENABLED
14116|      2|    __xmlGlobalInitMutexLock();
14117|      2|    if (xmlParserInitialized == 0) {
  ------------------
  |  Branch (14117:9): [True: 2, False: 0]
  ------------------
14118|      2|#endif
14119|       |#if defined(_WIN32) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
14120|       |        if (xmlFree == free)
14121|       |            atexit(xmlCleanupParser);
14122|       |#endif
14123|       |
14124|      2|	xmlInitThreadsInternal();
14125|      2|	xmlInitGlobalsInternal();
14126|      2|	xmlInitMemoryInternal();
14127|      2|        __xmlInitializeDict();
14128|      2|	xmlInitEncodingInternal();
14129|      2|	xmlRegisterDefaultInputCallbacks();
14130|      2|#ifdef LIBXML_OUTPUT_ENABLED
14131|      2|	xmlRegisterDefaultOutputCallbacks();
14132|      2|#endif /* LIBXML_OUTPUT_ENABLED */
14133|      2|#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
14134|      2|	xmlInitXPathInternal();
14135|      2|#endif
14136|      2|	xmlParserInitialized = 1;
14137|      2|#ifdef LIBXML_THREAD_ENABLED
14138|      2|    }
14139|      2|    __xmlGlobalInitMutexUnlock();
14140|      2|#endif
14141|      2|}

xmlInitMutex:
  147|      6|{
  148|      6|#ifdef HAVE_POSIX_THREADS
  149|      6|    if (XML_IS_NEVER_THREADED() == 0)
  ------------------
  |  |   82|      6|#define XML_IS_NEVER_THREADED() (!libxml_is_threaded)
  ------------------
  |  Branch (149:9): [True: 6, False: 0]
  ------------------
  150|      6|        pthread_mutex_init(&mutex->lock, NULL);
  151|       |#elif defined HAVE_WIN32_THREADS
  152|       |    InitializeCriticalSection(&mutex->cs);
  153|       |#else
  154|       |    (void) mutex;
  155|       |#endif
  156|      6|}
__xmlGlobalInitMutexLock:
  380|      2|{
  381|       |    /* Make sure the global init lock is initialized and then lock it. */
  382|      2|#ifdef HAVE_POSIX_THREADS
  383|      2|#ifdef XML_PTHREAD_WEAK
  384|      2|    if (pthread_mutex_lock == NULL)
  ------------------
  |  Branch (384:9): [True: 0, False: 2]
  ------------------
  385|      0|        return;
  386|       |#else
  387|       |    if (XML_IS_THREADED() == 0)
  388|       |        return;
  389|       |#endif
  390|       |    /* The mutex is statically initialized, so we just lock it. */
  391|      2|    pthread_mutex_lock(&global_init_lock);
  392|       |#elif defined HAVE_WIN32_THREADS
  393|       |    LPCRITICAL_SECTION cs;
  394|       |
  395|       |    /* Create a new critical section */
  396|       |    if (global_init_lock == NULL) {
  397|       |        cs = malloc(sizeof(CRITICAL_SECTION));
  398|       |        if (cs == NULL) {
  399|       |            xmlGenericError(xmlGenericErrorContext,
  400|       |                            "xmlGlobalInitMutexLock: out of memory\n");
  401|       |            return;
  402|       |        }
  403|       |        InitializeCriticalSection(cs);
  404|       |
  405|       |        /* Swap it into the global_init_lock */
  406|       |#ifdef InterlockedCompareExchangePointer
  407|       |        InterlockedCompareExchangePointer((void **) &global_init_lock,
  408|       |                                          cs, NULL);
  409|       |#else /* Use older void* version */
  410|       |        InterlockedCompareExchange((void **) &global_init_lock,
  411|       |                                   (void *) cs, NULL);
  412|       |#endif /* InterlockedCompareExchangePointer */
  413|       |
  414|       |        /* If another thread successfully recorded its critical
  415|       |         * section in the global_init_lock then discard the one
  416|       |         * allocated by this thread. */
  417|       |        if (global_init_lock != cs) {
  418|       |            DeleteCriticalSection(cs);
  419|       |            free(cs);
  420|       |        }
  421|       |    }
  422|       |
  423|       |    /* Lock the chosen critical section */
  424|       |    EnterCriticalSection(global_init_lock);
  425|       |#endif
  426|      2|}
__xmlGlobalInitMutexUnlock:
  430|      2|{
  431|      2|#ifdef HAVE_POSIX_THREADS
  432|      2|#ifdef XML_PTHREAD_WEAK
  433|      2|    if (pthread_mutex_lock == NULL)
  ------------------
  |  Branch (433:9): [True: 0, False: 2]
  ------------------
  434|      0|        return;
  435|       |#else
  436|       |    if (XML_IS_THREADED() == 0)
  437|       |        return;
  438|       |#endif
  439|      2|    pthread_mutex_unlock(&global_init_lock);
  440|       |#elif defined HAVE_WIN32_THREADS
  441|       |    if (global_init_lock != NULL) {
  442|       |	LeaveCriticalSection(global_init_lock);
  443|       |    }
  444|       |#endif
  445|      2|}
xmlIsMainThread:
  689|  38.5k|{
  690|  38.5k|    xmlInitParser();
  691|       |
  692|       |#ifdef DEBUG_THREADS
  693|       |    xmlGenericError(xmlGenericErrorContext, "xmlIsMainThread()\n");
  694|       |#endif
  695|  38.5k|#ifdef HAVE_POSIX_THREADS
  696|  38.5k|    if (XML_IS_THREADED() == 0)
  ------------------
  |  |   81|  38.5k|#define XML_IS_THREADED() libxml_is_threaded
  ------------------
  |  Branch (696:9): [True: 0, False: 38.5k]
  ------------------
  697|      0|        return (1);
  698|  38.5k|    return (pthread_equal(mainthread,pthread_self()));
  699|       |#elif defined HAVE_WIN32_THREADS
  700|       |    return (mainthread == GetCurrentThreadId());
  701|       |#else
  702|       |    return (1);
  703|       |#endif
  704|  38.5k|}
xmlInitThreadsInternal:
  754|      2|{
  755|      2|#ifdef HAVE_POSIX_THREADS
  756|      2|#ifdef XML_PTHREAD_WEAK
  757|       |    /*
  758|       |     * This is somewhat unreliable since libpthread could be loaded
  759|       |     * later with dlopen() and threads could be created. But it's
  760|       |     * long-standing behavior and hard to work around.
  761|       |     */
  762|      2|    if (libxml_is_threaded == -1)
  ------------------
  |  Branch (762:9): [True: 2, False: 0]
  ------------------
  763|      2|        libxml_is_threaded =
  764|      2|            (pthread_getspecific != NULL) &&
  ------------------
  |  Branch (764:13): [True: 2, False: 0]
  ------------------
  765|      2|            (pthread_setspecific != NULL) &&
  ------------------
  |  Branch (765:13): [True: 2, False: 0]
  ------------------
  766|      2|            (pthread_key_create != NULL) &&
  ------------------
  |  Branch (766:13): [True: 2, False: 0]
  ------------------
  767|      2|            (pthread_key_delete != NULL) &&
  ------------------
  |  Branch (767:13): [True: 2, False: 0]
  ------------------
  768|      2|            (pthread_mutex_init != NULL) &&
  ------------------
  |  Branch (768:13): [True: 2, False: 0]
  ------------------
  769|      2|            (pthread_mutex_destroy != NULL) &&
  ------------------
  |  Branch (769:13): [True: 2, False: 0]
  ------------------
  770|      2|            (pthread_mutex_lock != NULL) &&
  ------------------
  |  Branch (770:13): [True: 2, False: 0]
  ------------------
  771|      2|            (pthread_mutex_unlock != NULL) &&
  ------------------
  |  Branch (771:13): [True: 2, False: 0]
  ------------------
  772|      2|            (pthread_cond_init != NULL) &&
  ------------------
  |  Branch (772:13): [True: 2, False: 0]
  ------------------
  773|      2|            (pthread_cond_destroy != NULL) &&
  ------------------
  |  Branch (773:13): [True: 2, False: 0]
  ------------------
  774|      2|            (pthread_cond_wait != NULL) &&
  ------------------
  |  Branch (774:13): [True: 2, False: 0]
  ------------------
  775|       |            /*
  776|       |             * pthread_equal can be inline, resuting in -Waddress warnings.
  777|       |             * Let's assume it's available if all the other functions are.
  778|       |             */
  779|       |            /* (pthread_equal != NULL) && */
  780|      2|            (pthread_self != NULL) &&
  ------------------
  |  Branch (780:13): [True: 2, False: 0]
  ------------------
  781|      2|            (pthread_cond_signal != NULL);
  ------------------
  |  Branch (781:13): [True: 2, False: 0]
  ------------------
  782|      2|    if (libxml_is_threaded == 0)
  ------------------
  |  Branch (782:9): [True: 0, False: 2]
  ------------------
  783|      0|        return;
  784|      2|#endif /* XML_PTHREAD_WEAK */
  785|      2|    pthread_key_create(&globalkey, xmlFreeGlobalState);
  786|      2|    mainthread = pthread_self();
  787|       |#elif defined(HAVE_WIN32_THREADS)
  788|       |#if !defined(HAVE_COMPILER_TLS)
  789|       |#if !defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)
  790|       |    InitializeCriticalSection(&cleanup_helpers_cs);
  791|       |#endif
  792|       |    globalkey = TlsAlloc();
  793|       |#endif
  794|       |    mainthread = GetCurrentThreadId();
  795|       |#endif
  796|      2|}

xmlParseURI:
  948|  15.8k|xmlParseURI(const char *str) {
  949|  15.8k|    xmlURIPtr uri;
  950|  15.8k|    int ret;
  951|       |
  952|  15.8k|    if (str == NULL)
  ------------------
  |  Branch (952:9): [True: 9, False: 15.8k]
  ------------------
  953|      9|	return(NULL);
  954|  15.8k|    uri = xmlCreateURI();
  955|  15.8k|    if (uri != NULL) {
  ------------------
  |  Branch (955:9): [True: 12.7k, False: 3.03k]
  ------------------
  956|  12.7k|	ret = xmlParse3986URIReference(uri, str);
  957|  12.7k|        if (ret) {
  ------------------
  |  Branch (957:13): [True: 6.31k, False: 6.48k]
  ------------------
  958|  6.31k|	    xmlFreeURI(uri);
  959|  6.31k|	    return(NULL);
  960|  6.31k|	}
  961|  12.7k|    }
  962|  9.51k|    return(uri);
  963|  15.8k|}
xmlParseURIReference:
  978|  11.6k|xmlParseURIReference(xmlURIPtr uri, const char *str) {
  979|  11.6k|    return(xmlParse3986URIReference(uri, str));
  980|  11.6k|}
xmlParseURIRaw:
  994|  4.28k|xmlParseURIRaw(const char *str, int raw) {
  995|  4.28k|    xmlURIPtr uri;
  996|  4.28k|    int ret;
  997|       |
  998|  4.28k|    if (str == NULL)
  ------------------
  |  Branch (998:9): [True: 9, False: 4.27k]
  ------------------
  999|      9|	return(NULL);
 1000|  4.27k|    uri = xmlCreateURI();
 1001|  4.27k|    if (uri != NULL) {
  ------------------
  |  Branch (1001:9): [True: 4.00k, False: 277]
  ------------------
 1002|  4.00k|        if (raw) {
  ------------------
  |  Branch (1002:13): [True: 4.00k, False: 0]
  ------------------
 1003|  4.00k|	    uri->cleanup |= 2;
 1004|  4.00k|	}
 1005|  4.00k|	ret = xmlParseURIReference(uri, str);
 1006|  4.00k|        if (ret) {
  ------------------
  |  Branch (1006:13): [True: 1.68k, False: 2.31k]
  ------------------
 1007|  1.68k|	    xmlFreeURI(uri);
 1008|  1.68k|	    return(NULL);
 1009|  1.68k|	}
 1010|  4.00k|    }
 1011|  2.59k|    return(uri);
 1012|  4.27k|}
xmlCreateURI:
 1028|  29.2k|xmlCreateURI(void) {
 1029|  29.2k|    xmlURIPtr ret;
 1030|       |
 1031|  29.2k|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1032|  29.2k|    if (ret == NULL) {
  ------------------
  |  Branch (1032:9): [True: 3.93k, False: 25.3k]
  ------------------
 1033|  3.93k|        xmlURIErrMemory("creating URI structure\n");
 1034|  3.93k|	return(NULL);
 1035|  3.93k|    }
 1036|  25.3k|    memset(ret, 0, sizeof(xmlURI));
 1037|  25.3k|    ret->port = PORT_EMPTY;
  ------------------
  |  |   38|  25.3k|#define PORT_EMPTY           0
  ------------------
 1038|  25.3k|    return(ret);
 1039|  29.2k|}
xmlSaveUri:
 1075|  10.8k|xmlSaveUri(xmlURIPtr uri) {
 1076|  10.8k|    xmlChar *ret = NULL;
 1077|  10.8k|    xmlChar *temp;
 1078|  10.8k|    const char *p;
 1079|  10.8k|    int len;
 1080|  10.8k|    int max;
 1081|       |
 1082|  10.8k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1082:9): [True: 3.74k, False: 7.14k]
  ------------------
 1083|       |
 1084|       |
 1085|  7.14k|    max = 80;
 1086|  7.14k|    ret = (xmlChar *) xmlMallocAtomic(max + 1);
 1087|  7.14k|    if (ret == NULL) {
  ------------------
  |  Branch (1087:9): [True: 273, False: 6.87k]
  ------------------
 1088|    273|        xmlURIErrMemory("saving URI\n");
 1089|    273|	return(NULL);
 1090|    273|    }
 1091|  6.87k|    len = 0;
 1092|       |
 1093|  6.87k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1093:9): [True: 971, False: 5.90k]
  ------------------
 1094|    971|	p = uri->scheme;
 1095|   131k|	while (*p != 0) {
  ------------------
  |  Branch (1095:9): [True: 130k, False: 970]
  ------------------
 1096|   130k|	    if (len >= max) {
  ------------------
  |  Branch (1096:10): [True: 282, False: 129k]
  ------------------
 1097|    282|                temp = xmlSaveUriRealloc(ret, &max);
 1098|    282|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1098:21): [True: 1, False: 281]
  ------------------
 1099|    281|		ret = temp;
 1100|    281|	    }
 1101|   130k|	    ret[len++] = *p++;
 1102|   130k|	}
 1103|    970|	if (len >= max) {
  ------------------
  |  Branch (1103:6): [True: 7, False: 963]
  ------------------
 1104|      7|            temp = xmlSaveUriRealloc(ret, &max);
 1105|      7|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1105:17): [True: 1, False: 6]
  ------------------
 1106|      6|            ret = temp;
 1107|      6|	}
 1108|    969|	ret[len++] = ':';
 1109|    969|    }
 1110|  6.87k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1110:9): [True: 0, False: 6.87k]
  ------------------
 1111|      0|	p = uri->opaque;
 1112|      0|	while (*p != 0) {
  ------------------
  |  Branch (1112:9): [True: 0, False: 0]
  ------------------
 1113|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1113:10): [True: 0, False: 0]
  ------------------
 1114|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1115|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1115:21): [True: 0, False: 0]
  ------------------
 1116|      0|                ret = temp;
 1117|      0|	    }
 1118|      0|	    if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p)))
  ------------------
  |  |  117|      0|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (117:25): [True: 0, False: 0]
  |  |  |  Branch (117:41): [True: 0, False: 0]
  |  |  |  Branch (117:57): [True: 0, False: 0]
  |  |  ------------------
  |  |  118|      0|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 0]
  |  |  |  Branch (118:25): [True: 0, False: 0]
  |  |  |  Branch (118:41): [True: 0, False: 0]
  |  |  |  Branch (118:57): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (119:9): [True: 0, False: 0]
  |  |  |  Branch (119:25): [True: 0, False: 0]
  |  |  |  Branch (119:41): [True: 0, False: 0]
  |  |  |  Branch (119:57): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (120:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
              	    if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p)))
  ------------------
  |  |  126|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   94|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (73:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   80|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (80:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (80:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (88:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (88:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |  100|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (100:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (100:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (100:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  102|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (102:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1119|      0|		ret[len++] = *p++;
 1120|      0|	    else {
 1121|      0|		int val = *(unsigned char *)p++;
 1122|      0|		int hi = val / 0x10, lo = val % 0x10;
 1123|      0|		ret[len++] = '%';
 1124|      0|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1124:22): [True: 0, False: 0]
  ------------------
 1125|      0|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1125:22): [True: 0, False: 0]
  ------------------
 1126|      0|	    }
 1127|      0|	}
 1128|  6.87k|    } else {
 1129|  6.87k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   38|  5.78k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1129:6): [True: 1.08k, False: 5.78k]
  |  Branch (1129:31): [True: 457, False: 5.32k]
  ------------------
 1130|  1.54k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1130:10): [True: 7, False: 1.53k]
  ------------------
 1131|      7|                temp = xmlSaveUriRealloc(ret, &max);
 1132|      7|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1132:21): [True: 1, False: 6]
  ------------------
 1133|      6|                ret = temp;
 1134|      6|	    }
 1135|  1.54k|	    ret[len++] = '/';
 1136|  1.54k|	    ret[len++] = '/';
 1137|  1.54k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1137:10): [True: 783, False: 760]
  ------------------
 1138|    783|		p = uri->user;
 1139|   168k|		while (*p != 0) {
  ------------------
  |  Branch (1139:10): [True: 167k, False: 781]
  ------------------
 1140|   167k|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1140:11): [True: 519, False: 166k]
  ------------------
 1141|    519|                        temp = xmlSaveUriRealloc(ret, &max);
 1142|    519|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1142:29): [True: 2, False: 517]
  ------------------
 1143|    517|                        ret = temp;
 1144|    517|		    }
 1145|   167k|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  126|   167k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   94|   334k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   334k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|   334k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:25): [True: 1.59k, False: 165k]
  |  |  |  |  |  |  |  |  |  Branch (73:41): [True: 854, False: 742]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   80|   166k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (80:24): [True: 3.16k, False: 163k]
  |  |  |  |  |  |  |  |  |  Branch (80:40): [True: 1.19k, False: 1.96k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|   165k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (88:22): [True: 4.77k, False: 160k]
  |  |  |  |  |  |  |  Branch (88:38): [True: 419, False: 4.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |  100|   164k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (100:21): [True: 217, False: 164k]
  |  |  |  |  |  Branch (100:37): [True: 210, False: 164k]
  |  |  |  |  |  Branch (100:53): [True: 425, False: 164k]
  |  |  |  |  ------------------
  |  |  |  |  101|   164k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:5): [True: 254, False: 163k]
  |  |  |  |  |  Branch (101:21): [True: 330, False: 163k]
  |  |  |  |  |  Branch (101:37): [True: 219, False: 163k]
  |  |  |  |  |  Branch (101:53): [True: 253, False: 163k]
  |  |  |  |  ------------------
  |  |  |  |  102|   164k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:5): [True: 1.30k, False: 161k]
  |  |  |  |  |  Branch (102:21): [True: 232, False: 161k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1146|   167k|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1146:4): [True: 243, False: 161k]
  |  Branch (1146:23): [True: 899, False: 160k]
  ------------------
 1147|   167k|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1147:4): [True: 210, False: 160k]
  |  Branch (1147:23): [True: 214, False: 159k]
  ------------------
 1148|   167k|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1148:4): [True: 238, False: 159k]
  |  Branch (1148:23): [True: 218, False: 159k]
  ------------------
 1149|   167k|			((*(p) == ',')))
  ------------------
  |  Branch (1149:4): [True: 377, False: 159k]
  ------------------
 1150|  8.31k|			ret[len++] = *p++;
 1151|   159k|		    else {
 1152|   159k|			int val = *(unsigned char *)p++;
 1153|   159k|			int hi = val / 0x10, lo = val % 0x10;
 1154|   159k|			ret[len++] = '%';
 1155|   159k|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1155:23): [True: 129k, False: 29.2k]
  ------------------
 1156|   159k|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1156:23): [True: 113k, False: 46.1k]
  ------------------
 1157|   159k|		    }
 1158|   167k|		}
 1159|    781|		if (len + 3 >= max) {
  ------------------
  |  Branch (1159:7): [True: 7, False: 774]
  ------------------
 1160|      7|                    temp = xmlSaveUriRealloc(ret, &max);
 1161|      7|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1161:25): [True: 1, False: 6]
  ------------------
 1162|      6|                    ret = temp;
 1163|      6|		}
 1164|    780|		ret[len++] = '@';
 1165|    780|	    }
 1166|  1.54k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1166:10): [True: 1.08k, False: 456]
  ------------------
 1167|  1.08k|		p = uri->server;
 1168|   308k|		while (*p != 0) {
  ------------------
  |  Branch (1168:10): [True: 307k, False: 1.08k]
  ------------------
 1169|   307k|		    if (len >= max) {
  ------------------
  |  Branch (1169:11): [True: 416, False: 306k]
  ------------------
 1170|    416|			temp = xmlSaveUriRealloc(ret, &max);
 1171|    416|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1171:8): [True: 1, False: 415]
  ------------------
 1172|    415|			ret = temp;
 1173|    415|		    }
 1174|       |                    /* TODO: escaping? */
 1175|   307k|		    ret[len++] = (xmlChar) *p++;
 1176|   307k|		}
 1177|  1.08k|	    }
 1178|  1.53k|            if (uri->port > 0) {
  ------------------
  |  Branch (1178:17): [True: 408, False: 1.13k]
  ------------------
 1179|    408|                if (len + 10 >= max) {
  ------------------
  |  Branch (1179:21): [True: 7, False: 401]
  ------------------
 1180|      7|                    temp = xmlSaveUriRealloc(ret, &max);
 1181|      7|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1181:25): [True: 1, False: 6]
  ------------------
 1182|      6|                    ret = temp;
 1183|      6|                }
 1184|    407|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1185|    407|            }
 1186|  5.32k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1186:13): [True: 0, False: 5.32k]
  ------------------
 1187|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1187:10): [True: 0, False: 0]
  ------------------
 1188|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1189|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1189:21): [True: 0, False: 0]
  ------------------
 1190|      0|                ret = temp;
 1191|      0|	    }
 1192|      0|	    ret[len++] = '/';
 1193|      0|	    ret[len++] = '/';
 1194|      0|	    p = uri->authority;
 1195|      0|	    while (*p != 0) {
  ------------------
  |  Branch (1195:13): [True: 0, False: 0]
  ------------------
 1196|      0|		if (len + 3 >= max) {
  ------------------
  |  Branch (1196:7): [True: 0, False: 0]
  ------------------
 1197|      0|                    temp = xmlSaveUriRealloc(ret, &max);
 1198|      0|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1198:25): [True: 0, False: 0]
  ------------------
 1199|      0|                    ret = temp;
 1200|      0|		}
 1201|      0|		if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  126|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   94|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (73:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   80|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (80:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (80:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (88:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (88:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |  100|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (100:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (100:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (100:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  102|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (102:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1202|      0|                    ((*(p) == '$')) || ((*(p) == ',')) || ((*(p) == ';')) ||
  ------------------
  |  Branch (1202:21): [True: 0, False: 0]
  |  Branch (1202:40): [True: 0, False: 0]
  |  Branch (1202:59): [True: 0, False: 0]
  ------------------
 1203|      0|                    ((*(p) == ':')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1203:21): [True: 0, False: 0]
  |  Branch (1203:40): [True: 0, False: 0]
  |  Branch (1203:59): [True: 0, False: 0]
  ------------------
 1204|      0|                    ((*(p) == '=')) || ((*(p) == '+')))
  ------------------
  |  Branch (1204:21): [True: 0, False: 0]
  |  Branch (1204:40): [True: 0, False: 0]
  ------------------
 1205|      0|		    ret[len++] = *p++;
 1206|      0|		else {
 1207|      0|		    int val = *(unsigned char *)p++;
 1208|      0|		    int hi = val / 0x10, lo = val % 0x10;
 1209|      0|		    ret[len++] = '%';
 1210|      0|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1210:26): [True: 0, False: 0]
  ------------------
 1211|      0|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1211:26): [True: 0, False: 0]
  ------------------
 1212|      0|		}
 1213|      0|	    }
 1214|  5.32k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1214:13): [True: 674, False: 4.65k]
  ------------------
 1215|    674|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1215:10): [True: 11, False: 663]
  ------------------
 1216|     11|                temp = xmlSaveUriRealloc(ret, &max);
 1217|     11|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1217:21): [True: 1, False: 10]
  ------------------
 1218|     10|                ret = temp;
 1219|     10|	    }
 1220|    674|	}
 1221|  6.86k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1221:6): [True: 3.98k, False: 2.87k]
  ------------------
 1222|  3.98k|	    p = uri->path;
 1223|       |	    /*
 1224|       |	     * the colon in file:///d: should not be escaped or
 1225|       |	     * Windows accesses fail later.
 1226|       |	     */
 1227|  3.98k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1227:10): [True: 320, False: 3.66k]
  ------------------
 1228|  3.98k|		(p[0] == '/') &&
  ------------------
  |  Branch (1228:3): [True: 137, False: 183]
  ------------------
 1229|  3.98k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1229:5): [True: 91, False: 46]
  |  Branch (1229:22): [True: 84, False: 7]
  ------------------
 1230|    137|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1230:5): [True: 22, False: 31]
  |  Branch (1230:22): [True: 15, False: 7]
  ------------------
 1231|  3.98k|		(p[2] == ':') &&
  ------------------
  |  Branch (1231:3): [True: 62, False: 37]
  ------------------
 1232|  3.98k|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   35|     62|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   35|     62|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1232:10): [True: 32, False: 30]
  ------------------
 1233|     32|		if (len + 3 >= max) {
  ------------------
  |  Branch (1233:7): [True: 7, False: 25]
  ------------------
 1234|      7|                    temp = xmlSaveUriRealloc(ret, &max);
 1235|      7|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1235:25): [True: 1, False: 6]
  ------------------
 1236|      6|                    ret = temp;
 1237|      6|		}
 1238|     31|		ret[len++] = *p++;
 1239|     31|		ret[len++] = *p++;
 1240|     31|		ret[len++] = *p++;
 1241|     31|	    }
 1242|   517k|	    while (*p != 0) {
  ------------------
  |  Branch (1242:13): [True: 513k, False: 3.98k]
  ------------------
 1243|   513k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1243:7): [True: 1.05k, False: 512k]
  ------------------
 1244|  1.05k|                    temp = xmlSaveUriRealloc(ret, &max);
 1245|  1.05k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1245:25): [True: 1, False: 1.05k]
  ------------------
 1246|  1.05k|                    ret = temp;
 1247|  1.05k|		}
 1248|   513k|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  126|   513k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   94|  1.02M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  1.02M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  1.02M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:25): [True: 30.2k, False: 483k]
  |  |  |  |  |  |  |  |  |  Branch (73:41): [True: 26.1k, False: 4.09k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   80|   487k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (80:24): [True: 174k, False: 313k]
  |  |  |  |  |  |  |  |  |  Branch (80:40): [True: 163k, False: 10.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|   324k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (88:22): [True: 61.4k, False: 263k]
  |  |  |  |  |  |  |  Branch (88:38): [True: 39.6k, False: 21.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |  100|   284k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (100:21): [True: 4.20k, False: 280k]
  |  |  |  |  |  Branch (100:37): [True: 452, False: 280k]
  |  |  |  |  |  Branch (100:53): [True: 21.3k, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  101|   284k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:5): [True: 577, False: 258k]
  |  |  |  |  |  Branch (101:21): [True: 2.65k, False: 255k]
  |  |  |  |  |  Branch (101:37): [True: 1.10k, False: 254k]
  |  |  |  |  |  Branch (101:53): [True: 1.48k, False: 253k]
  |  |  |  |  ------------------
  |  |  |  |  102|   284k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:5): [True: 1.01k, False: 252k]
  |  |  |  |  |  Branch (102:21): [True: 876, False: 251k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1248:32): [True: 111k, False: 139k]
  ------------------
 1249|   513k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1249:21): [True: 959, False: 138k]
  |  Branch (1249:40): [True: 840, False: 137k]
  |  Branch (1249:59): [True: 559, False: 137k]
  ------------------
 1250|   513k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1250:14): [True: 520, False: 136k]
  |  Branch (1250:33): [True: 1.23k, False: 135k]
  |  Branch (1250:52): [True: 456, False: 135k]
  ------------------
 1251|   513k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1251:14): [True: 611, False: 134k]
  ------------------
 1252|   379k|		    ret[len++] = *p++;
 1253|   134k|		else {
 1254|   134k|		    int val = *(unsigned char *)p++;
 1255|   134k|		    int hi = val / 0x10, lo = val % 0x10;
 1256|   134k|		    ret[len++] = '%';
 1257|   134k|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1257:26): [True: 25.1k, False: 109k]
  ------------------
 1258|   134k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1258:26): [True: 41.6k, False: 92.8k]
  ------------------
 1259|   134k|		}
 1260|   513k|	    }
 1261|  3.98k|	}
 1262|  6.86k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1262:6): [True: 589, False: 6.27k]
  ------------------
 1263|    589|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1263:10): [True: 8, False: 581]
  ------------------
 1264|      8|                temp = xmlSaveUriRealloc(ret, &max);
 1265|      8|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1265:21): [True: 1, False: 7]
  ------------------
 1266|      7|                ret = temp;
 1267|      7|	    }
 1268|    588|	    ret[len++] = '?';
 1269|    588|	    p = uri->query_raw;
 1270|  19.5k|	    while (*p != 0) {
  ------------------
  |  Branch (1270:13): [True: 18.9k, False: 587]
  ------------------
 1271|  18.9k|		if (len + 1 >= max) {
  ------------------
  |  Branch (1271:7): [True: 53, False: 18.9k]
  ------------------
 1272|     53|                    temp = xmlSaveUriRealloc(ret, &max);
 1273|     53|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1273:25): [True: 1, False: 52]
  ------------------
 1274|     52|                    ret = temp;
 1275|     52|		}
 1276|  18.9k|		ret[len++] = *p++;
 1277|  18.9k|	    }
 1278|  6.27k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1278:13): [True: 0, False: 6.27k]
  ------------------
 1279|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1279:10): [True: 0, False: 0]
  ------------------
 1280|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1281|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1281:21): [True: 0, False: 0]
  ------------------
 1282|      0|                ret = temp;
 1283|      0|	    }
 1284|      0|	    ret[len++] = '?';
 1285|      0|	    p = uri->query;
 1286|      0|	    while (*p != 0) {
  ------------------
  |  Branch (1286:13): [True: 0, False: 0]
  ------------------
 1287|      0|		if (len + 3 >= max) {
  ------------------
  |  Branch (1287:7): [True: 0, False: 0]
  ------------------
 1288|      0|                    temp = xmlSaveUriRealloc(ret, &max);
 1289|      0|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1289:25): [True: 0, False: 0]
  ------------------
 1290|      0|                    ret = temp;
 1291|      0|		}
 1292|      0|		if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  126|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   94|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (73:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   80|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (80:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (80:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (88:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (88:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |  100|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (100:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (100:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (100:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (101:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  102|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (102:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  117|      0|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (117:25): [True: 0, False: 0]
  |  |  |  Branch (117:41): [True: 0, False: 0]
  |  |  |  Branch (117:57): [True: 0, False: 0]
  |  |  ------------------
  |  |  118|      0|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 0]
  |  |  |  Branch (118:25): [True: 0, False: 0]
  |  |  |  Branch (118:41): [True: 0, False: 0]
  |  |  |  Branch (118:57): [True: 0, False: 0]
  |  |  ------------------
  |  |  119|      0|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (119:9): [True: 0, False: 0]
  |  |  |  Branch (119:25): [True: 0, False: 0]
  |  |  |  Branch (119:41): [True: 0, False: 0]
  |  |  |  Branch (119:57): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (120:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1293|      0|		    ret[len++] = *p++;
 1294|      0|		else {
 1295|      0|		    int val = *(unsigned char *)p++;
 1296|      0|		    int hi = val / 0x10, lo = val % 0x10;
 1297|      0|		    ret[len++] = '%';
 1298|      0|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1298:26): [True: 0, False: 0]
  ------------------
 1299|      0|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1299:26): [True: 0, False: 0]
  ------------------
 1300|      0|		}
 1301|      0|	    }
 1302|      0|	}
 1303|  6.86k|    }
 1304|  6.85k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1304:9): [True: 860, False: 5.99k]
  ------------------
 1305|    860|	if (len + 3 >= max) {
  ------------------
  |  Branch (1305:6): [True: 9, False: 851]
  ------------------
 1306|      9|            temp = xmlSaveUriRealloc(ret, &max);
 1307|      9|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1307:17): [True: 2, False: 7]
  ------------------
 1308|      7|            ret = temp;
 1309|      7|	}
 1310|    858|	ret[len++] = '#';
 1311|    858|	p = uri->fragment;
 1312|  16.0k|	while (*p != 0) {
  ------------------
  |  Branch (1312:9): [True: 15.1k, False: 857]
  ------------------
 1313|  15.1k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1313:10): [True: 54, False: 15.0k]
  ------------------
 1314|     54|                temp = xmlSaveUriRealloc(ret, &max);
 1315|     54|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1315:21): [True: 1, False: 53]
  ------------------
 1316|     53|                ret = temp;
 1317|     53|	    }
 1318|  15.1k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  126|  15.1k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   94|  30.2k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  30.2k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  30.2k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:25): [True: 1.27k, False: 13.8k]
  |  |  |  |  |  |  |  |  |  Branch (73:41): [True: 1.03k, False: 243]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   80|  14.1k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (80:24): [True: 1.22k, False: 12.8k]
  |  |  |  |  |  |  |  |  |  Branch (80:40): [True: 357, False: 863]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|  13.7k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (88:22): [True: 2.70k, False: 11.0k]
  |  |  |  |  |  |  |  Branch (88:38): [True: 359, False: 2.34k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |  100|  13.3k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (100:21): [True: 219, False: 13.1k]
  |  |  |  |  |  Branch (100:37): [True: 199, False: 12.9k]
  |  |  |  |  |  Branch (100:53): [True: 249, False: 12.7k]
  |  |  |  |  ------------------
  |  |  |  |  101|  13.3k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:5): [True: 198, False: 12.5k]
  |  |  |  |  |  Branch (101:21): [True: 228, False: 12.3k]
  |  |  |  |  |  Branch (101:37): [True: 209, False: 12.0k]
  |  |  |  |  |  Branch (101:53): [True: 244, False: 11.8k]
  |  |  |  |  ------------------
  |  |  |  |  102|  13.3k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:5): [True: 293, False: 11.5k]
  |  |  |  |  |  Branch (102:21): [True: 216, False: 11.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  117|  11.3k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (117:25): [True: 228, False: 11.1k]
  |  |  |  Branch (117:41): [True: 8.13k, False: 2.97k]
  |  |  |  Branch (117:57): [True: 374, False: 2.60k]
  |  |  ------------------
  |  |  118|  11.3k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 404, False: 2.20k]
  |  |  |  Branch (118:25): [True: 206, False: 1.99k]
  |  |  |  Branch (118:41): [True: 202, False: 1.79k]
  |  |  |  Branch (118:57): [True: 269, False: 1.52k]
  |  |  ------------------
  |  |  119|  11.3k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (119:9): [True: 315, False: 1.20k]
  |  |  |  Branch (119:25): [True: 211, False: 998]
  |  |  |  Branch (119:41): [True: 288, False: 710]
  |  |  |  Branch (119:57): [True: 209, False: 501]
  |  |  ------------------
  |  |  120|  11.3k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (120:9): [True: 211, False: 290]
  |  |  ------------------
  ------------------
 1319|  14.8k|		ret[len++] = *p++;
 1320|    290|	    else {
 1321|    290|		int val = *(unsigned char *)p++;
 1322|    290|		int hi = val / 0x10, lo = val % 0x10;
 1323|    290|		ret[len++] = '%';
 1324|    290|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1324:22): [True: 98, False: 192]
  ------------------
 1325|    290|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1325:22): [True: 93, False: 197]
  ------------------
 1326|    290|	    }
 1327|  15.1k|	}
 1328|    858|    }
 1329|  6.85k|    if (len >= max) {
  ------------------
  |  Branch (1329:9): [True: 7, False: 6.84k]
  ------------------
 1330|      7|        temp = xmlSaveUriRealloc(ret, &max);
 1331|      7|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1331:13): [True: 1, False: 6]
  ------------------
 1332|      6|        ret = temp;
 1333|      6|    }
 1334|  6.85k|    ret[len] = 0;
 1335|  6.85k|    return(ret);
 1336|       |
 1337|     17|mem_error:
 1338|     17|    xmlFree(ret);
 1339|     17|    return(NULL);
 1340|  6.85k|}
xmlFreeURI:
 1397|  29.1k|xmlFreeURI(xmlURIPtr uri) {
 1398|  29.1k|    if (uri == NULL) return;
  ------------------
  |  Branch (1398:9): [True: 3.74k, False: 25.3k]
  ------------------
 1399|       |
 1400|  25.3k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1400:9): [True: 3.27k, False: 22.0k]
  ------------------
 1401|  25.3k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1401:9): [True: 2.50k, False: 22.8k]
  ------------------
 1402|  25.3k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1402:9): [True: 1.73k, False: 23.6k]
  ------------------
 1403|  25.3k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1403:9): [True: 7.39k, False: 17.9k]
  ------------------
 1404|  25.3k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1404:9): [True: 2.11k, False: 23.2k]
  ------------------
 1405|  25.3k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1405:9): [True: 0, False: 25.3k]
  ------------------
 1406|  25.3k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1406:9): [True: 0, False: 25.3k]
  ------------------
 1407|  25.3k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1407:9): [True: 1.39k, False: 23.9k]
  ------------------
 1408|  25.3k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1408:9): [True: 1.40k, False: 23.9k]
  ------------------
 1409|  25.3k|    xmlFree(uri);
 1410|  25.3k|}
xmlNormalizeURIPath:
 1430|  4.71k|xmlNormalizeURIPath(char *path) {
 1431|  4.71k|    char *cur, *out;
 1432|       |
 1433|  4.71k|    if (path == NULL)
  ------------------
  |  Branch (1433:9): [True: 1.27k, False: 3.43k]
  ------------------
 1434|  1.27k|	return(-1);
 1435|       |
 1436|       |    /* Skip all initial "/" chars.  We want to get to the beginning of the
 1437|       |     * first non-empty segment.
 1438|       |     */
 1439|  3.43k|    cur = path;
 1440|  8.24k|    while (cur[0] == '/')
  ------------------
  |  Branch (1440:12): [True: 4.80k, False: 3.43k]
  ------------------
 1441|  4.80k|      ++cur;
 1442|  3.43k|    if (cur[0] == '\0')
  ------------------
  |  Branch (1442:9): [True: 88, False: 3.34k]
  ------------------
 1443|     88|      return(0);
 1444|       |
 1445|       |    /* Keep everything we've seen so far.  */
 1446|  3.34k|    out = cur;
 1447|       |
 1448|       |    /*
 1449|       |     * Analyze each segment in sequence for cases (c) and (d).
 1450|       |     */
 1451|  21.3k|    while (cur[0] != '\0') {
  ------------------
  |  Branch (1451:12): [True: 20.9k, False: 400]
  ------------------
 1452|       |	/*
 1453|       |	 * c) All occurrences of "./", where "." is a complete path segment,
 1454|       |	 *    are removed from the buffer string.
 1455|       |	 */
 1456|  20.9k|	if ((cur[0] == '.') && (cur[1] == '/')) {
  ------------------
  |  Branch (1456:6): [True: 12.0k, False: 8.92k]
  |  Branch (1456:25): [True: 1.20k, False: 10.8k]
  ------------------
 1457|  1.20k|	    cur += 2;
 1458|       |	    /* '//' normalization should be done at this point too */
 1459|  9.00k|	    while (cur[0] == '/')
  ------------------
  |  Branch (1459:13): [True: 7.79k, False: 1.20k]
  ------------------
 1460|  7.79k|		cur++;
 1461|  1.20k|	    continue;
 1462|  1.20k|	}
 1463|       |
 1464|       |	/*
 1465|       |	 * d) If the buffer string ends with "." as a complete path segment,
 1466|       |	 *    that "." is removed.
 1467|       |	 */
 1468|  19.7k|	if ((cur[0] == '.') && (cur[1] == '\0'))
  ------------------
  |  Branch (1468:6): [True: 10.8k, False: 8.92k]
  |  Branch (1468:25): [True: 69, False: 10.7k]
  ------------------
 1469|     69|	    break;
 1470|       |
 1471|       |	/* Otherwise keep the segment.  */
 1472|   458k|	while (cur[0] != '/') {
  ------------------
  |  Branch (1472:9): [True: 441k, False: 16.7k]
  ------------------
 1473|   441k|            if (cur[0] == '\0')
  ------------------
  |  Branch (1473:17): [True: 2.88k, False: 438k]
  ------------------
 1474|  2.88k|              goto done_cd;
 1475|   438k|	    (out++)[0] = (cur++)[0];
 1476|   438k|	}
 1477|       |	/* normalize // */
 1478|   103k|	while ((cur[0] == '/') && (cur[1] == '/'))
  ------------------
  |  Branch (1478:9): [True: 103k, False: 0]
  |  Branch (1478:28): [True: 87.1k, False: 16.7k]
  ------------------
 1479|  87.1k|	    cur++;
 1480|       |
 1481|  16.7k|        (out++)[0] = (cur++)[0];
 1482|  16.7k|    }
 1483|  3.34k| done_cd:
 1484|  3.34k|    out[0] = '\0';
 1485|       |
 1486|       |    /* Reset to the beginning of the first segment for the next sequence.  */
 1487|  3.34k|    cur = path;
 1488|  8.03k|    while (cur[0] == '/')
  ------------------
  |  Branch (1488:12): [True: 4.68k, False: 3.34k]
  ------------------
 1489|  4.68k|      ++cur;
 1490|  3.34k|    if (cur[0] == '\0')
  ------------------
  |  Branch (1490:9): [True: 59, False: 3.29k]
  ------------------
 1491|     59|	return(0);
 1492|       |
 1493|       |    /*
 1494|       |     * Analyze each segment in sequence for cases (e) and (f).
 1495|       |     *
 1496|       |     * e) All occurrences of "<segment>/../", where <segment> is a
 1497|       |     *    complete path segment not equal to "..", are removed from the
 1498|       |     *    buffer string.  Removal of these path segments is performed
 1499|       |     *    iteratively, removing the leftmost matching pattern on each
 1500|       |     *    iteration, until no matching pattern remains.
 1501|       |     *
 1502|       |     * f) If the buffer string ends with "<segment>/..", where <segment>
 1503|       |     *    is a complete path segment not equal to "..", that
 1504|       |     *    "<segment>/.." is removed.
 1505|       |     *
 1506|       |     * To satisfy the "iterative" clause in (e), we need to collapse the
 1507|       |     * string every time we find something that needs to be removed.  Thus,
 1508|       |     * we don't need to keep two pointers into the string: we only need a
 1509|       |     * "current position" pointer.
 1510|       |     */
 1511|  19.7k|    while (1) {
  ------------------
  |  Branch (1511:12): [Folded - Ignored]
  ------------------
 1512|  19.7k|        char *segp, *tmp;
 1513|       |
 1514|       |        /* At the beginning of each iteration of this loop, "cur" points to
 1515|       |         * the first character of the segment we want to examine.
 1516|       |         */
 1517|       |
 1518|       |        /* Find the end of the current segment.  */
 1519|  19.7k|        segp = cur;
 1520|   459k|        while ((segp[0] != '/') && (segp[0] != '\0'))
  ------------------
  |  Branch (1520:16): [True: 442k, False: 16.4k]
  |  Branch (1520:36): [True: 439k, False: 3.28k]
  ------------------
 1521|   439k|          ++segp;
 1522|       |
 1523|       |        /* If this is the last segment, we're done (we need at least two
 1524|       |         * segments to meet the criteria for the (e) and (f) cases).
 1525|       |         */
 1526|  19.7k|        if (segp[0] == '\0')
  ------------------
  |  Branch (1526:13): [True: 3.28k, False: 16.4k]
  ------------------
 1527|  3.28k|          break;
 1528|       |
 1529|       |        /* If the first segment is "..", or if the next segment _isn't_ "..",
 1530|       |         * keep this segment and try the next one.
 1531|       |         */
 1532|  16.4k|        ++segp;
 1533|  16.4k|        if (((cur[0] == '.') && (cur[1] == '.') && (segp == cur+3))
  ------------------
  |  Branch (1533:14): [True: 8.64k, False: 7.83k]
  |  Branch (1533:33): [True: 1.81k, False: 6.83k]
  |  Branch (1533:52): [True: 553, False: 1.26k]
  ------------------
 1534|  16.4k|            || ((segp[0] != '.') || (segp[1] != '.')
  ------------------
  |  Branch (1534:17): [True: 5.71k, False: 10.2k]
  |  Branch (1534:37): [True: 6.74k, False: 3.47k]
  ------------------
 1535|  15.9k|                || ((segp[2] != '/') && (segp[2] != '\0')))) {
  ------------------
  |  Branch (1535:21): [True: 934, False: 2.54k]
  |  Branch (1535:41): [True: 929, False: 5]
  ------------------
 1536|  13.9k|          cur = segp;
 1537|  13.9k|          continue;
 1538|  13.9k|        }
 1539|       |
 1540|       |        /* If we get here, remove this segment and the next one and back up
 1541|       |         * to the previous segment (if there is one), to implement the
 1542|       |         * "iteratively" clause.  It's pretty much impossible to back up
 1543|       |         * while maintaining two pointers into the buffer, so just compact
 1544|       |         * the whole buffer now.
 1545|       |         */
 1546|       |
 1547|       |        /* If this is the end of the buffer, we're done.  */
 1548|  2.54k|        if (segp[2] == '\0') {
  ------------------
  |  Branch (1548:13): [True: 5, False: 2.54k]
  ------------------
 1549|      5|          cur[0] = '\0';
 1550|      5|          break;
 1551|      5|        }
 1552|       |        /* Valgrind complained, strcpy(cur, segp + 3); */
 1553|       |        /* string will overlap, do not use strcpy */
 1554|  2.54k|        tmp = cur;
 1555|  2.54k|        segp += 3;
 1556|  2.70M|        while ((*tmp++ = *segp++) != 0)
  ------------------
  |  Branch (1556:16): [True: 2.70M, False: 2.54k]
  ------------------
 1557|  2.70M|          ;
 1558|       |
 1559|       |        /* If there are no previous segments, then keep going from here.  */
 1560|  2.54k|        segp = cur;
 1561|  5.01k|        while ((segp > path) && ((--segp)[0] == '/'))
  ------------------
  |  Branch (1561:16): [True: 4.74k, False: 267]
  |  Branch (1561:33): [True: 2.46k, False: 2.27k]
  ------------------
 1562|  2.46k|          ;
 1563|  2.54k|        if (segp == path)
  ------------------
  |  Branch (1563:13): [True: 294, False: 2.24k]
  ------------------
 1564|    294|          continue;
 1565|       |
 1566|       |        /* "segp" is pointing to the end of a previous segment; find it's
 1567|       |         * start.  We need to back up to the previous segment and start
 1568|       |         * over with that to handle things like "foo/bar/../..".  If we
 1569|       |         * don't do this, then on the first pass we'll remove the "bar/..",
 1570|       |         * but be pointing at the second ".." so we won't realize we can also
 1571|       |         * remove the "foo/..".
 1572|       |         */
 1573|  2.24k|        cur = segp;
 1574|  5.50k|        while ((cur > path) && (cur[-1] != '/'))
  ------------------
  |  Branch (1574:16): [True: 5.20k, False: 305]
  |  Branch (1574:32): [True: 3.25k, False: 1.94k]
  ------------------
 1575|  3.25k|          --cur;
 1576|  2.24k|    }
 1577|  3.29k|    out[0] = '\0';
 1578|       |
 1579|       |    /*
 1580|       |     * g) If the resulting buffer string still begins with one or more
 1581|       |     *    complete path segments of "..", then the reference is
 1582|       |     *    considered to be in error. Implementations may handle this
 1583|       |     *    error by retaining these components in the resolved path (i.e.,
 1584|       |     *    treating them as part of the final URI), by removing them from
 1585|       |     *    the resolved path (i.e., discarding relative levels above the
 1586|       |     *    root), or by avoiding traversal of the reference.
 1587|       |     *
 1588|       |     * We discard them from the final path.
 1589|       |     */
 1590|  3.29k|    if (path[0] == '/') {
  ------------------
  |  Branch (1590:9): [True: 775, False: 2.51k]
  ------------------
 1591|    775|      cur = path;
 1592|    989|      while ((cur[0] == '/') && (cur[1] == '.') && (cur[2] == '.')
  ------------------
  |  Branch (1592:14): [True: 984, False: 5]
  |  Branch (1592:33): [True: 235, False: 749]
  |  Branch (1592:52): [True: 218, False: 17]
  ------------------
 1593|    989|             && ((cur[3] == '/') || (cur[3] == '\0')))
  ------------------
  |  Branch (1593:18): [True: 209, False: 9]
  |  Branch (1593:37): [True: 5, False: 4]
  ------------------
 1594|    214|	cur += 3;
 1595|       |
 1596|    775|      if (cur != path) {
  ------------------
  |  Branch (1596:11): [True: 33, False: 742]
  ------------------
 1597|     33|	out = path;
 1598|    259|	while (cur[0] != '\0')
  ------------------
  |  Branch (1598:9): [True: 226, False: 33]
  ------------------
 1599|    226|          (out++)[0] = (cur++)[0];
 1600|     33|	out[0] = 0;
 1601|     33|      }
 1602|    775|    }
 1603|       |
 1604|  3.29k|    return(0);
 1605|  3.34k|}
xmlURIUnescapeString:
 1630|  25.1k|xmlURIUnescapeString(const char *str, int len, char *target) {
 1631|  25.1k|    char *ret, *out;
 1632|  25.1k|    const char *in;
 1633|       |
 1634|  25.1k|    if (str == NULL)
  ------------------
  |  Branch (1634:9): [True: 9, False: 25.1k]
  ------------------
 1635|      9|	return(NULL);
 1636|  25.1k|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1636:9): [True: 7.96k, False: 17.2k]
  ------------------
 1637|  25.1k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1637:9): [True: 0, False: 25.1k]
  ------------------
 1638|       |
 1639|  25.1k|    if (target == NULL) {
  ------------------
  |  Branch (1639:9): [True: 25.1k, False: 0]
  ------------------
 1640|  25.1k|	ret = (char *) xmlMallocAtomic(len + 1);
 1641|  25.1k|	if (ret == NULL) {
  ------------------
  |  Branch (1641:6): [True: 770, False: 24.3k]
  ------------------
 1642|    770|            xmlURIErrMemory("unescaping URI value\n");
 1643|    770|	    return(NULL);
 1644|    770|	}
 1645|  25.1k|    } else
 1646|      0|	ret = target;
 1647|  24.3k|    in = str;
 1648|  24.3k|    out = ret;
 1649|  2.39M|    while(len > 0) {
  ------------------
  |  Branch (1649:11): [True: 2.37M, False: 24.3k]
  ------------------
 1650|  2.37M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1650:6): [True: 2.33M, False: 36.4k]
  |  Branch (1650:19): [True: 182k, False: 2.15M]
  |  Branch (1650:35): [True: 164k, False: 18.1k]
  |  Branch (1650:54): [True: 163k, False: 1.07k]
  ------------------
 1651|   163k|            int c = 0;
 1652|   163k|	    in++;
 1653|   163k|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1653:10): [True: 163k, False: 0]
  |  Branch (1653:26): [True: 34.9k, False: 128k]
  ------------------
 1654|  34.9k|	        c = (*in - '0');
 1655|   128k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1655:15): [True: 3.79k, False: 124k]
  |  Branch (1655:31): [True: 3.79k, False: 0]
  ------------------
 1656|  3.79k|	        c = (*in - 'a') + 10;
 1657|   124k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1657:15): [True: 124k, False: 0]
  |  Branch (1657:31): [True: 124k, False: 0]
  ------------------
 1658|   124k|	        c = (*in - 'A') + 10;
 1659|   163k|	    in++;
 1660|   163k|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1660:10): [True: 163k, False: 0]
  |  Branch (1660:26): [True: 42.1k, False: 121k]
  ------------------
 1661|  42.1k|	        c = c * 16 + (*in - '0');
 1662|   121k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1662:15): [True: 4.91k, False: 116k]
  |  Branch (1662:31): [True: 4.91k, False: 0]
  ------------------
 1663|  4.91k|	        c = c * 16 + (*in - 'a') + 10;
 1664|   116k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1664:15): [True: 116k, False: 0]
  |  Branch (1664:31): [True: 116k, False: 0]
  ------------------
 1665|   116k|	        c = c * 16 + (*in - 'A') + 10;
 1666|   163k|	    in++;
 1667|   163k|	    len -= 3;
 1668|       |            /* Explicit sign change */
 1669|   163k|	    *out++ = (char) c;
 1670|  2.20M|	} else {
 1671|  2.20M|	    *out++ = *in++;
 1672|  2.20M|	    len--;
 1673|  2.20M|	}
 1674|  2.37M|    }
 1675|  24.3k|    *out = 0;
 1676|  24.3k|    return(ret);
 1677|  25.1k|}
xmlURIEscapeStr:
 1690|  7.83k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1691|  7.83k|    xmlChar *ret, ch;
 1692|  7.83k|    xmlChar *temp;
 1693|  7.83k|    const xmlChar *in;
 1694|  7.83k|    int len, out;
 1695|       |
 1696|  7.83k|    if (str == NULL)
  ------------------
  |  Branch (1696:9): [True: 9, False: 7.82k]
  ------------------
 1697|      9|	return(NULL);
 1698|  7.82k|    if (str[0] == 0)
  ------------------
  |  Branch (1698:9): [True: 145, False: 7.67k]
  ------------------
 1699|    145|	return(xmlStrdup(str));
 1700|  7.67k|    len = xmlStrlen(str);
 1701|  7.67k|    if (!(len > 0)) return(NULL);
  ------------------
  |  Branch (1701:9): [True: 0, False: 7.67k]
  ------------------
 1702|       |
 1703|  7.67k|    len += 20;
 1704|  7.67k|    ret = (xmlChar *) xmlMallocAtomic(len);
 1705|  7.67k|    if (ret == NULL) {
  ------------------
  |  Branch (1705:9): [True: 1.35k, False: 6.32k]
  ------------------
 1706|  1.35k|        xmlURIErrMemory("escaping URI value\n");
 1707|  1.35k|	return(NULL);
 1708|  1.35k|    }
 1709|  6.32k|    in = (const xmlChar *) str;
 1710|  6.32k|    out = 0;
 1711|  1.30M|    while(*in != 0) {
  ------------------
  |  Branch (1711:11): [True: 1.30M, False: 6.32k]
  ------------------
 1712|  1.30M|	if (len - out <= 3) {
  ------------------
  |  Branch (1712:6): [True: 1.69k, False: 1.29M]
  ------------------
 1713|  1.69k|            temp = xmlSaveUriRealloc(ret, &len);
 1714|  1.69k|	    if (temp == NULL) {
  ------------------
  |  Branch (1714:10): [True: 4, False: 1.68k]
  ------------------
 1715|      4|                xmlURIErrMemory("escaping URI value\n");
 1716|      4|		xmlFree(ret);
 1717|      4|		return(NULL);
 1718|      4|	    }
 1719|  1.68k|	    ret = temp;
 1720|  1.68k|	}
 1721|       |
 1722|  1.30M|	ch = *in;
 1723|       |
 1724|  1.30M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  126|  1.29M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   94|  2.59M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  2.59M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  2.59M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:25): [True: 754k, False: 544k]
  |  |  |  |  |  |  |  |  |  Branch (73:41): [True: 102k, False: 652k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   80|  1.19M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (80:24): [True: 747k, False: 449k]
  |  |  |  |  |  |  |  |  |  Branch (80:40): [True: 80.2k, False: 666k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|  1.11M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (88:22): [True: 701k, False: 414k]
  |  |  |  |  |  |  |  Branch (88:38): [True: 19.7k, False: 681k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |  100|  1.09M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (100:21): [True: 4.47k, False: 1.09M]
  |  |  |  |  |  Branch (100:37): [True: 951, False: 1.09M]
  |  |  |  |  |  Branch (100:53): [True: 142k, False: 949k]
  |  |  |  |  ------------------
  |  |  |  |  101|  1.09M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:5): [True: 1.29k, False: 947k]
  |  |  |  |  |  Branch (101:21): [True: 2.89k, False: 944k]
  |  |  |  |  |  Branch (101:37): [True: 1.88k, False: 943k]
  |  |  |  |  |  Branch (101:53): [True: 1.93k, False: 941k]
  |  |  |  |  ------------------
  |  |  |  |  102|  1.09M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:5): [True: 2.47k, False: 938k]
  |  |  |  |  |  Branch (102:21): [True: 1.44k, False: 937k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1724:6): [True: 1.29M, False: 2.29k]
  |  Branch (1724:45): [True: 800k, False: 137k]
  ------------------
 1725|   800k|	    unsigned char val;
 1726|   800k|	    ret[out++] = '%';
 1727|   800k|	    val = ch >> 4;
 1728|   800k|	    if (val <= 9)
  ------------------
  |  Branch (1728:10): [True: 206k, False: 593k]
  ------------------
 1729|   206k|		ret[out++] = '0' + val;
 1730|   593k|	    else
 1731|   593k|		ret[out++] = 'A' + val - 0xA;
 1732|   800k|	    val = ch & 0xF;
 1733|   800k|	    if (val <= 9)
  ------------------
  |  Branch (1733:10): [True: 218k, False: 582k]
  ------------------
 1734|   218k|		ret[out++] = '0' + val;
 1735|   582k|	    else
 1736|   582k|		ret[out++] = 'A' + val - 0xA;
 1737|   800k|	    in++;
 1738|   800k|	} else {
 1739|   501k|	    ret[out++] = *in++;
 1740|   501k|	}
 1741|       |
 1742|  1.30M|    }
 1743|  6.32k|    ret[out] = 0;
 1744|  6.32k|    return(ret);
 1745|  6.32k|}
xmlURIEscape:
 1764|  4.28k|{
 1765|  4.28k|    xmlChar *ret, *segment = NULL;
 1766|  4.28k|    xmlURIPtr uri;
 1767|  4.28k|    int ret2;
 1768|       |
 1769|  4.28k|    if (str == NULL)
  ------------------
  |  Branch (1769:9): [True: 9, False: 4.27k]
  ------------------
 1770|      9|        return (NULL);
 1771|       |
 1772|  4.27k|    uri = xmlCreateURI();
 1773|  4.27k|    if (uri != NULL) {
  ------------------
  |  Branch (1773:9): [True: 3.67k, False: 603]
  ------------------
 1774|       |	/*
 1775|       |	 * Allow escaping errors in the unescaped form
 1776|       |	 */
 1777|  3.67k|        uri->cleanup = 1;
 1778|  3.67k|        ret2 = xmlParseURIReference(uri, (const char *)str);
 1779|  3.67k|        if (ret2) {
  ------------------
  |  Branch (1779:13): [True: 1.42k, False: 2.25k]
  ------------------
 1780|  1.42k|            xmlFreeURI(uri);
 1781|  1.42k|            return (NULL);
 1782|  1.42k|        }
 1783|  3.67k|    }
 1784|       |
 1785|  2.85k|    if (!uri)
  ------------------
  |  Branch (1785:9): [True: 603, False: 2.25k]
  ------------------
 1786|    603|        return NULL;
 1787|       |
 1788|  2.25k|    ret = NULL;
 1789|       |
 1790|  2.25k|#define NULLCHK(p) if(!p) { \
 1791|  2.25k|         xmlURIErrMemory("escaping URI value\n"); \
 1792|  2.25k|         xmlFreeURI(uri); \
 1793|  2.25k|         xmlFree(ret); \
 1794|  2.25k|         return NULL; } \
 1795|  2.25k|
 1796|  2.25k|    if (uri->scheme) {
  ------------------
  |  Branch (1796:9): [True: 464, False: 1.79k]
  ------------------
 1797|    464|        segment = xmlURIEscapeStr(BAD_CAST uri->scheme, BAD_CAST "+-.");
  ------------------
  |  |   35|    464|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->scheme, BAD_CAST "+-.");
  ------------------
  |  |   35|    464|#define BAD_CAST (xmlChar *)
  ------------------
 1798|    464|        NULLCHK(segment)
  ------------------
  |  | 1790|    464|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1790:23): [True: 10, False: 454]
  |  |  ------------------
  |  | 1791|     10|         xmlURIErrMemory("escaping URI value\n"); \
  |  | 1792|     10|         xmlFreeURI(uri); \
  |  | 1793|     10|         xmlFree(ret); \
  |  | 1794|     10|         return NULL; } \
  ------------------
 1799|    454|        ret = xmlStrcat(ret, segment);
 1800|    454|        ret = xmlStrcat(ret, BAD_CAST ":");
  ------------------
  |  |   35|    454|#define BAD_CAST (xmlChar *)
  ------------------
 1801|    454|        xmlFree(segment);
 1802|    454|    }
 1803|       |
 1804|  2.24k|    if (uri->authority) {
  ------------------
  |  Branch (1804:9): [True: 0, False: 2.24k]
  ------------------
 1805|      0|        segment =
 1806|      0|            xmlURIEscapeStr(BAD_CAST uri->authority, BAD_CAST "/?;:@");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
                          xmlURIEscapeStr(BAD_CAST uri->authority, BAD_CAST "/?;:@");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1807|      0|        NULLCHK(segment)
  ------------------
  |  | 1790|      0|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1790:23): [True: 0, False: 0]
  |  |  ------------------
  |  | 1791|      0|         xmlURIErrMemory("escaping URI value\n"); \
  |  | 1792|      0|         xmlFreeURI(uri); \
  |  | 1793|      0|         xmlFree(ret); \
  |  | 1794|      0|         return NULL; } \
  ------------------
 1808|      0|        ret = xmlStrcat(ret, BAD_CAST "//");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1809|      0|        ret = xmlStrcat(ret, segment);
 1810|      0|        xmlFree(segment);
 1811|      0|    }
 1812|       |
 1813|  2.24k|    if (uri->user) {
  ------------------
  |  Branch (1813:9): [True: 379, False: 1.86k]
  ------------------
 1814|    379|        segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,");
  ------------------
  |  |   35|    379|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,");
  ------------------
  |  |   35|    379|#define BAD_CAST (xmlChar *)
  ------------------
 1815|    379|        NULLCHK(segment)
  ------------------
  |  | 1790|    379|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1790:23): [True: 7, False: 372]
  |  |  ------------------
  |  | 1791|      7|         xmlURIErrMemory("escaping URI value\n"); \
  |  | 1792|      7|         xmlFreeURI(uri); \
  |  | 1793|      7|         xmlFree(ret); \
  |  | 1794|      7|         return NULL; } \
  ------------------
 1816|    372|        ret = xmlStrcat(ret,BAD_CAST "//");
  ------------------
  |  |   35|    372|#define BAD_CAST (xmlChar *)
  ------------------
 1817|    372|        ret = xmlStrcat(ret, segment);
 1818|    372|        ret = xmlStrcat(ret, BAD_CAST "@");
  ------------------
  |  |   35|    372|#define BAD_CAST (xmlChar *)
  ------------------
 1819|    372|        xmlFree(segment);
 1820|    372|    }
 1821|       |
 1822|  2.23k|    if (uri->server) {
  ------------------
  |  Branch (1822:9): [True: 470, False: 1.76k]
  ------------------
 1823|    470|        segment = xmlURIEscapeStr(BAD_CAST uri->server, BAD_CAST "/?;:@");
  ------------------
  |  |   35|    470|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->server, BAD_CAST "/?;:@");
  ------------------
  |  |   35|    470|#define BAD_CAST (xmlChar *)
  ------------------
 1824|    470|        NULLCHK(segment)
  ------------------
  |  | 1790|    470|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1790:23): [True: 10, False: 460]
  |  |  ------------------
  |  | 1791|     10|         xmlURIErrMemory("escaping URI value\n"); \
  |  | 1792|     10|         xmlFreeURI(uri); \
  |  | 1793|     10|         xmlFree(ret); \
  |  | 1794|     10|         return NULL; } \
  ------------------
 1825|    460|        if (uri->user == NULL)
  ------------------
  |  Branch (1825:13): [True: 129, False: 331]
  ------------------
 1826|    129|            ret = xmlStrcat(ret, BAD_CAST "//");
  ------------------
  |  |   35|    129|#define BAD_CAST (xmlChar *)
  ------------------
 1827|    460|        ret = xmlStrcat(ret, segment);
 1828|    460|        xmlFree(segment);
 1829|    460|    }
 1830|       |
 1831|  2.22k|    if (uri->port > 0) {
  ------------------
  |  Branch (1831:9): [True: 167, False: 2.06k]
  ------------------
 1832|    167|        xmlChar port[11];
 1833|       |
 1834|    167|        snprintf((char *) port, 11, "%d", uri->port);
 1835|    167|        ret = xmlStrcat(ret, BAD_CAST ":");
  ------------------
  |  |   35|    167|#define BAD_CAST (xmlChar *)
  ------------------
 1836|    167|        ret = xmlStrcat(ret, port);
 1837|    167|    }
 1838|       |
 1839|  2.22k|    if (uri->path) {
  ------------------
  |  Branch (1839:9): [True: 794, False: 1.43k]
  ------------------
 1840|    794|        segment =
 1841|    794|            xmlURIEscapeStr(BAD_CAST uri->path, BAD_CAST ":@&=+$,/?;");
  ------------------
  |  |   35|    794|#define BAD_CAST (xmlChar *)
  ------------------
                          xmlURIEscapeStr(BAD_CAST uri->path, BAD_CAST ":@&=+$,/?;");
  ------------------
  |  |   35|    794|#define BAD_CAST (xmlChar *)
  ------------------
 1842|    794|        NULLCHK(segment)
  ------------------
  |  | 1790|    794|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1790:23): [True: 22, False: 772]
  |  |  ------------------
  |  | 1791|     22|         xmlURIErrMemory("escaping URI value\n"); \
  |  | 1792|     22|         xmlFreeURI(uri); \
  |  | 1793|     22|         xmlFree(ret); \
  |  | 1794|     22|         return NULL; } \
  ------------------
 1843|    772|        ret = xmlStrcat(ret, segment);
 1844|    772|        xmlFree(segment);
 1845|    772|    }
 1846|       |
 1847|  2.20k|    if (uri->query_raw) {
  ------------------
  |  Branch (1847:9): [True: 306, False: 1.89k]
  ------------------
 1848|    306|        ret = xmlStrcat(ret, BAD_CAST "?");
  ------------------
  |  |   35|    306|#define BAD_CAST (xmlChar *)
  ------------------
 1849|    306|        ret = xmlStrcat(ret, BAD_CAST uri->query_raw);
  ------------------
  |  |   35|    306|#define BAD_CAST (xmlChar *)
  ------------------
 1850|    306|    }
 1851|  1.89k|    else if (uri->query) {
  ------------------
  |  Branch (1851:14): [True: 9, False: 1.89k]
  ------------------
 1852|      9|        segment =
 1853|      9|            xmlURIEscapeStr(BAD_CAST uri->query, BAD_CAST ";/?:@&=+,$");
  ------------------
  |  |   35|      9|#define BAD_CAST (xmlChar *)
  ------------------
                          xmlURIEscapeStr(BAD_CAST uri->query, BAD_CAST ";/?:@&=+,$");
  ------------------
  |  |   35|      9|#define BAD_CAST (xmlChar *)
  ------------------
 1854|      9|        NULLCHK(segment)
  ------------------
  |  | 1790|      9|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1790:23): [True: 9, False: 0]
  |  |  ------------------
  |  | 1791|      9|         xmlURIErrMemory("escaping URI value\n"); \
  |  | 1792|      9|         xmlFreeURI(uri); \
  |  | 1793|      9|         xmlFree(ret); \
  |  | 1794|      9|         return NULL; } \
  ------------------
 1855|      0|        ret = xmlStrcat(ret, BAD_CAST "?");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1856|      0|        ret = xmlStrcat(ret, segment);
 1857|      0|        xmlFree(segment);
 1858|      0|    }
 1859|       |
 1860|  2.19k|    if (uri->opaque) {
  ------------------
  |  Branch (1860:9): [True: 0, False: 2.19k]
  ------------------
 1861|      0|        segment = xmlURIEscapeStr(BAD_CAST uri->opaque, BAD_CAST "");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->opaque, BAD_CAST "");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1862|      0|        NULLCHK(segment)
  ------------------
  |  | 1790|      0|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1790:23): [True: 0, False: 0]
  |  |  ------------------
  |  | 1791|      0|         xmlURIErrMemory("escaping URI value\n"); \
  |  | 1792|      0|         xmlFreeURI(uri); \
  |  | 1793|      0|         xmlFree(ret); \
  |  | 1794|      0|         return NULL; } \
  ------------------
 1863|      0|        ret = xmlStrcat(ret, segment);
 1864|      0|        xmlFree(segment);
 1865|      0|    }
 1866|       |
 1867|  2.19k|    if (uri->fragment) {
  ------------------
  |  Branch (1867:9): [True: 437, False: 1.75k]
  ------------------
 1868|    437|        segment = xmlURIEscapeStr(BAD_CAST uri->fragment, BAD_CAST "#");
  ------------------
  |  |   35|    437|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->fragment, BAD_CAST "#");
  ------------------
  |  |   35|    437|#define BAD_CAST (xmlChar *)
  ------------------
 1869|    437|        NULLCHK(segment)
  ------------------
  |  | 1790|    437|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1790:23): [True: 11, False: 426]
  |  |  ------------------
  |  | 1791|     11|         xmlURIErrMemory("escaping URI value\n"); \
  |  | 1792|     11|         xmlFreeURI(uri); \
  |  | 1793|     11|         xmlFree(ret); \
  |  | 1794|     11|         return NULL; } \
  ------------------
 1870|    426|        ret = xmlStrcat(ret, BAD_CAST "#");
  ------------------
  |  |   35|    426|#define BAD_CAST (xmlChar *)
  ------------------
 1871|    426|        ret = xmlStrcat(ret, segment);
 1872|    426|        xmlFree(segment);
 1873|    426|    }
 1874|       |
 1875|  2.18k|    xmlFreeURI(uri);
 1876|  2.18k|#undef NULLCHK
 1877|       |
 1878|  2.18k|    return (ret);
 1879|  2.19k|}
xmlBuildURI:
 1903|  4.28k|xmlBuildURI(const xmlChar *URI, const xmlChar *base) {
 1904|  4.28k|    xmlChar *val = NULL;
 1905|  4.28k|    int ret, len, indx, cur, out;
 1906|  4.28k|    xmlURIPtr ref = NULL;
 1907|  4.28k|    xmlURIPtr bas = NULL;
 1908|  4.28k|    xmlURIPtr res = NULL;
 1909|       |
 1910|       |    /*
 1911|       |     * 1) The URI reference is parsed into the potential four components and
 1912|       |     *    fragment identifier, as described in Section 4.3.
 1913|       |     *
 1914|       |     *    NOTE that a completely empty URI is treated by modern browsers
 1915|       |     *    as a reference to "." rather than as a synonym for the current
 1916|       |     *    URI.  Should we do that here?
 1917|       |     */
 1918|  4.28k|    if (URI == NULL)
  ------------------
  |  Branch (1918:9): [True: 3.07k, False: 1.21k]
  ------------------
 1919|  3.07k|	ret = -1;
 1920|  1.21k|    else {
 1921|  1.21k|	if (*URI) {
  ------------------
  |  Branch (1921:6): [True: 1.15k, False: 57]
  ------------------
 1922|  1.15k|	    ref = xmlCreateURI();
 1923|  1.15k|	    if (ref == NULL)
  ------------------
  |  Branch (1923:10): [True: 2, False: 1.15k]
  ------------------
 1924|      2|		goto done;
 1925|  1.15k|	    ret = xmlParseURIReference(ref, (const char *) URI);
 1926|  1.15k|	}
 1927|     57|	else
 1928|     57|	    ret = 0;
 1929|  1.21k|    }
 1930|  4.28k|    if (ret != 0)
  ------------------
  |  Branch (1930:9): [True: 3.13k, False: 1.15k]
  ------------------
 1931|  3.13k|	goto done;
 1932|  1.15k|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (1932:9): [True: 1.09k, False: 57]
  |  Branch (1932:26): [True: 197, False: 898]
  ------------------
 1933|       |	/*
 1934|       |	 * The URI is absolute don't modify.
 1935|       |	 */
 1936|    197|	val = xmlStrdup(URI);
 1937|    197|	goto done;
 1938|    197|    }
 1939|    955|    if (base == NULL)
  ------------------
  |  Branch (1939:9): [True: 0, False: 955]
  ------------------
 1940|      0|	ret = -1;
 1941|    955|    else {
 1942|    955|	bas = xmlCreateURI();
 1943|    955|	if (bas == NULL)
  ------------------
  |  Branch (1943:6): [True: 1, False: 954]
  ------------------
 1944|      1|	    goto done;
 1945|    954|	ret = xmlParseURIReference(bas, (const char *) base);
 1946|    954|    }
 1947|    954|    if (ret != 0) {
  ------------------
  |  Branch (1947:9): [True: 341, False: 613]
  ------------------
 1948|    341|	if (ref)
  ------------------
  |  Branch (1948:6): [True: 334, False: 7]
  ------------------
 1949|    334|	    val = xmlSaveUri(ref);
 1950|    341|	goto done;
 1951|    341|    }
 1952|    613|    if (ref == NULL) {
  ------------------
  |  Branch (1952:9): [True: 49, False: 564]
  ------------------
 1953|       |	/*
 1954|       |	 * the base fragment must be ignored
 1955|       |	 */
 1956|     49|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (1956:6): [True: 3, False: 46]
  ------------------
 1957|      3|	    xmlFree(bas->fragment);
 1958|      3|	    bas->fragment = NULL;
 1959|      3|	}
 1960|     49|	val = xmlSaveUri(bas);
 1961|     49|	goto done;
 1962|     49|    }
 1963|       |
 1964|       |    /*
 1965|       |     * 2) If the path component is empty and the scheme, authority, and
 1966|       |     *    query components are undefined, then it is a reference to the
 1967|       |     *    current document and we are done.  Otherwise, the reference URI's
 1968|       |     *    query and fragment components are defined as found (or not found)
 1969|       |     *    within the URI reference and not inherited from the base URI.
 1970|       |     *
 1971|       |     *    NOTE that in modern browsers, the parsing differs from the above
 1972|       |     *    in the following aspect:  the query component is allowed to be
 1973|       |     *    defined while still treating this as a reference to the current
 1974|       |     *    document.
 1975|       |     */
 1976|    564|    res = xmlCreateURI();
 1977|    564|    if (res == NULL)
  ------------------
  |  Branch (1977:9): [True: 1, False: 563]
  ------------------
 1978|      1|	goto done;
 1979|    563|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (1979:9): [True: 563, False: 0]
  |  Branch (1979:34): [True: 108, False: 455]
  ------------------
 1980|    563|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (1980:3): [True: 108, False: 0]
  |  Branch (1980:31): [True: 105, False: 3]
  ------------------
 1981|    108|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   38|    105|#define PORT_EMPTY           0
  ------------------
  |  Branch (1981:10): [True: 74, False: 31]
  ------------------
 1982|     74|	if (bas->scheme != NULL)
  ------------------
  |  Branch (1982:6): [True: 10, False: 64]
  ------------------
 1983|     10|	    res->scheme = xmlMemStrdup(bas->scheme);
 1984|     74|	if (bas->authority != NULL)
  ------------------
  |  Branch (1984:6): [True: 0, False: 74]
  ------------------
 1985|      0|	    res->authority = xmlMemStrdup(bas->authority);
 1986|     74|	else {
 1987|     74|	    if (bas->server != NULL)
  ------------------
  |  Branch (1987:10): [True: 8, False: 66]
  ------------------
 1988|      8|		res->server = xmlMemStrdup(bas->server);
 1989|     74|	    if (bas->user != NULL)
  ------------------
  |  Branch (1989:10): [True: 7, False: 67]
  ------------------
 1990|      7|		res->user = xmlMemStrdup(bas->user);
 1991|     74|	    res->port = bas->port;
 1992|     74|	}
 1993|     74|	if (bas->path != NULL)
  ------------------
  |  Branch (1993:6): [True: 57, False: 17]
  ------------------
 1994|     57|	    res->path = xmlMemStrdup(bas->path);
 1995|     74|	if (ref->query_raw != NULL)
  ------------------
  |  Branch (1995:6): [True: 29, False: 45]
  ------------------
 1996|     29|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 1997|     45|	else if (ref->query != NULL)
  ------------------
  |  Branch (1997:11): [True: 0, False: 45]
  ------------------
 1998|      0|	    res->query = xmlMemStrdup(ref->query);
 1999|     45|	else if (bas->query_raw != NULL)
  ------------------
  |  Branch (1999:11): [True: 7, False: 38]
  ------------------
 2000|      7|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2001|     38|	else if (bas->query != NULL)
  ------------------
  |  Branch (2001:11): [True: 0, False: 38]
  ------------------
 2002|      0|	    res->query = xmlMemStrdup(bas->query);
 2003|     74|	if (ref->fragment != NULL)
  ------------------
  |  Branch (2003:6): [True: 47, False: 27]
  ------------------
 2004|     47|	    res->fragment = xmlMemStrdup(ref->fragment);
 2005|     74|	goto step_7;
 2006|     74|    }
 2007|       |
 2008|       |    /*
 2009|       |     * 3) If the scheme component is defined, indicating that the reference
 2010|       |     *    starts with a scheme name, then the reference is interpreted as an
 2011|       |     *    absolute URI and we are done.  Otherwise, the reference URI's
 2012|       |     *    scheme is inherited from the base URI's scheme component.
 2013|       |     */
 2014|    489|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2014:9): [True: 0, False: 489]
  ------------------
 2015|      0|	val = xmlSaveUri(ref);
 2016|      0|	goto done;
 2017|      0|    }
 2018|    489|    if (bas->scheme != NULL)
  ------------------
  |  Branch (2018:9): [True: 16, False: 473]
  ------------------
 2019|     16|	res->scheme = xmlMemStrdup(bas->scheme);
 2020|       |
 2021|    489|    if (ref->query_raw != NULL)
  ------------------
  |  Branch (2021:9): [True: 2, False: 487]
  ------------------
 2022|      2|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2023|    487|    else if (ref->query != NULL)
  ------------------
  |  Branch (2023:14): [True: 0, False: 487]
  ------------------
 2024|      0|	res->query = xmlMemStrdup(ref->query);
 2025|    489|    if (ref->fragment != NULL)
  ------------------
  |  Branch (2025:9): [True: 2, False: 487]
  ------------------
 2026|      2|	res->fragment = xmlMemStrdup(ref->fragment);
 2027|       |
 2028|       |    /*
 2029|       |     * 4) If the authority component is defined, then the reference is a
 2030|       |     *    network-path and we skip to step 7.  Otherwise, the reference
 2031|       |     *    URI's authority is inherited from the base URI's authority
 2032|       |     *    component, which will also be undefined if the URI scheme does not
 2033|       |     *    use an authority component.
 2034|       |     */
 2035|    489|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2035:9): [True: 0, False: 489]
  |  Branch (2035:37): [True: 4, False: 485]
  ------------------
 2036|    489|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   38|    485|#define PORT_EMPTY           0
  ------------------
  |  Branch (2036:10): [True: 31, False: 454]
  ------------------
 2037|     35|	if (ref->authority != NULL)
  ------------------
  |  Branch (2037:6): [True: 0, False: 35]
  ------------------
 2038|      0|	    res->authority = xmlMemStrdup(ref->authority);
 2039|     35|	else {
 2040|     35|            if (ref->server != NULL)
  ------------------
  |  Branch (2040:17): [True: 4, False: 31]
  ------------------
 2041|      4|                res->server = xmlMemStrdup(ref->server);
 2042|     35|	    if (ref->user != NULL)
  ------------------
  |  Branch (2042:10): [True: 1, False: 34]
  ------------------
 2043|      1|		res->user = xmlMemStrdup(ref->user);
 2044|     35|            res->port = ref->port;
 2045|     35|	}
 2046|     35|	if (ref->path != NULL)
  ------------------
  |  Branch (2046:6): [True: 1, False: 34]
  ------------------
 2047|      1|	    res->path = xmlMemStrdup(ref->path);
 2048|     35|	goto step_7;
 2049|     35|    }
 2050|    454|    if (bas->authority != NULL)
  ------------------
  |  Branch (2050:9): [True: 0, False: 454]
  ------------------
 2051|      0|	res->authority = xmlMemStrdup(bas->authority);
 2052|    454|    else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   38|    391|#define PORT_EMPTY           0
  ------------------
  |  Branch (2052:14): [True: 63, False: 391]
  |  Branch (2052:39): [True: 34, False: 357]
  ------------------
 2053|     97|	if (bas->server != NULL)
  ------------------
  |  Branch (2053:6): [True: 63, False: 34]
  ------------------
 2054|     63|	    res->server = xmlMemStrdup(bas->server);
 2055|     97|	if (bas->user != NULL)
  ------------------
  |  Branch (2055:6): [True: 58, False: 39]
  ------------------
 2056|     58|	    res->user = xmlMemStrdup(bas->user);
 2057|     97|	res->port = bas->port;
 2058|     97|    }
 2059|       |
 2060|       |    /*
 2061|       |     * 5) If the path component begins with a slash character ("/"), then
 2062|       |     *    the reference is an absolute-path and we skip to step 7.
 2063|       |     */
 2064|    454|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2064:9): [True: 454, False: 0]
  |  Branch (2064:32): [True: 26, False: 428]
  ------------------
 2065|     26|	res->path = xmlMemStrdup(ref->path);
 2066|     26|	goto step_7;
 2067|     26|    }
 2068|       |
 2069|       |
 2070|       |    /*
 2071|       |     * 6) If this step is reached, then we are resolving a relative-path
 2072|       |     *    reference.  The relative path needs to be merged with the base
 2073|       |     *    URI's path.  Although there are many ways to do this, we will
 2074|       |     *    describe a simple method using a separate string buffer.
 2075|       |     *
 2076|       |     * Allocate a buffer large enough for the result string.
 2077|       |     */
 2078|    428|    len = 2; /* extra / and 0 */
 2079|    428|    if (ref->path != NULL)
  ------------------
  |  Branch (2079:9): [True: 428, False: 0]
  ------------------
 2080|    428|	len += strlen(ref->path);
 2081|    428|    if (bas->path != NULL)
  ------------------
  |  Branch (2081:9): [True: 314, False: 114]
  ------------------
 2082|    314|	len += strlen(bas->path);
 2083|    428|    res->path = (char *) xmlMallocAtomic(len);
 2084|    428|    if (res->path == NULL) {
  ------------------
  |  Branch (2084:9): [True: 1, False: 427]
  ------------------
 2085|      1|        xmlURIErrMemory("resolving URI against base\n");
 2086|      1|	goto done;
 2087|      1|    }
 2088|    427|    res->path[0] = 0;
 2089|       |
 2090|       |    /*
 2091|       |     * a) All but the last segment of the base URI's path component is
 2092|       |     *    copied to the buffer.  In other words, any characters after the
 2093|       |     *    last (right-most) slash character, if any, are excluded.
 2094|       |     */
 2095|    427|    cur = 0;
 2096|    427|    out = 0;
 2097|    427|    if (bas->path != NULL) {
  ------------------
  |  Branch (2097:9): [True: 314, False: 113]
  ------------------
 2098|  30.1k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2098:9): [True: 30.0k, False: 166]
  ------------------
 2099|  53.5k|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2099:13): [True: 53.4k, False: 148]
  |  Branch (2099:38): [True: 23.5k, False: 29.8k]
  ------------------
 2100|  23.5k|		cur++;
 2101|  30.0k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2101:10): [True: 148, False: 29.8k]
  ------------------
 2102|    148|		break;
 2103|       |
 2104|  29.8k|	    cur++;
 2105|  74.6k|	    while (out < cur) {
  ------------------
  |  Branch (2105:13): [True: 44.7k, False: 29.8k]
  ------------------
 2106|  44.7k|		res->path[out] = bas->path[out];
 2107|  44.7k|		out++;
 2108|  44.7k|	    }
 2109|  29.8k|	}
 2110|    314|    }
 2111|    427|    res->path[out] = 0;
 2112|       |
 2113|       |    /*
 2114|       |     * b) The reference's path component is appended to the buffer
 2115|       |     *    string.
 2116|       |     */
 2117|    427|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2117:9): [True: 427, False: 0]
  |  Branch (2117:30): [True: 426, False: 1]
  ------------------
 2118|    426|	indx = 0;
 2119|       |	/*
 2120|       |	 * Ensure the path includes a '/'
 2121|       |	 */
 2122|    426|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   38|    168|#define PORT_EMPTY           0
  ------------------
  |  Branch (2122:6): [True: 217, False: 209]
  |  Branch (2122:21): [True: 49, False: 168]
  |  Branch (2122:46): [True: 33, False: 135]
  ------------------
 2123|     82|	    res->path[out++] = '/';
 2124|  9.75k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2124:9): [True: 9.32k, False: 426]
  ------------------
 2125|  9.32k|	    res->path[out++] = ref->path[indx++];
 2126|  9.32k|	}
 2127|    426|    }
 2128|    427|    res->path[out] = 0;
 2129|       |
 2130|       |    /*
 2131|       |     * Steps c) to h) are really path normalization steps
 2132|       |     */
 2133|    427|    xmlNormalizeURIPath(res->path);
 2134|       |
 2135|    562|step_7:
 2136|       |
 2137|       |    /*
 2138|       |     * 7) The resulting URI components, including any inherited from the
 2139|       |     *    base URI, are recombined to give the absolute form of the URI
 2140|       |     *    reference.
 2141|       |     */
 2142|    562|    val = xmlSaveUri(res);
 2143|       |
 2144|  4.28k|done:
 2145|  4.28k|    if (ref != NULL)
  ------------------
  |  Branch (2145:9): [True: 1.15k, False: 3.12k]
  ------------------
 2146|  1.15k|	xmlFreeURI(ref);
 2147|  4.28k|    if (bas != NULL)
  ------------------
  |  Branch (2147:9): [True: 954, False: 3.33k]
  ------------------
 2148|    954|	xmlFreeURI(bas);
 2149|  4.28k|    if (res != NULL)
  ------------------
  |  Branch (2149:9): [True: 563, False: 3.72k]
  ------------------
 2150|    563|	xmlFreeURI(res);
 2151|  4.28k|    return(val);
 2152|    562|}
xmlBuildRelativeURI:
 2188|  4.28k|{
 2189|  4.28k|    xmlChar *val = NULL;
 2190|  4.28k|    int ret;
 2191|  4.28k|    int ix;
 2192|  4.28k|    int nbslash = 0;
 2193|  4.28k|    int len;
 2194|  4.28k|    xmlURIPtr ref = NULL;
 2195|  4.28k|    xmlURIPtr bas = NULL;
 2196|  4.28k|    xmlChar *bptr, *uptr, *vptr;
 2197|  4.28k|    int remove_path = 0;
 2198|       |
 2199|  4.28k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2199:9): [True: 3.07k, False: 1.21k]
  |  Branch (2199:26): [True: 57, False: 1.15k]
  ------------------
 2200|  3.12k|	return NULL;
 2201|       |
 2202|       |    /*
 2203|       |     * First parse URI into a standard form
 2204|       |     */
 2205|  1.15k|    ref = xmlCreateURI ();
 2206|  1.15k|    if (ref == NULL)
  ------------------
  |  Branch (2206:9): [True: 15, False: 1.14k]
  ------------------
 2207|     15|	return NULL;
 2208|       |    /* If URI not already in "relative" form */
 2209|  1.14k|    if (URI[0] != '.') {
  ------------------
  |  Branch (2209:9): [True: 967, False: 177]
  ------------------
 2210|    967|	ret = xmlParseURIReference (ref, (const char *) URI);
 2211|    967|	if (ret != 0)
  ------------------
  |  Branch (2211:6): [True: 7, False: 960]
  ------------------
 2212|      7|	    goto done;		/* Error in URI, return NULL */
 2213|    967|    } else
 2214|    177|	ref->path = (char *)xmlStrdup(URI);
 2215|       |
 2216|       |    /*
 2217|       |     * Next parse base into the same standard form
 2218|       |     */
 2219|  1.13k|    if ((base == NULL) || (*base == 0)) {
  ------------------
  |  Branch (2219:9): [True: 0, False: 1.13k]
  |  Branch (2219:27): [True: 62, False: 1.07k]
  ------------------
 2220|     62|	val = xmlStrdup (URI);
 2221|     62|	goto done;
 2222|     62|    }
 2223|  1.07k|    bas = xmlCreateURI ();
 2224|  1.07k|    if (bas == NULL)
  ------------------
  |  Branch (2224:9): [True: 3, False: 1.07k]
  ------------------
 2225|      3|	goto done;
 2226|  1.07k|    if (base[0] != '.') {
  ------------------
  |  Branch (2226:9): [True: 943, False: 129]
  ------------------
 2227|    943|	ret = xmlParseURIReference (bas, (const char *) base);
 2228|    943|	if (ret != 0)
  ------------------
  |  Branch (2228:6): [True: 311, False: 632]
  ------------------
 2229|    311|	    goto done;		/* Error in base, return NULL */
 2230|    943|    } else
 2231|    129|	bas->path = (char *)xmlStrdup(base);
 2232|       |
 2233|       |    /*
 2234|       |     * If the scheme / server on the URI differs from the base,
 2235|       |     * just return the URI
 2236|       |     */
 2237|    761|    if ((ref->scheme != NULL) &&
  ------------------
  |  Branch (2237:9): [True: 195, False: 566]
  ------------------
 2238|    761|	((bas->scheme == NULL) ||
  ------------------
  |  Branch (2238:3): [True: 1, False: 194]
  ------------------
 2239|    195|	 (xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2239:3): [True: 129, False: 65]
  ------------------
 2240|    195|	 (xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2240:3): [True: 19, False: 46]
  ------------------
 2241|    195|         (bas->port != ref->port))) {
  ------------------
  |  Branch (2241:10): [True: 44, False: 2]
  ------------------
 2242|    193|	val = xmlStrdup (URI);
 2243|    193|	goto done;
 2244|    193|    }
 2245|    568|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2245:9): [True: 37, False: 531]
  ------------------
 2246|     37|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   35|     37|#define BAD_CAST (xmlChar *)
  ------------------
 2247|     37|	goto done;
 2248|     37|    }
 2249|    531|    if (bas->path == NULL) {
  ------------------
  |  Branch (2249:9): [True: 99, False: 432]
  ------------------
 2250|     99|	val = xmlStrdup((xmlChar *)ref->path);
 2251|     99|	goto done;
 2252|     99|    }
 2253|    432|    if (ref->path == NULL) {
  ------------------
  |  Branch (2253:9): [True: 51, False: 381]
  ------------------
 2254|     51|        ref->path = (char *) "/";
 2255|     51|	remove_path = 1;
 2256|     51|    }
 2257|       |
 2258|       |    /*
 2259|       |     * At this point (at last!) we can compare the two paths
 2260|       |     *
 2261|       |     * First we take care of the special case where either of the
 2262|       |     * two path components may be missing (bug 316224)
 2263|       |     */
 2264|    432|    bptr = (xmlChar *)bas->path;
 2265|    432|    {
 2266|    432|        xmlChar *rptr = (xmlChar *) ref->path;
 2267|    432|        int pos = 0;
 2268|       |
 2269|       |        /*
 2270|       |         * Next we compare the two strings and find where they first differ
 2271|       |         */
 2272|    432|	if ((*rptr == '.') && (rptr[1] == '/'))
  ------------------
  |  Branch (2272:6): [True: 129, False: 303]
  |  Branch (2272:24): [True: 16, False: 113]
  ------------------
 2273|     16|            rptr += 2;
 2274|    432|	if ((*bptr == '.') && (bptr[1] == '/'))
  ------------------
  |  Branch (2274:6): [True: 125, False: 307]
  |  Branch (2274:24): [True: 25, False: 100]
  ------------------
 2275|     25|            bptr += 2;
 2276|    407|	else if ((*bptr == '/') && (*rptr != '/'))
  ------------------
  |  Branch (2276:11): [True: 67, False: 340]
  |  Branch (2276:29): [True: 43, False: 24]
  ------------------
 2277|     43|	    bptr++;
 2278|  9.42k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2278:9): [True: 8.99k, False: 426]
  |  Branch (2278:37): [True: 8.98k, False: 6]
  ------------------
 2279|  8.98k|	    pos++;
 2280|       |
 2281|    432|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2281:6): [True: 6, False: 426]
  ------------------
 2282|      6|	    val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   35|      6|#define BAD_CAST (xmlChar *)
  ------------------
 2283|      6|	    goto done;		/* (I can't imagine why anyone would do this) */
 2284|      6|	}
 2285|       |
 2286|       |	/*
 2287|       |	 * In URI, "back up" to the last '/' encountered.  This will be the
 2288|       |	 * beginning of the "unique" suffix of URI
 2289|       |	 */
 2290|    426|	ix = pos;
 2291|  9.23k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2291:9): [True: 8.85k, False: 378]
  ------------------
 2292|  8.85k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2292:10): [True: 48, False: 8.80k]
  ------------------
 2293|     48|		break;
 2294|  8.85k|	}
 2295|    426|	uptr = (xmlChar *)&rptr[ix];
 2296|       |
 2297|       |	/*
 2298|       |	 * In base, count the number of '/' from the differing point
 2299|       |	 */
 2300|  79.6k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2300:9): [True: 79.2k, False: 426]
  ------------------
 2301|  79.2k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2301:10): [True: 53.7k, False: 25.4k]
  ------------------
 2302|  53.7k|		nbslash++;
 2303|  79.2k|	}
 2304|       |
 2305|       |	/*
 2306|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2307|       |	 */
 2308|    426|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2308:6): [True: 207, False: 219]
  |  Branch (2308:22): [True: 11, False: 196]
  ------------------
 2309|     11|	    val = xmlStrdup(BAD_CAST "./");
  ------------------
  |  |   35|     11|#define BAD_CAST (xmlChar *)
  ------------------
 2310|     11|	    goto done;
 2311|     11|	}
 2312|       |
 2313|    415|	len = xmlStrlen (uptr) + 1;
 2314|    415|    }
 2315|       |
 2316|    415|    if (nbslash == 0) {
  ------------------
  |  Branch (2316:9): [True: 196, False: 219]
  ------------------
 2317|    196|	if (uptr != NULL)
  ------------------
  |  Branch (2317:6): [True: 196, False: 0]
  ------------------
 2318|       |	    /* exception characters from xmlSaveUri */
 2319|    196|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   35|    196|#define BAD_CAST (xmlChar *)
  ------------------
 2320|    196|	goto done;
 2321|    196|    }
 2322|       |
 2323|       |    /*
 2324|       |     * Allocate just enough space for the returned string -
 2325|       |     * length of the remainder of the URI, plus enough space
 2326|       |     * for the "../" groups, plus one for the terminator
 2327|       |     */
 2328|    219|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2329|    219|    if (val == NULL) {
  ------------------
  |  Branch (2329:9): [True: 1, False: 218]
  ------------------
 2330|      1|        xmlURIErrMemory("building relative URI\n");
 2331|      1|	goto done;
 2332|      1|    }
 2333|    218|    vptr = val;
 2334|       |    /*
 2335|       |     * Put in as many "../" as needed
 2336|       |     */
 2337|  54.0k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2337:12): [True: 53.7k, False: 218]
  ------------------
 2338|  53.7k|	*vptr++ = '.';
 2339|  53.7k|	*vptr++ = '.';
 2340|  53.7k|	*vptr++ = '/';
 2341|  53.7k|    }
 2342|       |    /*
 2343|       |     * Finish up with the end of the URI
 2344|       |     */
 2345|    218|    if (uptr != NULL) {
  ------------------
  |  Branch (2345:9): [True: 218, False: 0]
  ------------------
 2346|    218|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2346:13): [True: 218, False: 0]
  |  Branch (2346:29): [True: 218, False: 0]
  ------------------
 2347|    218|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2347:6): [True: 12, False: 206]
  |  Branch (2347:26): [True: 12, False: 0]
  ------------------
 2348|     12|	    memcpy (vptr, uptr + 1, len - 1);
 2349|     12|	    vptr[len - 2] = 0;
 2350|    206|	} else {
 2351|    206|	    memcpy (vptr, uptr, len);
 2352|    206|	    vptr[len - 1] = 0;
 2353|    206|	}
 2354|    218|    } else {
 2355|      0|	vptr[len - 1] = 0;
 2356|      0|    }
 2357|       |
 2358|       |    /* escape the freshly-built path */
 2359|    218|    vptr = val;
 2360|       |	/* exception characters from xmlSaveUri */
 2361|    218|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   35|    218|#define BAD_CAST (xmlChar *)
  ------------------
 2362|    218|    xmlFree(vptr);
 2363|       |
 2364|  1.14k|done:
 2365|       |    /*
 2366|       |     * Free the working variables
 2367|       |     */
 2368|  1.14k|    if (remove_path != 0)
  ------------------
  |  Branch (2368:9): [True: 51, False: 1.09k]
  ------------------
 2369|     51|        ref->path = NULL;
 2370|  1.14k|    if (ref != NULL)
  ------------------
  |  Branch (2370:9): [True: 1.14k, False: 0]
  ------------------
 2371|  1.14k|	xmlFreeURI (ref);
 2372|  1.14k|    if (bas != NULL)
  ------------------
  |  Branch (2372:9): [True: 1.07k, False: 72]
  ------------------
 2373|  1.07k|	xmlFreeURI (bas);
 2374|       |
 2375|  1.14k|    return val;
 2376|    218|}
xmlCanonicPath:
 2396|  6.77k|{
 2397|       |/*
 2398|       | * For Windows implementations, additional work needs to be done to
 2399|       | * replace backslashes in pathnames with "forward slashes"
 2400|       | */
 2401|       |#if defined(_WIN32)
 2402|       |    int len = 0;
 2403|       |    char *p = NULL;
 2404|       |#endif
 2405|  6.77k|    xmlURIPtr uri;
 2406|  6.77k|    xmlChar *ret;
 2407|  6.77k|    const xmlChar *absuri;
 2408|       |
 2409|  6.77k|    if (path == NULL)
  ------------------
  |  Branch (2409:9): [True: 9, False: 6.76k]
  ------------------
 2410|      9|	return(NULL);
 2411|       |
 2412|       |#if defined(_WIN32)
 2413|       |    /*
 2414|       |     * We must not change the backslashes to slashes if the the path
 2415|       |     * starts with \\?\
 2416|       |     * Those paths can be up to 32k characters long.
 2417|       |     * Was added specifically for OpenOffice, those paths can't be converted
 2418|       |     * to URIs anyway.
 2419|       |     */
 2420|       |    if ((path[0] == '\\') && (path[1] == '\\') && (path[2] == '?') &&
 2421|       |        (path[3] == '\\') )
 2422|       |	return xmlStrdup((const xmlChar *) path);
 2423|       |#endif
 2424|       |
 2425|       |	/* sanitize filename starting with // so it can be used as URI */
 2426|  6.76k|    if ((path[0] == '/') && (path[1] == '/') && (path[2] != '/'))
  ------------------
  |  Branch (2426:9): [True: 1.40k, False: 5.35k]
  |  Branch (2426:29): [True: 1.11k, False: 297]
  |  Branch (2426:49): [True: 1.07k, False: 40]
  ------------------
 2427|  1.07k|        path++;
 2428|       |
 2429|  6.76k|    if ((uri = xmlParseURI((const char *) path)) != NULL) {
  ------------------
  |  Branch (2429:9): [True: 1.74k, False: 5.01k]
  ------------------
 2430|  1.74k|	xmlFreeURI(uri);
 2431|  1.74k|	return xmlStrdup(path);
 2432|  1.74k|    }
 2433|       |
 2434|       |    /* Check if this is an "absolute uri" */
 2435|  5.01k|    absuri = xmlStrstr(path, BAD_CAST "://");
  ------------------
  |  |   35|  5.01k|#define BAD_CAST (xmlChar *)
  ------------------
 2436|  5.01k|    if (absuri != NULL) {
  ------------------
  |  Branch (2436:9): [True: 682, False: 4.33k]
  ------------------
 2437|    682|        int l, j;
 2438|    682|	unsigned char c;
 2439|    682|	xmlChar *escURI;
 2440|       |
 2441|       |        /*
 2442|       |	 * this looks like an URI where some parts have not been
 2443|       |	 * escaped leading to a parsing problem.  Check that the first
 2444|       |	 * part matches a protocol.
 2445|       |	 */
 2446|    682|	l = absuri - path;
 2447|       |	/* Bypass if first part (part before the '://') is > 20 chars */
 2448|    682|	if ((l <= 0) || (l > 20))
  ------------------
  |  Branch (2448:6): [True: 2, False: 680]
  |  Branch (2448:18): [True: 48, False: 632]
  ------------------
 2449|     50|	    goto path_processing;
 2450|       |	/* Bypass if any non-alpha characters are present in first part */
 2451|  1.57k|	for (j = 0;j < l;j++) {
  ------------------
  |  Branch (2451:13): [True: 1.00k, False: 578]
  ------------------
 2452|  1.00k|	    c = path[j];
 2453|  1.00k|	    if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))))
  ------------------
  |  Branch (2453:13): [True: 534, False: 466]
  |  Branch (2453:27): [True: 513, False: 21]
  |  Branch (2453:43): [True: 462, False: 25]
  |  Branch (2453:57): [True: 433, False: 29]
  ------------------
 2454|     54|	        goto path_processing;
 2455|  1.00k|	}
 2456|       |
 2457|       |	/* Escape all except the characters specified in the supplied path */
 2458|    578|        escURI = xmlURIEscapeStr(path, BAD_CAST ":/?_.#&;=");
  ------------------
  |  |   35|    578|#define BAD_CAST (xmlChar *)
  ------------------
 2459|    578|	if (escURI != NULL) {
  ------------------
  |  Branch (2459:6): [True: 508, False: 70]
  ------------------
 2460|       |	    /* Try parsing the escaped path */
 2461|    508|	    uri = xmlParseURI((const char *) escURI);
 2462|       |	    /* If successful, return the escaped string */
 2463|    508|	    if (uri != NULL) {
  ------------------
  |  Branch (2463:10): [True: 436, False: 72]
  ------------------
 2464|    436|	        xmlFreeURI(uri);
 2465|    436|		return escURI;
 2466|    436|	    }
 2467|     72|            xmlFree(escURI);
 2468|     72|	}
 2469|    578|    }
 2470|       |
 2471|  4.57k|path_processing:
 2472|       |/* For Windows implementations, replace backslashes with 'forward slashes' */
 2473|       |#if defined(_WIN32)
 2474|       |    /*
 2475|       |     * Create a URI structure
 2476|       |     */
 2477|       |    uri = xmlCreateURI();
 2478|       |    if (uri == NULL) {		/* Guard against 'out of memory' */
 2479|       |        return(NULL);
 2480|       |    }
 2481|       |
 2482|       |    len = xmlStrlen(path);
 2483|       |    if ((len > 2) && IS_WINDOWS_PATH(path)) {
 2484|       |        /* make the scheme 'file' */
 2485|       |	uri->scheme = (char *) xmlStrdup(BAD_CAST "file");
 2486|       |	/* allocate space for leading '/' + path + string terminator */
 2487|       |	uri->path = xmlMallocAtomic(len + 2);
 2488|       |	if (uri->path == NULL) {
 2489|       |	    xmlFreeURI(uri);	/* Guard against 'out of memory' */
 2490|       |	    return(NULL);
 2491|       |	}
 2492|       |	/* Put in leading '/' plus path */
 2493|       |	uri->path[0] = '/';
 2494|       |	p = uri->path + 1;
 2495|       |	strncpy(p, (char *) path, len + 1);
 2496|       |    } else {
 2497|       |	uri->path = (char *) xmlStrdup(path);
 2498|       |	if (uri->path == NULL) {
 2499|       |	    xmlFreeURI(uri);
 2500|       |	    return(NULL);
 2501|       |	}
 2502|       |	p = uri->path;
 2503|       |    }
 2504|       |    /* Now change all occurrences of '\' to '/' */
 2505|       |    while (*p != '\0') {
 2506|       |	if (*p == '\\')
 2507|       |	    *p = '/';
 2508|       |	p++;
 2509|       |    }
 2510|       |
 2511|       |    if (uri->scheme == NULL) {
 2512|       |	ret = xmlStrdup((const xmlChar *) uri->path);
 2513|       |    } else {
 2514|       |	ret = xmlSaveUri(uri);
 2515|       |    }
 2516|       |
 2517|       |    xmlFreeURI(uri);
 2518|       |#else
 2519|  4.57k|    ret = xmlStrdup((const xmlChar *) path);
 2520|  4.57k|#endif
 2521|  4.57k|    return(ret);
 2522|  5.01k|}
xmlPathToURI:
 2537|  4.28k|{
 2538|  4.28k|    xmlURIPtr uri;
 2539|  4.28k|    xmlURI temp;
 2540|  4.28k|    xmlChar *ret, *cal;
 2541|       |
 2542|  4.28k|    if (path == NULL)
  ------------------
  |  Branch (2542:9): [True: 9, False: 4.27k]
  ------------------
 2543|      9|        return(NULL);
 2544|       |
 2545|  4.27k|    if ((uri = xmlParseURI((const char *) path)) != NULL) {
  ------------------
  |  Branch (2545:9): [True: 1.79k, False: 2.48k]
  ------------------
 2546|  1.79k|	xmlFreeURI(uri);
 2547|  1.79k|	return xmlStrdup(path);
 2548|  1.79k|    }
 2549|  2.48k|    cal = xmlCanonicPath(path);
 2550|  2.48k|    if (cal == NULL)
  ------------------
  |  Branch (2550:9): [True: 1.11k, False: 1.37k]
  ------------------
 2551|  1.11k|        return(NULL);
 2552|       |#if defined(_WIN32)
 2553|       |    /* xmlCanonicPath can return an URI on Windows (is that the intended behaviour?)
 2554|       |       If 'cal' is a valid URI already then we are done here, as continuing would make
 2555|       |       it invalid. */
 2556|       |    if ((uri = xmlParseURI((const char *) cal)) != NULL) {
 2557|       |	xmlFreeURI(uri);
 2558|       |	return cal;
 2559|       |    }
 2560|       |    /* 'cal' can contain a relative path with backslashes. If that is processed
 2561|       |       by xmlSaveURI, they will be escaped and the external entity loader machinery
 2562|       |       will fail. So convert them to slashes. Misuse 'ret' for walking. */
 2563|       |    ret = cal;
 2564|       |    while (*ret != '\0') {
 2565|       |	if (*ret == '\\')
 2566|       |	    *ret = '/';
 2567|       |	ret++;
 2568|       |    }
 2569|       |#endif
 2570|  1.37k|    memset(&temp, 0, sizeof(temp));
 2571|  1.37k|    temp.path = (char *) cal;
 2572|  1.37k|    ret = xmlSaveUri(&temp);
 2573|  1.37k|    xmlFree(cal);
 2574|  1.37k|    return(ret);
 2575|  2.48k|}
uri.c:xmlParse3986URIReference:
  914|  24.4k|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  915|  24.4k|    int ret;
  916|       |
  917|  24.4k|    if (str == NULL)
  ------------------
  |  Branch (917:9): [True: 0, False: 24.4k]
  ------------------
  918|      0|	return(-1);
  919|  24.4k|    xmlCleanURI(uri);
  920|       |
  921|       |    /*
  922|       |     * Try first to parse absolute refs, then fallback to relative if
  923|       |     * it fails.
  924|       |     */
  925|  24.4k|    ret = xmlParse3986URI(uri, str);
  926|  24.4k|    if (ret != 0) {
  ------------------
  |  Branch (926:9): [True: 21.2k, False: 3.28k]
  ------------------
  927|  21.2k|	xmlCleanURI(uri);
  928|  21.2k|        ret = xmlParse3986RelativeRef(uri, str);
  929|  21.2k|	if (ret != 0) {
  ------------------
  |  Branch (929:6): [True: 10.1k, False: 11.0k]
  ------------------
  930|  10.1k|	    xmlCleanURI(uri);
  931|  10.1k|	    return(ret);
  932|  10.1k|	}
  933|  21.2k|    }
  934|  14.3k|    return(0);
  935|  24.4k|}
uri.c:xmlCleanURI:
 1367|  67.9k|xmlCleanURI(xmlURIPtr uri) {
 1368|  67.9k|    if (uri == NULL) return;
  ------------------
  |  Branch (1368:9): [True: 0, False: 67.9k]
  ------------------
 1369|       |
 1370|  67.9k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1370:9): [True: 4.32k, False: 63.6k]
  ------------------
 1371|  67.9k|    uri->scheme = NULL;
 1372|  67.9k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1372:9): [True: 714, False: 67.2k]
  ------------------
 1373|  67.9k|    uri->server = NULL;
 1374|  67.9k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1374:9): [True: 368, False: 67.6k]
  ------------------
 1375|  67.9k|    uri->user = NULL;
 1376|  67.9k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1376:9): [True: 6.00k, False: 61.9k]
  ------------------
 1377|  67.9k|    uri->path = NULL;
 1378|  67.9k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1378:9): [True: 1.70k, False: 66.2k]
  ------------------
 1379|  67.9k|    uri->fragment = NULL;
 1380|  67.9k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1380:9): [True: 0, False: 67.9k]
  ------------------
 1381|  67.9k|    uri->opaque = NULL;
 1382|  67.9k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1382:9): [True: 0, False: 67.9k]
  ------------------
 1383|  67.9k|    uri->authority = NULL;
 1384|  67.9k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1384:9): [True: 1.70k, False: 66.2k]
  ------------------
 1385|  67.9k|    uri->query = NULL;
 1386|  67.9k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1386:9): [True: 1.67k, False: 66.3k]
  ------------------
 1387|  67.9k|    uri->query_raw = NULL;
 1388|  67.9k|}
uri.c:xmlParse3986URI:
  873|  24.4k|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  874|  24.4k|    int ret;
  875|       |
  876|  24.4k|    ret = xmlParse3986Scheme(uri, &str);
  877|  24.4k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (877:9): [True: 16.8k, False: 7.65k]
  ------------------
  878|  7.65k|    if (*str != ':') {
  ------------------
  |  Branch (878:9): [True: 1.95k, False: 5.69k]
  ------------------
  879|  1.95k|	return(1);
  880|  1.95k|    }
  881|  5.69k|    str++;
  882|  5.69k|    ret = xmlParse3986HierPart(uri, &str);
  883|  5.69k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (883:9): [True: 236, False: 5.45k]
  ------------------
  884|  5.45k|    if (*str == '?') {
  ------------------
  |  Branch (884:9): [True: 370, False: 5.08k]
  ------------------
  885|    370|	str++;
  886|    370|	ret = xmlParse3986Query(uri, &str);
  887|    370|	if (ret != 0) return(ret);
  ------------------
  |  Branch (887:6): [True: 0, False: 370]
  ------------------
  888|    370|    }
  889|  5.45k|    if (*str == '#') {
  ------------------
  |  Branch (889:9): [True: 515, False: 4.94k]
  ------------------
  890|    515|	str++;
  891|    515|	ret = xmlParse3986Fragment(uri, &str);
  892|    515|	if (ret != 0) return(ret);
  ------------------
  |  Branch (892:6): [True: 0, False: 515]
  ------------------
  893|    515|    }
  894|  5.45k|    if (*str != 0) {
  ------------------
  |  Branch (894:9): [True: 2.17k, False: 3.28k]
  ------------------
  895|  2.17k|	xmlCleanURI(uri);
  896|  2.17k|	return(1);
  897|  2.17k|    }
  898|  3.28k|    return(0);
  899|  5.45k|}
uri.c:xmlParse3986Scheme:
  214|  24.4k|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  215|  24.4k|    const char *cur;
  216|       |
  217|  24.4k|    if (str == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 24.4k]
  ------------------
  218|      0|	return(-1);
  219|       |
  220|  24.4k|    cur = *str;
  221|  24.4k|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  153|  24.4k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (153:24): [True: 4.10k, False: 20.3k]
  |  |  |  Branch (153:41): [True: 3.86k, False: 234]
  |  |  ------------------
  |  |  154|  24.4k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (154:24): [True: 4.33k, False: 16.2k]
  |  |  |  Branch (154:41): [True: 3.78k, False: 546]
  |  |  ------------------
  ------------------
  222|  16.8k|	return(2);
  223|  7.65k|    cur++;
  224|   456k|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  153|   913k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (153:24): [True: 204k, False: 251k]
  |  |  |  Branch (153:41): [True: 204k, False: 27]
  |  |  ------------------
  |  |  154|   913k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (154:24): [True: 180k, False: 71.5k]
  |  |  |  Branch (154:41): [True: 180k, False: 47]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  152|   528k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 41.4k, False: 30.2k]
  |  |  |  Branch (152:40): [True: 35.6k, False: 5.80k]
  |  |  ------------------
  ------------------
  225|   456k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (225:12): [True: 2.65k, False: 33.3k]
  |  Branch (225:29): [True: 972, False: 32.3k]
  |  Branch (225:46): [True: 24.7k, False: 7.65k]
  ------------------
  226|  7.65k|    if (uri != NULL) {
  ------------------
  |  Branch (226:9): [True: 7.65k, False: 0]
  ------------------
  227|  7.65k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (227:6): [True: 0, False: 7.65k]
  ------------------
  228|  7.65k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  144|  7.65k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  229|  7.65k|    }
  230|  7.65k|    *str = cur;
  231|  7.65k|    return(0);
  232|  24.4k|}
uri.c:xmlParse3986HierPart:
  766|  5.69k|{
  767|  5.69k|    const char *cur;
  768|  5.69k|    int ret;
  769|       |
  770|  5.69k|    cur = *str;
  771|       |
  772|  5.69k|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (772:9): [True: 3.19k, False: 2.49k]
  |  Branch (772:26): [True: 2.96k, False: 231]
  ------------------
  773|  2.96k|        cur += 2;
  774|  2.96k|	ret = xmlParse3986Authority(uri, &cur);
  775|  2.96k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (775:6): [True: 236, False: 2.73k]
  ------------------
  776|       |        /*
  777|       |         * An empty server is marked with a special URI value.
  778|       |         */
  779|  2.73k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   38|  1.55k|#define PORT_EMPTY           0
  ------------------
  |  Branch (779:6): [True: 1.55k, False: 1.17k]
  |  Branch (779:31): [True: 1.17k, False: 386]
  ------------------
  780|  1.17k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   39|  1.17k|#define PORT_EMPTY_SERVER   -1
  ------------------
  781|  2.73k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  782|  2.73k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (782:6): [True: 0, False: 2.73k]
  ------------------
  783|  2.73k|	*str = cur;
  784|  2.73k|	return(0);
  785|  2.73k|    } else if (*cur == '/') {
  ------------------
  |  Branch (785:16): [True: 231, False: 2.49k]
  ------------------
  786|    231|        ret = xmlParse3986PathAbsolute(uri, &cur);
  787|    231|	if (ret != 0) return(ret);
  ------------------
  |  Branch (787:6): [True: 0, False: 231]
  ------------------
  788|  2.49k|    } else if (ISA_PCHAR(cur)) {
  ------------------
  |  |  199|  2.49k|     (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  186|  4.99k|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.49k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:24): [True: 72, False: 2.42k]
  |  |  |  |  |  |  |  Branch (153:41): [True: 28, False: 44]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.49k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:24): [True: 159, False: 2.31k]
  |  |  |  |  |  |  |  Branch (154:41): [True: 78, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.39k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 281, False: 2.11k]
  |  |  |  |  |  |  |  Branch (152:40): [True: 20, False: 261]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (186:44): [True: 25, False: 2.34k]
  |  |  |  |  ------------------
  |  |  |  |  187|  2.49k|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (187:8): [True: 33, False: 2.31k]
  |  |  |  |  |  Branch (187:27): [True: 19, False: 2.29k]
  |  |  |  |  |  Branch (187:46): [True: 20, False: 2.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  193|  4.77k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    317|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|    634|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 253, False: 64]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 61, False: 192]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 95, False: 161]
  |  |  |  |  |  |  |  Branch (156:43): [True: 76, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|    317|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 102, False: 78]
  |  |  |  |  |  |  |  Branch (157:27): [True: 66, False: 36]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    203|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|    406|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 130, False: 73]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 23, False: 107]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 47, False: 133]
  |  |  |  |  |  |  |  Branch (156:43): [True: 23, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|    203|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 72, False: 85]
  |  |  |  |  |  |  |  Branch (157:27): [True: 22, False: 50]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (193:7): [True: 317, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  164|  4.70k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (164:8): [True: 19, False: 2.18k]
  |  |  |  |  |  Branch (164:27): [True: 24, False: 2.16k]
  |  |  |  |  |  Branch (164:46): [True: 18, False: 2.14k]
  |  |  |  |  ------------------
  |  |  |  |  165|  2.20k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (165:8): [True: 31, False: 2.11k]
  |  |  |  |  |  Branch (165:27): [True: 19, False: 2.09k]
  |  |  |  |  |  Branch (165:46): [True: 19, False: 2.07k]
  |  |  |  |  ------------------
  |  |  |  |  166|  2.20k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (166:8): [True: 24, False: 2.05k]
  |  |  |  |  |  Branch (166:27): [True: 19, False: 2.03k]
  |  |  |  |  |  Branch (166:46): [True: 18, False: 2.01k]
  |  |  |  |  ------------------
  |  |  |  |  167|  2.20k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:8): [True: 28, False: 1.98k]
  |  |  |  |  |  Branch (167:27): [True: 19, False: 1.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  200|  2.49k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (200:7): [True: 85, False: 1.88k]
  |  |  |  Branch (200:26): [True: 23, False: 1.86k]
  |  |  ------------------
  ------------------
  789|    637|        ret = xmlParse3986PathRootless(uri, &cur);
  790|    637|	if (ret != 0) return(ret);
  ------------------
  |  Branch (790:6): [True: 0, False: 637]
  ------------------
  791|  1.86k|    } else {
  792|       |	/* path-empty is effectively empty */
  793|  1.86k|	if (uri != NULL) {
  ------------------
  |  Branch (793:6): [True: 1.86k, False: 0]
  ------------------
  794|  1.86k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (794:10): [True: 0, False: 1.86k]
  ------------------
  795|  1.86k|	    uri->path = NULL;
  796|  1.86k|	}
  797|  1.86k|    }
  798|  2.72k|    *str = cur;
  799|  2.72k|    return (0);
  800|  5.69k|}
uri.c:xmlParse3986Authority:
  522|  6.12k|{
  523|  6.12k|    const char *cur;
  524|  6.12k|    int ret;
  525|       |
  526|  6.12k|    cur = *str;
  527|       |    /*
  528|       |     * try to parse an userinfo and check for the trailing @
  529|       |     */
  530|  6.12k|    ret = xmlParse3986Userinfo(uri, &cur);
  531|  6.12k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (531:9): [True: 4.07k, False: 2.04k]
  |  Branch (531:23): [True: 0, False: 2.04k]
  ------------------
  532|  4.07k|        cur = *str;
  533|  2.04k|    else
  534|  2.04k|        cur++;
  535|  6.12k|    ret = xmlParse3986Host(uri, &cur);
  536|  6.12k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (536:9): [True: 129, False: 5.99k]
  ------------------
  537|  5.99k|    if (*cur == ':') {
  ------------------
  |  Branch (537:9): [True: 1.24k, False: 4.75k]
  ------------------
  538|  1.24k|        cur++;
  539|  1.24k|        ret = xmlParse3986Port(uri, &cur);
  540|  1.24k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (540:6): [True: 263, False: 980]
  ------------------
  541|  1.24k|    }
  542|  5.73k|    *str = cur;
  543|  5.73k|    return(0);
  544|  5.99k|}
uri.c:xmlParse3986Userinfo:
  371|  6.12k|{
  372|  6.12k|    const char *cur;
  373|       |
  374|  6.12k|    cur = *str;
  375|  54.1k|    while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  186|   108k|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  153|  54.1k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (153:24): [True: 2.68k, False: 51.4k]
  |  |  |  |  |  Branch (153:41): [True: 1.70k, False: 982]
  |  |  |  |  ------------------
  |  |  |  |  154|  54.1k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (154:24): [True: 4.51k, False: 47.9k]
  |  |  |  |  |  Branch (154:41): [True: 2.63k, False: 1.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  152|  49.8k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (152:23): [True: 13.9k, False: 35.8k]
  |  |  |  |  |  Branch (152:40): [True: 7.04k, False: 6.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (186:44): [True: 725, False: 42.0k]
  |  |  ------------------
  |  |  187|  54.1k|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (187:8): [True: 996, False: 41.0k]
  |  |  |  Branch (187:27): [True: 574, False: 40.4k]
  |  |  |  Branch (187:46): [True: 958, False: 39.5k]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  193|  93.6k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  156|  21.7k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  43.5k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 21.6k, False: 147]
  |  |  |  |  |  |  |  Branch (152:40): [True: 11.2k, False: 10.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (156:26): [True: 567, False: 9.91k]
  |  |  |  |  |  Branch (156:43): [True: 541, False: 26]
  |  |  |  |  ------------------
  |  |  |  |  157|  21.7k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:10): [True: 9.78k, False: 162]
  |  |  |  |  |  Branch (157:27): [True: 9.73k, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  156|  21.5k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  43.0k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 21.3k, False: 168]
  |  |  |  |  |  |  |  Branch (152:40): [True: 4.31k, False: 17.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (156:26): [True: 2.69k, False: 14.5k]
  |  |  |  |  |  Branch (156:43): [True: 2.66k, False: 28]
  |  |  |  |  ------------------
  |  |  |  |  157|  21.5k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:10): [True: 14.3k, False: 184]
  |  |  |  |  |  Branch (157:27): [True: 14.3k, False: 53]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (193:7): [True: 21.7k, False: 17.7k]
  |  |  ------------------
  ------------------
  376|  54.1k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  164|  72.3k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (164:8): [True: 728, False: 17.4k]
  |  |  |  Branch (164:27): [True: 1.00k, False: 16.4k]
  |  |  |  Branch (164:46): [True: 588, False: 15.8k]
  |  |  ------------------
  |  |  165|  18.1k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (165:8): [True: 2.82k, False: 13.0k]
  |  |  |  Branch (165:27): [True: 780, False: 12.2k]
  |  |  |  Branch (165:46): [True: 627, False: 11.6k]
  |  |  ------------------
  |  |  166|  18.1k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (166:8): [True: 657, False: 10.9k]
  |  |  |  Branch (166:27): [True: 1.23k, False: 9.75k]
  |  |  |  Branch (166:46): [True: 614, False: 9.14k]
  |  |  ------------------
  |  |  167|  18.1k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (167:8): [True: 601, False: 8.54k]
  |  |  |  Branch (167:27): [True: 727, False: 7.81k]
  |  |  ------------------
  ------------------
  |  Branch (376:34): [True: 1.68k, False: 6.12k]
  ------------------
  377|  48.0k|	NEXT(cur);
  ------------------
  |  |  132|  48.0k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (132:18): [True: 21.3k, False: 26.7k]
  |  |  ------------------
  ------------------
  378|  6.12k|    if (*cur == '@') {
  ------------------
  |  Branch (378:9): [True: 2.04k, False: 4.07k]
  ------------------
  379|  2.04k|	if (uri != NULL) {
  ------------------
  |  Branch (379:6): [True: 2.04k, False: 0]
  ------------------
  380|  2.04k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (380:10): [True: 0, False: 2.04k]
  ------------------
  381|  2.04k|	    if (uri->cleanup & 2)
  ------------------
  |  Branch (381:10): [True: 422, False: 1.62k]
  ------------------
  382|    422|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  144|    422|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  383|  1.62k|	    else
  384|  1.62k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  385|  2.04k|	}
  386|  2.04k|	*str = cur;
  387|  2.04k|	return(0);
  388|  2.04k|    }
  389|  4.07k|    return(1);
  390|  6.12k|}
uri.c:xmlParse3986Host:
  446|  6.12k|{
  447|  6.12k|    const char *cur = *str;
  448|  6.12k|    const char *host;
  449|       |
  450|  6.12k|    host = cur;
  451|       |    /*
  452|       |     * IPv6 and future addressing scheme are enclosed between brackets
  453|       |     */
  454|  6.12k|    if (*cur == '[') {
  ------------------
  |  Branch (454:9): [True: 985, False: 5.14k]
  ------------------
  455|    985|        cur++;
  456|   690k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (456:9): [True: 689k, False: 856]
  |  Branch (456:26): [True: 689k, False: 129]
  ------------------
  457|   689k|	    cur++;
  458|    985|	if (*cur != ']')
  ------------------
  |  Branch (458:6): [True: 129, False: 856]
  ------------------
  459|    129|	    return(1);
  460|    856|	cur++;
  461|    856|	goto found;
  462|    985|    }
  463|       |    /*
  464|       |     * try to parse an IPv4
  465|       |     */
  466|  5.14k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  152|  5.14k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 2.37k, False: 2.76k]
  |  |  |  Branch (152:40): [True: 195, False: 2.17k]
  |  |  ------------------
  ------------------
  467|    195|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (467:13): [True: 13, False: 182]
  ------------------
  468|     13|	    goto not_ipv4;
  469|    182|	if (*cur != '.')
  ------------------
  |  Branch (469:6): [True: 177, False: 5]
  ------------------
  470|    177|	    goto not_ipv4;
  471|      5|	cur++;
  472|      5|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (472:13): [True: 0, False: 5]
  ------------------
  473|      0|	    goto not_ipv4;
  474|      5|	if (*cur != '.')
  ------------------
  |  Branch (474:6): [True: 5, False: 0]
  ------------------
  475|      5|	    goto not_ipv4;
  476|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (476:13): [True: 0, False: 0]
  ------------------
  477|      0|	    goto not_ipv4;
  478|      0|	if (*cur != '.')
  ------------------
  |  Branch (478:6): [True: 0, False: 0]
  ------------------
  479|      0|	    goto not_ipv4;
  480|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|	    goto not_ipv4;
  482|      0|	goto found;
  483|    195|not_ipv4:
  484|    195|        cur = *str;
  485|    195|    }
  486|       |    /*
  487|       |     * then this should be a hostname which can be empty
  488|       |     */
  489|  34.1k|    while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  186|  68.3k|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  153|  34.1k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (153:24): [True: 1.54k, False: 32.6k]
  |  |  |  |  |  Branch (153:41): [True: 1.08k, False: 465]
  |  |  |  |  ------------------
  |  |  |  |  154|  34.1k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (154:24): [True: 2.17k, False: 30.9k]
  |  |  |  |  |  Branch (154:41): [True: 1.39k, False: 780]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  152|  31.6k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (152:23): [True: 4.17k, False: 27.5k]
  |  |  |  |  |  Branch (152:40): [True: 1.03k, False: 3.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (186:44): [True: 511, False: 30.1k]
  |  |  ------------------
  |  |  187|  34.1k|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (187:8): [True: 637, False: 29.5k]
  |  |  |  Branch (187:27): [True: 275, False: 29.2k]
  |  |  |  Branch (187:46): [True: 442, False: 28.7k]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  193|  62.9k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  156|  19.7k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  39.5k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 19.6k, False: 144]
  |  |  |  |  |  |  |  Branch (152:40): [True: 11.3k, False: 8.25k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (156:26): [True: 531, False: 7.87k]
  |  |  |  |  |  Branch (156:43): [True: 505, False: 26]
  |  |  |  |  ------------------
  |  |  |  |  157|  19.7k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:10): [True: 7.73k, False: 159]
  |  |  |  |  |  Branch (157:27): [True: 7.69k, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  156|  19.5k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  39.0k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 19.3k, False: 168]
  |  |  |  |  |  |  |  Branch (152:40): [True: 4.36k, False: 15.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (156:26): [True: 528, False: 14.6k]
  |  |  |  |  |  Branch (156:43): [True: 500, False: 28]
  |  |  |  |  ------------------
  |  |  |  |  157|  19.5k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:10): [True: 14.4k, False: 184]
  |  |  |  |  |  Branch (157:27): [True: 14.4k, False: 53]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (193:7): [True: 19.7k, False: 9.03k]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  164|  9.47k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (164:8): [True: 321, False: 9.15k]
  |  |  |  Branch (164:27): [True: 672, False: 8.48k]
  |  |  |  Branch (164:46): [True: 249, False: 8.23k]
  |  |  ------------------
  |  |  165|  9.47k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (165:8): [True: 269, False: 7.96k]
  |  |  |  Branch (165:27): [True: 387, False: 7.57k]
  |  |  |  Branch (165:46): [True: 250, False: 7.32k]
  |  |  ------------------
  |  |  166|  9.47k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (166:8): [True: 260, False: 7.06k]
  |  |  |  Branch (166:27): [True: 552, False: 6.51k]
  |  |  |  Branch (166:46): [True: 602, False: 5.91k]
  |  |  ------------------
  |  |  167|  9.47k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (167:8): [True: 324, False: 5.59k]
  |  |  |  Branch (167:27): [True: 450, False: 5.14k]
  |  |  ------------------
  ------------------
  490|  29.0k|        NEXT(cur);
  ------------------
  |  |  132|  34.1k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (132:18): [True: 19.3k, False: 9.70k]
  |  |  ------------------
  ------------------
  491|  5.99k|found:
  492|  5.99k|    if (uri != NULL) {
  ------------------
  |  Branch (492:9): [True: 5.99k, False: 0]
  ------------------
  493|  5.99k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (493:6): [True: 0, False: 5.99k]
  ------------------
  494|  5.99k|	uri->authority = NULL;
  495|  5.99k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (495:6): [True: 0, False: 5.99k]
  ------------------
  496|  5.99k|	if (cur != host) {
  ------------------
  |  Branch (496:6): [True: 3.18k, False: 2.81k]
  ------------------
  497|  3.18k|	    if (uri->cleanup & 2)
  ------------------
  |  Branch (497:10): [True: 616, False: 2.56k]
  ------------------
  498|    616|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  144|    616|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  499|  2.56k|	    else
  500|  2.56k|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  501|  3.18k|	} else
  502|  2.81k|	    uri->server = NULL;
  503|  5.99k|    }
  504|  5.99k|    *str = cur;
  505|  5.99k|    return(0);
  506|  5.14k|}
uri.c:xmlParse3986DecOctet:
  407|    200|xmlParse3986DecOctet(const char **str) {
  408|    200|    const char *cur = *str;
  409|       |
  410|    200|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  152|    200|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 200, False: 0]
  |  |  |  Branch (152:40): [True: 200, False: 0]
  |  |  ------------------
  ------------------
  411|      0|        return(1);
  412|    200|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  152|    200|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 85, False: 115]
  |  |  |  Branch (152:40): [True: 48, False: 37]
  |  |  ------------------
  ------------------
  413|    152|	cur++;
  414|     48|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  152|     44|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 44, False: 0]
  |  |  |  Branch (152:40): [True: 44, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  152|     44|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 40, False: 4]
  |  |  |  Branch (152:40): [True: 40, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (414:14): [True: 44, False: 4]
  ------------------
  415|      4|	cur += 2;
  416|     44|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  152|     12|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 12, False: 0]
  |  |  |  Branch (152:40): [True: 12, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  152|     12|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 12, False: 0]
  |  |  |  Branch (152:40): [True: 12, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (416:14): [True: 12, False: 32]
  ------------------
  417|     12|	cur += 3;
  418|     32|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (418:14): [True: 19, False: 13]
  |  Branch (418:31): [True: 19, False: 0]
  ------------------
  419|     32|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  152|     11|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 11, False: 0]
  |  |  |  Branch (152:40): [True: 11, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (419:7): [True: 11, False: 8]
  ------------------
  420|     11|	cur += 3;
  421|     21|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (421:14): [True: 8, False: 13]
  |  Branch (421:31): [True: 8, False: 0]
  ------------------
  422|     21|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (422:7): [True: 8, False: 0]
  |  Branch (422:30): [True: 8, False: 0]
  ------------------
  423|      8|	cur += 3;
  424|     13|    else
  425|     13|        return(1);
  426|    187|    *str = cur;
  427|    187|    return(0);
  428|    200|}
uri.c:xmlParse3986Port:
  332|  1.24k|{
  333|  1.24k|    const char *cur = *str;
  334|  1.24k|    int port = 0;
  335|       |
  336|  1.24k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  152|  1.24k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 1.07k, False: 168]
  |  |  |  Branch (152:40): [True: 1.03k, False: 42]
  |  |  ------------------
  ------------------
  337|  6.65k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  152|  6.65k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (152:23): [True: 5.76k, False: 891]
  |  |  |  Branch (152:40): [True: 5.67k, False: 89]
  |  |  ------------------
  ------------------
  338|  5.67k|            int digit = *cur - '0';
  339|       |
  340|  5.67k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (340:17): [True: 35, False: 5.64k]
  ------------------
  341|     35|                return(1);
  342|  5.64k|            port *= 10;
  343|  5.64k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (343:17): [True: 18, False: 5.62k]
  ------------------
  344|     18|                return(1);
  345|  5.62k|	    port += digit;
  346|       |
  347|  5.62k|	    cur++;
  348|  5.62k|	}
  349|    980|	if (uri != NULL)
  ------------------
  |  Branch (349:6): [True: 980, False: 0]
  ------------------
  350|    980|	    uri->port = port;
  351|    980|	*str = cur;
  352|    980|	return(0);
  353|  1.03k|    }
  354|    210|    return(1);
  355|  1.24k|}
uri.c:xmlParse3986PathAbEmpty:
  593|  5.73k|{
  594|  5.73k|    const char *cur;
  595|  5.73k|    int ret;
  596|       |
  597|  5.73k|    cur = *str;
  598|       |
  599|   155k|    while (*cur == '/') {
  ------------------
  |  Branch (599:12): [True: 149k, False: 5.73k]
  ------------------
  600|   149k|        cur++;
  601|   149k|	ret = xmlParse3986Segment(&cur, 0, 1);
  602|   149k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (602:6): [True: 0, False: 149k]
  ------------------
  603|   149k|    }
  604|  5.73k|    if (uri != NULL) {
  ------------------
  |  Branch (604:9): [True: 5.73k, False: 0]
  ------------------
  605|  5.73k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (605:6): [True: 0, False: 5.73k]
  ------------------
  606|  5.73k|        if (*str != cur) {
  ------------------
  |  Branch (606:13): [True: 747, False: 4.98k]
  ------------------
  607|    747|            if (uri->cleanup & 2)
  ------------------
  |  Branch (607:17): [True: 105, False: 642]
  ------------------
  608|    105|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  144|    105|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  609|    642|            else
  610|    642|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  611|  4.98k|        } else {
  612|  4.98k|            uri->path = NULL;
  613|  4.98k|        }
  614|  5.73k|    }
  615|  5.73k|    *str = cur;
  616|  5.73k|    return (0);
  617|  5.73k|}
uri.c:xmlParse3986Segment:
  564|   273k|{
  565|   273k|    const char *cur;
  566|       |
  567|   273k|    cur = *str;
  568|   273k|    if (!ISA_PCHAR(cur)) {
  ------------------
  |  |  199|   273k|     (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  186|   546k|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   273k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:24): [True: 4.42k, False: 268k]
  |  |  |  |  |  |  |  Branch (153:41): [True: 3.63k, False: 788]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   273k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:24): [True: 4.21k, False: 265k]
  |  |  |  |  |  |  |  Branch (154:41): [True: 3.00k, False: 1.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   266k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 7.22k, False: 259k]
  |  |  |  |  |  |  |  Branch (152:40): [True: 986, False: 6.23k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (186:44): [True: 4.36k, False: 261k]
  |  |  |  |  ------------------
  |  |  |  |  187|   273k|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (187:8): [True: 36.5k, False: 224k]
  |  |  |  |  |  Branch (187:27): [True: 338, False: 224k]
  |  |  |  |  |  Branch (187:46): [True: 764, False: 223k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  193|   496k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  2.04k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  4.08k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 1.92k, False: 117]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 662, False: 1.26k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 796, False: 582]
  |  |  |  |  |  |  |  Branch (156:43): [True: 770, False: 26]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  2.04k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 466, False: 142]
  |  |  |  |  |  |  |  Branch (157:27): [True: 417, False: 49]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  1.84k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  3.69k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 1.66k, False: 183]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 442, False: 1.22k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 532, False: 875]
  |  |  |  |  |  |  |  Branch (156:43): [True: 509, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  1.84k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 682, False: 216]
  |  |  |  |  |  |  |  Branch (157:27): [True: 636, False: 46]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (193:7): [True: 2.04k, False: 221k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  164|   494k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (164:8): [True: 410, False: 221k]
  |  |  |  |  |  Branch (164:27): [True: 387, False: 221k]
  |  |  |  |  |  Branch (164:46): [True: 384, False: 220k]
  |  |  |  |  ------------------
  |  |  |  |  165|   221k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (165:8): [True: 577, False: 220k]
  |  |  |  |  |  Branch (165:27): [True: 525, False: 219k]
  |  |  |  |  |  Branch (165:46): [True: 876, False: 218k]
  |  |  |  |  ------------------
  |  |  |  |  166|   221k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (166:8): [True: 2.35k, False: 216k]
  |  |  |  |  |  Branch (166:27): [True: 715, False: 215k]
  |  |  |  |  |  Branch (166:46): [True: 1.61k, False: 214k]
  |  |  |  |  ------------------
  |  |  |  |  167|   221k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:8): [True: 584, False: 213k]
  |  |  |  |  |  Branch (167:27): [True: 986, False: 212k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  200|   273k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (200:7): [True: 1.67k, False: 210k]
  |  |  |  Branch (200:26): [True: 1.06k, False: 209k]
  |  |  ------------------
  ------------------
  569|   209k|        if (empty)
  ------------------
  |  Branch (569:13): [True: 208k, False: 781]
  ------------------
  570|   208k|	    return(0);
  571|    781|	return(1);
  572|   209k|    }
  573|   401k|    while (ISA_PCHAR(cur) && (*cur != forbid))
  ------------------
  |  |  199|   803k|     (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  186|   803k|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   401k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:24): [True: 53.1k, False: 348k]
  |  |  |  |  |  |  |  Branch (153:41): [True: 46.9k, False: 6.17k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   401k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:24): [True: 108k, False: 246k]
  |  |  |  |  |  |  |  Branch (154:41): [True: 100k, False: 7.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   254k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 35.7k, False: 218k]
  |  |  |  |  |  |  |  Branch (152:40): [True: 6.65k, False: 29.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (186:44): [True: 10.4k, False: 237k]
  |  |  |  |  ------------------
  |  |  |  |  187|   401k|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (187:8): [True: 52.3k, False: 185k]
  |  |  |  |  |  Branch (187:27): [True: 1.11k, False: 183k]
  |  |  |  |  |  Branch (187:46): [True: 6.09k, False: 177k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  193|   579k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  76.8k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|   153k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 76.6k, False: 247]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 4.27k, False: 72.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 1.39k, False: 71.1k]
  |  |  |  |  |  |  |  Branch (156:43): [True: 1.36k, False: 26]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  76.8k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 70.9k, False: 265]
  |  |  |  |  |  |  |  Branch (157:27): [True: 70.8k, False: 64]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  76.5k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|   153k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 76.4k, False: 133]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 18.1k, False: 58.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 891, False: 57.4k]
  |  |  |  |  |  |  |  Branch (156:43): [True: 845, False: 46]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  76.5k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 57.3k, False: 158]
  |  |  |  |  |  |  |  Branch (157:27): [True: 57.3k, False: 73]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (193:7): [True: 76.8k, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  164|   503k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (164:8): [True: 1.27k, False: 100k]
  |  |  |  |  |  Branch (164:27): [True: 1.17k, False: 99.1k]
  |  |  |  |  |  Branch (164:46): [True: 1.30k, False: 97.8k]
  |  |  |  |  ------------------
  |  |  |  |  165|   101k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (165:8): [True: 2.17k, False: 95.6k]
  |  |  |  |  |  Branch (165:27): [True: 2.16k, False: 93.4k]
  |  |  |  |  |  Branch (165:46): [True: 2.59k, False: 90.8k]
  |  |  |  |  ------------------
  |  |  |  |  166|   101k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (166:8): [True: 3.74k, False: 87.1k]
  |  |  |  |  |  Branch (166:27): [True: 1.56k, False: 85.5k]
  |  |  |  |  |  Branch (166:46): [True: 2.46k, False: 83.1k]
  |  |  |  |  ------------------
  |  |  |  |  167|   101k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:8): [True: 1.30k, False: 81.7k]
  |  |  |  |  |  Branch (167:27): [True: 3.58k, False: 78.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  200|   401k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (200:7): [True: 15.6k, False: 62.5k]
  |  |  |  Branch (200:26): [True: 1.82k, False: 60.7k]
  |  |  ------------------
  ------------------
  |  Branch (573:30): [True: 338k, False: 2.61k]
  ------------------
  574|   338k|        NEXT(cur);
  ------------------
  |  |  132|   401k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (132:18): [True: 76.3k, False: 262k]
  |  |  ------------------
  ------------------
  575|  63.3k|    *str = cur;
  576|  63.3k|    return (0);
  577|   273k|}
uri.c:xmlParse3986PathAbsolute:
  633|  1.98k|{
  634|  1.98k|    const char *cur;
  635|  1.98k|    int ret;
  636|       |
  637|  1.98k|    cur = *str;
  638|       |
  639|  1.98k|    if (*cur != '/')
  ------------------
  |  Branch (639:9): [True: 0, False: 1.98k]
  ------------------
  640|      0|        return(1);
  641|  1.98k|    cur++;
  642|  1.98k|    ret = xmlParse3986Segment(&cur, 0, 0);
  643|  1.98k|    if (ret == 0) {
  ------------------
  |  Branch (643:9): [True: 1.20k, False: 781]
  ------------------
  644|  4.07k|	while (*cur == '/') {
  ------------------
  |  Branch (644:9): [True: 2.87k, False: 1.20k]
  ------------------
  645|  2.87k|	    cur++;
  646|  2.87k|	    ret = xmlParse3986Segment(&cur, 0, 1);
  647|  2.87k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (647:10): [True: 0, False: 2.87k]
  ------------------
  648|  2.87k|	}
  649|  1.20k|    }
  650|  1.98k|    if (uri != NULL) {
  ------------------
  |  Branch (650:9): [True: 1.98k, False: 0]
  ------------------
  651|  1.98k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (651:6): [True: 0, False: 1.98k]
  ------------------
  652|  1.98k|        if (cur != *str) {
  ------------------
  |  Branch (652:13): [True: 1.98k, False: 0]
  ------------------
  653|  1.98k|            if (uri->cleanup & 2)
  ------------------
  |  Branch (653:17): [True: 218, False: 1.76k]
  ------------------
  654|    218|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  144|    218|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  655|  1.76k|            else
  656|  1.76k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  657|  1.98k|        } else {
  658|      0|            uri->path = NULL;
  659|      0|        }
  660|  1.98k|    }
  661|  1.98k|    *str = cur;
  662|  1.98k|    return (0);
  663|  1.98k|}
uri.c:xmlParse3986PathRootless:
  679|    637|{
  680|    637|    const char *cur;
  681|    637|    int ret;
  682|       |
  683|    637|    cur = *str;
  684|       |
  685|    637|    ret = xmlParse3986Segment(&cur, 0, 0);
  686|    637|    if (ret != 0) return(ret);
  ------------------
  |  Branch (686:9): [True: 0, False: 637]
  ------------------
  687|    950|    while (*cur == '/') {
  ------------------
  |  Branch (687:12): [True: 313, False: 637]
  ------------------
  688|    313|        cur++;
  689|    313|	ret = xmlParse3986Segment(&cur, 0, 1);
  690|    313|	if (ret != 0) return(ret);
  ------------------
  |  Branch (690:6): [True: 0, False: 313]
  ------------------
  691|    313|    }
  692|    637|    if (uri != NULL) {
  ------------------
  |  Branch (692:9): [True: 637, False: 0]
  ------------------
  693|    637|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (693:6): [True: 0, False: 637]
  ------------------
  694|    637|        if (cur != *str) {
  ------------------
  |  Branch (694:13): [True: 637, False: 0]
  ------------------
  695|    637|            if (uri->cleanup & 2)
  ------------------
  |  Branch (695:17): [True: 130, False: 507]
  ------------------
  696|    130|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  144|    130|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  697|    507|            else
  698|    507|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  699|    637|        } else {
  700|      0|            uri->path = NULL;
  701|      0|        }
  702|    637|    }
  703|    637|    *str = cur;
  704|    637|    return (0);
  705|    637|}
uri.c:xmlParse3986Query:
  288|  3.14k|{
  289|  3.14k|    const char *cur;
  290|       |
  291|  3.14k|    if (str == NULL)
  ------------------
  |  Branch (291:9): [True: 0, False: 3.14k]
  ------------------
  292|      0|        return (-1);
  293|       |
  294|  3.14k|    cur = *str;
  295|       |
  296|  98.6k|    while ((ISA_PCHAR(cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  199|  98.6k|     (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  186|   197k|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  98.6k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:24): [True: 4.90k, False: 93.7k]
  |  |  |  |  |  |  |  Branch (153:41): [True: 2.28k, False: 2.61k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  98.6k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:24): [True: 8.92k, False: 87.3k]
  |  |  |  |  |  |  |  Branch (154:41): [True: 4.83k, False: 4.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  91.4k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 9.06k, False: 82.4k]
  |  |  |  |  |  |  |  Branch (152:40): [True: 2.44k, False: 6.61k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (186:44): [True: 1.90k, False: 87.1k]
  |  |  |  |  ------------------
  |  |  |  |  187|  98.6k|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (187:8): [True: 10.4k, False: 76.6k]
  |  |  |  |  |  Branch (187:27): [True: 212, False: 76.4k]
  |  |  |  |  |  Branch (187:46): [True: 1.88k, False: 74.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  193|   173k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  35.7k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  71.4k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 35.5k, False: 183]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 16.1k, False: 19.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 745, False: 18.7k]
  |  |  |  |  |  |  |  Branch (156:43): [True: 709, False: 36]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  35.7k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 18.6k, False: 203]
  |  |  |  |  |  |  |  Branch (157:27): [True: 18.5k, False: 59]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  35.4k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  70.8k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 35.2k, False: 171]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 10.6k, False: 24.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 474, False: 24.3k]
  |  |  |  |  |  |  |  Branch (156:43): [True: 446, False: 28]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  35.4k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 24.1k, False: 183]
  |  |  |  |  |  |  |  Branch (157:27): [True: 24.1k, False: 54]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (193:7): [True: 35.7k, False: 38.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  164|   137k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (164:8): [True: 346, False: 38.9k]
  |  |  |  |  |  Branch (164:27): [True: 253, False: 38.7k]
  |  |  |  |  |  Branch (164:46): [True: 214, False: 38.5k]
  |  |  |  |  ------------------
  |  |  |  |  165|  39.3k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (165:8): [True: 274, False: 38.2k]
  |  |  |  |  |  Branch (165:27): [True: 259, False: 37.9k]
  |  |  |  |  |  Branch (165:46): [True: 582, False: 37.4k]
  |  |  |  |  ------------------
  |  |  |  |  166|  39.3k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (166:8): [True: 262, False: 37.1k]
  |  |  |  |  |  Branch (166:27): [True: 248, False: 36.8k]
  |  |  |  |  |  Branch (166:46): [True: 361, False: 36.5k]
  |  |  |  |  ------------------
  |  |  |  |  167|  39.3k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:8): [True: 251, False: 36.2k]
  |  |  |  |  |  Branch (167:27): [True: 841, False: 35.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  200|  98.6k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (200:7): [True: 971, False: 34.4k]
  |  |  |  Branch (200:26): [True: 582, False: 33.8k]
  |  |  ------------------
  ------------------
  |  Branch (296:32): [True: 28.8k, False: 5.08k]
  |  Branch (296:49): [True: 342, False: 4.74k]
  ------------------
  297|  98.6k|           ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
  ------------------
  |  |  109|  2.12k|      (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) ||         \
  |  |  ------------------
  |  |  |  Branch (109:8): [True: 195, False: 1.92k]
  |  |  |  Branch (109:27): [True: 196, False: 1.73k]
  |  |  |  Branch (109:46): [True: 197, False: 1.53k]
  |  |  ------------------
  |  |  110|  2.12k|       ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) ||        \
  |  |  ------------------
  |  |  |  Branch (110:8): [True: 199, False: 1.33k]
  |  |  |  Branch (110:28): [True: 195, False: 1.14k]
  |  |  |  Branch (110:47): [True: 196, False: 945]
  |  |  ------------------
  |  |  111|  2.12k|       ((*(p) == ']')) || ((*(p) == '`')))
  |  |  ------------------
  |  |  |  Branch (111:8): [True: 229, False: 716]
  |  |  |  Branch (111:27): [True: 191, False: 525]
  |  |  ------------------
  ------------------
  |  Branch (297:13): [True: 4.74k, False: 0]
  |  Branch (297:30): [True: 2.12k, False: 2.61k]
  ------------------
  298|  95.4k|        NEXT(cur);
  ------------------
  |  |  132|  98.6k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (132:18): [True: 35.2k, False: 60.2k]
  |  |  ------------------
  ------------------
  299|  3.14k|    if (uri != NULL) {
  ------------------
  |  Branch (299:9): [True: 3.14k, False: 0]
  ------------------
  300|  3.14k|        if (uri->query != NULL)
  ------------------
  |  Branch (300:13): [True: 0, False: 3.14k]
  ------------------
  301|      0|            xmlFree(uri->query);
  302|  3.14k|	if (uri->cleanup & 2)
  ------------------
  |  Branch (302:6): [True: 573, False: 2.56k]
  ------------------
  303|    573|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  144|    573|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  304|  2.56k|	else
  305|  2.56k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  306|       |
  307|       |	/* Save the raw bytes of the query as well.
  308|       |	 * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00114
  309|       |	 */
  310|  3.14k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (310:6): [True: 0, False: 3.14k]
  ------------------
  311|      0|	    xmlFree (uri->query_raw);
  312|  3.14k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  144|  3.14k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  313|  3.14k|    }
  314|  3.14k|    *str = cur;
  315|  3.14k|    return (0);
  316|  3.14k|}
uri.c:xmlParse3986Fragment:
  251|  3.83k|{
  252|  3.83k|    const char *cur;
  253|       |
  254|  3.83k|    if (str == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 3.83k]
  ------------------
  255|      0|        return (-1);
  256|       |
  257|  3.83k|    cur = *str;
  258|       |
  259|  83.4k|    while ((ISA_PCHAR(cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  199|  83.4k|     (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  186|   166k|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  83.4k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:24): [True: 4.85k, False: 78.5k]
  |  |  |  |  |  |  |  Branch (153:41): [True: 2.94k, False: 1.91k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  83.4k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:24): [True: 7.06k, False: 73.4k]
  |  |  |  |  |  |  |  Branch (154:41): [True: 1.27k, False: 5.78k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  79.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 11.7k, False: 67.4k]
  |  |  |  |  |  |  |  Branch (152:40): [True: 1.09k, False: 10.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (186:44): [True: 797, False: 77.3k]
  |  |  |  |  ------------------
  |  |  |  |  187|  83.4k|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (187:8): [True: 1.16k, False: 76.1k]
  |  |  |  |  |  Branch (187:27): [True: 864, False: 75.2k]
  |  |  |  |  |  Branch (187:46): [True: 854, False: 74.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  193|   157k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  29.3k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  58.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 29.1k, False: 192]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 2.50k, False: 26.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 1.47k, False: 25.3k]
  |  |  |  |  |  |  |  Branch (156:43): [True: 1.41k, False: 61]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  29.3k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 25.2k, False: 192]
  |  |  |  |  |  |  |  Branch (157:27): [True: 25.1k, False: 91]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  29.0k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  58.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 28.8k, False: 246]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 8.29k, False: 20.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 881, False: 19.9k]
  |  |  |  |  |  |  |  Branch (156:43): [True: 827, False: 54]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  29.0k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 19.6k, False: 270]
  |  |  |  |  |  |  |  Branch (157:27): [True: 19.6k, False: 67]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (193:7): [True: 29.3k, False: 45.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  164|   129k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (164:8): [True: 895, False: 44.7k]
  |  |  |  |  |  Branch (164:27): [True: 695, False: 44.0k]
  |  |  |  |  |  Branch (164:46): [True: 709, False: 43.3k]
  |  |  |  |  ------------------
  |  |  |  |  165|  45.6k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (165:8): [True: 1.28k, False: 42.1k]
  |  |  |  |  |  Branch (165:27): [True: 941, False: 41.1k]
  |  |  |  |  |  Branch (165:46): [True: 997, False: 40.1k]
  |  |  |  |  ------------------
  |  |  |  |  166|  45.6k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (166:8): [True: 920, False: 39.2k]
  |  |  |  |  |  Branch (166:27): [True: 949, False: 38.2k]
  |  |  |  |  |  Branch (166:46): [True: 732, False: 37.5k]
  |  |  |  |  ------------------
  |  |  |  |  167|  45.6k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:8): [True: 844, False: 36.7k]
  |  |  |  |  |  Branch (167:27): [True: 801, False: 35.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  200|  83.4k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (200:7): [True: 1.24k, False: 34.6k]
  |  |  |  Branch (200:26): [True: 899, False: 33.7k]
  |  |  ------------------
  ------------------
  |  Branch (259:32): [True: 25.2k, False: 8.51k]
  |  Branch (259:49): [True: 1.11k, False: 7.40k]
  ------------------
  260|  83.4k|           (*cur == '[') || (*cur == ']') ||
  ------------------
  |  Branch (260:12): [True: 684, False: 6.71k]
  |  Branch (260:29): [True: 1.37k, False: 5.34k]
  ------------------
  261|  83.4k|           ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
  ------------------
  |  |  109|  2.13k|      (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) ||         \
  |  |  ------------------
  |  |  |  Branch (109:8): [True: 248, False: 1.88k]
  |  |  |  Branch (109:27): [True: 366, False: 1.52k]
  |  |  |  Branch (109:46): [True: 228, False: 1.29k]
  |  |  ------------------
  |  |  110|  2.13k|       ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) ||        \
  |  |  ------------------
  |  |  |  Branch (110:8): [True: 214, False: 1.08k]
  |  |  |  Branch (110:28): [True: 215, False: 865]
  |  |  |  Branch (110:47): [True: 0, False: 865]
  |  |  ------------------
  |  |  111|  2.13k|       ((*(p) == ']')) || ((*(p) == '`')))
  |  |  ------------------
  |  |  |  Branch (111:8): [True: 0, False: 865]
  |  |  |  Branch (111:27): [True: 233, False: 632]
  |  |  ------------------
  ------------------
  |  Branch (261:13): [True: 5.34k, False: 0]
  |  Branch (261:30): [True: 2.13k, False: 3.20k]
  ------------------
  262|  79.5k|        NEXT(cur);
  ------------------
  |  |  132|  83.4k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (132:18): [True: 28.7k, False: 50.8k]
  |  |  ------------------
  ------------------
  263|  3.83k|    if (uri != NULL) {
  ------------------
  |  Branch (263:9): [True: 3.83k, False: 0]
  ------------------
  264|  3.83k|        if (uri->fragment != NULL)
  ------------------
  |  Branch (264:13): [True: 0, False: 3.83k]
  ------------------
  265|      0|            xmlFree(uri->fragment);
  266|  3.83k|	if (uri->cleanup & 2)
  ------------------
  |  Branch (266:6): [True: 695, False: 3.14k]
  ------------------
  267|    695|	    uri->fragment = STRNDUP(*str, cur - *str);
  ------------------
  |  |  144|    695|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  268|  3.14k|	else
  269|  3.14k|	    uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
  270|  3.83k|    }
  271|  3.83k|    *str = cur;
  272|  3.83k|    return (0);
  273|  3.83k|}
uri.c:xmlParse3986RelativeRef:
  819|  21.2k|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  820|  21.2k|    int ret;
  821|       |
  822|  21.2k|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (822:9): [True: 4.91k, False: 16.2k]
  |  Branch (822:26): [True: 3.16k, False: 1.75k]
  ------------------
  823|  3.16k|        str += 2;
  824|  3.16k|	ret = xmlParse3986Authority(uri, &str);
  825|  3.16k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (825:6): [True: 156, False: 3.00k]
  ------------------
  826|  3.00k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  827|  3.00k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (827:6): [True: 0, False: 3.00k]
  ------------------
  828|  18.0k|    } else if (*str == '/') {
  ------------------
  |  Branch (828:16): [True: 1.75k, False: 16.2k]
  ------------------
  829|  1.75k|	ret = xmlParse3986PathAbsolute(uri, &str);
  830|  1.75k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (830:6): [True: 0, False: 1.75k]
  ------------------
  831|  16.2k|    } else if (ISA_PCHAR(str)) {
  ------------------
  |  |  199|  16.2k|     (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  186|  32.5k|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  16.2k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (153:24): [True: 2.40k, False: 13.8k]
  |  |  |  |  |  |  |  Branch (153:41): [True: 2.17k, False: 234]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  16.2k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:24): [True: 2.74k, False: 11.3k]
  |  |  |  |  |  |  |  Branch (154:41): [True: 2.19k, False: 546]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  11.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:23): [True: 3.82k, False: 8.10k]
  |  |  |  |  |  |  |  Branch (152:40): [True: 414, False: 3.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (186:44): [True: 324, False: 11.1k]
  |  |  |  |  ------------------
  |  |  |  |  187|  16.2k|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (187:8): [True: 1.28k, False: 9.90k]
  |  |  |  |  |  Branch (187:27): [True: 118, False: 9.78k]
  |  |  |  |  |  Branch (187:46): [True: 196, False: 9.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  193|  25.8k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    973|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  1.94k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 822, False: 151]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 259, False: 563]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 298, False: 416]
  |  |  |  |  |  |  |  Branch (156:43): [True: 245, False: 53]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|    973|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 293, False: 176]
  |  |  |  |  |  |  |  Branch (157:27): [True: 197, False: 96]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    701|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  1.40k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (152:23): [True: 596, False: 105]
  |  |  |  |  |  |  |  |  |  Branch (152:40): [True: 163, False: 433]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (156:26): [True: 200, False: 338]
  |  |  |  |  |  |  |  Branch (156:43): [True: 165, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  157|    701|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (157:10): [True: 260, False: 113]
  |  |  |  |  |  |  |  Branch (157:27): [True: 189, False: 71]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (193:7): [True: 973, False: 8.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  164|  25.3k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (164:8): [True: 157, False: 8.91k]
  |  |  |  |  |  Branch (164:27): [True: 162, False: 8.75k]
  |  |  |  |  |  Branch (164:46): [True: 159, False: 8.59k]
  |  |  |  |  ------------------
  |  |  |  |  165|  9.07k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (165:8): [True: 178, False: 8.41k]
  |  |  |  |  |  Branch (165:27): [True: 282, False: 8.13k]
  |  |  |  |  |  Branch (165:46): [True: 209, False: 7.92k]
  |  |  |  |  ------------------
  |  |  |  |  166|  9.07k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (166:8): [True: 185, False: 7.74k]
  |  |  |  |  |  Branch (166:27): [True: 254, False: 7.48k]
  |  |  |  |  |  Branch (166:46): [True: 134, False: 7.35k]
  |  |  |  |  ------------------
  |  |  |  |  167|  9.07k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:8): [True: 139, False: 7.21k]
  |  |  |  |  |  Branch (167:27): [True: 207, False: 7.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  200|  16.2k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (200:7): [True: 152, False: 6.85k]
  |  |  |  Branch (200:26): [True: 147, False: 6.70k]
  |  |  ------------------
  ------------------
  832|  9.58k|        ret = xmlParse3986PathNoScheme(uri, &str);
  833|  9.58k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (833:6): [True: 0, False: 9.58k]
  ------------------
  834|  9.58k|    } else {
  835|       |	/* path-empty is effectively empty */
  836|  6.70k|	if (uri != NULL) {
  ------------------
  |  Branch (836:6): [True: 6.70k, False: 0]
  ------------------
  837|  6.70k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (837:10): [True: 0, False: 6.70k]
  ------------------
  838|  6.70k|	    uri->path = NULL;
  839|  6.70k|	}
  840|  6.70k|    }
  841|       |
  842|  21.0k|    if (*str == '?') {
  ------------------
  |  Branch (842:9): [True: 2.77k, False: 18.2k]
  ------------------
  843|  2.77k|	str++;
  844|  2.77k|	ret = xmlParse3986Query(uri, &str);
  845|  2.77k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (845:6): [True: 0, False: 2.77k]
  ------------------
  846|  2.77k|    }
  847|  21.0k|    if (*str == '#') {
  ------------------
  |  Branch (847:9): [True: 3.32k, False: 17.7k]
  ------------------
  848|  3.32k|	str++;
  849|  3.32k|	ret = xmlParse3986Fragment(uri, &str);
  850|  3.32k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (850:6): [True: 0, False: 3.32k]
  ------------------
  851|  3.32k|    }
  852|  21.0k|    if (*str != 0) {
  ------------------
  |  Branch (852:9): [True: 9.98k, False: 11.0k]
  ------------------
  853|  9.98k|	xmlCleanURI(uri);
  854|  9.98k|	return(1);
  855|  9.98k|    }
  856|  11.0k|    return(0);
  857|  21.0k|}
uri.c:xmlParse3986PathNoScheme:
  721|  9.58k|{
  722|  9.58k|    const char *cur;
  723|  9.58k|    int ret;
  724|       |
  725|  9.58k|    cur = *str;
  726|       |
  727|  9.58k|    ret = xmlParse3986Segment(&cur, ':', 0);
  728|  9.58k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (728:9): [True: 0, False: 9.58k]
  ------------------
  729|   117k|    while (*cur == '/') {
  ------------------
  |  Branch (729:12): [True: 108k, False: 9.58k]
  ------------------
  730|   108k|        cur++;
  731|   108k|	ret = xmlParse3986Segment(&cur, 0, 1);
  732|   108k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (732:6): [True: 0, False: 108k]
  ------------------
  733|   108k|    }
  734|  9.58k|    if (uri != NULL) {
  ------------------
  |  Branch (734:9): [True: 9.58k, False: 0]
  ------------------
  735|  9.58k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (735:6): [True: 0, False: 9.58k]
  ------------------
  736|  9.58k|        if (cur != *str) {
  ------------------
  |  Branch (736:13): [True: 9.43k, False: 152]
  ------------------
  737|  9.43k|            if (uri->cleanup & 2)
  ------------------
  |  Branch (737:17): [True: 1.36k, False: 8.07k]
  ------------------
  738|  1.36k|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  144|  1.36k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  739|  8.07k|            else
  740|  8.07k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  741|  9.43k|        } else {
  742|    152|            uri->path = NULL;
  743|    152|        }
  744|  9.58k|    }
  745|  9.58k|    *str = cur;
  746|  9.58k|    return (0);
  747|  9.58k|}
uri.c:xmlURIErrMemory:
   43|  6.42k|{
   44|  6.42k|    if (extra)
  ------------------
  |  Branch (44:9): [True: 6.42k, False: 0]
  ------------------
   45|  6.42k|        __xmlRaiseError(NULL, NULL, NULL,
   46|  6.42k|                        NULL, NULL, XML_FROM_URI,
   47|  6.42k|                        XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0,
   48|  6.42k|                        extra, NULL, NULL, 0, 0,
   49|  6.42k|                        "Memory allocation failed : %s\n", extra);
   50|      0|    else
   51|      0|        __xmlRaiseError(NULL, NULL, NULL,
   52|      0|                        NULL, NULL, XML_FROM_URI,
   53|      0|                        XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0,
   54|      0|                        NULL, NULL, NULL, 0, 0,
   55|      0|                        "Memory allocation failed\n");
   56|  6.42k|}
uri.c:xmlSaveUriRealloc:
 1048|  4.14k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1049|  4.14k|    xmlChar *temp;
 1050|  4.14k|    int tmp;
 1051|       |
 1052|  4.14k|    if (*max > MAX_URI_LENGTH) {
  ------------------
  |  |   36|  4.14k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
  |  Branch (1052:9): [True: 0, False: 4.14k]
  ------------------
 1053|      0|        xmlURIErrMemory("reaching arbitrary MAX_URI_LENGTH limit\n");
 1054|      0|        return(NULL);
 1055|      0|    }
 1056|  4.14k|    tmp = *max * 2;
 1057|  4.14k|    temp = (xmlChar *) xmlRealloc(ret, (tmp + 1));
 1058|  4.14k|    if (temp == NULL) {
  ------------------
  |  Branch (1058:9): [True: 21, False: 4.11k]
  ------------------
 1059|     21|        xmlURIErrMemory("saving URI\n");
 1060|     21|        return(NULL);
 1061|     21|    }
 1062|  4.11k|    *max = tmp;
 1063|  4.11k|    return(temp);
 1064|  4.14k|}
uri.c:is_hex:
 1607|   347k|static int is_hex(char c) {
 1608|   347k|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1608:10): [True: 328k, False: 18.5k]
  |  Branch (1608:24): [True: 77.4k, False: 251k]
  ------------------
 1609|   347k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1609:10): [True: 9.62k, False: 260k]
  |  Branch (1609:24): [True: 9.11k, False: 508]
  ------------------
 1610|   347k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1610:10): [True: 242k, False: 18.6k]
  |  Branch (1610:24): [True: 241k, False: 582]
  ------------------
 1611|   328k|	return(1);
 1612|  19.2k|    return(0);
 1613|   347k|}

xmlRegisterInputCallbacks:
 2181|      6|	xmlInputCloseCallback closeFunc) {
 2182|      6|    if (xmlInputCallbackNr >= MAX_INPUT_CALLBACK) {
  ------------------
  |  |   92|      6|#define MAX_INPUT_CALLBACK 15
  ------------------
  |  Branch (2182:9): [True: 0, False: 6]
  ------------------
 2183|      0|	return(-1);
 2184|      0|    }
 2185|      6|    xmlInputCallbackTable[xmlInputCallbackNr].matchcallback = matchFunc;
 2186|      6|    xmlInputCallbackTable[xmlInputCallbackNr].opencallback = openFunc;
 2187|      6|    xmlInputCallbackTable[xmlInputCallbackNr].readcallback = readFunc;
 2188|      6|    xmlInputCallbackTable[xmlInputCallbackNr].closecallback = closeFunc;
 2189|      6|    xmlInputCallbackInitialized = 1;
 2190|      6|    return(xmlInputCallbackNr++);
 2191|      6|}
xmlRegisterOutputCallbacks:
 2208|      2|	xmlOutputCloseCallback closeFunc) {
 2209|      2|    if (xmlOutputCallbackNr >= MAX_OUTPUT_CALLBACK) {
  ------------------
  |  |  109|      2|#define MAX_OUTPUT_CALLBACK 15
  ------------------
  |  Branch (2209:9): [True: 0, False: 2]
  ------------------
 2210|      0|	return(-1);
 2211|      0|    }
 2212|      2|    xmlOutputCallbackTable[xmlOutputCallbackNr].matchcallback = matchFunc;
 2213|      2|    xmlOutputCallbackTable[xmlOutputCallbackNr].opencallback = openFunc;
 2214|      2|    xmlOutputCallbackTable[xmlOutputCallbackNr].writecallback = writeFunc;
 2215|      2|    xmlOutputCallbackTable[xmlOutputCallbackNr].closecallback = closeFunc;
 2216|      2|    xmlOutputCallbackInitialized = 1;
 2217|      2|    return(xmlOutputCallbackNr++);
 2218|      2|}
xmlRegisterDefaultInputCallbacks:
 2227|      2|xmlRegisterDefaultInputCallbacks(void) {
 2228|      2|    if (xmlInputCallbackInitialized)
  ------------------
  |  Branch (2228:9): [True: 0, False: 2]
  ------------------
 2229|      0|	return;
 2230|       |
 2231|      2|    xmlRegisterInputCallbacks(xmlFileMatch, xmlFileOpen,
 2232|      2|	                      xmlFileRead, xmlFileClose);
 2233|      2|#ifdef LIBXML_ZLIB_ENABLED
 2234|      2|    xmlRegisterInputCallbacks(xmlGzfileMatch, xmlGzfileOpen,
 2235|      2|	                      xmlGzfileRead, xmlGzfileClose);
 2236|      2|#endif /* LIBXML_ZLIB_ENABLED */
 2237|      2|#ifdef LIBXML_LZMA_ENABLED
 2238|      2|    xmlRegisterInputCallbacks(xmlXzfileMatch, xmlXzfileOpen,
 2239|      2|	                      xmlXzfileRead, xmlXzfileClose);
 2240|      2|#endif /* LIBXML_LZMA_ENABLED */
 2241|       |
 2242|       |#ifdef LIBXML_HTTP_ENABLED
 2243|       |    xmlRegisterInputCallbacks(xmlIOHTTPMatch, xmlIOHTTPOpen,
 2244|       |	                      xmlIOHTTPRead, xmlIOHTTPClose);
 2245|       |#endif /* LIBXML_HTTP_ENABLED */
 2246|       |
 2247|       |#ifdef LIBXML_FTP_ENABLED
 2248|       |    xmlRegisterInputCallbacks(xmlIOFTPMatch, xmlIOFTPOpen,
 2249|       |	                      xmlIOFTPRead, xmlIOFTPClose);
 2250|       |#endif /* LIBXML_FTP_ENABLED */
 2251|      2|    xmlInputCallbackInitialized = 1;
 2252|      2|}
xmlRegisterDefaultOutputCallbacks:
 2261|      2|xmlRegisterDefaultOutputCallbacks (void) {
 2262|      2|    if (xmlOutputCallbackInitialized)
  ------------------
  |  Branch (2262:9): [True: 0, False: 2]
  ------------------
 2263|      0|	return;
 2264|       |
 2265|      2|    xmlRegisterOutputCallbacks(xmlFileMatch, xmlFileOpenW,
 2266|      2|	                      xmlFileWrite, xmlFileClose);
 2267|       |
 2268|       |#ifdef LIBXML_HTTP_ENABLED
 2269|       |    xmlRegisterOutputCallbacks(xmlIOHTTPMatch, xmlIOHTTPDfltOpenW,
 2270|       |	                       xmlIOHTTPWrite, xmlIOHTTPClosePut);
 2271|       |#endif
 2272|       |
 2273|       |/*********************************
 2274|       | No way a-priori to distinguish between gzipped files from
 2275|       | uncompressed ones except opening if existing then closing
 2276|       | and saving with same compression ratio ... a pain.
 2277|       |
 2278|       |#ifdef LIBXML_ZLIB_ENABLED
 2279|       |    xmlRegisterOutputCallbacks(xmlGzfileMatch, xmlGzfileOpen,
 2280|       |	                       xmlGzfileWrite, xmlGzfileClose);
 2281|       |#endif
 2282|       |
 2283|       | Nor FTP PUT ....
 2284|       |#ifdef LIBXML_FTP_ENABLED
 2285|       |    xmlRegisterOutputCallbacks(xmlIOFTPMatch, xmlIOFTPOpen,
 2286|       |	                       xmlIOFTPWrite, xmlIOFTPClose);
 2287|       |#endif
 2288|       | **********************************/
 2289|      2|    xmlOutputCallbackInitialized = 1;
 2290|      2|}

xmlInitMemoryInternal:
  895|      2|xmlInitMemoryInternal(void) {
  896|      2|     char *breakpoint;
  897|       |#ifdef DEBUG_MEMORY
  898|       |     xmlGenericError(xmlGenericErrorContext,
  899|       |	     "xmlInitMemory()\n");
  900|       |#endif
  901|      2|     xmlInitMutex(&xmlMemMutex);
  902|       |
  903|      2|     breakpoint = getenv("XML_MEM_BREAKPOINT");
  904|      2|     if (breakpoint != NULL) {
  ------------------
  |  Branch (904:10): [True: 0, False: 2]
  ------------------
  905|      0|         sscanf(breakpoint, "%ud", &xmlMemStopAtBlock);
  906|      0|     }
  907|      2|     breakpoint = getenv("XML_MEM_TRACE");
  908|      2|     if (breakpoint != NULL) {
  ------------------
  |  Branch (908:10): [True: 0, False: 2]
  ------------------
  909|      0|         sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
  910|      0|     }
  911|       |
  912|       |#ifdef DEBUG_MEMORY
  913|       |     xmlGenericError(xmlGenericErrorContext,
  914|       |	     "xmlInitMemory() Ok\n");
  915|       |#endif
  916|      2|}
xmlMemSetup:
  967|      2|            xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc) {
  968|       |#ifdef DEBUG_MEMORY
  969|       |     xmlGenericError(xmlGenericErrorContext,
  970|       |	     "xmlMemSetup()\n");
  971|       |#endif
  972|      2|    if (freeFunc == NULL)
  ------------------
  |  Branch (972:9): [True: 0, False: 2]
  ------------------
  973|      0|	return(-1);
  974|      2|    if (mallocFunc == NULL)
  ------------------
  |  Branch (974:9): [True: 0, False: 2]
  ------------------
  975|      0|	return(-1);
  976|      2|    if (reallocFunc == NULL)
  ------------------
  |  Branch (976:9): [True: 0, False: 2]
  ------------------
  977|      0|	return(-1);
  978|      2|    if (strdupFunc == NULL)
  ------------------
  |  Branch (978:9): [True: 0, False: 2]
  ------------------
  979|      0|	return(-1);
  980|      2|    xmlFree = freeFunc;
  981|      2|    xmlMalloc = mallocFunc;
  982|      2|    xmlMallocAtomic = mallocFunc;
  983|      2|    xmlRealloc = reallocFunc;
  984|      2|    xmlMemStrdup = strdupFunc;
  985|       |#ifdef DEBUG_MEMORY
  986|       |     xmlGenericError(xmlGenericErrorContext,
  987|       |	     "xmlMemSetup() Ok\n");
  988|       |#endif
  989|      2|    return(0);
  990|      2|}

xmlStrndup:
   45|  32.6k|xmlStrndup(const xmlChar *cur, int len) {
   46|  32.6k|    xmlChar *ret;
   47|       |
   48|  32.6k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (48:9): [True: 0, False: 32.6k]
  |  Branch (48:26): [True: 0, False: 32.6k]
  ------------------
   49|  32.6k|    ret = (xmlChar *) xmlMallocAtomic((size_t) len + 1);
   50|  32.6k|    if (ret == NULL) {
  ------------------
  |  Branch (50:9): [True: 8.97k, False: 23.6k]
  ------------------
   51|  8.97k|        return(NULL);
   52|  8.97k|    }
   53|  23.6k|    memcpy(ret, cur, len);
   54|  23.6k|    ret[len] = 0;
   55|  23.6k|    return(ret);
   56|  32.6k|}
xmlStrdup:
   69|  17.7k|xmlStrdup(const xmlChar *cur) {
   70|  17.7k|    const xmlChar *p = cur;
   71|       |
   72|  17.7k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (72:9): [True: 0, False: 17.7k]
  ------------------
   73|  1.18M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (73:12): [True: 1.16M, False: 17.7k]
  ------------------
   74|  17.7k|    return(xmlStrndup(cur, p - cur));
   75|  17.7k|}
xmlCharStrndup:
   88|  4.61k|xmlCharStrndup(const char *cur, int len) {
   89|  4.61k|    int i;
   90|  4.61k|    xmlChar *ret;
   91|       |
   92|  4.61k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (92:9): [True: 0, False: 4.61k]
  |  Branch (92:26): [True: 0, False: 4.61k]
  ------------------
   93|  4.61k|    ret = (xmlChar *) xmlMallocAtomic((size_t) len + 1);
   94|  4.61k|    if (ret == NULL) {
  ------------------
  |  Branch (94:9): [True: 1.27k, False: 3.34k]
  ------------------
   95|  1.27k|        return(NULL);
   96|  1.27k|    }
   97|   526k|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (97:16): [True: 523k, False: 3.34k]
  ------------------
   98|       |        /* Explicit sign change */
   99|   523k|        ret[i] = (xmlChar) cur[i];
  100|   523k|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (100:13): [True: 0, False: 523k]
  ------------------
  101|   523k|    }
  102|  3.34k|    ret[len] = 0;
  103|  3.34k|    return(ret);
  104|  3.34k|}
xmlCharStrdup:
  116|  4.62k|xmlCharStrdup(const char *cur) {
  117|  4.62k|    const char *p = cur;
  118|       |
  119|  4.62k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (119:9): [True: 9, False: 4.61k]
  ------------------
  120|   533k|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (120:12): [True: 529k, False: 4.61k]
  ------------------
  121|  4.61k|    return(xmlCharStrndup(cur, p - cur));
  122|  4.62k|}
xmlStrcmp:
  135|    259|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  136|    259|    if (str1 == str2) return(0);
  ------------------
  |  Branch (136:9): [True: 45, False: 214]
  ------------------
  137|    214|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (137:9): [True: 1, False: 213]
  ------------------
  138|    213|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (138:9): [True: 1, False: 212]
  ------------------
  139|    212|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  140|    212|    return(strcmp((const char *)str1, (const char *)str2));
  141|       |#else
  142|       |    do {
  143|       |        int tmp = *str1++ - *str2;
  144|       |        if (tmp != 0) return(tmp);
  145|       |    } while (*str2++ != 0);
  146|       |    return 0;
  147|       |#endif
  148|    213|}
xmlStrEqual:
  162|    630|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  163|    630|    if (str1 == str2) return(1);
  ------------------
  |  Branch (163:9): [True: 17, False: 613]
  ------------------
  164|    613|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (164:9): [True: 99, False: 514]
  ------------------
  165|    514|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (165:9): [True: 51, False: 463]
  ------------------
  166|    463|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  167|    463|    return(strcmp((const char *)str1, (const char *)str2) == 0);
  168|       |#else
  169|       |    do {
  170|       |        if (*str1++ != *str2) return(0);
  171|       |    } while (*str2++);
  172|       |    return(1);
  173|       |#endif
  174|    514|}
xmlStrncmp:
  215|  2.27k|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  216|  2.27k|    if (len <= 0) return(0);
  ------------------
  |  Branch (216:9): [True: 0, False: 2.27k]
  ------------------
  217|  2.27k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (217:9): [True: 0, False: 2.27k]
  ------------------
  218|  2.27k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (218:9): [True: 0, False: 2.27k]
  ------------------
  219|  2.27k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (219:9): [True: 0, False: 2.27k]
  ------------------
  220|  2.27k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  221|  2.27k|    return(strncmp((const char *)str1, (const char *)str2, len));
  222|       |#else
  223|       |    do {
  224|       |        int tmp = *str1++ - *str2;
  225|       |        if (tmp != 0 || --len == 0) return(tmp);
  226|       |    } while (*str2++ != 0);
  227|       |    return 0;
  228|       |#endif
  229|  2.27k|}
xmlStrchr:
  327|   937k|xmlStrchr(const xmlChar *str, xmlChar val) {
  328|   937k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (328:9): [True: 273k, False: 664k]
  ------------------
  329|  22.6M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (329:12): [True: 22.1M, False: 526k]
  ------------------
  330|  22.1M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (330:13): [True: 137k, False: 21.9M]
  ------------------
  331|  21.9M|        str++;
  332|  21.9M|    }
  333|   526k|    return(NULL);
  334|   664k|}
xmlStrstr:
  347|  5.01k|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  348|  5.01k|    int n;
  349|       |
  350|  5.01k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (350:9): [True: 0, False: 5.01k]
  ------------------
  351|  5.01k|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (351:9): [True: 0, False: 5.01k]
  ------------------
  352|  5.01k|    n = xmlStrlen(val);
  353|       |
  354|  5.01k|    if (n == 0) return(str);
  ------------------
  |  Branch (354:9): [True: 0, False: 5.01k]
  ------------------
  355|   349k|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (355:12): [True: 345k, False: 4.33k]
  ------------------
  356|   345k|        if (*str == *val) {
  ------------------
  |  Branch (356:13): [True: 2.27k, False: 342k]
  ------------------
  357|  2.27k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (357:17): [True: 682, False: 1.59k]
  ------------------
  358|  2.27k|        }
  359|   344k|        str++;
  360|   344k|    }
  361|  4.33k|    return(NULL);
  362|  5.01k|}
xmlStrlen:
  428|  16.0k|xmlStrlen(const xmlChar *str) {
  429|  16.0k|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (429:18): [True: 16.0k, False: 0]
  ------------------
  430|  16.0k|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (430:12): [True: 0, False: 16.0k]
  ------------------
  431|  16.0k|}
xmlStrncat:
  448|  3.04k|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  449|  3.04k|    int size;
  450|  3.04k|    xmlChar *ret;
  451|       |
  452|  3.04k|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (452:9): [True: 0, False: 3.04k]
  |  Branch (452:26): [True: 134, False: 2.91k]
  ------------------
  453|    134|        return(cur);
  454|  2.91k|    if (len < 0)
  ------------------
  |  Branch (454:9): [True: 0, False: 2.91k]
  ------------------
  455|      0|	return(NULL);
  456|  2.91k|    if (cur == NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 2.91k]
  ------------------
  457|      0|        return(xmlStrndup(add, len));
  458|       |
  459|  2.91k|    size = xmlStrlen(cur);
  460|  2.91k|    if ((size < 0) || (size > INT_MAX - len))
  ------------------
  |  Branch (460:9): [True: 0, False: 2.91k]
  |  Branch (460:23): [True: 0, False: 2.91k]
  ------------------
  461|      0|        return(NULL);
  462|  2.91k|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  463|  2.91k|    if (ret == NULL) {
  ------------------
  |  Branch (463:9): [True: 52, False: 2.86k]
  ------------------
  464|     52|        return(cur);
  465|     52|    }
  466|  2.86k|    memcpy(&ret[size], add, len);
  467|  2.86k|    ret[size + len] = 0;
  468|  2.86k|    return(ret);
  469|  2.91k|}
xmlStrcat:
  524|  5.18k|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  525|  5.18k|    const xmlChar *p = add;
  526|       |
  527|  5.18k|    if (add == NULL) return(cur);
  ------------------
  |  Branch (527:9): [True: 0, False: 5.18k]
  ------------------
  528|  5.18k|    if (cur == NULL)
  ------------------
  |  Branch (528:9): [True: 2.13k, False: 3.04k]
  ------------------
  529|  2.13k|        return(xmlStrdup(add));
  530|       |
  531|   927k|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (531:12): [True: 924k, False: 3.04k]
  ------------------
  532|  3.04k|    return(xmlStrncat(cur, add, p - add));
  533|  5.18k|}

xmlInitXPathInternal:
  177|      2|xmlInitXPathInternal(void) {
  178|      2|#if defined(NAN) && defined(INFINITY)
  179|      2|    xmlXPathNAN = NAN;
  180|      2|    xmlXPathPINF = INFINITY;
  181|      2|    xmlXPathNINF = -INFINITY;
  182|       |#else
  183|       |    /* MSVC doesn't allow division by zero in constant expressions. */
  184|       |    double zero = 0.0;
  185|       |    xmlXPathNAN = 0.0 / zero;
  186|       |    xmlXPathPINF = 1.0 / zero;
  187|       |    xmlXPathNINF = -xmlXPathPINF;
  188|       |#endif
  189|      2|}

