xmlInitDictInternal:
  111|      2|xmlInitDictInternal(void) {
  112|      2|    xmlInitMutex(&xmlDictMutex);
  113|      2|}
xmlInitRandom:
  925|      2|xmlInitRandom(void) {
  926|      2|    xmlInitMutex(&xmlRngMutex);
  927|       |
  928|      2|    {
  929|       |#ifdef _WIN32
  930|       |        NTSTATUS status;
  931|       |
  932|       |        status = BCryptGenRandom(NULL, (unsigned char *) globalRngState,
  933|       |                                 sizeof(globalRngState),
  934|       |                                 BCRYPT_USE_SYSTEM_PREFERRED_RNG);
  935|       |        if (!BCRYPT_SUCCESS(status)) {
  936|       |            fprintf(stderr, "libxml2: BCryptGenRandom failed with "
  937|       |                    "error code %lu\n", GetLastError());
  938|       |            abort();
  939|       |        }
  940|       |#elif defined(HAVE_GETENTROPY)
  941|      2|        while (1) {
  ------------------
  |  Branch (941:16): [Folded - Ignored]
  ------------------
  942|      2|            if (getentropy(globalRngState, sizeof(globalRngState)) == 0)
  ------------------
  |  Branch (942:17): [True: 2, False: 0]
  ------------------
  943|      2|                break;
  944|       |
  945|      0|            if (errno != EINTR) {
  ------------------
  |  Branch (945:17): [True: 0, False: 0]
  ------------------
  946|      0|                fprintf(stderr, "libxml2: getentropy failed with "
  947|      0|                        "error code %d\n", errno);
  948|      0|                abort();
  949|      0|            }
  950|      0|        }
  951|       |#else
  952|       |        int var;
  953|       |
  954|       |        globalRngState[0] =
  955|       |                (unsigned) time(NULL) ^
  956|       |                HASH_ROL((unsigned) ((size_t) &xmlInitRandom & 0xFFFFFFFF), 8);
  957|       |        globalRngState[1] =
  958|       |                HASH_ROL((unsigned) ((size_t) &xmlRngMutex & 0xFFFFFFFF), 16) ^
  959|       |                HASH_ROL((unsigned) ((size_t) &var & 0xFFFFFFFF), 24);
  960|       |#endif
  961|      2|    }
  962|      2|}
xmlGlobalRandom:
  984|      4|xmlGlobalRandom(void) {
  985|      4|    unsigned ret;
  986|       |
  987|      4|    xmlMutexLock(&xmlRngMutex);
  988|      4|    ret = xoroshiro64ss(globalRngState);
  989|      4|    xmlMutexUnlock(&xmlRngMutex);
  990|       |
  991|      4|    return(ret);
  992|      4|}
xmlRandom:
  995|  3.94k|xmlRandom(void) {
  996|  3.94k|#ifdef LIBXML_THREAD_ENABLED
  997|  3.94k|    return(xoroshiro64ss(xmlGetLocalRngState()));
  998|       |#else
  999|       |    return(xmlGlobalRandom());
 1000|       |#endif
 1001|  3.94k|}
dict.c:xoroshiro64ss:
  971|  3.94k|xoroshiro64ss(unsigned *s) {
  972|  3.94k|    unsigned s0 = s[0];
  973|  3.94k|    unsigned s1 = s[1];
  974|  3.94k|    unsigned result = HASH_ROL(s0 * 0x9E3779BB, 5) * 5;
  ------------------
  |  |   12|  3.94k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  975|       |
  976|  3.94k|    s1 ^= s0;
  977|  3.94k|    s[0] = HASH_ROL(s0, 26) ^ s1 ^ (s1 << 9);
  ------------------
  |  |   12|  3.94k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  978|  3.94k|    s[1] = HASH_ROL(s1, 13);
  ------------------
  |  |   12|  3.94k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  979|       |
  980|  3.94k|    return(result & 0xFFFFFFFF);
  981|  3.94k|}

xmlInitEncodingInternal:
 1421|      2|xmlInitEncodingInternal(void) {
 1422|      2|    unsigned short int tst = 0x1234;
 1423|      2|    unsigned char *ptr = (unsigned char *) &tst;
 1424|       |
 1425|      2|    if (*ptr == 0x12) xmlLittleEndian = 0;
  ------------------
  |  Branch (1425:9): [True: 0, False: 2]
  ------------------
 1426|      2|    else xmlLittleEndian = 1;
 1427|      2|}

xmlSetGenericErrorFunc:
  245|      2|xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
  246|      2|    xmlGenericErrorContext = ctx;
  ------------------
  |  |  881|      2|  #define xmlGenericErrorContext XML_GLOBAL_MACRO(xmlGenericErrorContext)
  |  |  ------------------
  |  |  |  |  122|      2|  #define XML_GLOBAL_MACRO(name) (*__##name())
  |  |  ------------------
  ------------------
  247|      2|    if (handler != NULL)
  ------------------
  |  Branch (247:9): [True: 2, False: 0]
  ------------------
  248|      2|	xmlGenericError = handler;
  ------------------
  |  |  880|      2|  #define xmlGenericError XML_GLOBAL_MACRO(xmlGenericError)
  |  |  ------------------
  |  |  |  |  122|      2|  #define XML_GLOBAL_MACRO(name) (*__##name())
  |  |  ------------------
  ------------------
  249|      0|    else
  250|      0|	xmlGenericError = xmlGenericErrorDefaultFunc;
  ------------------
  |  |  880|      0|  #define xmlGenericError XML_GLOBAL_MACRO(xmlGenericError)
  |  |  ------------------
  |  |  |  |  122|      0|  #define XML_GLOBAL_MACRO(name) (*__##name())
  |  |  ------------------
  ------------------
  251|      2|}

xmlFuzzMemSetup:
  100|      2|xmlFuzzMemSetup(void) {
  101|      2|    xmlMemSetup(free, xmlFuzzMalloc, xmlFuzzRealloc, xmlMemStrdup);
  102|      2|}
xmlFuzzMemSetLimit:
  105|  7.88k|xmlFuzzMemSetLimit(size_t limit) {
  106|  7.88k|    fuzzNumAllocs = 0;
  107|  7.88k|    fuzzMaxAllocs = limit;
  108|  7.88k|    fuzzAllocFailed = 0;
  109|  7.88k|}
xmlFuzzResetMallocFailed:
  117|  30.0k|xmlFuzzResetMallocFailed(void) {
  118|  30.0k|    fuzzAllocFailed = 0;
  119|  30.0k|}
xmlFuzzCheckMallocFailure:
  122|  30.0k|xmlFuzzCheckMallocFailure(const char *func, int expect) {
  123|  30.0k|    if (fuzzAllocFailed != expect) {
  ------------------
  |  Branch (123:9): [True: 0, False: 30.0k]
  ------------------
  124|      0|        fprintf(stderr, "%s: malloc failure %s reported\n",
  125|      0|                func, fuzzAllocFailed ? "not" : "erroneously");
  ------------------
  |  Branch (125:23): [True: 0, False: 0]
  ------------------
  126|      0|        abort();
  127|      0|    }
  128|  30.0k|}
xmlFuzzDataInit:
  136|  3.94k|xmlFuzzDataInit(const char *data, size_t size) {
  137|  3.94k|    fuzzData.data = data;
  138|  3.94k|    fuzzData.size = size;
  139|  3.94k|    fuzzData.ptr = data;
  140|  3.94k|    fuzzData.remaining = size;
  141|       |
  142|  3.94k|    fuzzData.outBuf = xmlMalloc(size + 1);
  143|  3.94k|    fuzzData.outPtr = fuzzData.outBuf;
  144|       |
  145|  3.94k|    fuzzData.entities = xmlHashCreate(8);
  146|  3.94k|    fuzzData.mainUrl = NULL;
  147|  3.94k|    fuzzData.mainEntity = NULL;
  148|  3.94k|}
xmlFuzzDataCleanup:
  156|  3.94k|xmlFuzzDataCleanup(void) {
  157|  3.94k|    xmlFree(fuzzData.outBuf);
  158|  3.94k|    xmlHashFree(fuzzData.entities, xmlHashDefaultDeallocator);
  159|  3.94k|}
xmlFuzzReadInt:
  192|  3.94k|xmlFuzzReadInt(int size) {
  193|  3.94k|    size_t ret = 0;
  194|       |
  195|  19.6k|    while ((size > 0) && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (195:12): [True: 15.7k, False: 3.93k]
  |  Branch (195:26): [True: 15.7k, False: 3]
  ------------------
  196|  15.7k|        unsigned char c = (unsigned char) *fuzzData.ptr++;
  197|  15.7k|        fuzzData.remaining--;
  198|  15.7k|        ret = (ret << 8) | c;
  199|  15.7k|        size--;
  200|  15.7k|    }
  201|       |
  202|  3.94k|    return ret;
  203|  3.94k|}
xmlFuzzReadString:
  256|  7.88k|xmlFuzzReadString(size_t *size) {
  257|  7.88k|    const char *out = fuzzData.outPtr;
  258|       |
  259|   550k|    while (fuzzData.remaining > 0) {
  ------------------
  |  Branch (259:12): [True: 544k, False: 6.41k]
  ------------------
  260|   544k|        int c = *fuzzData.ptr++;
  261|   544k|        fuzzData.remaining--;
  262|       |
  263|   544k|        if ((c == '\\') && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (263:13): [True: 3.53k, False: 541k]
  |  Branch (263:28): [True: 3.51k, False: 20]
  ------------------
  264|  3.51k|            int c2 = *fuzzData.ptr;
  265|       |
  266|  3.51k|            if (c2 == '\n') {
  ------------------
  |  Branch (266:17): [True: 1.47k, False: 2.04k]
  ------------------
  267|  1.47k|                fuzzData.ptr++;
  268|  1.47k|                fuzzData.remaining--;
  269|  1.47k|                if (size != NULL)
  ------------------
  |  Branch (269:21): [True: 0, False: 1.47k]
  ------------------
  270|      0|                    *size = fuzzData.outPtr - out;
  271|  1.47k|                *fuzzData.outPtr++ = '\0';
  272|  1.47k|                return(out);
  273|  1.47k|            }
  274|  2.04k|            if (c2 == '\\') {
  ------------------
  |  Branch (274:17): [True: 1.11k, False: 935]
  ------------------
  275|  1.11k|                fuzzData.ptr++;
  276|  1.11k|                fuzzData.remaining--;
  277|  1.11k|            }
  278|  2.04k|        }
  279|       |
  280|   543k|        *fuzzData.outPtr++ = c;
  281|   543k|    }
  282|       |
  283|  6.41k|    if (fuzzData.outPtr > out) {
  ------------------
  |  Branch (283:9): [True: 3.91k, False: 2.49k]
  ------------------
  284|  3.91k|        if (size != NULL)
  ------------------
  |  Branch (284:13): [True: 0, False: 3.91k]
  ------------------
  285|      0|            *size = fuzzData.outPtr - out;
  286|  3.91k|        *fuzzData.outPtr++ = '\0';
  287|  3.91k|        return(out);
  288|  3.91k|    }
  289|       |
  290|  2.49k|    if (size != NULL)
  ------------------
  |  Branch (290:9): [True: 0, False: 2.49k]
  ------------------
  291|      0|        *size = 0;
  292|  2.49k|    return(NULL);
  293|  6.41k|}
fuzz.c:xmlFuzzMalloc:
   70|   106k|xmlFuzzMalloc(size_t size) {
   71|   106k|    if (fuzzMaxAllocs > 0) {
  ------------------
  |  Branch (71:9): [True: 97.3k, False: 8.67k]
  ------------------
   72|  97.3k|        fuzzNumAllocs += 1;
   73|  97.3k|        if (fuzzNumAllocs == fuzzMaxAllocs) {
  ------------------
  |  Branch (73:13): [True: 955, False: 96.3k]
  ------------------
   74|       |#if XML_FUZZ_MALLOC_ABORT
   75|       |            abort();
   76|       |#endif
   77|    955|            fuzzAllocFailed = 1;
   78|    955|            return(NULL);
   79|    955|        }
   80|  97.3k|    }
   81|   105k|    return malloc(size);
   82|   106k|}
fuzz.c:xmlFuzzRealloc:
   85|  8.05k|xmlFuzzRealloc(void *ptr, size_t size) {
   86|  8.05k|    if (fuzzMaxAllocs > 0) {
  ------------------
  |  Branch (86:9): [True: 7.94k, False: 107]
  ------------------
   87|  7.94k|        fuzzNumAllocs += 1;
   88|  7.94k|        if (fuzzNumAllocs == fuzzMaxAllocs) {
  ------------------
  |  Branch (88:13): [True: 47, False: 7.89k]
  ------------------
   89|       |#if XML_FUZZ_MALLOC_ABORT
   90|       |            abort();
   91|       |#endif
   92|     47|            fuzzAllocFailed = 1;
   93|     47|            return(NULL);
   94|     47|        }
   95|  7.94k|    }
   96|  8.00k|    return realloc(ptr, size);
   97|  8.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|  3.94k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
   21|  3.94k|    xmlURIPtr uri;
   22|  3.94k|    size_t maxAlloc;
   23|  3.94k|    const char *str1, *str2;
   24|  3.94k|    char *copy;
   25|  3.94k|    xmlChar *strRes;
   26|  3.94k|    int intRes;
   27|       |
   28|  3.94k|    if (size > 10000)
  ------------------
  |  Branch (28:9): [True: 7, False: 3.94k]
  ------------------
   29|      7|        return(0);
   30|       |
   31|  3.94k|    xmlFuzzDataInit(data, size);
   32|  3.94k|    maxAlloc = xmlFuzzReadInt(4) % (size * 8 + 100);
   33|  3.94k|    str1 = xmlFuzzReadString(NULL);
   34|  3.94k|    str2 = xmlFuzzReadString(NULL);
   35|       |
   36|  3.94k|    xmlFuzzMemSetLimit(maxAlloc);
   37|       |
   38|  3.94k|    xmlFuzzResetMallocFailed();
   39|  3.94k|    intRes = xmlParseURISafe(str1, &uri);
   40|  3.94k|    xmlFuzzCheckMallocFailure("xmlParseURISafe", intRes == -1);
   41|       |
   42|  3.94k|    if (uri != NULL) {
  ------------------
  |  Branch (42:9): [True: 2.48k, False: 1.45k]
  ------------------
   43|  2.48k|        xmlFuzzResetMallocFailed();
   44|  2.48k|        strRes = xmlSaveUri(uri);
   45|  2.48k|        xmlFuzzCheckMallocFailure("xmlSaveURI", strRes == NULL);
   46|  2.48k|        xmlFree(strRes);
   47|  2.48k|        xmlFreeURI(uri);
   48|  2.48k|    }
   49|       |
   50|  3.94k|    xmlFreeURI(xmlParseURI(str1));
   51|       |
   52|  3.94k|    uri = xmlParseURIRaw(str1, 1);
   53|  3.94k|    xmlFree(xmlSaveUri(uri));
   54|  3.94k|    xmlFreeURI(uri);
   55|       |
   56|  3.94k|    xmlFuzzResetMallocFailed();
   57|  3.94k|    strRes = BAD_CAST xmlURIUnescapeString(str1, -1, NULL);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   58|  3.94k|    xmlFuzzCheckMallocFailure("xmlURIUnescapeString",
   59|  3.94k|                              str1 != NULL && strRes == NULL);
  ------------------
  |  Branch (59:31): [True: 3.93k, False: 4]
  |  Branch (59:47): [True: 15, False: 3.92k]
  ------------------
   60|  3.94k|    xmlFree(strRes);
   61|       |
   62|  3.94k|    xmlFree(xmlURIEscape(BAD_CAST str1));
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   63|       |
   64|  3.94k|    xmlFuzzResetMallocFailed();
   65|  3.94k|    strRes = xmlCanonicPath(BAD_CAST str1);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   66|  3.94k|    xmlFuzzCheckMallocFailure("xmlCanonicPath",
   67|  3.94k|                              str1 != NULL && strRes == NULL);
  ------------------
  |  Branch (67:31): [True: 3.93k, False: 4]
  |  Branch (67:47): [True: 21, False: 3.91k]
  ------------------
   68|  3.94k|    xmlFree(strRes);
   69|       |
   70|  3.94k|    xmlFuzzResetMallocFailed();
   71|  3.94k|    strRes = xmlPathToURI(BAD_CAST str1);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   72|  3.94k|    xmlFuzzCheckMallocFailure("xmlPathToURI", str1 != NULL && strRes == NULL);
  ------------------
  |  Branch (72:47): [True: 3.93k, False: 4]
  |  Branch (72:63): [True: 20, False: 3.91k]
  ------------------
   73|  3.94k|    xmlFree(strRes);
   74|       |
   75|  3.94k|    xmlFuzzResetMallocFailed();
   76|  3.94k|    intRes = xmlBuildURISafe(BAD_CAST str2, BAD_CAST str1, &strRes);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
                  intRes = xmlBuildURISafe(BAD_CAST str2, BAD_CAST str1, &strRes);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   77|  3.94k|    xmlFuzzCheckMallocFailure("xmlBuildURISafe", intRes == -1);
   78|  3.94k|    xmlFree(strRes);
   79|       |
   80|  3.94k|    xmlFree(xmlBuildURI(BAD_CAST str2, BAD_CAST str1));
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
                  xmlFree(xmlBuildURI(BAD_CAST str2, BAD_CAST str1));
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   81|       |
   82|  3.94k|    xmlFuzzResetMallocFailed();
   83|  3.94k|    intRes = xmlBuildRelativeURISafe(BAD_CAST str2, BAD_CAST str1, &strRes);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
                  intRes = xmlBuildRelativeURISafe(BAD_CAST str2, BAD_CAST str1, &strRes);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   84|  3.94k|    xmlFuzzCheckMallocFailure("xmlBuildRelativeURISafe", intRes == -1);
   85|  3.94k|    xmlFree(strRes);
   86|       |
   87|  3.94k|    xmlFree(xmlBuildRelativeURI(BAD_CAST str2, BAD_CAST str1));
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
                  xmlFree(xmlBuildRelativeURI(BAD_CAST str2, BAD_CAST str1));
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   88|       |
   89|  3.94k|    xmlFuzzResetMallocFailed();
   90|  3.94k|    strRes = xmlURIEscapeStr(BAD_CAST str1, BAD_CAST str2);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
                  strRes = xmlURIEscapeStr(BAD_CAST str1, BAD_CAST str2);
  ------------------
  |  |   35|  3.94k|#define BAD_CAST (xmlChar *)
  ------------------
   91|  3.94k|    xmlFuzzCheckMallocFailure("xmlURIEscapeStr",
   92|  3.94k|                              str1 != NULL && strRes == NULL);
  ------------------
  |  Branch (92:31): [True: 3.93k, False: 4]
  |  Branch (92:47): [True: 22, False: 3.91k]
  ------------------
   93|  3.94k|    xmlFree(strRes);
   94|       |
   95|  3.94k|    copy = (char *) xmlCharStrdup(str1);
   96|  3.94k|    xmlNormalizeURIPath(copy);
   97|  3.94k|    xmlFree(copy);
   98|       |
   99|  3.94k|    xmlFuzzMemSetLimit(0);
  100|  3.94k|    xmlFuzzDataCleanup();
  101|       |
  102|  3.94k|    return 0;
  103|  3.94k|}

xmlInitGlobalsInternal:
  577|      2|void xmlInitGlobalsInternal(void) {
  578|      2|    xmlInitMutex(&xmlThrDefMutex);
  579|       |
  580|      2|#ifdef HAVE_POSIX_THREADS
  581|      2|#ifdef XML_PTHREAD_WEAK
  582|      2|    if (libxml_is_threaded == -1)
  ------------------
  |  Branch (582:9): [True: 2, False: 0]
  ------------------
  583|      2|        libxml_is_threaded =
  584|      2|            (pthread_getspecific != NULL) &&
  ------------------
  |  Branch (584:13): [True: 2, False: 0]
  ------------------
  585|      2|            (pthread_setspecific != NULL) &&
  ------------------
  |  Branch (585:13): [True: 2, False: 0]
  ------------------
  586|      2|            (pthread_key_create != NULL) &&
  ------------------
  |  Branch (586:13): [True: 2, False: 0]
  ------------------
  587|      2|            (pthread_key_delete != NULL) &&
  ------------------
  |  Branch (587:13): [True: 2, False: 0]
  ------------------
  588|       |            /*
  589|       |             * pthread_equal can be inline, resuting in -Waddress warnings.
  590|       |             * Let's assume it's available if all the other functions are.
  591|       |             */
  592|       |            /* (pthread_equal != NULL) && */
  593|      2|            (pthread_self != NULL);
  ------------------
  |  Branch (593:13): [True: 2, False: 0]
  ------------------
  594|      2|    if (libxml_is_threaded == 0)
  ------------------
  |  Branch (594:9): [True: 0, False: 2]
  ------------------
  595|      0|        return;
  596|      2|#endif /* XML_PTHREAD_WEAK */
  597|      2|    pthread_key_create(&globalkey, xmlFreeGlobalState);
  598|      2|    mainthread = pthread_self();
  599|       |#elif defined(HAVE_WIN32_THREADS)
  600|       |#ifndef USE_TLS
  601|       |    globalkey = TlsAlloc();
  602|       |#endif
  603|       |    mainthread = GetCurrentThreadId();
  604|       |#endif
  605|       |
  606|      2|#ifdef LIBXML_THREAD_ENABLED
  607|      2|    xmlMainThreadRngState[0] = xmlGlobalRandom();
  608|      2|    xmlMainThreadRngState[1] = xmlGlobalRandom();
  609|      2|#endif
  610|      2|}
__xmlGenericError:
  900|      2|    type *__##name(void) { \
  901|      2|        if (IS_MAIN_THREAD) \
  ------------------
  |  |   62|      2|#define IS_MAIN_THREAD (xmlIsMainThreadInternal())
  |  |  ------------------
  |  |  |  Branch (62:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  902|      2|            return (&name); \
  903|      2|        else \
  904|      2|            return (&xmlGetThreadLocalStorage(0)->gs_##name); \
  905|      2|    }
__xmlGenericErrorContext:
  900|      2|    type *__##name(void) { \
  901|      2|        if (IS_MAIN_THREAD) \
  ------------------
  |  |   62|      2|#define IS_MAIN_THREAD (xmlIsMainThreadInternal())
  |  |  ------------------
  |  |  |  Branch (62:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  902|      2|            return (&name); \
  903|      2|        else \
  904|      2|            return (&xmlGetThreadLocalStorage(0)->gs_##name); \
  905|      2|    }
xmlGetLocalRngState:
  917|  3.94k|xmlGetLocalRngState(void) {
  918|  3.94k|    if (IS_MAIN_THREAD)
  ------------------
  |  |   62|  3.94k|#define IS_MAIN_THREAD (xmlIsMainThreadInternal())
  |  |  ------------------
  |  |  |  Branch (62:24): [True: 3.94k, False: 0]
  |  |  ------------------
  ------------------
  919|  3.94k|        return(xmlMainThreadRngState);
  920|      0|    else
  921|      0|        return(xmlGetThreadLocalStorage(0)->localRngState);
  922|  3.94k|}
globals.c:xmlPosixStrdup:
  231|  1.30k|xmlPosixStrdup(const char *cur) {
  232|  1.30k|    return((char*) xmlCharStrdup(cur));
  233|  1.30k|}
globals.c:xmlIsMainThreadInternal:
  676|  3.94k|xmlIsMainThreadInternal(void) {
  677|  3.94k|    if (parserInitialized == 0) {
  ------------------
  |  Branch (677:9): [True: 2, False: 3.94k]
  ------------------
  678|      2|        xmlInitParser();
  679|      2|        parserInitialized = 1;
  680|      2|    }
  681|       |
  682|  3.94k|#ifdef HAVE_POSIX_THREADS
  683|  3.94k|#ifdef XML_PTHREAD_WEAK
  684|  3.94k|    if (libxml_is_threaded == 0)
  ------------------
  |  Branch (684:9): [True: 0, False: 3.94k]
  ------------------
  685|      0|        return (1);
  686|  3.94k|#endif
  687|  3.94k|    return (pthread_equal(mainthread, pthread_self()));
  688|       |#elif defined HAVE_WIN32_THREADS
  689|       |    return (mainthread == GetCurrentThreadId());
  690|       |#else
  691|       |    return (1);
  692|       |#endif
  693|  3.94k|}

xmlHashCreate:
  160|  3.94k|xmlHashCreate(int size) {
  161|  3.94k|    xmlHashTablePtr hash;
  162|       |
  163|  3.94k|    xmlInitParser();
  164|       |
  165|  3.94k|    hash = xmlMalloc(sizeof(*hash));
  166|  3.94k|    if (hash == NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 3.94k]
  ------------------
  167|      0|        return(NULL);
  168|  3.94k|    hash->dict = NULL;
  169|  3.94k|    hash->size = 0;
  170|  3.94k|    hash->table = NULL;
  171|  3.94k|    hash->nbElems = 0;
  172|  3.94k|    hash->randomSeed = xmlRandom();
  173|  3.94k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  174|  3.94k|    hash->randomSeed = 0;
  175|  3.94k|#endif
  176|       |
  177|       |    /*
  178|       |     * Unless a larger size is passed, the backing table is created
  179|       |     * lazily with MIN_HASH_SIZE capacity. In practice, there are many
  180|       |     * hash tables which are never filled.
  181|       |     */
  182|  3.94k|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|  3.94k|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (182:9): [True: 0, False: 3.94k]
  ------------------
  183|      0|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|      0|#define MIN_HASH_SIZE 8
  ------------------
  184|       |
  185|      0|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|      0|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (185:16): [True: 0, False: 0]
  |  Branch (185:47): [True: 0, False: 0]
  ------------------
  186|      0|            newSize *= 2;
  187|       |
  188|      0|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (188:13): [True: 0, False: 0]
  ------------------
  189|      0|            xmlFree(hash);
  190|      0|            return(NULL);
  191|      0|        }
  192|      0|    }
  193|       |
  194|  3.94k|    return(hash);
  195|  3.94k|}
xmlHashFree:
  229|  3.94k|xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc) {
  230|  3.94k|    if (hash == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 3.94k]
  ------------------
  231|      0|        return;
  232|       |
  233|  3.94k|    if (hash->table) {
  ------------------
  |  Branch (233:9): [True: 0, False: 3.94k]
  ------------------
  234|      0|        const xmlHashEntry *end = &hash->table[hash->size];
  235|      0|        const xmlHashEntry *entry;
  236|       |
  237|      0|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (237:35): [True: 0, False: 0]
  ------------------
  238|      0|            if (entry->hashValue == 0)
  ------------------
  |  Branch (238:17): [True: 0, False: 0]
  ------------------
  239|      0|                continue;
  240|      0|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (240:17): [True: 0, False: 0]
  |  Branch (240:38): [True: 0, False: 0]
  ------------------
  241|      0|                dealloc(entry->payload, entry->key);
  242|      0|            if (hash->dict == NULL) {
  ------------------
  |  Branch (242:17): [True: 0, False: 0]
  ------------------
  243|      0|                if (entry->key)
  ------------------
  |  Branch (243:21): [True: 0, False: 0]
  ------------------
  244|      0|                    xmlFree(entry->key);
  245|      0|                if (entry->key2)
  ------------------
  |  Branch (245:21): [True: 0, False: 0]
  ------------------
  246|      0|                    xmlFree(entry->key2);
  247|      0|                if (entry->key3)
  ------------------
  |  Branch (247:21): [True: 0, False: 0]
  ------------------
  248|      0|                    xmlFree(entry->key3);
  249|      0|            }
  250|      0|        }
  251|       |
  252|      0|        xmlFree(hash->table);
  253|      0|    }
  254|       |
  255|  3.94k|    if (hash->dict)
  ------------------
  |  Branch (255:9): [True: 0, False: 3.94k]
  ------------------
  256|      0|        xmlDictFree(hash->dict);
  257|       |
  258|  3.94k|    xmlFree(hash);
  259|  3.94k|}

xmlInitMutex:
  130|      8|{
  131|      8|#ifdef HAVE_POSIX_THREADS
  132|      8|    if (XML_IS_NEVER_THREADED() == 0)
  ------------------
  |  |   86|      8|#define XML_IS_NEVER_THREADED() (!libxml_is_threaded)
  ------------------
  |  Branch (132:9): [True: 8, False: 0]
  ------------------
  133|      8|        pthread_mutex_init(&mutex->lock, NULL);
  134|       |#elif defined HAVE_WIN32_THREADS
  135|       |    InitializeCriticalSection(&mutex->cs);
  136|       |#else
  137|       |    (void) mutex;
  138|       |#endif
  139|      8|}
xmlMutexLock:
  203|      4|{
  204|      4|    if (tok == NULL)
  ------------------
  |  Branch (204:9): [True: 0, False: 4]
  ------------------
  205|      0|        return;
  206|      4|#ifdef HAVE_POSIX_THREADS
  207|       |    /*
  208|       |     * This assumes that __libc_single_threaded won't change while the
  209|       |     * lock is held.
  210|       |     */
  211|      4|    if (XML_IS_THREADED() != 0)
  ------------------
  |  |   85|      4|#define XML_IS_THREADED() libxml_is_threaded
  ------------------
  |  Branch (211:9): [True: 4, False: 0]
  ------------------
  212|      4|        pthread_mutex_lock(&tok->lock);
  213|       |#elif defined HAVE_WIN32_THREADS
  214|       |    EnterCriticalSection(&tok->cs);
  215|       |#endif
  216|       |
  217|      4|}
xmlMutexUnlock:
  227|      4|{
  228|      4|    if (tok == NULL)
  ------------------
  |  Branch (228:9): [True: 0, False: 4]
  ------------------
  229|      0|        return;
  230|      4|#ifdef HAVE_POSIX_THREADS
  231|      4|    if (XML_IS_THREADED() != 0)
  ------------------
  |  |   85|      4|#define XML_IS_THREADED() libxml_is_threaded
  ------------------
  |  Branch (231:9): [True: 4, False: 0]
  ------------------
  232|      4|        pthread_mutex_unlock(&tok->lock);
  233|       |#elif defined HAVE_WIN32_THREADS
  234|       |    LeaveCriticalSection(&tok->cs);
  235|       |#endif
  236|      4|}
xmlInitParser:
  569|  3.94k|xmlInitParser(void) {
  570|       |    /*
  571|       |     * Note that the initialization code must not make memory allocations.
  572|       |     */
  573|  3.94k|    if (xmlParserInitialized != 0)
  ------------------
  |  Branch (573:9): [True: 3.94k, False: 2]
  ------------------
  574|  3.94k|        return;
  575|       |
  576|      2|    xmlGlobalInitMutexLock();
  577|       |
  578|      2|    if (xmlParserInnerInitialized == 0) {
  ------------------
  |  Branch (578:9): [True: 2, False: 0]
  ------------------
  579|       |#if defined(_WIN32) && \
  580|       |    !defined(LIBXML_THREAD_ALLOC_ENABLED) && \
  581|       |    (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
  582|       |        if (xmlFree == free)
  583|       |            atexit(xmlCleanupParser);
  584|       |#endif
  585|       |
  586|      2|        xmlInitRandom(); /* Required by xmlInitGlobalsInternal */
  587|      2|        xmlInitMemoryInternal();
  588|      2|        xmlInitGlobalsInternal();
  589|      2|        xmlInitDictInternal();
  590|      2|        xmlInitEncodingInternal();
  591|      2|#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
  592|      2|        xmlInitXPathInternal();
  593|      2|#endif
  594|      2|        xmlInitIOCallbacks();
  595|       |
  596|      2|        xmlParserInnerInitialized = 1;
  597|      2|    }
  598|       |
  599|      2|    xmlGlobalInitMutexUnlock();
  600|       |
  601|      2|    xmlParserInitialized = 1;
  602|      2|}
threads.c:xmlGlobalInitMutexLock:
  463|      2|xmlGlobalInitMutexLock(void) {
  464|      2|#ifdef HAVE_POSIX_THREADS
  465|       |
  466|      2|#ifdef XML_PTHREAD_WEAK
  467|       |    /*
  468|       |     * This is somewhat unreliable since libpthread could be loaded
  469|       |     * later with dlopen() and threads could be created. But it's
  470|       |     * long-standing behavior and hard to work around.
  471|       |     */
  472|      2|    if (libxml_is_threaded == -1)
  ------------------
  |  Branch (472:9): [True: 2, False: 0]
  ------------------
  473|      2|        libxml_is_threaded =
  474|      2|            (pthread_mutex_init != NULL) &&
  ------------------
  |  Branch (474:13): [True: 2, False: 0]
  ------------------
  475|      2|            (pthread_mutex_destroy != NULL) &&
  ------------------
  |  Branch (475:13): [True: 2, False: 0]
  ------------------
  476|      2|            (pthread_mutex_lock != NULL) &&
  ------------------
  |  Branch (476:13): [True: 2, False: 0]
  ------------------
  477|      2|            (pthread_mutex_unlock != NULL) &&
  ------------------
  |  Branch (477:13): [True: 2, False: 0]
  ------------------
  478|      2|            (pthread_cond_init != NULL) &&
  ------------------
  |  Branch (478:13): [True: 2, False: 0]
  ------------------
  479|      2|            (pthread_cond_destroy != NULL) &&
  ------------------
  |  Branch (479:13): [True: 2, False: 0]
  ------------------
  480|      2|            (pthread_cond_wait != NULL) &&
  ------------------
  |  Branch (480:13): [True: 2, False: 0]
  ------------------
  481|       |            /*
  482|       |             * pthread_equal can be inline, resuting in -Waddress warnings.
  483|       |             * Let's assume it's available if all the other functions are.
  484|       |             */
  485|       |            /* (pthread_equal != NULL) && */
  486|      2|            (pthread_self != NULL) &&
  ------------------
  |  Branch (486:13): [True: 2, False: 0]
  ------------------
  487|      2|            (pthread_cond_signal != NULL);
  ------------------
  |  Branch (487:13): [True: 2, False: 0]
  ------------------
  488|      2|#endif
  489|       |
  490|       |    /* The mutex is statically initialized, so we just lock it. */
  491|      2|    if (XML_IS_THREADED() != 0)
  ------------------
  |  |   85|      2|#define XML_IS_THREADED() libxml_is_threaded
  ------------------
  |  Branch (491:9): [True: 2, False: 0]
  ------------------
  492|      2|        pthread_mutex_lock(&global_init_lock);
  493|       |
  494|       |#elif defined HAVE_WIN32_THREADS
  495|       |
  496|       |    LPCRITICAL_SECTION cs;
  497|       |
  498|       |    /* Create a new critical section */
  499|       |    if (global_init_lock == NULL) {
  500|       |        cs = malloc(sizeof(CRITICAL_SECTION));
  501|       |        if (cs == NULL) {
  502|       |            fprintf(stderr, "libxml2: xmlInitParser: out of memory\n");
  503|       |            abort();
  504|       |        }
  505|       |        InitializeCriticalSection(cs);
  506|       |
  507|       |        /* Swap it into the global_init_lock */
  508|       |#ifdef InterlockedCompareExchangePointer
  509|       |        InterlockedCompareExchangePointer((void **) &global_init_lock,
  510|       |                                          cs, NULL);
  511|       |#else /* Use older void* version */
  512|       |        InterlockedCompareExchange((void **) &global_init_lock,
  513|       |                                   (void *) cs, NULL);
  514|       |#endif /* InterlockedCompareExchangePointer */
  515|       |
  516|       |        /* If another thread successfully recorded its critical
  517|       |         * section in the global_init_lock then discard the one
  518|       |         * allocated by this thread. */
  519|       |        if (global_init_lock != cs) {
  520|       |            DeleteCriticalSection(cs);
  521|       |            free(cs);
  522|       |        }
  523|       |    }
  524|       |
  525|       |    /* Lock the chosen critical section */
  526|       |    EnterCriticalSection(global_init_lock);
  527|       |
  528|       |#endif
  529|      2|}
threads.c:xmlGlobalInitMutexUnlock:
  532|      2|xmlGlobalInitMutexUnlock(void) {
  533|      2|#ifdef HAVE_POSIX_THREADS
  534|      2|    if (XML_IS_THREADED() != 0)
  ------------------
  |  |   85|      2|#define XML_IS_THREADED() libxml_is_threaded
  ------------------
  |  Branch (534:9): [True: 2, False: 0]
  ------------------
  535|      2|        pthread_mutex_unlock(&global_init_lock);
  536|       |#elif defined HAVE_WIN32_THREADS
  537|       |    if (global_init_lock != NULL)
  538|       |	LeaveCriticalSection(global_init_lock);
  539|       |#endif
  540|      2|}

xmlParseURISafe:
  977|  11.9k|xmlParseURISafe(const char *str, xmlURIPtr *uriOut) {
  978|  11.9k|    xmlURIPtr uri;
  979|  11.9k|    int ret;
  980|       |
  981|  11.9k|    if (uriOut != NULL)
  ------------------
  |  Branch (981:9): [True: 11.9k, False: 0]
  ------------------
  982|  11.9k|        *uriOut = NULL;
  983|  11.9k|    if (str == NULL)
  ------------------
  |  Branch (983:9): [True: 8, False: 11.9k]
  ------------------
  984|      8|	return(1);
  985|       |
  986|  11.9k|    uri = xmlCreateURI();
  987|  11.9k|    if (uri == NULL)
  ------------------
  |  Branch (987:9): [True: 240, False: 11.7k]
  ------------------
  988|    240|        return(-1);
  989|       |
  990|  11.7k|    ret = xmlParse3986URIReference(uri, str);
  991|  11.7k|    if (ret) {
  ------------------
  |  Branch (991:9): [True: 3.15k, False: 8.59k]
  ------------------
  992|  3.15k|        xmlFreeURI(uri);
  993|  3.15k|        return(ret);
  994|  3.15k|    }
  995|       |
  996|  8.59k|    if (uriOut != NULL)
  ------------------
  |  Branch (996:9): [True: 8.59k, False: 0]
  ------------------
  997|  8.59k|        *uriOut = uri;
  998|  8.59k|    return(0);
  999|  11.7k|}
xmlParseURI:
 1012|  3.94k|xmlParseURI(const char *str) {
 1013|  3.94k|    xmlURIPtr uri;
 1014|  3.94k|    xmlParseURISafe(str, &uri);
 1015|  3.94k|    return(uri);
 1016|  3.94k|}
xmlParseURIReference:
 1031|  12.2k|xmlParseURIReference(xmlURIPtr uri, const char *str) {
 1032|  12.2k|    return(xmlParse3986URIReference(uri, str));
 1033|  12.2k|}
xmlParseURIRaw:
 1047|  3.94k|xmlParseURIRaw(const char *str, int raw) {
 1048|  3.94k|    xmlURIPtr uri;
 1049|  3.94k|    int ret;
 1050|       |
 1051|  3.94k|    if (str == NULL)
  ------------------
  |  Branch (1051:9): [True: 4, False: 3.93k]
  ------------------
 1052|      4|	return(NULL);
 1053|  3.93k|    uri = xmlCreateURI();
 1054|  3.93k|    if (uri != NULL) {
  ------------------
  |  Branch (1054:9): [True: 3.83k, False: 106]
  ------------------
 1055|  3.83k|        if (raw) {
  ------------------
  |  Branch (1055:13): [True: 3.83k, False: 0]
  ------------------
 1056|  3.83k|	    uri->cleanup |= XML_URI_NO_UNESCAPE;
  ------------------
  |  |  193|  3.83k|#define XML_URI_NO_UNESCAPE     2
  ------------------
 1057|  3.83k|	}
 1058|  3.83k|	ret = xmlParseURIReference(uri, str);
 1059|  3.83k|        if (ret) {
  ------------------
  |  Branch (1059:13): [True: 1.32k, False: 2.50k]
  ------------------
 1060|  1.32k|	    xmlFreeURI(uri);
 1061|  1.32k|	    return(NULL);
 1062|  1.32k|	}
 1063|  3.83k|    }
 1064|  2.60k|    return(uri);
 1065|  3.93k|}
xmlCreateURI:
 1081|  26.2k|xmlCreateURI(void) {
 1082|  26.2k|    xmlURIPtr ret;
 1083|       |
 1084|  26.2k|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1085|  26.2k|    if (ret == NULL)
  ------------------
  |  Branch (1085:9): [True: 453, False: 25.8k]
  ------------------
 1086|    453|	return(NULL);
 1087|  25.8k|    memset(ret, 0, sizeof(xmlURI));
 1088|  25.8k|    ret->port = PORT_EMPTY;
  ------------------
  |  |   37|  25.8k|#define PORT_EMPTY           0
  ------------------
 1089|  25.8k|    return(ret);
 1090|  26.2k|}
xmlSaveUri:
 1122|  7.66k|xmlSaveUri(xmlURIPtr uri) {
 1123|  7.66k|    xmlChar *ret = NULL;
 1124|  7.66k|    xmlChar *temp;
 1125|  7.66k|    const char *p;
 1126|  7.66k|    int len;
 1127|  7.66k|    int max;
 1128|       |
 1129|  7.66k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1129:9): [True: 1.43k, False: 6.22k]
  ------------------
 1130|       |
 1131|       |
 1132|  6.22k|    max = 80;
 1133|  6.22k|    ret = (xmlChar *) xmlMallocAtomic(max + 1);
 1134|  6.22k|    if (ret == NULL)
  ------------------
  |  Branch (1134:9): [True: 60, False: 6.16k]
  ------------------
 1135|     60|	return(NULL);
 1136|  6.16k|    len = 0;
 1137|       |
 1138|  6.16k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1138:9): [True: 1.82k, False: 4.34k]
  ------------------
 1139|  1.82k|	p = uri->scheme;
 1140|  95.7k|	while (*p != 0) {
  ------------------
  |  Branch (1140:9): [True: 93.9k, False: 1.82k]
  ------------------
 1141|  93.9k|	    if (len >= max) {
  ------------------
  |  Branch (1141:10): [True: 219, False: 93.7k]
  ------------------
 1142|    219|                temp = xmlSaveUriRealloc(ret, &max);
 1143|    219|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1143:21): [True: 3, False: 216]
  ------------------
 1144|    216|		ret = temp;
 1145|    216|	    }
 1146|  93.9k|	    ret[len++] = *p++;
 1147|  93.9k|	}
 1148|  1.82k|	if (len >= max) {
  ------------------
  |  Branch (1148:6): [True: 11, False: 1.80k]
  ------------------
 1149|     11|            temp = xmlSaveUriRealloc(ret, &max);
 1150|     11|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1150:17): [True: 1, False: 10]
  ------------------
 1151|     10|            ret = temp;
 1152|     10|	}
 1153|  1.81k|	ret[len++] = ':';
 1154|  1.81k|    }
 1155|  6.16k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1155:9): [True: 0, False: 6.16k]
  ------------------
 1156|      0|	p = uri->opaque;
 1157|      0|	while (*p != 0) {
  ------------------
  |  Branch (1157:9): [True: 0, False: 0]
  ------------------
 1158|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1158:10): [True: 0, False: 0]
  ------------------
 1159|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1160|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1160:21): [True: 0, False: 0]
  ------------------
 1161|      0|                ret = temp;
 1162|      0|	    }
 1163|      0|	    if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p)))
  ------------------
  |  |   96|      0|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (96:25): [True: 0, False: 0]
  |  |  |  Branch (96:41): [True: 0, False: 0]
  |  |  |  Branch (96:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   97|      0|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 0, False: 0]
  |  |  |  Branch (97:25): [True: 0, False: 0]
  |  |  |  Branch (97:41): [True: 0, False: 0]
  |  |  |  Branch (97:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   98|      0|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 0, False: 0]
  |  |  |  Branch (98:25): [True: 0, False: 0]
  |  |  |  Branch (98:41): [True: 0, False: 0]
  |  |  |  Branch (98:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   99|      0|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (99:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
              	    if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p)))
  ------------------
  |  |  104|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   74|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (54:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (54:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (61:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (61:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (69:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (69:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   80|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   82|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (82:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|      0|		ret[len++] = *p++;
 1165|      0|	    else {
 1166|      0|		int val = *(unsigned char *)p++;
 1167|      0|		int hi = val / 0x10, lo = val % 0x10;
 1168|      0|		ret[len++] = '%';
 1169|      0|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1169:22): [True: 0, False: 0]
  ------------------
 1170|      0|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1170:22): [True: 0, False: 0]
  ------------------
 1171|      0|	    }
 1172|      0|	}
 1173|  6.16k|    } else {
 1174|  6.16k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   37|  4.77k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1174:6): [True: 1.38k, False: 4.77k]
  |  Branch (1174:31): [True: 963, False: 3.81k]
  ------------------
 1175|  2.34k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1175:10): [True: 13, False: 2.33k]
  ------------------
 1176|     13|                temp = xmlSaveUriRealloc(ret, &max);
 1177|     13|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1177:21): [True: 2, False: 11]
  ------------------
 1178|     11|                ret = temp;
 1179|     11|	    }
 1180|  2.34k|	    ret[len++] = '/';
 1181|  2.34k|	    ret[len++] = '/';
 1182|  2.34k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1182:10): [True: 1.02k, False: 1.32k]
  ------------------
 1183|  1.02k|		p = uri->user;
 1184|   223k|		while (*p != 0) {
  ------------------
  |  Branch (1184:10): [True: 222k, False: 1.01k]
  ------------------
 1185|   222k|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1185:11): [True: 625, False: 221k]
  ------------------
 1186|    625|                        temp = xmlSaveUriRealloc(ret, &max);
 1187|    625|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1187:29): [True: 2, False: 623]
  ------------------
 1188|    623|                        ret = temp;
 1189|    623|		    }
 1190|   222k|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  104|   222k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   74|   444k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|   444k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|   444k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (54:25): [True: 4.47k, False: 217k]
  |  |  |  |  |  |  |  |  |  Branch (54:41): [True: 711, False: 3.76k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|   221k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (61:24): [True: 13.5k, False: 207k]
  |  |  |  |  |  |  |  |  |  Branch (61:40): [True: 1.07k, False: 12.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|   220k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (69:22): [True: 20.0k, False: 200k]
  |  |  |  |  |  |  |  Branch (69:38): [True: 636, False: 19.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   80|   219k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:21): [True: 829, False: 218k]
  |  |  |  |  |  Branch (80:37): [True: 220, False: 218k]
  |  |  |  |  |  Branch (80:53): [True: 1.47k, False: 217k]
  |  |  |  |  ------------------
  |  |  |  |   81|   219k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 276, False: 217k]
  |  |  |  |  |  Branch (81:21): [True: 235, False: 216k]
  |  |  |  |  |  Branch (81:37): [True: 290, False: 216k]
  |  |  |  |  |  Branch (81:53): [True: 2.00k, False: 214k]
  |  |  |  |  ------------------
  |  |  |  |   82|   219k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:5): [True: 616, False: 213k]
  |  |  |  |  |  Branch (82:21): [True: 557, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1191|   222k|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1191:4): [True: 282, False: 213k]
  |  Branch (1191:23): [True: 4.03k, False: 209k]
  ------------------
 1192|   222k|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1192:4): [True: 2.05k, False: 206k]
  |  Branch (1192:23): [True: 214, False: 206k]
  ------------------
 1193|   222k|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1193:4): [True: 207, False: 206k]
  |  Branch (1193:23): [True: 211, False: 206k]
  ------------------
 1194|   222k|			((*(p) == ',')))
  ------------------
  |  Branch (1194:4): [True: 209, False: 206k]
  ------------------
 1195|  16.1k|			ret[len++] = *p++;
 1196|   206k|		    else {
 1197|   206k|			int val = *(unsigned char *)p++;
 1198|   206k|			int hi = val / 0x10, lo = val % 0x10;
 1199|   206k|			ret[len++] = '%';
 1200|   206k|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1200:23): [True: 148k, False: 57.4k]
  ------------------
 1201|   206k|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1201:23): [True: 146k, False: 60.1k]
  ------------------
 1202|   206k|		    }
 1203|   222k|		}
 1204|  1.01k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1204:7): [True: 18, False: 1.00k]
  ------------------
 1205|     18|                    temp = xmlSaveUriRealloc(ret, &max);
 1206|     18|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1206:25): [True: 1, False: 17]
  ------------------
 1207|     17|                    ret = temp;
 1208|     17|		}
 1209|  1.01k|		ret[len++] = '@';
 1210|  1.01k|	    }
 1211|  2.34k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1211:10): [True: 1.38k, False: 961]
  ------------------
 1212|  1.38k|		p = uri->server;
 1213|   427k|		while (*p != 0) {
  ------------------
  |  Branch (1213:10): [True: 425k, False: 1.38k]
  ------------------
 1214|   425k|		    if (len >= max) {
  ------------------
  |  Branch (1214:11): [True: 531, False: 425k]
  ------------------
 1215|    531|			temp = xmlSaveUriRealloc(ret, &max);
 1216|    531|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1216:8): [True: 1, False: 530]
  ------------------
 1217|    530|			ret = temp;
 1218|    530|		    }
 1219|       |                    /* TODO: escaping? */
 1220|   425k|		    ret[len++] = (xmlChar) *p++;
 1221|   425k|		}
 1222|  1.38k|	    }
 1223|  2.34k|            if (uri->port > 0) {
  ------------------
  |  Branch (1223:17): [True: 457, False: 1.88k]
  ------------------
 1224|    457|                if (len + 10 >= max) {
  ------------------
  |  Branch (1224:21): [True: 20, False: 437]
  ------------------
 1225|     20|                    temp = xmlSaveUriRealloc(ret, &max);
 1226|     20|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1226:25): [True: 1, False: 19]
  ------------------
 1227|     19|                    ret = temp;
 1228|     19|                }
 1229|    456|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1230|    456|            }
 1231|  3.81k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1231:13): [True: 0, False: 3.81k]
  ------------------
 1232|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1232:10): [True: 0, False: 0]
  ------------------
 1233|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1234|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1234:21): [True: 0, False: 0]
  ------------------
 1235|      0|                ret = temp;
 1236|      0|	    }
 1237|      0|	    ret[len++] = '/';
 1238|      0|	    ret[len++] = '/';
 1239|      0|	    p = uri->authority;
 1240|      0|	    while (*p != 0) {
  ------------------
  |  Branch (1240:13): [True: 0, False: 0]
  ------------------
 1241|      0|		if (len + 3 >= max) {
  ------------------
  |  Branch (1241:7): [True: 0, False: 0]
  ------------------
 1242|      0|                    temp = xmlSaveUriRealloc(ret, &max);
 1243|      0|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1243:25): [True: 0, False: 0]
  ------------------
 1244|      0|                    ret = temp;
 1245|      0|		}
 1246|      0|		if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  104|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   74|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (54:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (54:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (61:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (61:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (69:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (69:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   80|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   82|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (82:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1247|      0|                    ((*(p) == '$')) || ((*(p) == ',')) || ((*(p) == ';')) ||
  ------------------
  |  Branch (1247:21): [True: 0, False: 0]
  |  Branch (1247:40): [True: 0, False: 0]
  |  Branch (1247:59): [True: 0, False: 0]
  ------------------
 1248|      0|                    ((*(p) == ':')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1248:21): [True: 0, False: 0]
  |  Branch (1248:40): [True: 0, False: 0]
  |  Branch (1248:59): [True: 0, False: 0]
  ------------------
 1249|      0|                    ((*(p) == '=')) || ((*(p) == '+')))
  ------------------
  |  Branch (1249:21): [True: 0, False: 0]
  |  Branch (1249:40): [True: 0, False: 0]
  ------------------
 1250|      0|		    ret[len++] = *p++;
 1251|      0|		else {
 1252|      0|		    int val = *(unsigned char *)p++;
 1253|      0|		    int hi = val / 0x10, lo = val % 0x10;
 1254|      0|		    ret[len++] = '%';
 1255|      0|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1255:26): [True: 0, False: 0]
  ------------------
 1256|      0|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1256:26): [True: 0, False: 0]
  ------------------
 1257|      0|		}
 1258|      0|	    }
 1259|  3.81k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1259:13): [True: 589, False: 3.22k]
  ------------------
 1260|    589|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1260:10): [True: 13, False: 576]
  ------------------
 1261|     13|                temp = xmlSaveUriRealloc(ret, &max);
 1262|     13|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1262:21): [True: 1, False: 12]
  ------------------
 1263|     12|                ret = temp;
 1264|     12|	    }
 1265|    589|	}
 1266|  6.15k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1266:6): [True: 2.86k, False: 3.29k]
  ------------------
 1267|  2.86k|	    p = uri->path;
 1268|       |	    /*
 1269|       |	     * the colon in file:///d: should not be escaped or
 1270|       |	     * Windows accesses fail later.
 1271|       |	     */
 1272|  2.86k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1272:10): [True: 637, False: 2.22k]
  ------------------
 1273|  2.86k|		(p[0] == '/') &&
  ------------------
  |  Branch (1273:3): [True: 501, False: 136]
  ------------------
 1274|  2.86k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1274:5): [True: 172, False: 329]
  |  Branch (1274:22): [True: 160, False: 12]
  ------------------
 1275|    501|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1275:5): [True: 107, False: 234]
  |  Branch (1275:22): [True: 91, False: 16]
  ------------------
 1276|  2.86k|		(p[2] == ':') &&
  ------------------
  |  Branch (1276:3): [True: 102, False: 149]
  ------------------
 1277|  2.86k|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   35|    102|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   35|    102|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1277:10): [True: 62, False: 40]
  ------------------
 1278|     62|		if (len + 3 >= max) {
  ------------------
  |  Branch (1278:7): [True: 13, False: 49]
  ------------------
 1279|     13|                    temp = xmlSaveUriRealloc(ret, &max);
 1280|     13|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1280:25): [True: 2, False: 11]
  ------------------
 1281|     11|                    ret = temp;
 1282|     11|		}
 1283|     60|		ret[len++] = *p++;
 1284|     60|		ret[len++] = *p++;
 1285|     60|		ret[len++] = *p++;
 1286|     60|	    }
 1287|   298k|	    while (*p != 0) {
  ------------------
  |  Branch (1287:13): [True: 295k, False: 2.85k]
  ------------------
 1288|   295k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1288:7): [True: 631, False: 294k]
  ------------------
 1289|    631|                    temp = xmlSaveUriRealloc(ret, &max);
 1290|    631|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1290:25): [True: 1, False: 630]
  ------------------
 1291|    630|                    ret = temp;
 1292|    630|		}
 1293|   295k|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  104|   295k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   74|   590k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|   590k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|   590k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (54:25): [True: 19.3k, False: 276k]
  |  |  |  |  |  |  |  |  |  Branch (54:41): [True: 19.0k, False: 340]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|   276k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (61:24): [True: 26.6k, False: 249k]
  |  |  |  |  |  |  |  |  |  Branch (61:40): [True: 26.1k, False: 561]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|   250k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (69:22): [True: 32.5k, False: 217k]
  |  |  |  |  |  |  |  Branch (69:38): [True: 6.75k, False: 25.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   80|   243k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:21): [True: 593, False: 242k]
  |  |  |  |  |  Branch (80:37): [True: 213, False: 242k]
  |  |  |  |  |  Branch (80:53): [True: 5.72k, False: 237k]
  |  |  |  |  ------------------
  |  |  |  |   81|   243k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 626, False: 236k]
  |  |  |  |  |  Branch (81:21): [True: 337, False: 236k]
  |  |  |  |  |  Branch (81:37): [True: 862, False: 235k]
  |  |  |  |  |  Branch (81:53): [True: 2.87k, False: 232k]
  |  |  |  |  ------------------
  |  |  |  |   82|   243k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:5): [True: 407, False: 231k]
  |  |  |  |  |  Branch (82:21): [True: 1.75k, False: 230k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1293:32): [True: 168k, False: 61.2k]
  ------------------
 1294|   295k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1294:21): [True: 324, False: 60.9k]
  |  Branch (1294:40): [True: 1.14k, False: 59.7k]
  |  Branch (1294:59): [True: 1.70k, False: 58.0k]
  ------------------
 1295|   295k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1295:14): [True: 555, False: 57.5k]
  |  Branch (1295:33): [True: 632, False: 56.8k]
  |  Branch (1295:52): [True: 31.6k, False: 25.2k]
  ------------------
 1296|   295k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1296:14): [True: 1.54k, False: 23.6k]
  ------------------
 1297|   271k|		    ret[len++] = *p++;
 1298|  23.6k|		else {
 1299|  23.6k|		    int val = *(unsigned char *)p++;
 1300|  23.6k|		    int hi = val / 0x10, lo = val % 0x10;
 1301|  23.6k|		    ret[len++] = '%';
 1302|  23.6k|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1302:26): [True: 220, False: 23.4k]
  ------------------
 1303|  23.6k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1303:26): [True: 23.4k, False: 276]
  ------------------
 1304|  23.6k|		}
 1305|   295k|	    }
 1306|  2.85k|	}
 1307|  6.14k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1307:6): [True: 689, False: 5.46k]
  ------------------
 1308|    689|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1308:10): [True: 11, False: 678]
  ------------------
 1309|     11|                temp = xmlSaveUriRealloc(ret, &max);
 1310|     11|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1310:21): [True: 1, False: 10]
  ------------------
 1311|     10|                ret = temp;
 1312|     10|	    }
 1313|    688|	    ret[len++] = '?';
 1314|    688|	    p = uri->query_raw;
 1315|  16.5k|	    while (*p != 0) {
  ------------------
  |  Branch (1315:13): [True: 15.8k, False: 687]
  ------------------
 1316|  15.8k|		if (len + 1 >= max) {
  ------------------
  |  Branch (1316:7): [True: 59, False: 15.8k]
  ------------------
 1317|     59|                    temp = xmlSaveUriRealloc(ret, &max);
 1318|     59|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1318:25): [True: 1, False: 58]
  ------------------
 1319|     58|                    ret = temp;
 1320|     58|		}
 1321|  15.8k|		ret[len++] = *p++;
 1322|  15.8k|	    }
 1323|  5.46k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1323:13): [True: 0, False: 5.46k]
  ------------------
 1324|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1324:10): [True: 0, False: 0]
  ------------------
 1325|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1326|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1326:21): [True: 0, False: 0]
  ------------------
 1327|      0|                ret = temp;
 1328|      0|	    }
 1329|      0|	    ret[len++] = '?';
 1330|      0|	    p = uri->query;
 1331|      0|	    while (*p != 0) {
  ------------------
  |  Branch (1331:13): [True: 0, False: 0]
  ------------------
 1332|      0|		if (len + 3 >= max) {
  ------------------
  |  Branch (1332:7): [True: 0, False: 0]
  ------------------
 1333|      0|                    temp = xmlSaveUriRealloc(ret, &max);
 1334|      0|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1334:25): [True: 0, False: 0]
  ------------------
 1335|      0|                    ret = temp;
 1336|      0|		}
 1337|      0|		if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  104|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   74|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (54:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (54:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (61:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (61:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (69:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (69:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   80|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   82|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (82:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   96|      0|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (96:25): [True: 0, False: 0]
  |  |  |  Branch (96:41): [True: 0, False: 0]
  |  |  |  Branch (96:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   97|      0|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 0, False: 0]
  |  |  |  Branch (97:25): [True: 0, False: 0]
  |  |  |  Branch (97:41): [True: 0, False: 0]
  |  |  |  Branch (97:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   98|      0|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 0, False: 0]
  |  |  |  Branch (98:25): [True: 0, False: 0]
  |  |  |  Branch (98:41): [True: 0, False: 0]
  |  |  |  Branch (98:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   99|      0|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (99:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1338|      0|		    ret[len++] = *p++;
 1339|      0|		else {
 1340|      0|		    int val = *(unsigned char *)p++;
 1341|      0|		    int hi = val / 0x10, lo = val % 0x10;
 1342|      0|		    ret[len++] = '%';
 1343|      0|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1343:26): [True: 0, False: 0]
  ------------------
 1344|      0|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1344:26): [True: 0, False: 0]
  ------------------
 1345|      0|		}
 1346|      0|	    }
 1347|      0|	}
 1348|  6.14k|    }
 1349|  6.14k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1349:9): [True: 1.01k, False: 5.13k]
  ------------------
 1350|  1.01k|	if (len + 3 >= max) {
  ------------------
  |  Branch (1350:6): [True: 14, False: 1.00k]
  ------------------
 1351|     14|            temp = xmlSaveUriRealloc(ret, &max);
 1352|     14|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1352:17): [True: 1, False: 13]
  ------------------
 1353|     13|            ret = temp;
 1354|     13|	}
 1355|  1.01k|	ret[len++] = '#';
 1356|  1.01k|	p = uri->fragment;
 1357|  13.0k|	while (*p != 0) {
  ------------------
  |  Branch (1357:9): [True: 12.0k, False: 1.01k]
  ------------------
 1358|  12.0k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1358:10): [True: 61, False: 11.9k]
  ------------------
 1359|     61|                temp = xmlSaveUriRealloc(ret, &max);
 1360|     61|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1360:21): [True: 1, False: 60]
  ------------------
 1361|     60|                ret = temp;
 1362|     60|	    }
 1363|  12.0k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  104|  12.0k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   74|  24.0k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  24.0k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|  24.0k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (54:25): [True: 1.54k, False: 10.5k]
  |  |  |  |  |  |  |  |  |  Branch (54:41): [True: 1.32k, False: 215]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|  10.7k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (61:24): [True: 1.58k, False: 9.14k]
  |  |  |  |  |  |  |  |  |  Branch (61:40): [True: 407, False: 1.17k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  10.3k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (69:22): [True: 3.33k, False: 6.98k]
  |  |  |  |  |  |  |  Branch (69:38): [True: 588, False: 2.74k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   80|  9.72k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:21): [True: 210, False: 9.51k]
  |  |  |  |  |  Branch (80:37): [True: 194, False: 9.32k]
  |  |  |  |  |  Branch (80:53): [True: 244, False: 9.08k]
  |  |  |  |  ------------------
  |  |  |  |   81|  9.72k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 240, False: 8.84k]
  |  |  |  |  |  Branch (81:21): [True: 202, False: 8.63k]
  |  |  |  |  |  Branch (81:37): [True: 360, False: 8.27k]
  |  |  |  |  |  Branch (81:53): [True: 303, False: 7.97k]
  |  |  |  |  ------------------
  |  |  |  |   82|  9.72k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:5): [True: 316, False: 7.65k]
  |  |  |  |  |  Branch (82:21): [True: 248, False: 7.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   96|  7.41k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (96:25): [True: 275, False: 7.13k]
  |  |  |  Branch (96:41): [True: 2.86k, False: 4.27k]
  |  |  |  Branch (96:57): [True: 349, False: 3.92k]
  |  |  ------------------
  |  |   97|  7.41k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 433, False: 3.49k]
  |  |  |  Branch (97:25): [True: 278, False: 3.21k]
  |  |  |  Branch (97:41): [True: 878, False: 2.33k]
  |  |  |  Branch (97:57): [True: 232, False: 2.10k]
  |  |  ------------------
  |  |   98|  7.41k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 242, False: 1.86k]
  |  |  |  Branch (98:25): [True: 230, False: 1.63k]
  |  |  |  Branch (98:41): [True: 291, False: 1.33k]
  |  |  |  Branch (98:57): [True: 429, False: 910]
  |  |  ------------------
  |  |   99|  7.41k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (99:9): [True: 334, False: 576]
  |  |  ------------------
  ------------------
 1364|  11.4k|		ret[len++] = *p++;
 1365|    576|	    else {
 1366|    576|		int val = *(unsigned char *)p++;
 1367|    576|		int hi = val / 0x10, lo = val % 0x10;
 1368|    576|		ret[len++] = '%';
 1369|    576|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1369:22): [True: 240, False: 336]
  ------------------
 1370|    576|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1370:22): [True: 212, False: 364]
  ------------------
 1371|    576|	    }
 1372|  12.0k|	}
 1373|  1.01k|    }
 1374|  6.14k|    if (len >= max) {
  ------------------
  |  Branch (1374:9): [True: 12, False: 6.13k]
  ------------------
 1375|     12|        temp = xmlSaveUriRealloc(ret, &max);
 1376|     12|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1376:13): [True: 1, False: 11]
  ------------------
 1377|     11|        ret = temp;
 1378|     11|    }
 1379|  6.14k|    ret[len] = 0;
 1380|  6.14k|    return(ret);
 1381|       |
 1382|     20|mem_error:
 1383|     20|    xmlFree(ret);
 1384|     20|    return(NULL);
 1385|  6.14k|}
xmlFreeURI:
 1442|  28.6k|xmlFreeURI(xmlURIPtr uri) {
 1443|  28.6k|    if (uri == NULL) return;
  ------------------
  |  Branch (1443:9): [True: 2.85k, False: 25.8k]
  ------------------
 1444|       |
 1445|  25.8k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1445:9): [True: 5.50k, False: 20.2k]
  ------------------
 1446|  25.8k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1446:9): [True: 3.28k, False: 22.5k]
  ------------------
 1447|  25.8k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1447:9): [True: 2.34k, False: 23.4k]
  ------------------
 1448|  25.8k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1448:9): [True: 9.92k, False: 15.8k]
  ------------------
 1449|  25.8k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1449:9): [True: 2.74k, False: 23.0k]
  ------------------
 1450|  25.8k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1450:9): [True: 0, False: 25.8k]
  ------------------
 1451|  25.8k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1451:9): [True: 0, False: 25.8k]
  ------------------
 1452|  25.8k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1452:9): [True: 1.69k, False: 24.1k]
  ------------------
 1453|  25.8k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1453:9): [True: 1.80k, False: 24.0k]
  ------------------
 1454|  25.8k|    xmlFree(uri);
 1455|  25.8k|}
xmlNormalizeURIPath:
 1589|  4.56k|xmlNormalizeURIPath(char *path) {
 1590|  4.56k|    return(xmlNormalizePath(path, 0));
 1591|  4.56k|}
xmlURIUnescapeString:
 1616|  23.3k|xmlURIUnescapeString(const char *str, int len, char *target) {
 1617|  23.3k|    char *ret, *out;
 1618|  23.3k|    const char *in;
 1619|       |
 1620|  23.3k|    if (str == NULL)
  ------------------
  |  Branch (1620:9): [True: 4, False: 23.3k]
  ------------------
 1621|      4|	return(NULL);
 1622|  23.3k|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1622:9): [True: 7.99k, False: 15.3k]
  ------------------
 1623|  23.3k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1623:9): [True: 0, False: 23.3k]
  ------------------
 1624|       |
 1625|  23.3k|    if (target == NULL) {
  ------------------
  |  Branch (1625:9): [True: 23.3k, False: 0]
  ------------------
 1626|  23.3k|	ret = (char *) xmlMallocAtomic(len + 1);
 1627|  23.3k|	if (ret == NULL)
  ------------------
  |  Branch (1627:6): [True: 139, False: 23.1k]
  ------------------
 1628|    139|	    return(NULL);
 1629|  23.3k|    } else
 1630|      0|	ret = target;
 1631|  23.1k|    in = str;
 1632|  23.1k|    out = ret;
 1633|  2.57M|    while(len > 0) {
  ------------------
  |  Branch (1633:11): [True: 2.55M, False: 23.1k]
  ------------------
 1634|  2.55M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1634:6): [True: 2.52M, False: 34.3k]
  |  Branch (1634:19): [True: 16.6k, False: 2.50M]
  |  Branch (1634:35): [True: 11.4k, False: 5.14k]
  |  Branch (1634:54): [True: 10.1k, False: 1.31k]
  ------------------
 1635|  10.1k|            int c = 0;
 1636|  10.1k|	    in++;
 1637|  10.1k|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1637:10): [True: 10.1k, False: 0]
  |  Branch (1637:26): [True: 1.85k, False: 8.30k]
  ------------------
 1638|  1.85k|	        c = (*in - '0');
 1639|  8.30k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1639:15): [True: 3.58k, False: 4.72k]
  |  Branch (1639:31): [True: 3.58k, False: 0]
  ------------------
 1640|  3.58k|	        c = (*in - 'a') + 10;
 1641|  4.72k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1641:15): [True: 4.72k, False: 0]
  |  Branch (1641:31): [True: 4.72k, False: 0]
  ------------------
 1642|  4.72k|	        c = (*in - 'A') + 10;
 1643|  10.1k|	    in++;
 1644|  10.1k|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1644:10): [True: 10.1k, False: 0]
  |  Branch (1644:26): [True: 2.25k, False: 7.90k]
  ------------------
 1645|  2.25k|	        c = c * 16 + (*in - '0');
 1646|  7.90k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1646:15): [True: 4.17k, False: 3.73k]
  |  Branch (1646:31): [True: 4.17k, False: 0]
  ------------------
 1647|  4.17k|	        c = c * 16 + (*in - 'a') + 10;
 1648|  3.73k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1648:15): [True: 3.73k, False: 0]
  |  Branch (1648:31): [True: 3.73k, False: 0]
  ------------------
 1649|  3.73k|	        c = c * 16 + (*in - 'A') + 10;
 1650|  10.1k|	    in++;
 1651|  10.1k|	    len -= 3;
 1652|       |            /* Explicit sign change */
 1653|  10.1k|	    *out++ = (char) c;
 1654|  2.54M|	} else {
 1655|  2.54M|	    *out++ = *in++;
 1656|  2.54M|	    len--;
 1657|  2.54M|	}
 1658|  2.55M|    }
 1659|  23.1k|    *out = 0;
 1660|  23.1k|    return(ret);
 1661|  23.3k|}
xmlURIEscapeStr:
 1675|  10.1k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1676|  10.1k|    xmlChar *ret, ch;
 1677|  10.1k|    xmlChar *temp;
 1678|  10.1k|    const xmlChar *in;
 1679|  10.1k|    int len, out;
 1680|       |
 1681|  10.1k|    if (str == NULL)
  ------------------
  |  Branch (1681:9): [True: 4, False: 10.1k]
  ------------------
 1682|      4|	return(NULL);
 1683|  10.1k|    if (str[0] == 0)
  ------------------
  |  Branch (1683:9): [True: 161, False: 10.0k]
  ------------------
 1684|    161|	return(xmlStrdup(str));
 1685|  10.0k|    len = xmlStrlen(str);
 1686|       |
 1687|  10.0k|    len += 20;
 1688|  10.0k|    ret = (xmlChar *) xmlMallocAtomic(len);
 1689|  10.0k|    if (ret == NULL)
  ------------------
  |  Branch (1689:9): [True: 55, False: 9.97k]
  ------------------
 1690|     55|	return(NULL);
 1691|  9.97k|    in = (const xmlChar *) str;
 1692|  9.97k|    out = 0;
 1693|  1.74M|    while(*in != 0) {
  ------------------
  |  Branch (1693:11): [True: 1.73M, False: 9.97k]
  ------------------
 1694|  1.73M|	if (len - out <= 3) {
  ------------------
  |  Branch (1694:6): [True: 1.71k, False: 1.73M]
  ------------------
 1695|  1.71k|            if (len > INT_MAX / 2)
  ------------------
  |  Branch (1695:17): [True: 0, False: 1.71k]
  ------------------
 1696|      0|                return(NULL);
 1697|  1.71k|            temp = xmlRealloc(ret, len * 2);
 1698|  1.71k|	    if (temp == NULL) {
  ------------------
  |  Branch (1698:10): [True: 5, False: 1.71k]
  ------------------
 1699|      5|		xmlFree(ret);
 1700|      5|		return(NULL);
 1701|      5|	    }
 1702|  1.71k|	    ret = temp;
 1703|  1.71k|            len *= 2;
 1704|  1.71k|	}
 1705|       |
 1706|  1.73M|	ch = *in;
 1707|       |
 1708|  1.73M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  104|  1.72M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   74|  3.45M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  3.45M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|  3.45M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (54:25): [True: 717k, False: 1.00M]
  |  |  |  |  |  |  |  |  |  Branch (54:41): [True: 49.5k, False: 667k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|  1.67M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (61:24): [True: 796k, False: 879k]
  |  |  |  |  |  |  |  |  |  Branch (61:40): [True: 90.0k, False: 706k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  1.58M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (69:22): [True: 810k, False: 775k]
  |  |  |  |  |  |  |  Branch (69:38): [True: 57.6k, False: 752k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   80|  1.52M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:21): [True: 10.1k, False: 1.51M]
  |  |  |  |  |  Branch (80:37): [True: 892, False: 1.51M]
  |  |  |  |  |  Branch (80:53): [True: 279k, False: 1.23M]
  |  |  |  |  ------------------
  |  |  |  |   81|  1.52M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.94k, False: 1.23M]
  |  |  |  |  |  Branch (81:21): [True: 3.67k, False: 1.23M]
  |  |  |  |  |  Branch (81:37): [True: 3.56k, False: 1.22M]
  |  |  |  |  |  Branch (81:53): [True: 5.71k, False: 1.22M]
  |  |  |  |  ------------------
  |  |  |  |   82|  1.52M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:5): [True: 2.57k, False: 1.22M]
  |  |  |  |  |  Branch (82:21): [True: 3.76k, False: 1.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1708:6): [True: 1.72M, False: 9.16k]
  |  Branch (1708:45): [True: 862k, False: 354k]
  ------------------
 1709|   862k|	    unsigned char val;
 1710|   862k|	    ret[out++] = '%';
 1711|   862k|	    val = ch >> 4;
 1712|   862k|	    if (val <= 9)
  ------------------
  |  Branch (1712:10): [True: 287k, False: 574k]
  ------------------
 1713|   287k|		ret[out++] = '0' + val;
 1714|   574k|	    else
 1715|   574k|		ret[out++] = 'A' + val - 0xA;
 1716|   862k|	    val = ch & 0xF;
 1717|   862k|	    if (val <= 9)
  ------------------
  |  Branch (1717:10): [True: 236k, False: 625k]
  ------------------
 1718|   236k|		ret[out++] = '0' + val;
 1719|   625k|	    else
 1720|   625k|		ret[out++] = 'A' + val - 0xA;
 1721|   862k|	    in++;
 1722|   872k|	} else {
 1723|   872k|	    ret[out++] = *in++;
 1724|   872k|	}
 1725|       |
 1726|  1.73M|    }
 1727|  9.97k|    ret[out] = 0;
 1728|  9.97k|    return(ret);
 1729|  9.97k|}
xmlURIEscape:
 1748|  3.94k|{
 1749|  3.94k|    xmlChar *ret, *segment = NULL;
 1750|  3.94k|    xmlURIPtr uri;
 1751|  3.94k|    int ret2;
 1752|       |
 1753|  3.94k|    if (str == NULL)
  ------------------
  |  Branch (1753:9): [True: 4, False: 3.93k]
  ------------------
 1754|      4|        return (NULL);
 1755|       |
 1756|  3.93k|    uri = xmlCreateURI();
 1757|  3.93k|    if (uri != NULL) {
  ------------------
  |  Branch (1757:9): [True: 3.86k, False: 70]
  ------------------
 1758|       |	/*
 1759|       |	 * Allow escaping errors in the unescaped form
 1760|       |	 */
 1761|  3.86k|        uri->cleanup = XML_URI_ALLOW_UNWISE;
  ------------------
  |  |  192|  3.86k|#define XML_URI_ALLOW_UNWISE    1
  ------------------
 1762|  3.86k|        ret2 = xmlParseURIReference(uri, (const char *)str);
 1763|  3.86k|        if (ret2) {
  ------------------
  |  Branch (1763:13): [True: 988, False: 2.87k]
  ------------------
 1764|    988|            xmlFreeURI(uri);
 1765|    988|            return (NULL);
 1766|    988|        }
 1767|  3.86k|    }
 1768|       |
 1769|  2.94k|    if (!uri)
  ------------------
  |  Branch (1769:9): [True: 70, False: 2.87k]
  ------------------
 1770|     70|        return NULL;
 1771|       |
 1772|  2.87k|    ret = NULL;
 1773|       |
 1774|  2.87k|#define NULLCHK(p) if(!p) { \
 1775|  2.87k|         xmlFreeURI(uri); \
 1776|  2.87k|         xmlFree(ret); \
 1777|  2.87k|         return NULL; } \
 1778|  2.87k|
 1779|  2.87k|    if (uri->scheme) {
  ------------------
  |  Branch (1779:9): [True: 714, False: 2.16k]
  ------------------
 1780|    714|        segment = xmlURIEscapeStr(BAD_CAST uri->scheme, BAD_CAST "+-.");
  ------------------
  |  |   35|    714|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->scheme, BAD_CAST "+-.");
  ------------------
  |  |   35|    714|#define BAD_CAST (xmlChar *)
  ------------------
 1781|    714|        NULLCHK(segment)
  ------------------
  |  | 1774|    714|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1774:23): [True: 3, False: 711]
  |  |  ------------------
  |  | 1775|      3|         xmlFreeURI(uri); \
  |  | 1776|      3|         xmlFree(ret); \
  |  | 1777|      3|         return NULL; } \
  ------------------
 1782|    711|        ret = xmlStrcat(ret, segment);
 1783|    711|        ret = xmlStrcat(ret, BAD_CAST ":");
  ------------------
  |  |   35|    711|#define BAD_CAST (xmlChar *)
  ------------------
 1784|    711|        xmlFree(segment);
 1785|    711|    }
 1786|       |
 1787|  2.87k|    if (uri->authority) {
  ------------------
  |  Branch (1787:9): [True: 0, False: 2.87k]
  ------------------
 1788|      0|        segment =
 1789|      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 *)
  ------------------
 1790|      0|        NULLCHK(segment)
  ------------------
  |  | 1774|      0|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1774:23): [True: 0, False: 0]
  |  |  ------------------
  |  | 1775|      0|         xmlFreeURI(uri); \
  |  | 1776|      0|         xmlFree(ret); \
  |  | 1777|      0|         return NULL; } \
  ------------------
 1791|      0|        ret = xmlStrcat(ret, BAD_CAST "//");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1792|      0|        ret = xmlStrcat(ret, segment);
 1793|      0|        xmlFree(segment);
 1794|      0|    }
 1795|       |
 1796|  2.87k|    if (uri->user) {
  ------------------
  |  Branch (1796:9): [True: 484, False: 2.39k]
  ------------------
 1797|    484|        segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,");
  ------------------
  |  |   35|    484|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,");
  ------------------
  |  |   35|    484|#define BAD_CAST (xmlChar *)
  ------------------
 1798|    484|        NULLCHK(segment)
  ------------------
  |  | 1774|    484|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1774:23): [True: 2, False: 482]
  |  |  ------------------
  |  | 1775|      2|         xmlFreeURI(uri); \
  |  | 1776|      2|         xmlFree(ret); \
  |  | 1777|      2|         return NULL; } \
  ------------------
 1799|    482|        ret = xmlStrcat(ret,BAD_CAST "//");
  ------------------
  |  |   35|    482|#define BAD_CAST (xmlChar *)
  ------------------
 1800|    482|        ret = xmlStrcat(ret, segment);
 1801|    482|        ret = xmlStrcat(ret, BAD_CAST "@");
  ------------------
  |  |   35|    482|#define BAD_CAST (xmlChar *)
  ------------------
 1802|    482|        xmlFree(segment);
 1803|    482|    }
 1804|       |
 1805|  2.87k|    if (uri->server) {
  ------------------
  |  Branch (1805:9): [True: 695, False: 2.17k]
  ------------------
 1806|    695|        segment = xmlURIEscapeStr(BAD_CAST uri->server, BAD_CAST "/?;:@");
  ------------------
  |  |   35|    695|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->server, BAD_CAST "/?;:@");
  ------------------
  |  |   35|    695|#define BAD_CAST (xmlChar *)
  ------------------
 1807|    695|        NULLCHK(segment)
  ------------------
  |  | 1774|    695|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1774:23): [True: 4, False: 691]
  |  |  ------------------
  |  | 1775|      4|         xmlFreeURI(uri); \
  |  | 1776|      4|         xmlFree(ret); \
  |  | 1777|      4|         return NULL; } \
  ------------------
 1808|    691|        if (uri->user == NULL)
  ------------------
  |  Branch (1808:13): [True: 314, False: 377]
  ------------------
 1809|    314|            ret = xmlStrcat(ret, BAD_CAST "//");
  ------------------
  |  |   35|    314|#define BAD_CAST (xmlChar *)
  ------------------
 1810|    691|        ret = xmlStrcat(ret, segment);
 1811|    691|        xmlFree(segment);
 1812|    691|    }
 1813|       |
 1814|  2.87k|    if (uri->port > 0) {
  ------------------
  |  Branch (1814:9): [True: 176, False: 2.69k]
  ------------------
 1815|    176|        xmlChar port[11];
 1816|       |
 1817|    176|        snprintf((char *) port, 11, "%d", uri->port);
 1818|    176|        ret = xmlStrcat(ret, BAD_CAST ":");
  ------------------
  |  |   35|    176|#define BAD_CAST (xmlChar *)
  ------------------
 1819|    176|        ret = xmlStrcat(ret, port);
 1820|    176|    }
 1821|       |
 1822|  2.87k|    if (uri->path) {
  ------------------
  |  Branch (1822:9): [True: 1.14k, False: 1.72k]
  ------------------
 1823|  1.14k|        segment =
 1824|  1.14k|            xmlURIEscapeStr(BAD_CAST uri->path, BAD_CAST ":@&=+$,/?;");
  ------------------
  |  |   35|  1.14k|#define BAD_CAST (xmlChar *)
  ------------------
                          xmlURIEscapeStr(BAD_CAST uri->path, BAD_CAST ":@&=+$,/?;");
  ------------------
  |  |   35|  1.14k|#define BAD_CAST (xmlChar *)
  ------------------
 1825|  1.14k|        NULLCHK(segment)
  ------------------
  |  | 1774|  1.14k|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1774:23): [True: 9, False: 1.13k]
  |  |  ------------------
  |  | 1775|      9|         xmlFreeURI(uri); \
  |  | 1776|      9|         xmlFree(ret); \
  |  | 1777|      9|         return NULL; } \
  ------------------
 1826|  1.13k|        ret = xmlStrcat(ret, segment);
 1827|  1.13k|        xmlFree(segment);
 1828|  1.13k|    }
 1829|       |
 1830|  2.86k|    if (uri->query_raw) {
  ------------------
  |  Branch (1830:9): [True: 339, False: 2.52k]
  ------------------
 1831|    339|        ret = xmlStrcat(ret, BAD_CAST "?");
  ------------------
  |  |   35|    339|#define BAD_CAST (xmlChar *)
  ------------------
 1832|    339|        ret = xmlStrcat(ret, BAD_CAST uri->query_raw);
  ------------------
  |  |   35|    339|#define BAD_CAST (xmlChar *)
  ------------------
 1833|    339|    }
 1834|  2.52k|    else if (uri->query) {
  ------------------
  |  Branch (1834:14): [True: 0, False: 2.52k]
  ------------------
 1835|      0|        segment =
 1836|      0|            xmlURIEscapeStr(BAD_CAST uri->query, BAD_CAST ";/?:@&=+,$");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
                          xmlURIEscapeStr(BAD_CAST uri->query, BAD_CAST ";/?:@&=+,$");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1837|      0|        NULLCHK(segment)
  ------------------
  |  | 1774|      0|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1774:23): [True: 0, False: 0]
  |  |  ------------------
  |  | 1775|      0|         xmlFreeURI(uri); \
  |  | 1776|      0|         xmlFree(ret); \
  |  | 1777|      0|         return NULL; } \
  ------------------
 1838|      0|        ret = xmlStrcat(ret, BAD_CAST "?");
  ------------------
  |  |   35|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1839|      0|        ret = xmlStrcat(ret, segment);
 1840|      0|        xmlFree(segment);
 1841|      0|    }
 1842|       |
 1843|  2.86k|    if (uri->opaque) {
  ------------------
  |  Branch (1843:9): [True: 0, False: 2.86k]
  ------------------
 1844|      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 *)
  ------------------
 1845|      0|        NULLCHK(segment)
  ------------------
  |  | 1774|      0|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1774:23): [True: 0, False: 0]
  |  |  ------------------
  |  | 1775|      0|         xmlFreeURI(uri); \
  |  | 1776|      0|         xmlFree(ret); \
  |  | 1777|      0|         return NULL; } \
  ------------------
 1846|      0|        ret = xmlStrcat(ret, segment);
 1847|      0|        xmlFree(segment);
 1848|      0|    }
 1849|       |
 1850|  2.86k|    if (uri->fragment) {
  ------------------
  |  Branch (1850:9): [True: 485, False: 2.37k]
  ------------------
 1851|    485|        segment = xmlURIEscapeStr(BAD_CAST uri->fragment, BAD_CAST "#");
  ------------------
  |  |   35|    485|#define BAD_CAST (xmlChar *)
  ------------------
                      segment = xmlURIEscapeStr(BAD_CAST uri->fragment, BAD_CAST "#");
  ------------------
  |  |   35|    485|#define BAD_CAST (xmlChar *)
  ------------------
 1852|    485|        NULLCHK(segment)
  ------------------
  |  | 1774|    485|#define NULLCHK(p) if(!p) { \
  |  |  ------------------
  |  |  |  Branch (1774:23): [True: 5, False: 480]
  |  |  ------------------
  |  | 1775|      5|         xmlFreeURI(uri); \
  |  | 1776|      5|         xmlFree(ret); \
  |  | 1777|      5|         return NULL; } \
  ------------------
 1853|    480|        ret = xmlStrcat(ret, BAD_CAST "#");
  ------------------
  |  |   35|    480|#define BAD_CAST (xmlChar *)
  ------------------
 1854|    480|        ret = xmlStrcat(ret, segment);
 1855|    480|        xmlFree(segment);
 1856|    480|    }
 1857|       |
 1858|  2.85k|    xmlFreeURI(uri);
 1859|  2.85k|#undef NULLCHK
 1860|       |
 1861|  2.85k|    return (ret);
 1862|  2.86k|}
xmlBuildURISafe:
 2008|  7.88k|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 2009|  7.88k|    xmlChar *val = NULL;
 2010|  7.88k|    int ret, len, indx, cur, out;
 2011|  7.88k|    xmlURIPtr ref = NULL;
 2012|  7.88k|    xmlURIPtr bas = NULL;
 2013|  7.88k|    xmlURIPtr res = NULL;
 2014|       |
 2015|       |    /*
 2016|       |     * 1) The URI reference is parsed into the potential four components and
 2017|       |     *    fragment identifier, as described in Section 4.3.
 2018|       |     *
 2019|       |     *    NOTE that a completely empty URI is treated by modern browsers
 2020|       |     *    as a reference to "." rather than as a synonym for the current
 2021|       |     *    URI.  Should we do that here?
 2022|       |     */
 2023|  7.88k|    if (URI == NULL)
  ------------------
  |  Branch (2023:9): [True: 4.97k, False: 2.90k]
  ------------------
 2024|  4.97k|        ret = 1;
 2025|  2.90k|    else if (URI[0] != 0)
  ------------------
  |  Branch (2025:14): [True: 2.82k, False: 84]
  ------------------
 2026|  2.82k|        ret = xmlParseURISafe((const char *) URI, &ref);
 2027|     84|    else
 2028|     84|        ret = 0;
 2029|  7.88k|    if (ret != 0)
  ------------------
  |  Branch (2029:9): [True: 5.28k, False: 2.59k]
  ------------------
 2030|  5.28k|	goto done;
 2031|  2.59k|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2031:9): [True: 2.51k, False: 84]
  |  Branch (2031:26): [True: 434, False: 2.07k]
  ------------------
 2032|       |	/*
 2033|       |	 * The URI is absolute don't modify.
 2034|       |	 */
 2035|    434|	val = xmlStrdup(URI);
 2036|    434|        if (val == NULL)
  ------------------
  |  Branch (2036:13): [True: 5, False: 429]
  ------------------
 2037|      5|            ret = -1;
 2038|    434|	goto done;
 2039|    434|    }
 2040|       |
 2041|       |    /*
 2042|       |     * If base has no scheme or authority, it is assumed to be a
 2043|       |     * filesystem path.
 2044|       |     */
 2045|  2.16k|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   35|  2.16k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2045:9): [True: 868, False: 1.29k]
  ------------------
 2046|    868|        xmlFreeURI(ref);
 2047|    868|        return(xmlResolvePath(URI, base, valPtr));
 2048|    868|    }
 2049|       |
 2050|  1.29k|    ret = xmlParseURISafe((const char *) base, &bas);
 2051|  1.29k|    if (ret < 0)
  ------------------
  |  Branch (2051:9): [True: 11, False: 1.28k]
  ------------------
 2052|     11|        goto done;
 2053|  1.28k|    if (ret != 0) {
  ------------------
  |  Branch (2053:9): [True: 229, False: 1.05k]
  ------------------
 2054|    229|	if (ref) {
  ------------------
  |  Branch (2054:6): [True: 226, False: 3]
  ------------------
 2055|    226|            ret = 0;
 2056|    226|	    val = xmlSaveUri(ref);
 2057|    226|            if (val == NULL)
  ------------------
  |  Branch (2057:17): [True: 1, False: 225]
  ------------------
 2058|      1|                ret = -1;
 2059|    226|        }
 2060|    229|	goto done;
 2061|    229|    }
 2062|  1.05k|    if (ref == NULL) {
  ------------------
  |  Branch (2062:9): [True: 55, False: 997]
  ------------------
 2063|       |	/*
 2064|       |	 * the base fragment must be ignored
 2065|       |	 */
 2066|     55|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2066:6): [True: 3, False: 52]
  ------------------
 2067|      3|	    xmlFree(bas->fragment);
 2068|      3|	    bas->fragment = NULL;
 2069|      3|	}
 2070|     55|	val = xmlSaveUri(bas);
 2071|     55|        if (val == NULL)
  ------------------
  |  Branch (2071:13): [True: 2, False: 53]
  ------------------
 2072|      2|            ret = -1;
 2073|     55|	goto done;
 2074|     55|    }
 2075|       |
 2076|       |    /*
 2077|       |     * 2) If the path component is empty and the scheme, authority, and
 2078|       |     *    query components are undefined, then it is a reference to the
 2079|       |     *    current document and we are done.  Otherwise, the reference URI's
 2080|       |     *    query and fragment components are defined as found (or not found)
 2081|       |     *    within the URI reference and not inherited from the base URI.
 2082|       |     *
 2083|       |     *    NOTE that in modern browsers, the parsing differs from the above
 2084|       |     *    in the following aspect:  the query component is allowed to be
 2085|       |     *    defined while still treating this as a reference to the current
 2086|       |     *    document.
 2087|       |     */
 2088|    997|    ret = -1;
 2089|    997|    res = xmlCreateURI();
 2090|    997|    if (res == NULL)
  ------------------
  |  Branch (2090:9): [True: 9, False: 988]
  ------------------
 2091|      9|	goto done;
 2092|    988|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2092:9): [True: 988, False: 0]
  |  Branch (2092:34): [True: 290, False: 698]
  ------------------
 2093|    988|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2093:3): [True: 290, False: 0]
  |  Branch (2093:31): [True: 281, False: 9]
  ------------------
 2094|    290|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   37|    281|#define PORT_EMPTY           0
  ------------------
  |  Branch (2094:10): [True: 223, False: 58]
  ------------------
 2095|    223|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2095:6): [True: 71, False: 152]
  ------------------
 2096|     71|	    res->scheme = xmlMemStrdup(bas->scheme);
 2097|     71|            if (res->scheme == NULL)
  ------------------
  |  Branch (2097:17): [True: 2, False: 69]
  ------------------
 2098|      2|                goto done;
 2099|     71|        }
 2100|    221|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2100:6): [True: 0, False: 221]
  ------------------
 2101|      0|	    res->authority = xmlMemStrdup(bas->authority);
 2102|      0|            if (res->authority == NULL)
  ------------------
  |  Branch (2102:17): [True: 0, False: 0]
  ------------------
 2103|      0|                goto done;
 2104|    221|        } else {
 2105|    221|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2105:10): [True: 62, False: 159]
  ------------------
 2106|     62|		res->server = xmlMemStrdup(bas->server);
 2107|     62|                if (res->server == NULL)
  ------------------
  |  Branch (2107:21): [True: 2, False: 60]
  ------------------
 2108|      2|                    goto done;
 2109|     62|            }
 2110|    219|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2110:10): [True: 58, False: 161]
  ------------------
 2111|     58|		res->user = xmlMemStrdup(bas->user);
 2112|     58|                if (res->user == NULL)
  ------------------
  |  Branch (2112:21): [True: 3, False: 55]
  ------------------
 2113|      3|                    goto done;
 2114|     58|            }
 2115|    216|	    res->port = bas->port;
 2116|    216|	}
 2117|    216|	if (bas->path != NULL) {
  ------------------
  |  Branch (2117:6): [True: 88, False: 128]
  ------------------
 2118|     88|	    res->path = xmlMemStrdup(bas->path);
 2119|     88|            if (res->path == NULL)
  ------------------
  |  Branch (2119:17): [True: 1, False: 87]
  ------------------
 2120|      1|                goto done;
 2121|     88|        }
 2122|    215|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2122:6): [True: 50, False: 165]
  ------------------
 2123|     50|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2124|     50|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2124:17): [True: 1, False: 49]
  ------------------
 2125|      1|                goto done;
 2126|    165|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2126:20): [True: 0, False: 165]
  ------------------
 2127|      0|	    res->query = xmlMemStrdup(ref->query);
 2128|      0|            if (res->query == NULL)
  ------------------
  |  Branch (2128:17): [True: 0, False: 0]
  ------------------
 2129|      0|                goto done;
 2130|    165|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2130:20): [True: 55, False: 110]
  ------------------
 2131|     55|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2132|     55|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2132:17): [True: 1, False: 54]
  ------------------
 2133|      1|                goto done;
 2134|    110|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2134:20): [True: 0, False: 110]
  ------------------
 2135|      0|	    res->query = xmlMemStrdup(bas->query);
 2136|      0|            if (res->query == NULL)
  ------------------
  |  Branch (2136:17): [True: 0, False: 0]
  ------------------
 2137|      0|                goto done;
 2138|      0|        }
 2139|    213|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2139:6): [True: 168, False: 45]
  ------------------
 2140|    168|	    res->fragment = xmlMemStrdup(ref->fragment);
 2141|    168|            if (res->fragment == NULL)
  ------------------
  |  Branch (2141:17): [True: 3, False: 165]
  ------------------
 2142|      3|                goto done;
 2143|    168|        }
 2144|    210|	goto step_7;
 2145|    213|    }
 2146|       |
 2147|       |    /*
 2148|       |     * 3) If the scheme component is defined, indicating that the reference
 2149|       |     *    starts with a scheme name, then the reference is interpreted as an
 2150|       |     *    absolute URI and we are done.  Otherwise, the reference URI's
 2151|       |     *    scheme is inherited from the base URI's scheme component.
 2152|       |     */
 2153|    765|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 0, False: 765]
  ------------------
 2154|      0|	val = xmlSaveUri(ref);
 2155|      0|        if (val != NULL)
  ------------------
  |  Branch (2155:13): [True: 0, False: 0]
  ------------------
 2156|      0|            ret = 0;
 2157|      0|	goto done;
 2158|      0|    }
 2159|    765|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2159:9): [True: 398, False: 367]
  ------------------
 2160|    398|	res->scheme = xmlMemStrdup(bas->scheme);
 2161|    398|        if (res->scheme == NULL)
  ------------------
  |  Branch (2161:13): [True: 5, False: 393]
  ------------------
 2162|      5|            goto done;
 2163|    398|    }
 2164|       |
 2165|    760|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2165:9): [True: 8, False: 752]
  ------------------
 2166|      8|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2167|      8|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2167:13): [True: 1, False: 7]
  ------------------
 2168|      1|            goto done;
 2169|    752|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2169:16): [True: 0, False: 752]
  ------------------
 2170|      0|	res->query = xmlMemStrdup(ref->query);
 2171|      0|        if (res->query == NULL)
  ------------------
  |  Branch (2171:13): [True: 0, False: 0]
  ------------------
 2172|      0|            goto done;
 2173|      0|    }
 2174|    759|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2174:9): [True: 10, False: 749]
  ------------------
 2175|     10|	res->fragment = xmlMemStrdup(ref->fragment);
 2176|     10|        if (res->fragment == NULL)
  ------------------
  |  Branch (2176:13): [True: 1, False: 9]
  ------------------
 2177|      1|            goto done;
 2178|     10|    }
 2179|       |
 2180|       |    /*
 2181|       |     * 4) If the authority component is defined, then the reference is a
 2182|       |     *    network-path and we skip to step 7.  Otherwise, the reference
 2183|       |     *    URI's authority is inherited from the base URI's authority
 2184|       |     *    component, which will also be undefined if the URI scheme does not
 2185|       |     *    use an authority component.
 2186|       |     */
 2187|    758|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2187:9): [True: 0, False: 758]
  |  Branch (2187:37): [True: 15, False: 743]
  ------------------
 2188|    758|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   37|    743|#define PORT_EMPTY           0
  ------------------
  |  Branch (2188:10): [True: 58, False: 685]
  ------------------
 2189|     73|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2189:6): [True: 0, False: 73]
  ------------------
 2190|      0|	    res->authority = xmlMemStrdup(ref->authority);
 2191|      0|            if (res->authority == NULL)
  ------------------
  |  Branch (2191:17): [True: 0, False: 0]
  ------------------
 2192|      0|                goto done;
 2193|     73|        } else {
 2194|     73|            if (ref->server != NULL) {
  ------------------
  |  Branch (2194:17): [True: 15, False: 58]
  ------------------
 2195|     15|                res->server = xmlMemStrdup(ref->server);
 2196|     15|                if (res->server == NULL)
  ------------------
  |  Branch (2196:21): [True: 1, False: 14]
  ------------------
 2197|      1|                    goto done;
 2198|     15|            }
 2199|     72|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2199:10): [True: 6, False: 66]
  ------------------
 2200|      6|		res->user = xmlMemStrdup(ref->user);
 2201|      6|                if (res->user == NULL)
  ------------------
  |  Branch (2201:21): [True: 1, False: 5]
  ------------------
 2202|      1|                    goto done;
 2203|      6|            }
 2204|     71|            res->port = ref->port;
 2205|     71|	}
 2206|     71|	if (ref->path != NULL) {
  ------------------
  |  Branch (2206:6): [True: 6, False: 65]
  ------------------
 2207|      6|	    res->path = xmlMemStrdup(ref->path);
 2208|      6|            if (res->path == NULL)
  ------------------
  |  Branch (2208:17): [True: 1, False: 5]
  ------------------
 2209|      1|                goto done;
 2210|      6|        }
 2211|     70|	goto step_7;
 2212|     71|    }
 2213|    685|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2213:9): [True: 0, False: 685]
  ------------------
 2214|      0|	res->authority = xmlMemStrdup(bas->authority);
 2215|      0|        if (res->authority == NULL)
  ------------------
  |  Branch (2215:13): [True: 0, False: 0]
  ------------------
 2216|      0|            goto done;
 2217|    685|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   37|    551|#define PORT_EMPTY           0
  ------------------
  |  Branch (2217:16): [True: 134, False: 551]
  |  Branch (2217:41): [True: 210, False: 341]
  ------------------
 2218|    344|	if (bas->server != NULL) {
  ------------------
  |  Branch (2218:6): [True: 134, False: 210]
  ------------------
 2219|    134|	    res->server = xmlMemStrdup(bas->server);
 2220|    134|            if (res->server == NULL)
  ------------------
  |  Branch (2220:17): [True: 3, False: 131]
  ------------------
 2221|      3|                goto done;
 2222|    134|        }
 2223|    341|	if (bas->user != NULL) {
  ------------------
  |  Branch (2223:6): [True: 126, False: 215]
  ------------------
 2224|    126|	    res->user = xmlMemStrdup(bas->user);
 2225|    126|            if (res->user == NULL)
  ------------------
  |  Branch (2225:17): [True: 2, False: 124]
  ------------------
 2226|      2|                goto done;
 2227|    126|        }
 2228|    339|	res->port = bas->port;
 2229|    339|    }
 2230|       |
 2231|       |    /*
 2232|       |     * 5) If the path component begins with a slash character ("/"), then
 2233|       |     *    the reference is an absolute-path and we skip to step 7.
 2234|       |     */
 2235|    680|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2235:9): [True: 680, False: 0]
  |  Branch (2235:32): [True: 53, False: 627]
  ------------------
 2236|     53|	res->path = xmlMemStrdup(ref->path);
 2237|     53|        if (res->path == NULL)
  ------------------
  |  Branch (2237:13): [True: 1, False: 52]
  ------------------
 2238|      1|            goto done;
 2239|     52|	goto step_7;
 2240|     53|    }
 2241|       |
 2242|       |
 2243|       |    /*
 2244|       |     * 6) If this step is reached, then we are resolving a relative-path
 2245|       |     *    reference.  The relative path needs to be merged with the base
 2246|       |     *    URI's path.  Although there are many ways to do this, we will
 2247|       |     *    describe a simple method using a separate string buffer.
 2248|       |     *
 2249|       |     * Allocate a buffer large enough for the result string.
 2250|       |     */
 2251|    627|    len = 2; /* extra / and 0 */
 2252|    627|    if (ref->path != NULL)
  ------------------
  |  Branch (2252:9): [True: 627, False: 0]
  ------------------
 2253|    627|	len += strlen(ref->path);
 2254|    627|    if (bas->path != NULL)
  ------------------
  |  Branch (2254:9): [True: 251, False: 376]
  ------------------
 2255|    251|	len += strlen(bas->path);
 2256|    627|    res->path = (char *) xmlMallocAtomic(len);
 2257|    627|    if (res->path == NULL)
  ------------------
  |  Branch (2257:9): [True: 4, False: 623]
  ------------------
 2258|      4|	goto done;
 2259|    623|    res->path[0] = 0;
 2260|       |
 2261|       |    /*
 2262|       |     * a) All but the last segment of the base URI's path component is
 2263|       |     *    copied to the buffer.  In other words, any characters after the
 2264|       |     *    last (right-most) slash character, if any, are excluded.
 2265|       |     */
 2266|    623|    cur = 0;
 2267|    623|    out = 0;
 2268|    623|    if (bas->path != NULL) {
  ------------------
  |  Branch (2268:9): [True: 250, False: 373]
  ------------------
 2269|  41.4k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2269:9): [True: 41.2k, False: 176]
  ------------------
 2270|  75.0k|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2270:13): [True: 74.9k, False: 74]
  |  Branch (2270:38): [True: 33.7k, False: 41.2k]
  ------------------
 2271|  33.7k|		cur++;
 2272|  41.2k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2272:10): [True: 74, False: 41.2k]
  ------------------
 2273|     74|		break;
 2274|       |
 2275|  41.2k|	    cur++;
 2276|   116k|	    while (out < cur) {
  ------------------
  |  Branch (2276:13): [True: 74.8k, False: 41.2k]
  ------------------
 2277|  74.8k|		res->path[out] = bas->path[out];
 2278|  74.8k|		out++;
 2279|  74.8k|	    }
 2280|  41.2k|	}
 2281|    250|    }
 2282|    623|    res->path[out] = 0;
 2283|       |
 2284|       |    /*
 2285|       |     * b) The reference's path component is appended to the buffer
 2286|       |     *    string.
 2287|       |     */
 2288|    623|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2288:9): [True: 623, False: 0]
  |  Branch (2288:30): [True: 620, False: 3]
  ------------------
 2289|    620|	indx = 0;
 2290|       |	/*
 2291|       |	 * Ensure the path includes a '/'
 2292|       |	 */
 2293|    620|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   37|    276|#define PORT_EMPTY           0
  ------------------
  |  Branch (2293:6): [True: 375, False: 245]
  |  Branch (2293:21): [True: 99, False: 276]
  |  Branch (2293:46): [True: 189, False: 87]
  ------------------
 2294|    288|	    res->path[out++] = '/';
 2295|  1.53k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2295:9): [True: 912, False: 620]
  ------------------
 2296|    912|	    res->path[out++] = ref->path[indx++];
 2297|    912|	}
 2298|    620|    }
 2299|    623|    res->path[out] = 0;
 2300|       |
 2301|       |    /*
 2302|       |     * Steps c) to h) are really path normalization steps
 2303|       |     */
 2304|    623|    xmlNormalizeURIPath(res->path);
 2305|       |
 2306|    955|step_7:
 2307|       |
 2308|       |    /*
 2309|       |     * 7) The resulting URI components, including any inherited from the
 2310|       |     *    base URI, are recombined to give the absolute form of the URI
 2311|       |     *    reference.
 2312|       |     */
 2313|    955|    val = xmlSaveUri(res);
 2314|    955|    if (val != NULL)
  ------------------
  |  Branch (2314:9): [True: 952, False: 3]
  ------------------
 2315|    952|        ret = 0;
 2316|       |
 2317|  7.01k|done:
 2318|  7.01k|    if (ref != NULL)
  ------------------
  |  Branch (2318:9): [True: 1.66k, False: 5.35k]
  ------------------
 2319|  1.66k|	xmlFreeURI(ref);
 2320|  7.01k|    if (bas != NULL)
  ------------------
  |  Branch (2320:9): [True: 1.05k, False: 5.96k]
  ------------------
 2321|  1.05k|	xmlFreeURI(bas);
 2322|  7.01k|    if (res != NULL)
  ------------------
  |  Branch (2322:9): [True: 988, False: 6.02k]
  ------------------
 2323|    988|	xmlFreeURI(res);
 2324|  7.01k|    *valPtr = val;
 2325|  7.01k|    return(ret);
 2326|    955|}
xmlBuildURI:
 2344|  3.94k|xmlBuildURI(const xmlChar *URI, const xmlChar *base) {
 2345|  3.94k|    xmlChar *out;
 2346|       |
 2347|  3.94k|    xmlBuildURISafe(URI, base, &out);
 2348|  3.94k|    return(out);
 2349|  3.94k|}
xmlBuildRelativeURISafe:
 2387|  7.88k|{
 2388|  7.88k|    xmlChar *val = NULL;
 2389|  7.88k|    int ret = 0;
 2390|  7.88k|    int ix;
 2391|  7.88k|    int nbslash = 0;
 2392|  7.88k|    int len;
 2393|  7.88k|    xmlURIPtr ref = NULL;
 2394|  7.88k|    xmlURIPtr bas = NULL;
 2395|  7.88k|    xmlChar *bptr, *uptr, *vptr;
 2396|  7.88k|    int remove_path = 0;
 2397|       |
 2398|  7.88k|    if (valPtr == NULL)
  ------------------
  |  Branch (2398:9): [True: 0, False: 7.88k]
  ------------------
 2399|      0|        return(1);
 2400|  7.88k|    *valPtr = NULL;
 2401|  7.88k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2401:9): [True: 4.97k, False: 2.90k]
  |  Branch (2401:26): [True: 84, False: 2.82k]
  ------------------
 2402|  5.06k|	return(1);
 2403|       |
 2404|       |    /*
 2405|       |     * First parse URI into a standard form
 2406|       |     */
 2407|  2.82k|    ref = xmlCreateURI ();
 2408|  2.82k|    if (ref == NULL) {
  ------------------
  |  Branch (2408:9): [True: 20, False: 2.80k]
  ------------------
 2409|     20|        ret = -1;
 2410|     20|	goto done;
 2411|     20|    }
 2412|       |    /* If URI not already in "relative" form */
 2413|  2.80k|    if (URI[0] != '.') {
  ------------------
  |  Branch (2413:9): [True: 2.25k, False: 545]
  ------------------
 2414|  2.25k|	ret = xmlParseURIReference (ref, (const char *) URI);
 2415|  2.25k|	if (ret != 0)
  ------------------
  |  Branch (2415:6): [True: 83, False: 2.17k]
  ------------------
 2416|     83|	    goto done;		/* Error in URI, return NULL */
 2417|  2.25k|    } else {
 2418|    545|	ref->path = (char *)xmlStrdup(URI);
 2419|    545|        if (ref->path == NULL) {
  ------------------
  |  Branch (2419:13): [True: 3, False: 542]
  ------------------
 2420|      3|            ret = -1;
 2421|      3|            goto done;
 2422|      3|        }
 2423|    545|    }
 2424|       |
 2425|       |    /*
 2426|       |     * Next parse base into the same standard form
 2427|       |     */
 2428|  2.71k|    if ((base == NULL) || (*base == 0)) {
  ------------------
  |  Branch (2428:9): [True: 0, False: 2.71k]
  |  Branch (2428:27): [True: 144, False: 2.57k]
  ------------------
 2429|    144|	val = xmlStrdup (URI);
 2430|    144|        if (val == NULL)
  ------------------
  |  Branch (2430:13): [True: 4, False: 140]
  ------------------
 2431|      4|            ret = -1;
 2432|    144|	goto done;
 2433|    144|    }
 2434|  2.57k|    bas = xmlCreateURI ();
 2435|  2.57k|    if (bas == NULL) {
  ------------------
  |  Branch (2435:9): [True: 8, False: 2.56k]
  ------------------
 2436|      8|        ret = -1;
 2437|      8|	goto done;
 2438|      8|    }
 2439|  2.56k|    if (base[0] != '.') {
  ------------------
  |  Branch (2439:9): [True: 2.29k, False: 266]
  ------------------
 2440|  2.29k|	ret = xmlParseURIReference (bas, (const char *) base);
 2441|  2.29k|	if (ret != 0)
  ------------------
  |  Branch (2441:6): [True: 374, False: 1.92k]
  ------------------
 2442|    374|	    goto done;		/* Error in base, return NULL */
 2443|  2.29k|    } else {
 2444|    266|	bas->path = (char *)xmlStrdup(base);
 2445|    266|        if (bas->path == NULL) {
  ------------------
  |  Branch (2445:13): [True: 1, False: 265]
  ------------------
 2446|      1|            ret = -1;
 2447|      1|            goto done;
 2448|      1|        }
 2449|    266|    }
 2450|       |
 2451|       |    /*
 2452|       |     * If the scheme / server on the URI differs from the base,
 2453|       |     * just return the URI
 2454|       |     */
 2455|  2.18k|    if ((ref->scheme != NULL) &&
  ------------------
  |  Branch (2455:9): [True: 414, False: 1.77k]
  ------------------
 2456|  2.18k|	((bas->scheme == NULL) ||
  ------------------
  |  Branch (2456:3): [True: 5, False: 409]
  ------------------
 2457|    414|	 (xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2457:3): [True: 268, False: 141]
  ------------------
 2458|    414|	 (xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2458:3): [True: 41, False: 100]
  ------------------
 2459|    414|         (bas->port != ref->port))) {
  ------------------
  |  Branch (2459:10): [True: 83, False: 17]
  ------------------
 2460|    397|	val = xmlStrdup (URI);
 2461|    397|        if (val == NULL)
  ------------------
  |  Branch (2461:13): [True: 2, False: 395]
  ------------------
 2462|      2|            ret = -1;
 2463|    397|	goto done;
 2464|    397|    }
 2465|  1.79k|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2465:9): [True: 276, False: 1.51k]
  ------------------
 2466|    276|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   35|    276|#define BAD_CAST (xmlChar *)
  ------------------
 2467|    276|        if (val == NULL)
  ------------------
  |  Branch (2467:13): [True: 2, False: 274]
  ------------------
 2468|      2|            ret = -1;
 2469|    276|	goto done;
 2470|    276|    }
 2471|  1.51k|    if (bas->path == NULL) {
  ------------------
  |  Branch (2471:9): [True: 465, False: 1.05k]
  ------------------
 2472|    465|	val = xmlStrdup((xmlChar *)ref->path);
 2473|    465|        if (val == NULL)
  ------------------
  |  Branch (2473:13): [True: 3, False: 462]
  ------------------
 2474|      3|            ret = -1;
 2475|    465|	goto done;
 2476|    465|    }
 2477|  1.05k|    if (ref->path == NULL) {
  ------------------
  |  Branch (2477:9): [True: 139, False: 912]
  ------------------
 2478|    139|        ref->path = (char *) "/";
 2479|    139|	remove_path = 1;
 2480|    139|    }
 2481|       |
 2482|       |    /*
 2483|       |     * At this point (at last!) we can compare the two paths
 2484|       |     *
 2485|       |     * First we take care of the special case where either of the
 2486|       |     * two path components may be missing (bug 316224)
 2487|       |     */
 2488|  1.05k|    bptr = (xmlChar *)bas->path;
 2489|  1.05k|    {
 2490|  1.05k|        xmlChar *rptr = (xmlChar *) ref->path;
 2491|  1.05k|        int pos = 0;
 2492|       |
 2493|       |        /*
 2494|       |         * Next we compare the two strings and find where they first differ
 2495|       |         */
 2496|  1.05k|	if ((*rptr == '.') && (rptr[1] == '/'))
  ------------------
  |  Branch (2496:6): [True: 337, False: 714]
  |  Branch (2496:24): [True: 35, False: 302]
  ------------------
 2497|     35|            rptr += 2;
 2498|  1.05k|	if ((*bptr == '.') && (bptr[1] == '/'))
  ------------------
  |  Branch (2498:6): [True: 259, False: 792]
  |  Branch (2498:24): [True: 47, False: 212]
  ------------------
 2499|     47|            bptr += 2;
 2500|  1.00k|	else if ((*bptr == '/') && (*rptr != '/'))
  ------------------
  |  Branch (2500:11): [True: 275, False: 729]
  |  Branch (2500:29): [True: 177, False: 98]
  ------------------
 2501|    177|	    bptr++;
 2502|  19.6k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2502:9): [True: 18.6k, False: 1.02k]
  |  Branch (2502:37): [True: 18.6k, False: 25]
  ------------------
 2503|  18.6k|	    pos++;
 2504|       |
 2505|  1.05k|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2505:6): [True: 25, False: 1.02k]
  ------------------
 2506|     25|	    val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   35|     25|#define BAD_CAST (xmlChar *)
  ------------------
 2507|     25|            if (val == NULL)
  ------------------
  |  Branch (2507:17): [True: 2, False: 23]
  ------------------
 2508|      2|                ret = -1;
 2509|     25|	    goto done;		/* (I can't imagine why anyone would do this) */
 2510|     25|	}
 2511|       |
 2512|       |	/*
 2513|       |	 * In URI, "back up" to the last '/' encountered.  This will be the
 2514|       |	 * beginning of the "unique" suffix of URI
 2515|       |	 */
 2516|  1.02k|	ix = pos;
 2517|  17.9k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2517:9): [True: 17.0k, False: 860]
  ------------------
 2518|  17.0k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2518:10): [True: 166, False: 16.8k]
  ------------------
 2519|    166|		break;
 2520|  17.0k|	}
 2521|  1.02k|	uptr = (xmlChar *)&rptr[ix];
 2522|       |
 2523|       |	/*
 2524|       |	 * In base, count the number of '/' from the differing point
 2525|       |	 */
 2526|   194k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2526:9): [True: 193k, False: 1.02k]
  ------------------
 2527|   193k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2527:10): [True: 130k, False: 62.7k]
  ------------------
 2528|   130k|		nbslash++;
 2529|   193k|	}
 2530|       |
 2531|       |	/*
 2532|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2533|       |	 */
 2534|  1.02k|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2534:6): [True: 391, False: 635]
  |  Branch (2534:22): [True: 26, False: 365]
  ------------------
 2535|     26|	    val = xmlStrdup(BAD_CAST "./");
  ------------------
  |  |   35|     26|#define BAD_CAST (xmlChar *)
  ------------------
 2536|     26|            if (val == NULL)
  ------------------
  |  Branch (2536:17): [True: 1, False: 25]
  ------------------
 2537|      1|                ret = -1;
 2538|     26|	    goto done;
 2539|     26|	}
 2540|       |
 2541|  1.00k|	len = xmlStrlen (uptr) + 1;
 2542|  1.00k|    }
 2543|       |
 2544|  1.00k|    if (nbslash == 0) {
  ------------------
  |  Branch (2544:9): [True: 365, False: 635]
  ------------------
 2545|    365|	if (uptr != NULL) {
  ------------------
  |  Branch (2545:6): [True: 365, False: 0]
  ------------------
 2546|       |	    /* exception characters from xmlSaveUri */
 2547|    365|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   35|    365|#define BAD_CAST (xmlChar *)
  ------------------
 2548|    365|            if (val == NULL)
  ------------------
  |  Branch (2548:17): [True: 4, False: 361]
  ------------------
 2549|      4|                ret = -1;
 2550|    365|        }
 2551|    365|	goto done;
 2552|    365|    }
 2553|       |
 2554|       |    /*
 2555|       |     * Allocate just enough space for the returned string -
 2556|       |     * length of the remainder of the URI, plus enough space
 2557|       |     * for the "../" groups, plus one for the terminator
 2558|       |     */
 2559|    635|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2560|    635|    if (val == NULL) {
  ------------------
  |  Branch (2560:9): [True: 5, False: 630]
  ------------------
 2561|      5|        ret = -1;
 2562|      5|	goto done;
 2563|      5|    }
 2564|    630|    vptr = val;
 2565|       |    /*
 2566|       |     * Put in as many "../" as needed
 2567|       |     */
 2568|   130k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2568:12): [True: 130k, False: 630]
  ------------------
 2569|   130k|	*vptr++ = '.';
 2570|   130k|	*vptr++ = '.';
 2571|   130k|	*vptr++ = '/';
 2572|   130k|    }
 2573|       |    /*
 2574|       |     * Finish up with the end of the URI
 2575|       |     */
 2576|    630|    if (uptr != NULL) {
  ------------------
  |  Branch (2576:9): [True: 630, False: 0]
  ------------------
 2577|    630|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2577:13): [True: 630, False: 0]
  |  Branch (2577:29): [True: 630, False: 0]
  ------------------
 2578|    630|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2578:6): [True: 57, False: 573]
  |  Branch (2578:26): [True: 57, False: 0]
  ------------------
 2579|     57|	    memcpy (vptr, uptr + 1, len - 1);
 2580|     57|	    vptr[len - 2] = 0;
 2581|    573|	} else {
 2582|    573|	    memcpy (vptr, uptr, len);
 2583|    573|	    vptr[len - 1] = 0;
 2584|    573|	}
 2585|    630|    } else {
 2586|      0|	vptr[len - 1] = 0;
 2587|      0|    }
 2588|       |
 2589|       |    /* escape the freshly-built path */
 2590|    630|    vptr = val;
 2591|       |	/* exception characters from xmlSaveUri */
 2592|    630|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   35|    630|#define BAD_CAST (xmlChar *)
  ------------------
 2593|    630|    if (val == NULL)
  ------------------
  |  Branch (2593:9): [True: 6, False: 624]
  ------------------
 2594|      6|        ret = -1;
 2595|    624|    else
 2596|    624|        ret = 0;
 2597|    630|    xmlFree(vptr);
 2598|       |
 2599|  2.82k|done:
 2600|       |    /*
 2601|       |     * Free the working variables
 2602|       |     */
 2603|  2.82k|    if (remove_path != 0)
  ------------------
  |  Branch (2603:9): [True: 139, False: 2.68k]
  ------------------
 2604|    139|        ref->path = NULL;
 2605|  2.82k|    if (ref != NULL)
  ------------------
  |  Branch (2605:9): [True: 2.80k, False: 20]
  ------------------
 2606|  2.80k|	xmlFreeURI (ref);
 2607|  2.82k|    if (bas != NULL)
  ------------------
  |  Branch (2607:9): [True: 2.56k, False: 258]
  ------------------
 2608|  2.56k|	xmlFreeURI (bas);
 2609|  2.82k|    if (ret != 0) {
  ------------------
  |  Branch (2609:9): [True: 518, False: 2.30k]
  ------------------
 2610|    518|        xmlFree(val);
 2611|    518|        val = NULL;
 2612|    518|    }
 2613|       |
 2614|  2.82k|    *valPtr = val;
 2615|  2.82k|    return(ret);
 2616|    630|}
xmlBuildRelativeURI:
 2630|  3.94k|{
 2631|  3.94k|    xmlChar *val;
 2632|       |
 2633|  3.94k|    xmlBuildRelativeURISafe(URI, base, &val);
 2634|  3.94k|    return(val);
 2635|  3.94k|}
xmlCanonicPath:
 2656|  7.88k|{
 2657|  7.88k|    xmlChar *ret;
 2658|       |
 2659|  7.88k|    if (path == NULL)
  ------------------
  |  Branch (2659:9): [True: 8, False: 7.87k]
  ------------------
 2660|      8|	return(NULL);
 2661|       |
 2662|       |    /* Check if this is an "absolute uri" */
 2663|  7.87k|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   35|  7.87k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2663:9): [True: 1.73k, False: 6.13k]
  ------------------
 2664|       |	/*
 2665|       |         * Escape all characters except reserved, unreserved and the
 2666|       |         * percent sign.
 2667|       |         *
 2668|       |         * xmlURIEscapeStr already keeps unreserved characters, so we
 2669|       |         * pass gen-delims, sub-delims and "%" to ignore.
 2670|       |         */
 2671|  1.73k|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   35|  1.73k|#define BAD_CAST (xmlChar *)
  ------------------
 2672|  6.13k|    } else {
 2673|  6.13k|        ret = xmlStrdup((const xmlChar *) path);
 2674|  6.13k|    }
 2675|       |
 2676|  7.87k|    return(ret);
 2677|  7.88k|}
xmlPathToURI:
 2692|  3.94k|{
 2693|  3.94k|    return(xmlCanonicPath(path));
 2694|  3.94k|}
uri.c:xmlParse3986URIReference:
  939|  24.0k|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  940|  24.0k|    int ret;
  941|       |
  942|  24.0k|    if (str == NULL)
  ------------------
  |  Branch (942:9): [True: 0, False: 24.0k]
  ------------------
  943|      0|	return(-1);
  944|  24.0k|    xmlCleanURI(uri);
  945|       |
  946|       |    /*
  947|       |     * Try first to parse absolute refs, then fallback to relative if
  948|       |     * it fails.
  949|       |     */
  950|  24.0k|    ret = xmlParse3986URI(uri, str);
  951|  24.0k|    if (ret < 0)
  ------------------
  |  Branch (951:9): [True: 82, False: 23.9k]
  ------------------
  952|     82|        return(ret);
  953|  23.9k|    if (ret != 0) {
  ------------------
  |  Branch (953:9): [True: 18.8k, False: 5.02k]
  ------------------
  954|  18.8k|	xmlCleanURI(uri);
  955|  18.8k|        ret = xmlParse3986RelativeRef(uri, str);
  956|  18.8k|	if (ret != 0) {
  ------------------
  |  Branch (956:6): [True: 5.84k, False: 13.0k]
  ------------------
  957|  5.84k|	    xmlCleanURI(uri);
  958|  5.84k|	    return(ret);
  959|  5.84k|	}
  960|  18.8k|    }
  961|  18.0k|    return(0);
  962|  23.9k|}
uri.c:xmlCleanURI:
 1412|  54.8k|xmlCleanURI(xmlURIPtr uri) {
 1413|  54.8k|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 0, False: 54.8k]
  ------------------
 1414|       |
 1415|  54.8k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 2.71k, False: 52.1k]
  ------------------
 1416|  54.8k|    uri->scheme = NULL;
 1417|  54.8k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1417:9): [True: 366, False: 54.5k]
  ------------------
 1418|  54.8k|    uri->server = NULL;
 1419|  54.8k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1419:9): [True: 132, False: 54.7k]
  ------------------
 1420|  54.8k|    uri->user = NULL;
 1421|  54.8k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1421:9): [True: 2.34k, False: 52.5k]
  ------------------
 1422|  54.8k|    uri->path = NULL;
 1423|  54.8k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1423:9): [True: 615, False: 54.2k]
  ------------------
 1424|  54.8k|    uri->fragment = NULL;
 1425|  54.8k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1425:9): [True: 0, False: 54.8k]
  ------------------
 1426|  54.8k|    uri->opaque = NULL;
 1427|  54.8k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1427:9): [True: 0, False: 54.8k]
  ------------------
 1428|  54.8k|    uri->authority = NULL;
 1429|  54.8k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1429:9): [True: 594, False: 54.2k]
  ------------------
 1430|  54.8k|    uri->query = NULL;
 1431|  54.8k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1431:9): [True: 582, False: 54.2k]
  ------------------
 1432|  54.8k|    uri->query_raw = NULL;
 1433|  54.8k|}
uri.c:xmlParse3986URI:
  898|  24.0k|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  899|  24.0k|    int ret;
  900|       |
  901|  24.0k|    ret = xmlParse3986Scheme(uri, &str);
  902|  24.0k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (902:9): [True: 16.2k, False: 7.76k]
  ------------------
  903|  7.76k|    if (*str != ':') {
  ------------------
  |  Branch (903:9): [True: 2.00k, False: 5.76k]
  ------------------
  904|  2.00k|	return(1);
  905|  2.00k|    }
  906|  5.76k|    str++;
  907|  5.76k|    ret = xmlParse3986HierPart(uri, &str);
  908|  5.76k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (908:9): [True: 90, False: 5.67k]
  ------------------
  909|  5.67k|    if (*str == '?') {
  ------------------
  |  Branch (909:9): [True: 111, False: 5.56k]
  ------------------
  910|    111|	str++;
  911|    111|	ret = xmlParse3986Query(uri, &str);
  912|    111|	if (ret != 0) return(ret);
  ------------------
  |  Branch (912:6): [True: 2, False: 109]
  ------------------
  913|    111|    }
  914|  5.67k|    if (*str == '#') {
  ------------------
  |  Branch (914:9): [True: 166, False: 5.50k]
  ------------------
  915|    166|	str++;
  916|    166|	ret = xmlParse3986Fragment(uri, &str);
  917|    166|	if (ret != 0) return(ret);
  ------------------
  |  Branch (917:6): [True: 1, False: 165]
  ------------------
  918|    166|    }
  919|  5.67k|    if (*str != 0) {
  ------------------
  |  Branch (919:9): [True: 642, False: 5.02k]
  ------------------
  920|    642|	xmlCleanURI(uri);
  921|    642|	return(1);
  922|    642|    }
  923|  5.02k|    return(0);
  924|  5.67k|}
uri.c:xmlParse3986Scheme:
  227|  24.0k|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  228|  24.0k|    const char *cur;
  229|       |
  230|  24.0k|    cur = *str;
  231|  24.0k|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  129|  24.0k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 3.41k, False: 20.5k]
  |  |  |  Branch (129:41): [True: 3.12k, False: 291]
  |  |  ------------------
  |  |  130|  24.0k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (130:24): [True: 5.72k, False: 15.1k]
  |  |  |  Branch (130:41): [True: 4.70k, False: 1.01k]
  |  |  ------------------
  ------------------
  232|  16.1k|	return(1);
  233|  7.82k|    cur++;
  234|   289k|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  129|   579k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 45.2k, False: 244k]
  |  |  |  Branch (129:41): [True: 45.1k, False: 42]
  |  |  ------------------
  |  |  130|   579k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (130:24): [True: 154k, False: 89.7k]
  |  |  |  Branch (130:41): [True: 154k, False: 52]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  128|   379k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 77.0k, False: 12.7k]
  |  |  |  Branch (128:40): [True: 71.1k, False: 5.89k]
  |  |  ------------------
  ------------------
  235|   289k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (235:12): [True: 1.51k, False: 17.1k]
  |  Branch (235:29): [True: 6.14k, False: 10.9k]
  |  Branch (235:46): [True: 3.13k, False: 7.82k]
  ------------------
  236|  7.82k|    if (uri != NULL) {
  ------------------
  |  Branch (236:9): [True: 7.82k, False: 0]
  ------------------
  237|  7.82k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (237:6): [True: 0, False: 7.82k]
  ------------------
  238|  7.82k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  120|  7.82k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  239|  7.82k|        if (uri->scheme == NULL)
  ------------------
  |  Branch (239:13): [True: 63, False: 7.76k]
  ------------------
  240|     63|            return(-1);
  241|  7.82k|    }
  242|  7.76k|    *str = cur;
  243|  7.76k|    return(0);
  244|  7.82k|}
uri.c:xmlParse3986HierPart:
  791|  5.76k|{
  792|  5.76k|    const char *cur;
  793|  5.76k|    int ret;
  794|       |
  795|  5.76k|    cur = *str;
  796|       |
  797|  5.76k|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (797:9): [True: 3.32k, False: 2.43k]
  |  Branch (797:26): [True: 3.10k, False: 221]
  ------------------
  798|  3.10k|        cur += 2;
  799|  3.10k|	ret = xmlParse3986Authority(uri, &cur);
  800|  3.10k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (800:6): [True: 80, False: 3.02k]
  ------------------
  801|       |        /*
  802|       |         * An empty server is marked with a special URI value.
  803|       |         */
  804|  3.02k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   37|  1.93k|#define PORT_EMPTY           0
  ------------------
  |  Branch (804:6): [True: 1.93k, False: 1.09k]
  |  Branch (804:31): [True: 1.37k, False: 560]
  ------------------
  805|  1.37k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   38|  1.37k|#define PORT_EMPTY_SERVER   -1
  ------------------
  806|  3.02k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  807|  3.02k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (807:6): [True: 1, False: 3.02k]
  ------------------
  808|  3.02k|	*str = cur;
  809|  3.02k|	return(0);
  810|  3.02k|    } else if (*cur == '/') {
  ------------------
  |  Branch (810:16): [True: 221, False: 2.43k]
  ------------------
  811|    221|        ret = xmlParse3986PathAbsolute(uri, &cur);
  812|    221|	if (ret != 0) return(ret);
  ------------------
  |  Branch (812:6): [True: 4, False: 217]
  ------------------
  813|  2.43k|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  175|  2.43k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  190|  4.87k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:30): [True: 52, False: 2.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  169|  4.82k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|    321|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|    642|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 264, False: 57]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 66, False: 198]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 89, False: 166]
  |  |  |  |  |  |  |  Branch (132:43): [True: 66, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|    321|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 112, False: 77]
  |  |  |  |  |  |  |  Branch (133:27): [True: 74, False: 38]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|    206|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|    412|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 130, False: 76]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 18, False: 112]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 37, False: 151]
  |  |  |  |  |  |  |  Branch (132:43): [True: 22, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|    206|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 51, False: 115]
  |  |  |  |  |  |  |  Branch (133:27): [True: 15, False: 36]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:7): [True: 321, False: 2.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  140|  4.76k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 17, False: 2.31k]
  |  |  |  |  |  Branch (140:27): [True: 20, False: 2.29k]
  |  |  |  |  |  Branch (140:46): [True: 17, False: 2.27k]
  |  |  |  |  ------------------
  |  |  |  |  141|  2.33k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 21, False: 2.25k]
  |  |  |  |  |  Branch (141:27): [True: 17, False: 2.23k]
  |  |  |  |  |  Branch (141:46): [True: 17, False: 2.22k]
  |  |  |  |  ------------------
  |  |  |  |  142|  2.33k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 21, False: 2.20k]
  |  |  |  |  |  Branch (142:27): [True: 20, False: 2.18k]
  |  |  |  |  |  Branch (142:46): [True: 17, False: 2.16k]
  |  |  |  |  ------------------
  |  |  |  |  143|  2.33k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 17, False: 2.14k]
  |  |  |  |  |  Branch (143:27): [True: 17, False: 2.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  176|  2.43k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (176:7): [True: 69, False: 2.06k]
  |  |  |  Branch (176:26): [True: 17, False: 2.04k]
  |  |  ------------------
  ------------------
  814|    394|        ret = xmlParse3986PathRootless(uri, &cur);
  815|    394|	if (ret != 0) return(ret);
  ------------------
  |  Branch (815:6): [True: 5, False: 389]
  ------------------
  816|  2.04k|    } else {
  817|       |	/* path-empty is effectively empty */
  818|  2.04k|	if (uri != NULL) {
  ------------------
  |  Branch (818:6): [True: 2.04k, False: 0]
  ------------------
  819|  2.04k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (819:10): [True: 0, False: 2.04k]
  ------------------
  820|  2.04k|	    uri->path = NULL;
  821|  2.04k|	}
  822|  2.04k|    }
  823|  2.65k|    *str = cur;
  824|  2.65k|    return (0);
  825|  5.76k|}
uri.c:xmlParse3986Authority:
  537|  6.90k|{
  538|  6.90k|    const char *cur;
  539|  6.90k|    int ret;
  540|       |
  541|  6.90k|    cur = *str;
  542|       |    /*
  543|       |     * try to parse an userinfo and check for the trailing @
  544|       |     */
  545|  6.90k|    ret = xmlParse3986Userinfo(uri, &cur);
  546|  6.90k|    if (ret < 0)
  ------------------
  |  Branch (546:9): [True: 10, False: 6.89k]
  ------------------
  547|     10|        return(ret);
  548|  6.89k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (548:9): [True: 4.60k, False: 2.29k]
  |  Branch (548:23): [True: 0, False: 2.29k]
  ------------------
  549|  4.60k|        cur = *str;
  550|  2.29k|    else
  551|  2.29k|        cur++;
  552|  6.89k|    ret = xmlParse3986Host(uri, &cur);
  553|  6.89k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (553:9): [True: 116, False: 6.77k]
  ------------------
  554|  6.77k|    if (*cur == ':') {
  ------------------
  |  Branch (554:9): [True: 1.25k, False: 5.52k]
  ------------------
  555|  1.25k|        cur++;
  556|  1.25k|        ret = xmlParse3986Port(uri, &cur);
  557|  1.25k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (557:6): [True: 188, False: 1.06k]
  ------------------
  558|  1.25k|    }
  559|  6.59k|    *str = cur;
  560|  6.59k|    return(0);
  561|  6.77k|}
uri.c:xmlParse3986Userinfo:
  381|  6.90k|{
  382|  6.90k|    const char *cur;
  383|       |
  384|  6.90k|    cur = *str;
  385|  39.8k|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  190|  79.7k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (190:30): [True: 19.3k, False: 20.4k]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  169|  60.3k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  132|  3.24k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|  6.49k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (128:23): [True: 3.17k, False: 69]
  |  |  |  |  |  |  |  Branch (128:40): [True: 387, False: 2.79k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:26): [True: 716, False: 2.14k]
  |  |  |  |  |  Branch (132:43): [True: 696, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  133|  3.24k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (133:10): [True: 2.07k, False: 87]
  |  |  |  |  |  Branch (133:27): [True: 2.04k, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  132|  3.12k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|  6.25k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (128:23): [True: 2.96k, False: 163]
  |  |  |  |  |  |  |  Branch (128:40): [True: 397, False: 2.56k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:26): [True: 1.75k, False: 977]
  |  |  |  |  |  Branch (132:43): [True: 1.72k, False: 23]
  |  |  |  |  ------------------
  |  |  |  |  133|  3.12k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (133:10): [True: 825, False: 175]
  |  |  |  |  |  Branch (133:27): [True: 790, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (169:7): [True: 3.24k, False: 17.2k]
  |  |  ------------------
  ------------------
  386|  39.8k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  140|  57.4k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 577, False: 16.9k]
  |  |  |  Branch (140:27): [True: 842, False: 16.1k]
  |  |  |  Branch (140:46): [True: 598, False: 15.5k]
  |  |  ------------------
  |  |  141|  17.5k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.12k, False: 14.4k]
  |  |  |  Branch (141:27): [True: 620, False: 13.8k]
  |  |  |  Branch (141:46): [True: 585, False: 13.2k]
  |  |  ------------------
  |  |  142|  17.5k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 652, False: 12.5k]
  |  |  |  Branch (142:27): [True: 1.41k, False: 11.1k]
  |  |  |  Branch (142:46): [True: 616, False: 10.5k]
  |  |  ------------------
  |  |  143|  17.5k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 499, False: 10.0k]
  |  |  |  Branch (143:27): [True: 930, False: 9.11k]
  |  |  ------------------
  ------------------
  |  Branch (386:34): [True: 2.21k, False: 6.90k]
  ------------------
  387|  32.9k|	NEXT(cur);
  ------------------
  |  |  109|  32.9k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (109:18): [True: 2.91k, False: 30.0k]
  |  |  ------------------
  ------------------
  388|  6.90k|    if (*cur == '@') {
  ------------------
  |  Branch (388:9): [True: 2.30k, False: 4.60k]
  ------------------
  389|  2.30k|	if (uri != NULL) {
  ------------------
  |  Branch (389:6): [True: 2.30k, False: 0]
  ------------------
  390|  2.30k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (390:10): [True: 0, False: 2.30k]
  ------------------
  391|  2.30k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  193|  2.30k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (391:10): [True: 443, False: 1.85k]
  ------------------
  392|    443|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  120|    443|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  393|  1.85k|	    else
  394|  1.85k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  395|  2.30k|            if (uri->user == NULL)
  ------------------
  |  Branch (395:17): [True: 10, False: 2.29k]
  ------------------
  396|     10|                return(-1);
  397|  2.30k|	}
  398|  2.29k|	*str = cur;
  399|  2.29k|	return(0);
  400|  2.30k|    }
  401|  4.60k|    return(1);
  402|  6.90k|}
uri.c:xmlParse3986Host:
  458|  6.89k|{
  459|  6.89k|    const char *cur = *str;
  460|  6.89k|    const char *host;
  461|       |
  462|  6.89k|    host = cur;
  463|       |    /*
  464|       |     * IPv6 and future addressing scheme are enclosed between brackets
  465|       |     */
  466|  6.89k|    if (*cur == '[') {
  ------------------
  |  Branch (466:9): [True: 1.27k, False: 5.62k]
  ------------------
  467|  1.27k|        cur++;
  468|   854k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (468:9): [True: 853k, False: 1.17k]
  |  Branch (468:26): [True: 853k, False: 97]
  ------------------
  469|   853k|	    cur++;
  470|  1.27k|	if (*cur != ']')
  ------------------
  |  Branch (470:6): [True: 97, False: 1.17k]
  ------------------
  471|     97|	    return(1);
  472|  1.17k|	cur++;
  473|  1.17k|	goto found;
  474|  1.27k|    }
  475|       |    /*
  476|       |     * try to parse an IPv4
  477|       |     */
  478|  5.62k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  128|  5.62k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 2.71k, False: 2.91k]
  |  |  |  Branch (128:40): [True: 756, False: 1.95k]
  |  |  ------------------
  ------------------
  479|    756|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (479:13): [True: 81, False: 675]
  ------------------
  480|     81|	    goto not_ipv4;
  481|    675|	if (*cur != '.')
  ------------------
  |  Branch (481:6): [True: 381, False: 294]
  ------------------
  482|    381|	    goto not_ipv4;
  483|    294|	cur++;
  484|    294|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (484:13): [True: 90, False: 204]
  ------------------
  485|     90|	    goto not_ipv4;
  486|    204|	if (*cur != '.')
  ------------------
  |  Branch (486:6): [True: 184, False: 20]
  ------------------
  487|    184|	    goto not_ipv4;
  488|     20|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (488:13): [True: 20, False: 0]
  ------------------
  489|     20|	    goto not_ipv4;
  490|      0|	if (*cur != '.')
  ------------------
  |  Branch (490:6): [True: 0, False: 0]
  ------------------
  491|      0|	    goto not_ipv4;
  492|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|	    goto not_ipv4;
  494|      0|	goto found;
  495|    756|not_ipv4:
  496|    756|        cur = *str;
  497|    756|    }
  498|       |    /*
  499|       |     * then this should be a hostname which can be empty
  500|       |     */
  501|  22.7k|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  190|  45.4k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (190:30): [True: 10.6k, False: 12.0k]
  |  |  ------------------
  ------------------
  502|  22.7k|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  169|  34.7k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  132|  1.88k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|  3.77k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (128:23): [True: 1.81k, False: 68]
  |  |  |  |  |  |  |  Branch (128:40): [True: 378, False: 1.44k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:26): [True: 707, False: 802]
  |  |  |  |  |  Branch (132:43): [True: 687, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  133|  1.88k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (133:10): [True: 738, False: 84]
  |  |  |  |  |  Branch (133:27): [True: 703, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  132|  1.76k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|  3.53k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (128:23): [True: 1.60k, False: 160]
  |  |  |  |  |  |  |  Branch (128:40): [True: 381, False: 1.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:26): [True: 487, False: 900]
  |  |  |  |  |  Branch (132:43): [True: 464, False: 23]
  |  |  |  |  ------------------
  |  |  |  |  133|  1.76k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (133:10): [True: 751, False: 172]
  |  |  |  |  |  Branch (133:27): [True: 716, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (169:7): [True: 1.88k, False: 10.1k]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  140|  10.5k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 382, False: 10.1k]
  |  |  |  Branch (140:27): [True: 499, False: 9.64k]
  |  |  |  Branch (140:46): [True: 251, False: 9.39k]
  |  |  ------------------
  |  |  141|  10.5k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 411, False: 8.97k]
  |  |  |  Branch (141:27): [True: 368, False: 8.61k]
  |  |  |  Branch (141:46): [True: 334, False: 8.27k]
  |  |  ------------------
  |  |  142|  10.5k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 304, False: 7.97k]
  |  |  |  Branch (142:27): [True: 1.05k, False: 6.91k]
  |  |  |  Branch (142:46): [True: 352, False: 6.56k]
  |  |  ------------------
  |  |  143|  10.5k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 225, False: 6.34k]
  |  |  |  Branch (143:27): [True: 718, False: 5.62k]
  |  |  ------------------
  ------------------
  503|  17.0k|        NEXT(cur);
  ------------------
  |  |  109|  22.7k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (109:18): [True: 1.56k, False: 15.5k]
  |  |  ------------------
  ------------------
  504|  6.79k|found:
  505|  6.79k|    if (uri != NULL) {
  ------------------
  |  Branch (505:9): [True: 6.79k, False: 0]
  ------------------
  506|  6.79k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (506:6): [True: 0, False: 6.79k]
  ------------------
  507|  6.79k|	uri->authority = NULL;
  508|  6.79k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (508:6): [True: 0, False: 6.79k]
  ------------------
  509|  6.79k|	if (cur != host) {
  ------------------
  |  Branch (509:6): [True: 3.46k, False: 3.33k]
  ------------------
  510|  3.46k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  193|  3.46k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (510:10): [True: 678, False: 2.78k]
  ------------------
  511|    678|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  120|    678|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  512|  2.78k|	    else
  513|  2.78k|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  514|  3.46k|            if (uri->server == NULL)
  ------------------
  |  Branch (514:17): [True: 19, False: 3.44k]
  ------------------
  515|     19|                return(-1);
  516|  3.46k|	} else
  517|  3.33k|	    uri->server = NULL;
  518|  6.79k|    }
  519|  6.77k|    *str = cur;
  520|  6.77k|    return(0);
  521|  6.79k|}
uri.c:xmlParse3986DecOctet:
  419|  1.07k|xmlParse3986DecOctet(const char **str) {
  420|  1.07k|    const char *cur = *str;
  421|       |
  422|  1.07k|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  128|  1.07k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 1.02k, False: 42]
  |  |  |  Branch (128:40): [True: 996, False: 32]
  |  |  ------------------
  ------------------
  423|     74|        return(1);
  424|    996|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  128|    996|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 478, False: 518]
  |  |  |  Branch (128:40): [True: 390, False: 88]
  |  |  ------------------
  ------------------
  425|    606|	cur++;
  426|    390|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  128|    336|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 336, False: 0]
  |  |  |  Branch (128:40): [True: 336, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  128|    336|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 268, False: 68]
  |  |  |  Branch (128:40): [True: 221, False: 47]
  |  |  ------------------
  ------------------
  |  Branch (426:14): [True: 336, False: 54]
  ------------------
  427|    115|	cur += 2;
  428|    275|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  128|     56|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 56, False: 0]
  |  |  |  Branch (128:40): [True: 56, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  128|     56|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 56, False: 0]
  |  |  |  Branch (128:40): [True: 56, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (428:14): [True: 56, False: 219]
  ------------------
  429|     56|	cur += 3;
  430|    219|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (430:14): [True: 138, False: 81]
  |  Branch (430:31): [True: 138, False: 0]
  ------------------
  431|    219|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  128|     60|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 60, False: 0]
  |  |  |  Branch (128:40): [True: 60, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (431:7): [True: 60, False: 78]
  ------------------
  432|     60|	cur += 3;
  433|    159|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (433:14): [True: 78, False: 81]
  |  Branch (433:31): [True: 42, False: 36]
  ------------------
  434|    159|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (434:7): [True: 42, False: 0]
  |  Branch (434:30): [True: 42, False: 0]
  ------------------
  435|     42|	cur += 3;
  436|    117|    else
  437|    117|        return(1);
  438|    879|    *str = cur;
  439|    879|    return(0);
  440|    996|}
uri.c:xmlParse3986Port:
  342|  1.25k|{
  343|  1.25k|    const char *cur = *str;
  344|  1.25k|    int port = 0;
  345|       |
  346|  1.25k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  128|  1.25k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 1.16k, False: 90]
  |  |  |  Branch (128:40): [True: 1.11k, False: 51]
  |  |  ------------------
  ------------------
  347|  7.22k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  128|  7.22k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (128:23): [True: 6.22k, False: 1.00k]
  |  |  |  Branch (128:40): [True: 6.16k, False: 60]
  |  |  ------------------
  ------------------
  348|  6.16k|            int digit = *cur - '0';
  349|       |
  350|  6.16k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (350:17): [True: 29, False: 6.13k]
  ------------------
  351|     29|                return(1);
  352|  6.13k|            port *= 10;
  353|  6.13k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (353:17): [True: 18, False: 6.11k]
  ------------------
  354|     18|                return(1);
  355|  6.11k|	    port += digit;
  356|       |
  357|  6.11k|	    cur++;
  358|  6.11k|	}
  359|  1.06k|	if (uri != NULL)
  ------------------
  |  Branch (359:6): [True: 1.06k, False: 0]
  ------------------
  360|  1.06k|	    uri->port = port;
  361|  1.06k|	*str = cur;
  362|  1.06k|	return(0);
  363|  1.11k|    }
  364|    141|    return(1);
  365|  1.25k|}
uri.c:xmlParse3986PathAbEmpty:
  610|  6.59k|{
  611|  6.59k|    const char *cur;
  612|  6.59k|    int ret;
  613|       |
  614|  6.59k|    cur = *str;
  615|       |
  616|   245k|    while (*cur == '/') {
  ------------------
  |  Branch (616:12): [True: 238k, False: 6.59k]
  ------------------
  617|   238k|        cur++;
  618|   238k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  619|   238k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (619:6): [True: 0, False: 238k]
  ------------------
  620|   238k|    }
  621|  6.59k|    if (uri != NULL) {
  ------------------
  |  Branch (621:9): [True: 6.59k, False: 0]
  ------------------
  622|  6.59k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (622:6): [True: 0, False: 6.59k]
  ------------------
  623|  6.59k|        if (*str != cur) {
  ------------------
  |  Branch (623:13): [True: 666, False: 5.92k]
  ------------------
  624|    666|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  193|    666|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (624:17): [True: 116, False: 550]
  ------------------
  625|    116|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  120|    116|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  626|    550|            else
  627|    550|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  628|    666|            if (uri->path == NULL)
  ------------------
  |  Branch (628:17): [True: 4, False: 662]
  ------------------
  629|      4|                return (-1);
  630|  5.92k|        } else {
  631|  5.92k|            uri->path = NULL;
  632|  5.92k|        }
  633|  6.59k|    }
  634|  6.58k|    *str = cur;
  635|  6.58k|    return (0);
  636|  6.59k|}
uri.c:xmlParse3986Segment:
  581|   492k|{
  582|   492k|    const char *cur;
  583|       |
  584|   492k|    cur = *str;
  585|   492k|    if (!ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  175|   492k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  190|   985k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:30): [True: 15.5k, False: 477k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  169|   969k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.71k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  3.43k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 1.64k, False: 78]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 515, False: 1.12k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 593, False: 611]
  |  |  |  |  |  |  |  Branch (132:43): [True: 575, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  1.71k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 535, False: 94]
  |  |  |  |  |  |  |  Branch (133:27): [True: 501, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.59k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  3.18k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 1.46k, False: 130]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 475, False: 986]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 480, False: 636]
  |  |  |  |  |  |  |  Branch (132:43): [True: 460, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  1.59k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 522, False: 134]
  |  |  |  |  |  |  |  Branch (133:27): [True: 478, False: 44]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:7): [True: 1.71k, False: 475k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  140|   968k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 538, False: 475k]
  |  |  |  |  |  Branch (140:27): [True: 62.6k, False: 412k]
  |  |  |  |  |  Branch (140:46): [True: 3.02k, False: 409k]
  |  |  |  |  ------------------
  |  |  |  |  141|   475k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 402, False: 409k]
  |  |  |  |  |  Branch (141:27): [True: 2.34k, False: 406k]
  |  |  |  |  |  Branch (141:46): [True: 1.29k, False: 405k]
  |  |  |  |  ------------------
  |  |  |  |  142|   475k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 462, False: 404k]
  |  |  |  |  |  Branch (142:27): [True: 2.83k, False: 402k]
  |  |  |  |  |  Branch (142:46): [True: 384, False: 401k]
  |  |  |  |  ------------------
  |  |  |  |  143|   475k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 678, False: 401k]
  |  |  |  |  |  Branch (143:27): [True: 2.64k, False: 398k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  176|   492k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (176:7): [True: 11.9k, False: 386k]
  |  |  |  Branch (176:26): [True: 1.39k, False: 385k]
  |  |  ------------------
  ------------------
  586|   385k|        if (empty)
  ------------------
  |  Branch (586:13): [True: 384k, False: 632]
  ------------------
  587|   384k|	    return(0);
  588|    632|	return(1);
  589|   385k|    }
  590|   421k|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  175|   842k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  190|   842k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:30): [True: 171k, False: 249k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  169|   670k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.04k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  6.09k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 2.98k, False: 69]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 711, False: 2.26k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 1.06k, False: 1.27k]
  |  |  |  |  |  |  |  Branch (132:43): [True: 1.04k, False: 22]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  3.04k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 1.20k, False: 89]
  |  |  |  |  |  |  |  Branch (133:27): [True: 1.16k, False: 36]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.92k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  5.84k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 2.84k, False: 77]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 726, False: 2.12k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 906, False: 1.29k]
  |  |  |  |  |  |  |  Branch (132:43): [True: 881, False: 25]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  2.92k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 1.18k, False: 129]
  |  |  |  |  |  |  |  Branch (133:27): [True: 1.15k, False: 37]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:7): [True: 3.04k, False: 246k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  140|   667k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 2.23k, False: 244k]
  |  |  |  |  |  Branch (140:27): [True: 63.5k, False: 180k]
  |  |  |  |  |  Branch (140:46): [True: 3.64k, False: 177k]
  |  |  |  |  ------------------
  |  |  |  |  141|   246k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.02k, False: 176k]
  |  |  |  |  |  Branch (141:27): [True: 3.77k, False: 172k]
  |  |  |  |  |  Branch (141:46): [True: 2.08k, False: 170k]
  |  |  |  |  ------------------
  |  |  |  |  142|   246k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.52k, False: 168k]
  |  |  |  |  |  Branch (142:27): [True: 3.32k, False: 165k]
  |  |  |  |  |  Branch (142:46): [True: 873, False: 164k]
  |  |  |  |  ------------------
  |  |  |  |  143|   246k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 1.52k, False: 163k]
  |  |  |  |  |  Branch (143:27): [True: 6.01k, False: 157k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  176|   421k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (176:7): [True: 47.8k, False: 109k]
  |  |  |  Branch (176:26): [True: 2.90k, False: 106k]
  |  |  ------------------
  ------------------
  |  Branch (590:35): [True: 313k, False: 1.04k]
  ------------------
  591|   313k|        NEXT(cur);
  ------------------
  |  |  109|   421k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (109:18): [True: 2.75k, False: 310k]
  |  |  ------------------
  ------------------
  592|   107k|    *str = cur;
  593|   107k|    return (0);
  594|   492k|}
uri.c:xmlParse3986PathAbsolute:
  652|  1.46k|{
  653|  1.46k|    const char *cur;
  654|  1.46k|    int ret;
  655|       |
  656|  1.46k|    cur = *str;
  657|       |
  658|  1.46k|    if (*cur != '/')
  ------------------
  |  Branch (658:9): [True: 0, False: 1.46k]
  ------------------
  659|      0|        return(1);
  660|  1.46k|    cur++;
  661|  1.46k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  662|  1.46k|    if (ret == 0) {
  ------------------
  |  Branch (662:9): [True: 834, False: 632]
  ------------------
  663|  38.6k|	while (*cur == '/') {
  ------------------
  |  Branch (663:9): [True: 37.8k, False: 834]
  ------------------
  664|  37.8k|	    cur++;
  665|  37.8k|	    ret = xmlParse3986Segment(uri, &cur, 0, 1);
  666|  37.8k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (666:10): [True: 0, False: 37.8k]
  ------------------
  667|  37.8k|	}
  668|    834|    }
  669|  1.46k|    if (uri != NULL) {
  ------------------
  |  Branch (669:9): [True: 1.46k, False: 0]
  ------------------
  670|  1.46k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (670:6): [True: 0, False: 1.46k]
  ------------------
  671|  1.46k|        if (cur != *str) {
  ------------------
  |  Branch (671:13): [True: 1.46k, False: 0]
  ------------------
  672|  1.46k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  193|  1.46k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (672:17): [True: 242, False: 1.22k]
  ------------------
  673|    242|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  120|    242|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  674|  1.22k|            else
  675|  1.22k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  676|  1.46k|            if (uri->path == NULL)
  ------------------
  |  Branch (676:17): [True: 10, False: 1.45k]
  ------------------
  677|     10|                return (-1);
  678|  1.46k|        } else {
  679|      0|            uri->path = NULL;
  680|      0|        }
  681|  1.46k|    }
  682|  1.45k|    *str = cur;
  683|  1.45k|    return (0);
  684|  1.46k|}
uri.c:xmlIsUnreserved:
  197|  1.08M|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  198|  1.08M|    if (uri == NULL)
  ------------------
  |  Branch (198:9): [True: 0, False: 1.08M]
  ------------------
  199|      0|        return(0);
  200|       |
  201|  1.08M|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  162|  1.08M|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  129|  1.08M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 63.0k, False: 1.02M]
  |  |  |  |  |  Branch (129:41): [True: 54.3k, False: 8.66k]
  |  |  |  |  ------------------
  |  |  |  |  130|  1.08M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (130:24): [True: 124k, False: 906k]
  |  |  |  |  |  Branch (130:41): [True: 108k, False: 15.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|   922k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:23): [True: 146k, False: 776k]
  |  |  |  |  |  Branch (128:40): [True: 30.5k, False: 115k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (162:44): [True: 3.75k, False: 888k]
  |  |  ------------------
  |  |  163|  1.08M|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (163:8): [True: 26.0k, False: 862k]
  |  |  |  Branch (163:27): [True: 1.63k, False: 860k]
  |  |  |  Branch (163:46): [True: 7.07k, False: 853k]
  |  |  ------------------
  ------------------
  202|   231k|        return(1);
  203|       |
  204|   853k|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  192|   853k|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (204:9): [True: 139k, False: 713k]
  ------------------
  205|   139k|        if (IS_UNWISE(cur))
  ------------------
  |  |   88|   139k|      (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) ||         \
  |  |  ------------------
  |  |  |  Branch (88:8): [True: 308, False: 139k]
  |  |  |  Branch (88:27): [True: 650, False: 138k]
  |  |  |  Branch (88:46): [True: 255, False: 138k]
  |  |  ------------------
  |  |   89|   139k|       ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) ||        \
  |  |  ------------------
  |  |  |  Branch (89:8): [True: 786, False: 137k]
  |  |  |  Branch (89:28): [True: 309, False: 137k]
  |  |  |  Branch (89:47): [True: 563, False: 136k]
  |  |  ------------------
  |  |   90|   139k|       ((*(p) == ']')) || ((*(p) == '`')))
  |  |  ------------------
  |  |  |  Branch (90:8): [True: 489, False: 136k]
  |  |  |  Branch (90:27): [True: 375, False: 135k]
  |  |  ------------------
  ------------------
  206|  3.73k|            return(1);
  207|   713k|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  194|   713k|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (207:16): [True: 0, False: 713k]
  ------------------
  208|      0|        if (ISA_UCSCHAR(cur))
  ------------------
  |  |  186|      0|    ((*(p) <= 0x20) || (*(p) >= 0x7F) || (*(p) == '<') || (*(p) == '>') || \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 0, False: 0]
  |  |  |  Branch (186:24): [True: 0, False: 0]
  |  |  |  Branch (186:42): [True: 0, False: 0]
  |  |  |  Branch (186:59): [True: 0, False: 0]
  |  |  ------------------
  |  |  187|      0|     (*(p) == '"')  || (*(p) == '{')  || (*(p) == '}') || (*(p) == '|') || \
  |  |  ------------------
  |  |  |  Branch (187:6): [True: 0, False: 0]
  |  |  |  Branch (187:24): [True: 0, False: 0]
  |  |  |  Branch (187:42): [True: 0, False: 0]
  |  |  |  Branch (187:59): [True: 0, False: 0]
  |  |  ------------------
  |  |  188|      0|     (*(p) == '\\') || (*(p) == '^')  || (*(p) == '`'))
  |  |  ------------------
  |  |  |  Branch (188:6): [True: 0, False: 0]
  |  |  |  Branch (188:24): [True: 0, False: 0]
  |  |  |  Branch (188:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  209|      0|            return(1);
  210|      0|    }
  211|       |
  212|   849k|    return(0);
  213|   853k|}
uri.c:xmlParse3986PathRootless:
  700|    394|{
  701|    394|    const char *cur;
  702|    394|    int ret;
  703|       |
  704|    394|    cur = *str;
  705|       |
  706|    394|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  707|    394|    if (ret != 0) return(ret);
  ------------------
  |  Branch (707:9): [True: 0, False: 394]
  ------------------
  708|    760|    while (*cur == '/') {
  ------------------
  |  Branch (708:12): [True: 366, False: 394]
  ------------------
  709|    366|        cur++;
  710|    366|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  711|    366|	if (ret != 0) return(ret);
  ------------------
  |  Branch (711:6): [True: 0, False: 366]
  ------------------
  712|    366|    }
  713|    394|    if (uri != NULL) {
  ------------------
  |  Branch (713:9): [True: 394, False: 0]
  ------------------
  714|    394|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (714:6): [True: 0, False: 394]
  ------------------
  715|    394|        if (cur != *str) {
  ------------------
  |  Branch (715:13): [True: 394, False: 0]
  ------------------
  716|    394|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  193|    394|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (716:17): [True: 66, False: 328]
  ------------------
  717|     66|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  120|     66|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  718|    328|            else
  719|    328|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  720|    394|            if (uri->path == NULL)
  ------------------
  |  Branch (720:17): [True: 5, False: 389]
  ------------------
  721|      5|                return (-1);
  722|    394|        } else {
  723|      0|            uri->path = NULL;
  724|      0|        }
  725|    394|    }
  726|    389|    *str = cur;
  727|    389|    return (0);
  728|    394|}
uri.c:xmlParse3986Query:
  298|  2.29k|{
  299|  2.29k|    const char *cur;
  300|       |
  301|  2.29k|    cur = *str;
  302|       |
  303|  60.0k|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?'))
  ------------------
  |  |  175|  60.0k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  190|   120k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:30): [True: 6.63k, False: 53.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  169|   113k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.89k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  3.78k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 1.83k, False: 53]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 306, False: 1.53k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 653, False: 931]
  |  |  |  |  |  |  |  Branch (132:43): [True: 622, False: 31]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  1.89k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 873, False: 89]
  |  |  |  |  |  |  |  Branch (133:27): [True: 832, False: 41]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.76k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  3.52k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 1.65k, False: 108]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 298, False: 1.35k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 534, False: 928]
  |  |  |  |  |  |  |  Branch (132:43): [True: 508, False: 26]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  1.76k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 798, False: 156]
  |  |  |  |  |  |  |  Branch (133:27): [True: 768, False: 30]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:7): [True: 1.89k, False: 51.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  140|   111k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 218, False: 51.6k]
  |  |  |  |  |  Branch (140:27): [True: 199, False: 51.4k]
  |  |  |  |  |  Branch (140:46): [True: 1.23k, False: 50.1k]
  |  |  |  |  ------------------
  |  |  |  |  141|  51.8k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 340, False: 49.8k]
  |  |  |  |  |  Branch (141:27): [True: 354, False: 49.4k]
  |  |  |  |  |  Branch (141:46): [True: 341, False: 49.1k]
  |  |  |  |  ------------------
  |  |  |  |  142|  51.8k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 222, False: 48.9k]
  |  |  |  |  |  Branch (142:27): [True: 211, False: 48.7k]
  |  |  |  |  |  Branch (142:46): [True: 204, False: 48.4k]
  |  |  |  |  ------------------
  |  |  |  |  143|  51.8k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 246, False: 48.2k]
  |  |  |  |  |  Branch (143:27): [True: 1.22k, False: 47.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  176|  60.0k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (176:7): [True: 7.58k, False: 39.4k]
  |  |  |  Branch (176:26): [True: 425, False: 39.0k]
  |  |  ------------------
  ------------------
  |  Branch (303:37): [True: 27.1k, False: 11.8k]
  |  Branch (303:54): [True: 9.59k, False: 2.29k]
  ------------------
  304|  57.7k|        NEXT(cur);
  ------------------
  |  |  109|  57.7k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (109:18): [True: 1.57k, False: 56.1k]
  |  |  ------------------
  ------------------
  305|  2.29k|    if (uri != NULL) {
  ------------------
  |  Branch (305:9): [True: 2.29k, False: 0]
  ------------------
  306|  2.29k|        if (uri->query != NULL)
  ------------------
  |  Branch (306:13): [True: 0, False: 2.29k]
  ------------------
  307|      0|            xmlFree(uri->query);
  308|  2.29k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  193|  2.29k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (308:6): [True: 413, False: 1.88k]
  ------------------
  309|    413|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  120|    413|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  310|  1.88k|	else
  311|  1.88k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  312|  2.29k|        if (uri->query == NULL)
  ------------------
  |  Branch (312:13): [True: 11, False: 2.28k]
  ------------------
  313|     11|            return (-1);
  314|       |
  315|       |	/* Save the raw bytes of the query as well.
  316|       |	 * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00114
  317|       |	 */
  318|  2.28k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (318:6): [True: 0, False: 2.28k]
  ------------------
  319|      0|	    xmlFree (uri->query_raw);
  320|  2.28k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  120|  2.28k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  321|  2.28k|        if (uri->query_raw == NULL)
  ------------------
  |  Branch (321:13): [True: 13, False: 2.27k]
  ------------------
  322|     13|            return (-1);
  323|  2.28k|    }
  324|  2.27k|    *str = cur;
  325|  2.27k|    return (0);
  326|  2.29k|}
uri.c:xmlParse3986Fragment:
  263|  3.21k|{
  264|  3.21k|    const char *cur;
  265|       |
  266|  3.21k|    cur = *str;
  267|       |
  268|  32.9k|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  175|  32.9k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  190|  65.9k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:30): [True: 6.59k, False: 26.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  169|  59.3k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.62k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  5.25k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 2.55k, False: 68]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 580, False: 1.97k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 1.24k, False: 799]
  |  |  |  |  |  |  |  Branch (132:43): [True: 1.18k, False: 58]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  2.62k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 773, False: 84]
  |  |  |  |  |  |  |  Branch (133:27): [True: 707, False: 66]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.47k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  4.95k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 2.28k, False: 192]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 650, False: 1.63k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 741, False: 1.08k]
  |  |  |  |  |  |  |  Branch (132:43): [True: 699, False: 42]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  2.47k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 891, False: 236]
  |  |  |  |  |  |  |  Branch (133:27): [True: 830, False: 61]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:7): [True: 2.62k, False: 23.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  140|  57.1k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 551, False: 23.6k]
  |  |  |  |  |  Branch (140:27): [True: 540, False: 23.0k]
  |  |  |  |  |  Branch (140:46): [True: 1.84k, False: 21.2k]
  |  |  |  |  ------------------
  |  |  |  |  141|  24.1k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 746, False: 20.4k]
  |  |  |  |  |  Branch (141:27): [True: 734, False: 19.7k]
  |  |  |  |  |  Branch (141:46): [True: 828, False: 18.9k]
  |  |  |  |  ------------------
  |  |  |  |  142|  24.1k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 576, False: 18.3k]
  |  |  |  |  |  Branch (142:27): [True: 710, False: 17.6k]
  |  |  |  |  |  Branch (142:46): [True: 631, False: 17.0k]
  |  |  |  |  ------------------
  |  |  |  |  143|  24.1k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 540, False: 16.4k]
  |  |  |  |  |  Branch (143:27): [True: 694, False: 15.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  176|  32.9k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (176:7): [True: 1.19k, False: 14.5k]
  |  |  |  Branch (176:26): [True: 638, False: 13.9k]
  |  |  ------------------
  ------------------
  |  Branch (268:37): [True: 8.39k, False: 5.56k]
  |  Branch (268:54): [True: 931, False: 4.63k]
  ------------------
  269|  32.9k|           (*cur == '[') || (*cur == ']'))
  ------------------
  |  Branch (269:12): [True: 818, False: 3.81k]
  |  Branch (269:29): [True: 600, False: 3.21k]
  ------------------
  270|  29.7k|        NEXT(cur);
  ------------------
  |  |  109|  29.7k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (109:18): [True: 2.17k, False: 27.5k]
  |  |  ------------------
  ------------------
  271|  3.21k|    if (uri != NULL) {
  ------------------
  |  Branch (271:9): [True: 3.21k, False: 0]
  ------------------
  272|  3.21k|        if (uri->fragment != NULL)
  ------------------
  |  Branch (272:13): [True: 0, False: 3.21k]
  ------------------
  273|      0|            xmlFree(uri->fragment);
  274|  3.21k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  193|  3.21k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (274:6): [True: 561, False: 2.65k]
  ------------------
  275|    561|	    uri->fragment = STRNDUP(*str, cur - *str);
  ------------------
  |  |  120|    561|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  276|  2.65k|	else
  277|  2.65k|	    uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
  278|  3.21k|        if (uri->fragment == NULL)
  ------------------
  |  Branch (278:13): [True: 28, False: 3.18k]
  ------------------
  279|     28|            return (-1);
  280|  3.21k|    }
  281|  3.18k|    *str = cur;
  282|  3.18k|    return (0);
  283|  3.21k|}
uri.c:xmlParse3986RelativeRef:
  844|  18.8k|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  845|  18.8k|    int ret;
  846|       |
  847|  18.8k|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (847:9): [True: 5.04k, False: 13.8k]
  |  Branch (847:26): [True: 3.80k, False: 1.24k]
  ------------------
  848|  3.80k|        str += 2;
  849|  3.80k|	ret = xmlParse3986Authority(uri, &str);
  850|  3.80k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (850:6): [True: 234, False: 3.56k]
  ------------------
  851|  3.56k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  852|  3.56k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (852:6): [True: 3, False: 3.56k]
  ------------------
  853|  15.0k|    } else if (*str == '/') {
  ------------------
  |  Branch (853:16): [True: 1.24k, False: 13.8k]
  ------------------
  854|  1.24k|	ret = xmlParse3986PathAbsolute(uri, &str);
  855|  1.24k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (855:6): [True: 6, False: 1.23k]
  ------------------
  856|  13.8k|    } else if (ISA_PCHAR(uri, str)) {
  ------------------
  |  |  175|  13.8k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  190|  27.6k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:30): [True: 5.30k, False: 8.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  169|  22.3k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.00k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  2.01k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 911, False: 98]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 304, False: 607]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 256, False: 449]
  |  |  |  |  |  |  |  Branch (132:43): [True: 226, False: 30]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  1.00k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 361, False: 118]
  |  |  |  |  |  |  |  Branch (133:27): [True: 285, False: 76]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|    815|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  128|  1.63k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (128:23): [True: 715, False: 100]
  |  |  |  |  |  |  |  |  |  Branch (128:40): [True: 272, False: 443]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:26): [True: 170, False: 373]
  |  |  |  |  |  |  |  Branch (132:43): [True: 147, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  133|    815|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (133:10): [True: 280, False: 116]
  |  |  |  |  |  |  |  Branch (133:27): [True: 232, False: 48]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:7): [True: 1.00k, False: 7.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  140|  21.7k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 196, False: 7.68k]
  |  |  |  |  |  Branch (140:27): [True: 208, False: 7.48k]
  |  |  |  |  |  Branch (140:46): [True: 183, False: 7.29k]
  |  |  |  |  ------------------
  |  |  |  |  141|  7.88k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 177, False: 7.12k]
  |  |  |  |  |  Branch (141:27): [True: 240, False: 6.88k]
  |  |  |  |  |  Branch (141:46): [True: 230, False: 6.65k]
  |  |  |  |  ------------------
  |  |  |  |  142|  7.88k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 142, False: 6.50k]
  |  |  |  |  |  Branch (142:27): [True: 155, False: 6.35k]
  |  |  |  |  |  Branch (142:46): [True: 170, False: 6.18k]
  |  |  |  |  ------------------
  |  |  |  |  143|  7.88k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 274, False: 5.91k]
  |  |  |  |  |  Branch (143:27): [True: 128, False: 5.78k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  176|  13.8k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (176:7): [True: 162, False: 5.62k]
  |  |  |  Branch (176:26): [True: 180, False: 5.44k]
  |  |  ------------------
  ------------------
  857|  8.40k|        ret = xmlParse3986PathNoScheme(uri, &str);
  858|  8.40k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (858:6): [True: 64, False: 8.34k]
  ------------------
  859|  8.40k|    } else {
  860|       |	/* path-empty is effectively empty */
  861|  5.44k|	if (uri != NULL) {
  ------------------
  |  Branch (861:6): [True: 5.44k, False: 0]
  ------------------
  862|  5.44k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (862:10): [True: 0, False: 5.44k]
  ------------------
  863|  5.44k|	    uri->path = NULL;
  864|  5.44k|	}
  865|  5.44k|    }
  866|       |
  867|  18.5k|    if (*str == '?') {
  ------------------
  |  Branch (867:9): [True: 2.18k, False: 16.3k]
  ------------------
  868|  2.18k|	str++;
  869|  2.18k|	ret = xmlParse3986Query(uri, &str);
  870|  2.18k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (870:6): [True: 22, False: 2.16k]
  ------------------
  871|  2.18k|    }
  872|  18.5k|    if (*str == '#') {
  ------------------
  |  Branch (872:9): [True: 3.04k, False: 15.5k]
  ------------------
  873|  3.04k|	str++;
  874|  3.04k|	ret = xmlParse3986Fragment(uri, &str);
  875|  3.04k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (875:6): [True: 27, False: 3.02k]
  ------------------
  876|  3.04k|    }
  877|  18.5k|    if (*str != 0) {
  ------------------
  |  Branch (877:9): [True: 5.48k, False: 13.0k]
  ------------------
  878|  5.48k|	xmlCleanURI(uri);
  879|  5.48k|	return(1);
  880|  5.48k|    }
  881|  13.0k|    return(0);
  882|  18.5k|}
uri.c:xmlParse3986PathNoScheme:
  744|  8.40k|{
  745|  8.40k|    const char *cur;
  746|  8.40k|    int ret;
  747|       |
  748|  8.40k|    cur = *str;
  749|       |
  750|  8.40k|    ret = xmlParse3986Segment(uri, &cur, ':', 0);
  751|  8.40k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (751:9): [True: 0, False: 8.40k]
  ------------------
  752|   213k|    while (*cur == '/') {
  ------------------
  |  Branch (752:12): [True: 205k, False: 8.40k]
  ------------------
  753|   205k|        cur++;
  754|   205k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  755|   205k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (755:6): [True: 0, False: 205k]
  ------------------
  756|   205k|    }
  757|  8.40k|    if (uri != NULL) {
  ------------------
  |  Branch (757:9): [True: 8.40k, False: 0]
  ------------------
  758|  8.40k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (758:6): [True: 0, False: 8.40k]
  ------------------
  759|  8.40k|        if (cur != *str) {
  ------------------
  |  Branch (759:13): [True: 8.24k, False: 162]
  ------------------
  760|  8.24k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  193|  8.24k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (760:17): [True: 977, False: 7.26k]
  ------------------
  761|    977|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  120|    977|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  762|  7.26k|            else
  763|  7.26k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  764|  8.24k|            if (uri->path == NULL)
  ------------------
  |  Branch (764:17): [True: 64, False: 8.17k]
  ------------------
  765|     64|                return (-1);
  766|  8.24k|        } else {
  767|    162|            uri->path = NULL;
  768|    162|        }
  769|  8.40k|    }
  770|  8.34k|    *str = cur;
  771|  8.34k|    return (0);
  772|  8.40k|}
uri.c:xmlSaveUriRealloc:
 1099|  2.25k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1100|  2.25k|    xmlChar *temp;
 1101|  2.25k|    int tmp;
 1102|       |
 1103|  2.25k|    if (*max > MAX_URI_LENGTH)
  ------------------
  |  |   35|  2.25k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
  |  Branch (1103:9): [True: 0, False: 2.25k]
  ------------------
 1104|      0|        return(NULL);
 1105|  2.25k|    tmp = *max * 2;
 1106|  2.25k|    temp = (xmlChar *) xmlRealloc(ret, (tmp + 1));
 1107|  2.25k|    if (temp == NULL)
  ------------------
  |  Branch (1107:9): [True: 20, False: 2.23k]
  ------------------
 1108|     20|        return(NULL);
 1109|  2.23k|    *max = tmp;
 1110|  2.23k|    return(temp);
 1111|  2.25k|}
uri.c:xmlNormalizePath:
 1488|  5.29k|xmlNormalizePath(char *path, int isFile) {
 1489|  5.29k|    char *cur, *out;
 1490|  5.29k|    int numSeg = 0;
 1491|       |
 1492|  5.29k|    if (path == NULL)
  ------------------
  |  Branch (1492:9): [True: 323, False: 4.96k]
  ------------------
 1493|    323|	return(-1);
 1494|       |
 1495|  4.96k|    cur = path;
 1496|  4.96k|    out = path;
 1497|       |
 1498|  4.96k|    if (*cur == 0)
  ------------------
  |  Branch (1498:9): [True: 87, False: 4.88k]
  ------------------
 1499|     87|        return(0);
 1500|       |
 1501|  4.88k|    if (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1501:9): [True: 1.53k, False: 3.35k]
  ------------------
 1502|  1.53k|        cur++;
 1503|  1.53k|        *out++ = '/';
 1504|  1.53k|    }
 1505|       |
 1506|  70.1k|    while (*cur != 0) {
  ------------------
  |  Branch (1506:12): [True: 65.4k, False: 4.74k]
  ------------------
 1507|       |        /*
 1508|       |         * At this point, out is either empty or ends with a separator.
 1509|       |         * Collapse multiple separators first.
 1510|       |         */
 1511|   238k|        while (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1511:16): [True: 173k, False: 65.4k]
  ------------------
 1512|       |#ifdef _WIN32
 1513|       |            /* Allow two separators at start of path */
 1514|       |            if ((isFile) && (out == path + 1))
 1515|       |                *out++ = '/';
 1516|       |#endif
 1517|   173k|            cur++;
 1518|   173k|        }
 1519|       |
 1520|  65.4k|        if (*cur == '.') {
  ------------------
  |  Branch (1520:13): [True: 3.76k, False: 61.6k]
  ------------------
 1521|  3.76k|            if (cur[1] == 0) {
  ------------------
  |  Branch (1521:17): [True: 93, False: 3.67k]
  ------------------
 1522|       |                /* Ignore "." at end of path */
 1523|     93|                break;
 1524|  3.67k|            } else if (xmlIsPathSeparator(cur[1], isFile)) {
  ------------------
  |  Branch (1524:24): [True: 856, False: 2.81k]
  ------------------
 1525|       |                /* Skip "./" */
 1526|    856|                cur += 2;
 1527|    856|                continue;
 1528|  2.81k|            } else if ((cur[1] == '.') &&
  ------------------
  |  Branch (1528:24): [True: 2.49k, False: 319]
  ------------------
 1529|  2.81k|                       ((cur[2] == 0) || xmlIsPathSeparator(cur[2], isFile))) {
  ------------------
  |  Branch (1529:25): [True: 59, False: 2.43k]
  |  Branch (1529:42): [True: 1.68k, False: 752]
  ------------------
 1530|  1.74k|                if (numSeg > 0) {
  ------------------
  |  Branch (1530:21): [True: 593, False: 1.15k]
  ------------------
 1531|       |                    /* Handle ".." by removing last segment */
 1532|  3.23k|                    do {
 1533|  3.23k|                        out--;
 1534|  3.23k|                    } while ((out > path) &&
  ------------------
  |  Branch (1534:30): [True: 2.94k, False: 285]
  ------------------
 1535|  3.23k|                             !xmlIsPathSeparator(out[-1], isFile));
  ------------------
  |  Branch (1535:30): [True: 2.64k, False: 308]
  ------------------
 1536|    593|                    numSeg--;
 1537|       |
 1538|    593|                    if (cur[2] == 0)
  ------------------
  |  Branch (1538:25): [True: 34, False: 559]
  ------------------
 1539|     34|                        break;
 1540|    559|                    cur += 3;
 1541|    559|                    continue;
 1542|  1.15k|                } else if (out[0] == '/') {
  ------------------
  |  Branch (1542:28): [True: 581, False: 569]
  ------------------
 1543|       |                    /* Ignore extraneous ".." in absolute paths */
 1544|    581|                    if (cur[2] == 0)
  ------------------
  |  Branch (1544:25): [True: 6, False: 575]
  ------------------
 1545|      6|                        break;
 1546|    575|                    cur += 3;
 1547|    575|                    continue;
 1548|    581|                } else {
 1549|       |                    /* Keep "../" at start of relative path */
 1550|    569|                    numSeg--;
 1551|    569|                }
 1552|  1.74k|            }
 1553|  3.76k|        }
 1554|       |
 1555|       |        /* Copy segment */
 1556|   486k|        while ((*cur != 0) && !xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1556:16): [True: 481k, False: 4.44k]
  |  Branch (1556:31): [True: 422k, False: 58.8k]
  ------------------
 1557|   422k|            *out++ = *cur++;
 1558|   422k|        }
 1559|       |
 1560|       |        /* Copy separator */
 1561|  63.3k|        if (*cur != 0) {
  ------------------
  |  Branch (1561:13): [True: 58.8k, False: 4.44k]
  ------------------
 1562|  58.8k|            cur++;
 1563|  58.8k|            *out++ = '/';
 1564|  58.8k|        }
 1565|       |
 1566|  63.3k|        numSeg++;
 1567|  63.3k|    }
 1568|       |
 1569|       |    /* Keep "." if output is empty and it's a file */
 1570|  4.88k|    if ((isFile) && (out <= path))
  ------------------
  |  Branch (1570:9): [True: 426, False: 4.45k]
  |  Branch (1570:21): [True: 49, False: 377]
  ------------------
 1571|     49|        *out++ = '.';
 1572|  4.88k|    *out = 0;
 1573|       |
 1574|  4.88k|    return(0);
 1575|  4.96k|}
uri.c:xmlIsPathSeparator:
 1464|   772k|xmlIsPathSeparator(int c, int isFile) {
 1465|   772k|    (void) isFile;
 1466|       |
 1467|   772k|    if (c == '/')
  ------------------
  |  Branch (1467:9): [True: 236k, False: 536k]
  ------------------
 1468|   236k|        return(1);
 1469|       |
 1470|       |#ifdef _WIN32
 1471|       |    if (isFile && (c == '\\'))
 1472|       |        return(1);
 1473|       |#endif
 1474|       |
 1475|   536k|    return(0);
 1476|   772k|}
uri.c:is_hex:
 1593|  28.0k|static int is_hex(char c) {
 1594|  28.0k|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1594:10): [True: 22.8k, False: 5.21k]
  |  Branch (1594:24): [True: 4.60k, False: 18.2k]
  ------------------
 1595|  28.0k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1595:10): [True: 8.79k, False: 14.6k]
  |  Branch (1595:24): [True: 8.05k, False: 745]
  ------------------
 1596|  28.0k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1596:10): [True: 10.0k, False: 5.37k]
  |  Branch (1596:24): [True: 8.97k, False: 1.08k]
  ------------------
 1597|  21.6k|	return(1);
 1598|  6.46k|    return(0);
 1599|  28.0k|}
uri.c:xmlResolvePath:
 1899|    868|xmlResolvePath(const xmlChar *escRef, const xmlChar *base, xmlChar **out) {
 1900|    868|    const xmlChar *fragment;
 1901|    868|    xmlChar *tmp = NULL;
 1902|    868|    xmlChar *ref = NULL;
 1903|    868|    xmlChar *result = NULL;
 1904|    868|    int ret = -1;
 1905|    868|    int i;
 1906|       |
 1907|    868|    if (out == NULL)
  ------------------
  |  Branch (1907:9): [True: 0, False: 868]
  ------------------
 1908|      0|        return(1);
 1909|    868|    *out = NULL;
 1910|       |
 1911|    868|    if ((escRef == NULL) || (escRef[0] == 0)) {
  ------------------
  |  Branch (1911:9): [True: 0, False: 868]
  |  Branch (1911:29): [True: 22, False: 846]
  ------------------
 1912|     22|        if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1912:13): [True: 0, False: 22]
  |  Branch (1912:31): [True: 6, False: 16]
  ------------------
 1913|      6|            return(1);
 1914|     16|        ref = xmlStrdup(base);
 1915|     16|        if (ref == NULL)
  ------------------
  |  Branch (1915:13): [True: 1, False: 15]
  ------------------
 1916|      1|            goto err_memory;
 1917|     15|        *out = ref;
 1918|     15|        return(0);
 1919|     16|    }
 1920|       |
 1921|       |    /*
 1922|       |     * If a URI is resolved, we can assume it is a valid URI and not
 1923|       |     * a filesystem path. This means we have to unescape the part
 1924|       |     * before the fragment.
 1925|       |     */
 1926|    846|    fragment = xmlStrchr(escRef, '#');
 1927|    846|    if (fragment != NULL) {
  ------------------
  |  Branch (1927:9): [True: 68, False: 778]
  ------------------
 1928|     68|        tmp = xmlStrndup(escRef, fragment - escRef);
 1929|     68|        if (tmp == NULL)
  ------------------
  |  Branch (1929:13): [True: 1, False: 67]
  ------------------
 1930|      1|            goto err_memory;
 1931|     67|        escRef = tmp;
 1932|     67|    }
 1933|       |
 1934|    845|    ref = (xmlChar *) xmlURIUnescapeString((char *) escRef, -1, NULL);
 1935|    845|    if (ref == NULL)
  ------------------
  |  Branch (1935:9): [True: 7, False: 838]
  ------------------
 1936|      7|        goto err_memory;
 1937|       |
 1938|    838|    if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1938:9): [True: 0, False: 838]
  |  Branch (1938:27): [True: 77, False: 761]
  ------------------
 1939|     77|        goto done;
 1940|       |
 1941|    761|    if (xmlIsAbsolutePath(ref))
  ------------------
  |  Branch (1941:9): [True: 30, False: 731]
  ------------------
 1942|     30|        goto done;
 1943|       |
 1944|       |    /*
 1945|       |     * Remove last segment from base
 1946|       |     */
 1947|    731|    i = xmlStrlen(base);
 1948|  38.4k|    while ((i > 0) && !xmlIsPathSeparator(base[i-1], 1))
  ------------------
  |  Branch (1948:12): [True: 38.1k, False: 302]
  |  Branch (1948:23): [True: 37.6k, False: 429]
  ------------------
 1949|  37.6k|        i--;
 1950|       |
 1951|       |    /*
 1952|       |     * Concatenate base and ref
 1953|       |     */
 1954|    731|    if (i > 0) {
  ------------------
  |  Branch (1954:9): [True: 429, False: 302]
  ------------------
 1955|    429|        int refLen = xmlStrlen(ref);
 1956|       |
 1957|    429|        result = xmlMalloc(i + refLen + 1);
 1958|    429|        if (result == NULL)
  ------------------
  |  Branch (1958:13): [True: 3, False: 426]
  ------------------
 1959|      3|            goto err_memory;
 1960|       |
 1961|    426|        memcpy(result, base, i);
 1962|    426|        memcpy(result + i, ref, refLen + 1);
 1963|    426|    }
 1964|       |
 1965|       |    /*
 1966|       |     * Normalize
 1967|       |     */
 1968|    728|    xmlNormalizePath((char *) result, 1);
 1969|       |
 1970|    835|done:
 1971|    835|    if (result == NULL) {
  ------------------
  |  Branch (1971:9): [True: 409, False: 426]
  ------------------
 1972|    409|        result = ref;
 1973|    409|        ref = NULL;
 1974|    409|    }
 1975|       |
 1976|    835|    if (fragment != NULL) {
  ------------------
  |  Branch (1976:9): [True: 66, False: 769]
  ------------------
 1977|     66|        result = xmlStrcat(result, fragment);
 1978|     66|        if (result == NULL)
  ------------------
  |  Branch (1978:13): [True: 1, False: 65]
  ------------------
 1979|      1|            goto err_memory;
 1980|     66|    }
 1981|       |
 1982|    834|    *out = result;
 1983|    834|    ret = 0;
 1984|       |
 1985|    847|err_memory:
 1986|    847|    xmlFree(tmp);
 1987|    847|    xmlFree(ref);
 1988|    847|    return(ret);
 1989|    834|}
uri.c:xmlIsAbsolutePath:
 1871|    761|xmlIsAbsolutePath(const xmlChar *path) {
 1872|    761|    int c = path[0];
 1873|       |
 1874|    761|    if (xmlIsPathSeparator(c, 1))
  ------------------
  |  Branch (1874:9): [True: 30, False: 731]
  ------------------
 1875|     30|        return(1);
 1876|       |
 1877|       |#ifdef _WIN32
 1878|       |    if ((((c >= 'A') && (c <= 'Z')) ||
 1879|       |         ((c >= 'a') && (c <= 'z'))) &&
 1880|       |        (path[1] == ':'))
 1881|       |        return(1);
 1882|       |#endif
 1883|       |
 1884|    731|    return(0);
 1885|    761|}

xmlInitIOCallbacks:
 2866|      2|{
 2867|      2|    xmlInputCallbackNr = 1;
 2868|      2|    xmlInputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2869|       |
 2870|      2|#ifdef LIBXML_OUTPUT_ENABLED
 2871|      2|    xmlOutputCallbackNr = 1;
 2872|      2|    xmlOutputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2873|      2|#endif
 2874|      2|}

xmlInitMemoryInternal:
  846|      2|xmlInitMemoryInternal(void) {
  847|      2|     char *breakpoint;
  848|      2|     xmlInitMutex(&xmlMemMutex);
  849|       |
  850|      2|     breakpoint = getenv("XML_MEM_BREAKPOINT");
  851|      2|     if (breakpoint != NULL) {
  ------------------
  |  Branch (851:10): [True: 0, False: 2]
  ------------------
  852|      0|         sscanf(breakpoint, "%ud", &xmlMemStopAtBlock);
  853|      0|     }
  854|      2|     breakpoint = getenv("XML_MEM_TRACE");
  855|      2|     if (breakpoint != NULL) {
  ------------------
  |  Branch (855:10): [True: 0, False: 2]
  ------------------
  856|      0|         sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
  857|      0|     }
  858|       |
  859|      2|}
xmlMemSetup:
  910|      2|            xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc) {
  911|      2|    if (freeFunc == NULL)
  ------------------
  |  Branch (911:9): [True: 0, False: 2]
  ------------------
  912|      0|	return(-1);
  913|      2|    if (mallocFunc == NULL)
  ------------------
  |  Branch (913:9): [True: 0, False: 2]
  ------------------
  914|      0|	return(-1);
  915|      2|    if (reallocFunc == NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 2]
  ------------------
  916|      0|	return(-1);
  917|      2|    if (strdupFunc == NULL)
  ------------------
  |  Branch (917:9): [True: 0, False: 2]
  ------------------
  918|      0|	return(-1);
  919|      2|    xmlFree = freeFunc;
  920|      2|    xmlMalloc = mallocFunc;
  921|      2|    xmlMallocAtomic = mallocFunc;
  922|      2|    xmlRealloc = reallocFunc;
  923|      2|    xmlMemStrdup = strdupFunc;
  924|      2|    return(0);
  925|      2|}

xmlStrndup:
   53|  25.3k|xmlStrndup(const xmlChar *cur, int len) {
   54|  25.3k|    xmlChar *ret;
   55|       |
   56|  25.3k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (56:9): [True: 0, False: 25.3k]
  |  Branch (56:26): [True: 0, False: 25.3k]
  ------------------
   57|  25.3k|    ret = (xmlChar *) xmlMallocAtomic((size_t) len + 1);
   58|  25.3k|    if (ret == NULL) {
  ------------------
  |  Branch (58:9): [True: 190, False: 25.1k]
  ------------------
   59|    190|        return(NULL);
   60|    190|    }
   61|  25.1k|    memcpy(ret, cur, len);
   62|  25.1k|    ret[len] = 0;
   63|  25.1k|    return(ret);
   64|  25.3k|}
xmlStrdup:
   77|  11.6k|xmlStrdup(const xmlChar *cur) {
   78|  11.6k|    const xmlChar *p = cur;
   79|       |
   80|  11.6k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (80:9): [True: 0, False: 11.6k]
  ------------------
   81|   904k|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (81:12): [True: 892k, False: 11.6k]
  ------------------
   82|  11.6k|    return(xmlStrndup(cur, p - cur));
   83|  11.6k|}
xmlCharStrndup:
   96|  5.24k|xmlCharStrndup(const char *cur, int len) {
   97|  5.24k|    int i;
   98|  5.24k|    xmlChar *ret;
   99|       |
  100|  5.24k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (100:9): [True: 0, False: 5.24k]
  |  Branch (100:26): [True: 0, False: 5.24k]
  ------------------
  101|  5.24k|    ret = (xmlChar *) xmlMallocAtomic((size_t) len + 1);
  102|  5.24k|    if (ret == NULL) {
  ------------------
  |  Branch (102:9): [True: 46, False: 5.19k]
  ------------------
  103|     46|        return(NULL);
  104|     46|    }
  105|   508k|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (105:16): [True: 502k, False: 5.19k]
  ------------------
  106|       |        /* Explicit sign change */
  107|   502k|        ret[i] = (xmlChar) cur[i];
  108|   502k|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (108:13): [True: 0, False: 502k]
  ------------------
  109|   502k|    }
  110|  5.19k|    ret[len] = 0;
  111|  5.19k|    return(ret);
  112|  5.19k|}
xmlCharStrdup:
  124|  5.24k|xmlCharStrdup(const char *cur) {
  125|  5.24k|    const char *p = cur;
  126|       |
  127|  5.24k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (127:9): [True: 4, False: 5.24k]
  ------------------
  128|   508k|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (128:12): [True: 503k, False: 5.24k]
  ------------------
  129|  5.24k|    return(xmlCharStrndup(cur, p - cur));
  130|  5.24k|}
xmlStrcmp:
  143|    550|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  144|    550|    if (str1 == str2) return(0);
  ------------------
  |  Branch (144:9): [True: 100, False: 450]
  ------------------
  145|    450|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (145:9): [True: 3, False: 447]
  ------------------
  146|    447|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (146:9): [True: 3, False: 444]
  ------------------
  147|    444|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  148|    444|    return(strcmp((const char *)str1, (const char *)str2));
  149|       |#else
  150|       |    do {
  151|       |        int tmp = *str1++ - *str2;
  152|       |        if (tmp != 0) return(tmp);
  153|       |    } while (*str2++ != 0);
  154|       |    return 0;
  155|       |#endif
  156|    447|}
xmlStrEqual:
  170|  1.89k|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  171|  1.89k|    if (str1 == str2) return(1);
  ------------------
  |  Branch (171:9): [True: 219, False: 1.67k]
  ------------------
  172|  1.67k|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (172:9): [True: 465, False: 1.21k]
  ------------------
  173|  1.21k|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (173:9): [True: 139, False: 1.07k]
  ------------------
  174|  1.07k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  175|  1.07k|    return(strcmp((const char *)str1, (const char *)str2) == 0);
  176|       |#else
  177|       |    do {
  178|       |        if (*str1++ != *str2) return(0);
  179|       |    } while (*str2++);
  180|       |    return(1);
  181|       |#endif
  182|  1.21k|}
xmlStrncmp:
  223|  23.8k|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  224|  23.8k|    if (len <= 0) return(0);
  ------------------
  |  Branch (224:9): [True: 0, False: 23.8k]
  ------------------
  225|  23.8k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (225:9): [True: 0, False: 23.8k]
  ------------------
  226|  23.8k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (226:9): [True: 0, False: 23.8k]
  ------------------
  227|  23.8k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (227:9): [True: 0, False: 23.8k]
  ------------------
  228|  23.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  229|  23.8k|    return(strncmp((const char *)str1, (const char *)str2, len));
  230|       |#else
  231|       |    do {
  232|       |        int tmp = *str1++ - *str2;
  233|       |        if (tmp != 0 || --len == 0) return(tmp);
  234|       |    } while (*str2++ != 0);
  235|       |    return 0;
  236|       |#endif
  237|  23.8k|}
xmlStrchr:
  335|  1.21M|xmlStrchr(const xmlChar *str, xmlChar val) {
  336|  1.21M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (336:9): [True: 234k, False: 983k]
  ------------------
  337|  6.86M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (337:12): [True: 6.23M, False: 629k]
  ------------------
  338|  6.23M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (338:13): [True: 354k, False: 5.88M]
  ------------------
  339|  5.88M|        str++;
  340|  5.88M|    }
  341|   629k|    return(NULL);
  342|   983k|}
xmlStrstr:
  355|  10.0k|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  356|  10.0k|    int n;
  357|       |
  358|  10.0k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (358:9): [True: 0, False: 10.0k]
  ------------------
  359|  10.0k|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (359:9): [True: 0, False: 10.0k]
  ------------------
  360|  10.0k|    n = xmlStrlen(val);
  361|       |
  362|  10.0k|    if (n == 0) return(str);
  ------------------
  |  Branch (362:9): [True: 0, False: 10.0k]
  ------------------
  363|   943k|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (363:12): [True: 936k, False: 7.00k]
  ------------------
  364|   936k|        if (*str == *val) {
  ------------------
  |  Branch (364:13): [True: 23.8k, False: 912k]
  ------------------
  365|  23.8k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (365:17): [True: 3.02k, False: 20.8k]
  ------------------
  366|  23.8k|        }
  367|   933k|        str++;
  368|   933k|    }
  369|  7.00k|    return(NULL);
  370|  10.0k|}
xmlStrlen:
  436|  26.3k|xmlStrlen(const xmlChar *str) {
  437|  26.3k|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (437:18): [True: 26.3k, False: 0]
  ------------------
  438|  26.3k|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (438:12): [True: 0, False: 26.3k]
  ------------------
  439|  26.3k|}
xmlStrncat:
  456|  4.27k|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  457|  4.27k|    int size;
  458|  4.27k|    xmlChar *ret;
  459|       |
  460|  4.27k|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (460:9): [True: 0, False: 4.27k]
  |  Branch (460:26): [True: 190, False: 4.08k]
  ------------------
  461|    190|        return(cur);
  462|  4.08k|    if (len < 0)
  ------------------
  |  Branch (462:9): [True: 0, False: 4.08k]
  ------------------
  463|      0|	return(NULL);
  464|  4.08k|    if (cur == NULL)
  ------------------
  |  Branch (464:9): [True: 0, False: 4.08k]
  ------------------
  465|      0|        return(xmlStrndup(add, len));
  466|       |
  467|  4.08k|    size = xmlStrlen(cur);
  468|  4.08k|    if ((size < 0) || (size > INT_MAX - len))
  ------------------
  |  Branch (468:9): [True: 0, False: 4.08k]
  |  Branch (468:23): [True: 0, False: 4.08k]
  ------------------
  469|      0|        return(NULL);
  470|  4.08k|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  471|  4.08k|    if (ret == NULL) {
  ------------------
  |  Branch (471:9): [True: 22, False: 4.06k]
  ------------------
  472|     22|        xmlFree(cur);
  473|     22|        return(NULL);
  474|     22|    }
  475|  4.06k|    memcpy(&ret[size], add, len);
  476|  4.06k|    ret[size + len] = 0;
  477|  4.06k|    return(ret);
  478|  4.08k|}
xmlStrcat:
  532|  7.06k|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  533|  7.06k|    const xmlChar *p = add;
  534|       |
  535|  7.06k|    if (add == NULL) return(cur);
  ------------------
  |  Branch (535:9): [True: 0, False: 7.06k]
  ------------------
  536|  7.06k|    if (cur == NULL)
  ------------------
  |  Branch (536:9): [True: 2.79k, False: 4.27k]
  ------------------
  537|  2.79k|        return(xmlStrdup(add));
  538|       |
  539|  1.23M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (539:12): [True: 1.22M, False: 4.27k]
  ------------------
  540|  4.27k|    return(xmlStrncat(cur, add, p - add));
  541|  7.06k|}

xmlInitXPathInternal:
  166|      2|xmlInitXPathInternal(void) {
  167|      2|#if defined(NAN) && defined(INFINITY)
  168|      2|    xmlXPathNAN = NAN;
  169|      2|    xmlXPathPINF = INFINITY;
  170|      2|    xmlXPathNINF = -INFINITY;
  171|       |#else
  172|       |    /* MSVC doesn't allow division by zero in constant expressions. */
  173|       |    double zero = 0.0;
  174|       |    xmlXPathNAN = 0.0 / zero;
  175|       |    xmlXPathPINF = 1.0 / zero;
  176|       |    xmlXPathNINF = -xmlXPathPINF;
  177|       |#endif
  178|      2|}

