UA_base64_buf:
   36|    522|UA_base64_buf(const unsigned char *src, size_t len, unsigned char *out) {
   37|    522|    const unsigned char *end = src + len;
   38|    522|    const unsigned char *in = src;
   39|    522|    unsigned char *pos = out;
   40|    522|    while(end - in >= 3) {
  ------------------
  |  Branch (40:11): [True: 0, False: 522]
  ------------------
   41|      0|        *pos++ = base64_table[in[0] >> 2];
   42|      0|        *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)];
   43|      0|        *pos++ = base64_table[((in[1] & 0x0f) << 2) | (in[2] >> 6)];
   44|      0|        *pos++ = base64_table[in[2] & 0x3f];
   45|      0|        in += 3;
   46|      0|    }
   47|       |
   48|    522|    if(end - in) {
  ------------------
  |  Branch (48:8): [True: 142, False: 380]
  ------------------
   49|    142|        *pos++ = base64_table[in[0] >> 2];
   50|    142|        if(end - in == 1) {
  ------------------
  |  Branch (50:12): [True: 0, False: 142]
  ------------------
   51|      0|            *pos++ = base64_table[(in[0] & 0x03) << 4];
   52|      0|            *pos++ = '=';
   53|    142|        } else {
   54|    142|            *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)];
   55|    142|            *pos++ = base64_table[(in[1] & 0x0f) << 2];
   56|    142|        }
   57|    142|        *pos++ = '=';
   58|    142|    }
   59|       |
   60|    522|    return (size_t)(pos - out);
   61|    522|}
UA_unbase64:
   75|    685|UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) {
   76|       |    /* Empty base64 results in an empty byte-string */
   77|    685|    if(len == 0) {
  ------------------
  |  Branch (77:8): [True: 381, False: 304]
  ------------------
   78|    381|        *out_len = 0;
   79|    381|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    381|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
   80|    381|    }
   81|       |
   82|       |    /* Allocate the output string. Append four bytes to allow missing padding */
   83|    304|    size_t olen = (len / 4 * 3) + 4;
   84|    304|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |   18|    304|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   85|    304|    if(!out)
  ------------------
  |  Branch (85:8): [True: 20, False: 284]
  ------------------
   86|     20|        return NULL;
   87|       |
   88|       |    /* Iterate over the input */
   89|    284|    size_t pad = 0;
   90|    284|    unsigned char count = 0;
   91|    284|    unsigned char block[4];
   92|    284|    unsigned char *pos = out;
   93|  5.89k|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (93:23): [True: 5.62k, False: 270]
  ------------------
   94|  5.62k|        if(src[i] & 0x80)
  ------------------
  |  Branch (94:12): [True: 8, False: 5.61k]
  ------------------
   95|      8|            goto error; /* Non-ASCII input */
   96|  5.61k|        unsigned char tmp = dtable[src[i]];
   97|  5.61k|        if(tmp == 0x80)
  ------------------
  |  Branch (97:12): [True: 4, False: 5.60k]
  ------------------
   98|      4|            goto error; /* Not an allowed character */
   99|  5.60k|        if(tmp == 0x7f)
  ------------------
  |  Branch (99:12): [True: 194, False: 5.41k]
  ------------------
  100|    194|            continue; /* Whitespace is ignored to accomodate RFC 2045, used in
  101|       |                       * XML for xs:base64Binary. */
  102|  5.41k|        block[count++] = tmp;
  103|       |
  104|       |        /* Padding */
  105|  5.41k|        if(src[i] == '=') {
  ------------------
  |  Branch (105:12): [True: 144, False: 5.27k]
  ------------------
  106|    144|            if(count < 3) /* Padding can only be the last two bytes of a block */
  ------------------
  |  Branch (106:16): [True: 2, False: 142]
  ------------------
  107|      2|                goto error;
  108|    142|            block[count-1] = 0;
  109|    142|            pad++;
  110|  5.27k|        } else if(pad > 0) {
  ------------------
  |  Branch (110:19): [True: 0, False: 5.27k]
  ------------------
  111|      0|            goto error; /* Padding not terminated correctly */
  112|      0|        }
  113|       |
  114|       |        /* Write three output characters for four characters of input */
  115|  5.41k|        if(count == 4) {
  ------------------
  |  Branch (115:12): [True: 1.35k, False: 4.06k]
  ------------------
  116|  1.35k|            if(pad > 2)
  ------------------
  |  Branch (116:16): [True: 0, False: 1.35k]
  ------------------
  117|      0|                goto error; /* Invalid padding */
  118|  1.35k|            *pos++ = (block[0] << 2) | (block[1] >> 4);
  119|  1.35k|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  120|  1.35k|            *pos++ = (block[2] << 6) | block[3];
  121|  1.35k|            count = 0;
  122|  1.35k|            pos -= pad;
  123|  1.35k|            pad = 0;
  124|  1.35k|        }
  125|  5.41k|    }
  126|       |
  127|       |    /* Input length not a multiple of four */
  128|    270|    if(count > 0)
  ------------------
  |  Branch (128:8): [True: 0, False: 270]
  ------------------
  129|      0|        goto error;
  130|       |
  131|    270|    *out_len = (size_t)(pos - out);
  132|    270|    if(*out_len == 0) {
  ------------------
  |  Branch (132:8): [True: 128, False: 142]
  ------------------
  133|    128|        UA_free(out);
  ------------------
  |  |   19|    128|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  134|    128|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    128|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  135|    128|    }
  136|    142|    return out;
  137|       |
  138|     14| error:
  139|     14|    UA_free(out);
  ------------------
  |  |   19|     14|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  140|       |    return NULL;
  141|    270|}

itoaUnsigned:
   42|    166|UA_UInt16 itoaUnsigned(UA_UInt64 value, char* buffer, UA_Byte base) {
   43|       |    /* consider absolute value of number */
   44|    166|    UA_UInt64 n = value;
   45|       |
   46|    166|    UA_UInt16 i = 0;
   47|    844|    while (n) {
  ------------------
  |  Branch (47:12): [True: 678, False: 166]
  ------------------
   48|    678|        UA_UInt64 r = n % base;
   49|       |
   50|    678|        if (r >= 10)
  ------------------
  |  Branch (50:13): [True: 0, False: 678]
  ------------------
   51|      0|            buffer[i++] = (char)(65 + (r - 10));
   52|    678|        else
   53|    678|            buffer[i++] = (char)(48 + r);
   54|       |
   55|    678|        n = n / base;
   56|    678|    }
   57|       |    /* if number is 0 */
   58|    166|    if (i == 0)
  ------------------
  |  Branch (58:9): [True: 32, False: 134]
  ------------------
   59|     32|        buffer[i++] = '0';
   60|       |
   61|    166|    buffer[i] = '\0'; /* null terminate string */
   62|    166|    i--;
   63|       |    /* reverse the string */
   64|    166|    reverse(buffer, 0, i);
   65|    166|    i++;
   66|    166|    return i;
   67|    166|}
itoa.c:reverse:
   34|    166|static char* reverse(char *buffer, UA_UInt16 i, UA_UInt16 j) {
   35|    472|    while (i < j)
  ------------------
  |  Branch (35:12): [True: 306, False: 166]
  ------------------
   36|    306|        swap(&buffer[i++], &buffer[j--]);
   37|       |
   38|    166|    return buffer;
   39|    166|}
itoa.c:swap:
   27|    306|static void swap(char *x, char *y) {
   28|    306|    char t = *x;
   29|    306|    *x = *y;
   30|    306|    *y = t;
   31|    306|}

UA_STRING:
  220|  79.5k|UA_STRING(char *chars) {
  221|  79.5k|    UA_String s = {0, NULL};
  222|  79.5k|    if(!chars)
  ------------------
  |  Branch (222:8): [True: 0, False: 79.5k]
  ------------------
  223|      0|        return s;
  224|  79.5k|    s.length = strlen(chars);
  225|  79.5k|    s.data = (UA_Byte*)chars;
  226|  79.5k|    return s;
  227|  79.5k|}
UA_String_append:
  296|  80.0k|UA_String_append(UA_String *s, const UA_String s2) {
  297|  80.0k|    if(s2.length == 0)
  ------------------
  |  Branch (297:8): [True: 22, False: 79.9k]
  ------------------
  298|     22|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     22|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  299|  79.9k|    UA_Byte *buf = (UA_Byte*)UA_realloc(s->data, s->length + s2.length);
  ------------------
  |  |   21|  79.9k|#define UA_realloc(ptr, size) UA_reallocSingleton(ptr, size)
  ------------------
  300|  79.9k|    if(!buf)
  ------------------
  |  Branch (300:8): [True: 0, False: 79.9k]
  ------------------
  301|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  302|  79.9k|    memcpy(buf + s->length, s2.data, s2.length);
  303|  79.9k|    s->data = buf;
  304|  79.9k|    s->length += s2.length;
  305|  79.9k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  79.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  306|  79.9k|}
UA_ByteString_allocBuffer:
  758|    840|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  759|    840|    UA_ByteString_init(bs);
  760|    840|    if(length == 0) {
  ------------------
  |  Branch (760:8): [True: 0, False: 840]
  ------------------
  761|      0|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  762|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  763|      0|    }
  764|    840|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|    840|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  765|    840|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  565|    840|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (565:25): [True: 0, False: 840]
  |  |  ------------------
  ------------------
  766|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  767|    840|    bs->length = length;
  768|    840|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    840|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  769|    840|}
UA_NODEID_NUMERIC:
  828|  74.1k|UA_NODEID_NUMERIC(UA_UInt16 nsIndex, UA_UInt32 identifier) {
  829|  74.1k|    UA_NodeId id;
  830|  74.1k|    memset(&id, 0, sizeof(UA_NodeId));
  831|  74.1k|    id.namespaceIndex = nsIndex;
  832|  74.1k|    id.identifierType = UA_NODEIDTYPE_NUMERIC;
  833|  74.1k|    id.identifier.numeric = identifier;
  834|  74.1k|    return id;
  835|  74.1k|}
nodeId_printEscape:
 1022|  3.82k|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1023|       |    /* Try to map the NamespaceIndex to the Uri */
 1024|  3.82k|    UA_String nsUri = UA_STRING_NULL;
 1025|  3.82k|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1025:8): [True: 56, False: 3.76k]
  |  Branch (1025:34): [True: 0, False: 56]
  ------------------
 1026|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1027|       |
 1028|       |    /* Compute the string length and print numerical identifiers. */
 1029|  3.82k|    u8 nsStr[7];
 1030|  3.82k|    u8 numIdStr[12];
 1031|  3.82k|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1032|  3.82k|    if(idLen == 0)
  ------------------
  |  Branch (1032:8): [True: 0, False: 3.82k]
  ------------------
 1033|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1034|       |
 1035|       |    /* Allocate memory if required */
 1036|  3.82k|    if(output->length == 0) {
  ------------------
  |  Branch (1036:8): [True: 840, False: 2.98k]
  ------------------
 1037|    840|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1038|    840|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    840|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1038:12): [True: 0, False: 840]
  ------------------
 1039|      0|            return res;
 1040|  2.98k|    } else {
 1041|  2.98k|        if(output->length < idLen)
  ------------------
  |  Branch (1041:12): [True: 840, False: 2.14k]
  ------------------
 1042|    840|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|    840|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1043|  2.14k|        output->length = idLen;
 1044|  2.14k|    }
 1045|       |
 1046|       |    /* Print the NodeId */
 1047|  2.98k|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1048|  2.98k|    output->length = (size_t)(pos - output->data);
 1049|  2.98k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.98k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1050|  3.82k|}
UA_NodeId_printEx:
 1054|  3.69k|                  const UA_NamespaceMapping *nsMapping) {
 1055|  3.69k|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1056|  3.69k|}
UA_NodeId_print:
 1059|  3.69k|UA_NodeId_print(const UA_NodeId *id, UA_String *output) {
 1060|       |    return UA_NodeId_printEx(id, output, NULL);
 1061|  3.69k|}
UA_copy:
 2059|  81.6k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2060|  81.6k|    memset(dst, 0, type->memSize); /* init */
 2061|  81.6k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2062|  81.6k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  81.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2062:8): [True: 29, False: 81.6k]
  ------------------
 2063|     29|        UA_clear(dst, type);
 2064|  81.6k|    return retval;
 2065|  81.6k|}
UA_clear:
 2162|  80.2k|UA_clear(void *p, const UA_DataType *type) {
 2163|  80.2k|    clearJumpTable[type->typeKind](p, type);
 2164|  80.2k|    memset(p, 0, type->memSize); /* init */
 2165|  80.2k|}
UA_order:
 2616|  79.5k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2617|  79.5k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2618|  79.5k|}
UA_equal:
 2621|    154|UA_equal(const void *p1, const void *p2, const UA_DataType *type) {
 2622|    154|    return (UA_order(p1, p2, type) == UA_ORDER_EQ);
 2623|    154|}
UA_Array_copy:
 2640|  81.6k|              void **dst, const UA_DataType *type) {
 2641|  81.6k|    if(size == 0) {
  ------------------
  |  Branch (2641:8): [True: 76.6k, False: 5.03k]
  ------------------
 2642|  76.6k|        if(src == NULL)
  ------------------
  |  Branch (2642:12): [True: 0, False: 76.6k]
  ------------------
 2643|      0|            *dst = NULL;
 2644|  76.6k|        else
 2645|  76.6k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  76.6k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2646|  76.6k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  76.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2647|  76.6k|    }
 2648|       |
 2649|       |    /* Check the array consistency -- defensive programming in case the user
 2650|       |     * manually created an inconsistent array */
 2651|  5.03k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  565|  10.0k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (565:25): [True: 0, False: 5.03k]
  |  |  |  Branch (565:43): [True: 0, False: 5.03k]
  |  |  |  Branch (565:43): [True: 0, False: 5.03k]
  |  |  ------------------
  ------------------
 2652|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2653|       |
 2654|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2655|  5.03k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  5.03k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2656|  5.03k|    if(!*dst)
  ------------------
  |  Branch (2656:8): [True: 29, False: 5.00k]
  ------------------
 2657|     29|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|     29|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2658|       |
 2659|  5.00k|    if(type->pointerFree) {
  ------------------
  |  Branch (2659:8): [True: 5.00k, False: 0]
  ------------------
 2660|  5.00k|        memcpy(*dst, src, type->memSize * size);
 2661|  5.00k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  5.00k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2662|  5.00k|    }
 2663|       |
 2664|      0|    uintptr_t ptrs = (uintptr_t)src;
 2665|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2666|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2667|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2667:23): [True: 0, False: 0]
  ------------------
 2668|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2669|      0|        ptrs += type->memSize;
 2670|      0|        ptrd += type->memSize;
 2671|      0|    }
 2672|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2672:8): [True: 0, False: 0]
  ------------------
 2673|      0|        UA_Array_delete(*dst, size, type);
 2674|       |        *dst = NULL;
 2675|      0|    }
 2676|      0|    return retval;
 2677|  5.00k|}
UA_Array_delete:
 2768|  85.1k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2769|  85.1k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2769:8): [True: 450, False: 84.6k]
  ------------------
 2770|    450|        uintptr_t ptr = (uintptr_t)p;
 2771|  78.1k|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2771:27): [True: 77.6k, False: 450]
  ------------------
 2772|  77.6k|            UA_clear((void*)ptr, type);
 2773|  77.6k|            ptr += type->memSize;
 2774|  77.6k|        }
 2775|    450|    }
 2776|  85.1k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|  85.1k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2777|  85.1k|}
ua_types.c:nodeIdSize:
  921|  3.82k|           UA_Escaping idEsc) {
  922|       |    /* Namespace length */
  923|  3.82k|    size_t len = 0;
  924|  3.82k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (924:8): [True: 0, False: 3.82k]
  ------------------
  925|      0|        len += 5; /* nsu=; */
  926|      0|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  927|  3.82k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (927:15): [True: 56, False: 3.76k]
  ------------------
  928|     56|        len += 4; /* ns=; */
  929|     56|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  930|     56|        nsStr[nsStrSize] = 0;
  931|     56|        len += nsStrSize;
  932|     56|    }
  933|       |
  934|  3.82k|    len += 2; /* ?= */
  935|       |
  936|  3.82k|    switch (id->identifierType) {
  937|     94|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (937:5): [True: 94, False: 3.73k]
  ------------------
  938|     94|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  939|     94|        numIdStr[numIdStrSize] = 0;
  940|     94|        len += numIdStrSize;
  941|     94|        break;
  942|      0|    }
  943|  3.20k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (943:5): [True: 3.20k, False: 616]
  ------------------
  944|  3.20k|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  945|  3.20k|        break;
  946|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (946:5): [True: 0, False: 3.82k]
  ------------------
  947|      0|        len += 36;
  948|      0|        break;
  949|    522|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (949:5): [True: 522, False: 3.30k]
  ------------------
  950|    522|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  951|    522|        break;
  952|      0|    default:
  ------------------
  |  Branch (952:5): [True: 0, False: 3.82k]
  ------------------
  953|      0|        len = 0;
  954|  3.82k|    }
  955|  3.82k|    return len;
  956|  3.82k|}
ua_types.c:printNodeIdBody:
  960|  2.98k|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  961|  2.98k|    size_t len;
  962|       |
  963|       |    /* Encode the namespace */
  964|  2.98k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (964:8): [True: 0, False: 2.98k]
  ------------------
  965|      0|        memcpy(pos, "nsu=", 4);
  966|      0|        pos += 4;
  967|      0|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  968|      0|        *pos++ = ';';
  969|  2.98k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (969:15): [True: 56, False: 2.92k]
  ------------------
  970|     56|        memcpy(pos, "ns=", 3);
  971|     56|        pos += 3;
  972|     56|        len = strlen((char*)nsStr);
  973|     56|        memcpy(pos, nsStr, len);
  974|     56|        pos += len;
  975|     56|        *pos++ = ';';
  976|     56|    }
  977|       |
  978|       |    /* Encode the identifier */
  979|  2.98k|    switch(id->identifierType) {
  ------------------
  |  Branch (979:12): [True: 2.98k, False: 0]
  ------------------
  980|     94|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (980:5): [True: 94, False: 2.89k]
  ------------------
  981|     94|        memcpy(pos, "i=", 2);
  982|     94|        pos += 2;
  983|     94|        len = strlen((char*)numIdStr);
  984|     94|        memcpy(pos, numIdStr, len);
  985|     94|        pos += len;
  986|     94|        break;
  987|  2.36k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (987:5): [True: 2.36k, False: 616]
  ------------------
  988|  2.36k|        memcpy(pos, "s=", 2);
  989|  2.36k|        pos += 2;
  990|  2.36k|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  991|  2.36k|        break;
  992|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (992:5): [True: 0, False: 2.98k]
  ------------------
  993|      0|        memcpy(pos, "g=", 2);
  994|      0|        pos += 2;
  995|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
  996|      0|        pos += 36;
  997|      0|        break;
  998|    522|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (998:5): [True: 522, False: 2.46k]
  ------------------
  999|    522|        memcpy(pos, "b=", 2);
 1000|    522|        pos += 2;
 1001|       |        /* Use base64url encoding for percent-escaping.
 1002|       |         * Replace +/ with -_ and remove the padding. */
 1003|    522|        u8 *bpos = pos;
 1004|    522|        pos += UA_base64_buf(id->identifier.byteString.data,
 1005|    522|                             id->identifier.byteString.length, pos);
 1006|    522|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1006:12): [True: 0, False: 522]
  ------------------
 1007|    522|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1007:12): [True: 0, False: 522]
  ------------------
 1008|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1008:19): [True: 0, False: 0]
  |  Branch (1008:33): [True: 0, False: 0]
  ------------------
 1009|      0|                pos--;
 1010|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1010:19): [True: 0, False: 0]
  ------------------
 1011|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1011:20): [True: 0, False: 0]
  ------------------
 1012|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1012:25): [True: 0, False: 0]
  ------------------
 1013|      0|            }
 1014|      0|        }
 1015|    522|        break;
 1016|  2.98k|    }
 1017|  2.98k|    return pos;
 1018|  2.98k|}
ua_types.c:String_copy:
  281|  81.6k|String_copy(UA_String const *src, UA_String *dst, const UA_DataType *_) {
  282|  81.6k|    UA_StatusCode res =
  283|  81.6k|        UA_Array_copy(src->data, src->length, (void**)&dst->data,
  284|  81.6k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  81.6k|#define UA_TYPES_BYTE 2
  ------------------
  285|  81.6k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  81.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (285:8): [True: 81.6k, False: 29]
  ------------------
  286|  81.6k|        dst->length = src->length;
  287|  81.6k|    return res;
  288|  81.6k|}
ua_types.c:nopClear:
 2124|   155k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  291|  84.6k|String_clear(UA_String *s, const UA_DataType *_) {
  292|  84.6k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  84.6k|#define UA_TYPES_BYTE 2
  ------------------
  293|  84.6k|}
ua_types.c:NodeId_clear:
  773|  78.1k|NodeId_clear(UA_NodeId *p, const UA_DataType *_) {
  774|  78.1k|    switch(p->identifierType) {
  775|  3.31k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (775:5): [True: 3.31k, False: 74.8k]
  ------------------
  776|  3.97k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (776:5): [True: 657, False: 77.4k]
  ------------------
  777|  3.97k|        String_clear(&p->identifier.string, NULL);
  778|  3.97k|        break;
  779|  74.1k|    default: break;
  ------------------
  |  Branch (779:5): [True: 74.1k, False: 3.97k]
  ------------------
  780|  78.1k|    }
  781|  78.1k|}
ua_types.c:QualifiedName_clear:
  393|  78.3k|QualifiedName_clear(UA_QualifiedName *p, const UA_DataType *_) {
  394|       |    String_clear(&p->name, NULL);
  395|  78.3k|}
ua_types.c:clearStructure:
 2068|  78.5k|clearStructure(void *p, const UA_DataType *type) {
 2069|  78.5k|    uintptr_t ptr = (uintptr_t)p;
 2070|   392k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2070:23): [True: 313k, False: 78.5k]
  ------------------
 2071|   313k|        const UA_DataTypeMember *m = &type->members[i];
 2072|   313k|        const UA_DataType *mt = m->memberType;
 2073|   313k|        ptr += m->padding;
 2074|   313k|        if(!m->isOptional) {
  ------------------
  |  Branch (2074:12): [True: 313k, False: 0]
  ------------------
 2075|   313k|            if(!m->isArray) {
  ------------------
  |  Branch (2075:16): [True: 312k, False: 450]
  ------------------
 2076|   312k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2077|   312k|                ptr += mt->memSize;
 2078|   312k|            } else {
 2079|    450|                size_t length = *(size_t*)ptr;
 2080|    450|                ptr += sizeof(size_t);
 2081|    450|                UA_Array_delete(*(void**)ptr, length, mt);
 2082|    450|                ptr += sizeof(void*);
 2083|    450|            }
 2084|   313k|        } else { /* field is optional */
 2085|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2085:16): [True: 0, False: 0]
  ------------------
 2086|       |                /* optional scalar field is contained */
 2087|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2087:20): [True: 0, False: 0]
  ------------------
 2088|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2089|      0|                ptr += sizeof(void *);
 2090|      0|            } else {
 2091|       |                /* optional array field is contained */
 2092|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2092:20): [True: 0, False: 0]
  ------------------
 2093|      0|                    size_t length = *(size_t *)ptr;
 2094|      0|                    ptr += sizeof(size_t);
 2095|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2096|      0|                    ptr += sizeof(void *);
 2097|      0|                } else { /* optional array field not contained */
 2098|      0|                    ptr += sizeof(size_t);
 2099|      0|                    ptr += sizeof(void *);
 2100|      0|                }
 2101|      0|            }
 2102|      0|        }
 2103|   313k|    }
 2104|  78.5k|}
ua_types.c:nodeIdOrder:
 2246|   113k|nodeIdOrder(const UA_NodeId *p1, const UA_NodeId *p2, const UA_DataType *_) {
 2247|       |    /* Compare namespaceIndex */
 2248|   113k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2248:8): [True: 56, False: 113k]
  ------------------
 2249|     56|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2249:16): [True: 56, False: 0]
  ------------------
 2250|       |
 2251|       |    /* Compare identifierType */
 2252|   113k|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2252:8): [True: 2.89k, False: 111k]
  ------------------
 2253|  2.89k|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2253:16): [True: 2.89k, False: 0]
  ------------------
 2254|       |
 2255|       |    /* Compare the identifier */
 2256|   111k|    switch(p1->identifierType) {
 2257|   109k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2257:5): [True: 109k, False: 1.44k]
  ------------------
 2258|   109k|    default:
  ------------------
  |  Branch (2258:5): [True: 0, False: 111k]
  ------------------
 2259|   109k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2259:12): [True: 416, False: 109k]
  ------------------
 2260|    416|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2260:20): [True: 384, False: 32]
  ------------------
 2261|    384|                UA_ORDER_LESS : UA_ORDER_MORE;
 2262|   109k|        return UA_ORDER_EQ;
 2263|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2263:5): [True: 0, False: 111k]
  ------------------
 2264|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2265|  1.18k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2265:5): [True: 1.18k, False: 109k]
  ------------------
 2266|  1.44k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2266:5): [True: 261, False: 110k]
  ------------------
 2267|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2268|   111k|    }
 2269|   111k|}
ua_types.c:booleanOrder:
 2179|  75.6k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|  75.6k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 75.6k]
  ------------------
 2181|  75.6k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|  75.6k|        return UA_ORDER_EQ;                                         \
 2183|  75.6k|    }
ua_types.c:uInt32Order:
 2179|    154|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|    154|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 154]
  ------------------
 2181|    154|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|    154|        return UA_ORDER_EQ;                                         \
 2183|    154|    }
ua_types.c:stringOrder:
 2231|  42.9k|stringOrder(const UA_String *p1, const UA_String *p2, const UA_DataType *type) {
 2232|  42.9k|    if(p1->length != p2->length)
  ------------------
  |  Branch (2232:8): [True: 2.64k, False: 40.3k]
  ------------------
 2233|  2.64k|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2233:16): [True: 1.57k, False: 1.07k]
  ------------------
 2234|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2235|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2236|  40.3k|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2236:8): [True: 38.0k, False: 2.27k]
  ------------------
 2237|  2.27k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2237:8): [True: 0, False: 2.27k]
  ------------------
 2238|  2.27k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2238:8): [True: 0, False: 2.27k]
  ------------------
 2239|  2.27k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2240|  2.27k|    if(cmp != 0)
  ------------------
  |  Branch (2240:8): [True: 7, False: 2.26k]
  ------------------
 2241|      7|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2241:16): [True: 2, False: 5]
  ------------------
 2242|  2.26k|    return UA_ORDER_EQ;
 2243|  2.27k|}
ua_types.c:qualifiedNameOrder:
 2284|  37.8k|                   const UA_DataType *_) {
 2285|  37.8k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2285:8): [True: 0, False: 37.8k]
  ------------------
 2286|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2286:16): [True: 0, False: 0]
  ------------------
 2287|  37.8k|    return stringOrder(&p1->name, &p2->name, NULL);
 2288|  37.8k|}
ua_types.c:arrayOrder:
 2348|    154|           const UA_DataType *type) {
 2349|    154|    if(p1Length != p2Length)
  ------------------
  |  Branch (2349:8): [True: 0, False: 154]
  ------------------
 2350|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2350:16): [True: 0, False: 0]
  ------------------
 2351|    154|    uintptr_t u1 = (uintptr_t)p1;
 2352|    154|    uintptr_t u2 = (uintptr_t)p2;
 2353|  37.9k|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2353:23): [True: 37.8k, False: 154]
  ------------------
 2354|  37.8k|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2355|  37.8k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2355:12): [True: 0, False: 37.8k]
  ------------------
 2356|      0|            return o;
 2357|  37.8k|        u1 += type->memSize;
 2358|  37.8k|        u2 += type->memSize;
 2359|  37.8k|    }
 2360|    154|    return UA_ORDER_EQ;
 2361|    154|}
ua_types.c:structureOrder:
 2497|  38.1k|structureOrder(const void *p1, const void *p2, const UA_DataType *type) {
 2498|  38.1k|    uintptr_t u1 = (uintptr_t)p1;
 2499|  38.1k|    uintptr_t u2 = (uintptr_t)p2;
 2500|  38.1k|    UA_Order o = UA_ORDER_EQ;
 2501|   190k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2501:23): [True: 152k, False: 38.1k]
  ------------------
 2502|   152k|        const UA_DataTypeMember *m = &type->members[i];
 2503|   152k|        const UA_DataType *mt = m->memberType;
 2504|   152k|        u1 += m->padding;
 2505|   152k|        u2 += m->padding;
 2506|   152k|        if(!m->isOptional) {
  ------------------
  |  Branch (2506:12): [True: 152k, False: 0]
  ------------------
 2507|   152k|            if(!m->isArray) {
  ------------------
  |  Branch (2507:16): [True: 152k, False: 154]
  ------------------
 2508|   152k|                o = orderJumpTable[mt->typeKind]((const void *)u1, (const void *)u2, mt);
 2509|   152k|                u1 += mt->memSize;
 2510|   152k|                u2 += mt->memSize;
 2511|   152k|            } else {
 2512|    154|                size_t size1 = *(size_t*)u1;
 2513|    154|                size_t size2 = *(size_t*)u2;
 2514|    154|                u1 += sizeof(size_t);
 2515|    154|                u2 += sizeof(size_t);
 2516|    154|                o = arrayOrder(*(void* const*)u1, size1, *(void* const*)u2, size2, mt);
 2517|    154|                u1 += sizeof(void*);
 2518|    154|                u2 += sizeof(void*);
 2519|    154|            }
 2520|   152k|        } else {
 2521|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2521:16): [True: 0, False: 0]
  ------------------
 2522|      0|                const void *pp1 = *(void* const*)u1;
 2523|      0|                const void *pp2 = *(void* const*)u2;
 2524|      0|                if(pp1 == pp2) {
  ------------------
  |  Branch (2524:20): [True: 0, False: 0]
  ------------------
 2525|      0|                    o = UA_ORDER_EQ;
 2526|      0|                } else if(pp1 == NULL) {
  ------------------
  |  Branch (2526:27): [True: 0, False: 0]
  ------------------
 2527|      0|                    o = UA_ORDER_LESS;
 2528|      0|                } else if(pp2 == NULL) {
  ------------------
  |  Branch (2528:27): [True: 0, False: 0]
  ------------------
 2529|      0|                    o = UA_ORDER_MORE;
 2530|      0|                } else {
 2531|      0|                    o = orderJumpTable[mt->typeKind](pp1, pp2, mt);
 2532|      0|                }
 2533|      0|            } else {
 2534|      0|                size_t sa1 = *(size_t*)u1;
 2535|      0|                size_t sa2 = *(size_t*)u2;
 2536|      0|                u1 += sizeof(size_t);
 2537|      0|                u2 += sizeof(size_t);
 2538|      0|                o = arrayOrder(*(void* const*)u1, sa1, *(void* const*)u2, sa2, mt);
 2539|      0|            }
 2540|      0|            u1 += sizeof(void*);
 2541|      0|            u2 += sizeof(void*);
 2542|      0|        }
 2543|       |
 2544|   152k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2544:12): [True: 0, False: 152k]
  ------------------
 2545|      0|            break;
 2546|   152k|    }
 2547|  38.1k|    return o;
 2548|  38.1k|}

UA_AttributeOperand_parse:
 1211|    450|UA_AttributeOperand_parse(UA_AttributeOperand *ao, const UA_String str) {
 1212|       |    /* Objects folder is the default */
 1213|    450|    return parseAttributeOperand(ao, str, UA_NS0ID(OBJECTSFOLDER), 0);
  ------------------
  |  |  457|    450|#define UA_NS0ID(ID) UA_NODEID_NUMERIC(0, UA_NS0ID_##ID)
  |  |  ------------------
  |  |  |  |   81|    450|#define UA_NS0ID_OBJECTSFOLDER 85 /* Object */
  |  |  ------------------
  ------------------
 1214|    450|}
ua_types_lex.c:parse_guid:
   48|     10|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   49|     10|    size_t len = (size_t)(e - s);
   50|     10|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (50:8): [True: 10, False: 0]
  |  Branch (50:21): [True: 0, False: 0]
  |  Branch (50:36): [True: 0, False: 0]
  |  Branch (50:52): [True: 0, False: 0]
  ------------------
   51|     10|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   52|       |
   53|      0|    UA_UInt32 tmp;
   54|      0|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (54:8): [True: 0, False: 0]
  ------------------
   55|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   56|      0|    guid->data1 = tmp;
   57|       |
   58|      0|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (58:8): [True: 0, False: 0]
  ------------------
   59|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   60|      0|    guid->data2 = (UA_UInt16)tmp;
   61|       |
   62|      0|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (62:8): [True: 0, False: 0]
  ------------------
   63|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   64|      0|    guid->data3 = (UA_UInt16)tmp;
   65|       |
   66|      0|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (66:8): [True: 0, False: 0]
  ------------------
   67|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   68|      0|    guid->data4[0] = (UA_Byte)tmp;
   69|       |
   70|      0|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (70:8): [True: 0, False: 0]
  ------------------
   71|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   72|      0|    guid->data4[1] = (UA_Byte)tmp;
   73|       |
   74|      0|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (74:36): [True: 0, False: 0]
  ------------------
   75|      0|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (75:12): [True: 0, False: 0]
  ------------------
   76|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   77|      0|        guid->data4[pos] = (UA_Byte)tmp;
   78|      0|    }
   79|       |
   80|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   81|      0|}
ua_types_lex.c:parse_nodeid:
  144|  4.79k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  145|  4.79k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  146|  4.79k|    LexContext context;
  147|  4.79k|    memset(&context, 0, sizeof(LexContext));
  148|  4.79k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  149|  4.79k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  150|       |
  151|       |    
  152|  4.79k|{
  153|  4.79k|	u8 yych;
  154|  4.79k|	yych = YYPEEK();
  ------------------
  |  |   31|  4.79k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.79k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.79k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 4.79k, False: 0]
  |  |  ------------------
  ------------------
  155|  4.79k|	switch (yych) {
  156|    685|		case 'b':
  ------------------
  |  Branch (156:3): [True: 685, False: 4.11k]
  ------------------
  157|    695|		case 'g':
  ------------------
  |  Branch (157:3): [True: 10, False: 4.78k]
  ------------------
  158|    831|		case 'i':
  ------------------
  |  Branch (158:3): [True: 136, False: 4.66k]
  ------------------
  159|  3.18k|		case 's':
  ------------------
  |  Branch (159:3): [True: 2.35k, False: 2.44k]
  ------------------
  160|  3.18k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  3.18k|#define YYSTAGN(t) t = NULL
  ------------------
  161|  3.18k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  3.18k|#define YYSTAGN(t) t = NULL
  ------------------
  162|  3.18k|			goto yy3;
  163|  1.03k|		case 'n': goto yy4;
  ------------------
  |  Branch (163:3): [True: 1.03k, False: 3.76k]
  ------------------
  164|    580|		default: goto yy1;
  ------------------
  |  Branch (164:3): [True: 580, False: 4.21k]
  ------------------
  165|  4.79k|	}
  166|    580|yy1:
  167|    580|	YYSKIP();
  ------------------
  |  |   33|    580|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    580|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  168|    585|yy2:
  169|    585|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|    585|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  170|  3.18k|yy3:
  171|  3.18k|	YYSKIP();
  ------------------
  |  |   33|  3.18k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  3.18k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|  3.18k|	yych = YYPEEK();
  ------------------
  |  |   31|  3.18k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 3.18k, False: 0]
  |  |  ------------------
  ------------------
  173|  3.18k|	switch (yych) {
  174|  3.18k|		case '=': goto yy5;
  ------------------
  |  Branch (174:3): [True: 3.18k, False: 1]
  ------------------
  175|      1|		default: goto yy2;
  ------------------
  |  Branch (175:3): [True: 1, False: 3.18k]
  ------------------
  176|  3.18k|	}
  177|  1.03k|yy4:
  178|  1.03k|	YYSKIP();
  ------------------
  |  |   33|  1.03k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  179|  1.03k|	YYBACKUP();
  ------------------
  |  |   34|  1.03k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  1.03k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  180|  1.03k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.03k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.03k, False: 0]
  |  |  ------------------
  ------------------
  181|  1.03k|	switch (yych) {
  182|  1.03k|		case 's': goto yy6;
  ------------------
  |  Branch (182:3): [True: 1.03k, False: 0]
  ------------------
  183|      0|		default: goto yy2;
  ------------------
  |  Branch (183:3): [True: 0, False: 1.03k]
  ------------------
  184|  1.03k|	}
  185|  4.21k|yy5:
  186|  4.21k|	YYSKIP();
  ------------------
  |  |   33|  4.21k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  4.21k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  187|  4.21k|	nsu = context.yyt2;
  188|  4.21k|	ns = context.yyt1;
  189|  4.21k|	YYSTAGP(body);
  ------------------
  |  |   36|  4.21k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  4.21k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  190|  4.21k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   38|  4.21k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  191|  4.21k|	{ goto match; }
  192|  1.03k|yy6:
  193|  1.03k|	YYSKIP();
  ------------------
  |  |   33|  1.03k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  1.03k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.03k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.03k, False: 0]
  |  |  ------------------
  ------------------
  195|  1.03k|	switch (yych) {
  196|    313|		case '=': goto yy8;
  ------------------
  |  Branch (196:3): [True: 313, False: 717]
  ------------------
  197|    717|		case 'u': goto yy9;
  ------------------
  |  Branch (197:3): [True: 717, False: 313]
  ------------------
  198|      0|		default: goto yy7;
  ------------------
  |  Branch (198:3): [True: 0, False: 1.03k]
  ------------------
  199|  1.03k|	}
  200|      4|yy7:
  201|      4|	YYRESTORE();
  ------------------
  |  |   35|      4|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|      4|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|      4|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  202|      4|	goto yy2;
  203|    313|yy8:
  204|    313|	YYSKIP();
  ------------------
  |  |   33|    313|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    313|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  205|    313|	yych = YYPEEK();
  ------------------
  |  |   31|    313|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    313|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    313|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 313, False: 0]
  |  |  ------------------
  ------------------
  206|    313|	switch (yych) {
  207|    125|		case '0':
  ------------------
  |  Branch (207:3): [True: 125, False: 188]
  ------------------
  208|    140|		case '1':
  ------------------
  |  Branch (208:3): [True: 15, False: 298]
  ------------------
  209|    266|		case '2':
  ------------------
  |  Branch (209:3): [True: 126, False: 187]
  ------------------
  210|    306|		case '3':
  ------------------
  |  Branch (210:3): [True: 40, False: 273]
  ------------------
  211|    306|		case '4':
  ------------------
  |  Branch (211:3): [True: 0, False: 313]
  ------------------
  212|    307|		case '5':
  ------------------
  |  Branch (212:3): [True: 1, False: 312]
  ------------------
  213|    313|		case '6':
  ------------------
  |  Branch (213:3): [True: 6, False: 307]
  ------------------
  214|    313|		case '7':
  ------------------
  |  Branch (214:3): [True: 0, False: 313]
  ------------------
  215|    313|		case '8':
  ------------------
  |  Branch (215:3): [True: 0, False: 313]
  ------------------
  216|    313|		case '9':
  ------------------
  |  Branch (216:3): [True: 0, False: 313]
  ------------------
  217|    313|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|    313|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    313|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  218|    313|			goto yy10;
  219|      0|		default: goto yy7;
  ------------------
  |  Branch (219:3): [True: 0, False: 313]
  ------------------
  220|    313|	}
  221|    717|yy9:
  222|    717|	YYSKIP();
  ------------------
  |  |   33|    717|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    717|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  223|    717|	yych = YYPEEK();
  ------------------
  |  |   31|    717|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    717|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    717|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 717, False: 0]
  |  |  ------------------
  ------------------
  224|    717|	switch (yych) {
  225|    717|		case '=': goto yy11;
  ------------------
  |  Branch (225:3): [True: 717, False: 0]
  ------------------
  226|      0|		default: goto yy7;
  ------------------
  |  Branch (226:3): [True: 0, False: 717]
  ------------------
  227|    717|	}
  228|    374|yy10:
  229|    374|	YYSKIP();
  ------------------
  |  |   33|    374|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    374|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  230|    374|	yych = YYPEEK();
  ------------------
  |  |   31|    374|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    374|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    374|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 374, False: 0]
  |  |  ------------------
  ------------------
  231|    374|	switch (yych) {
  232|      6|		case '0':
  ------------------
  |  Branch (232:3): [True: 6, False: 368]
  ------------------
  233|     13|		case '1':
  ------------------
  |  Branch (233:3): [True: 7, False: 367]
  ------------------
  234|     16|		case '2':
  ------------------
  |  Branch (234:3): [True: 3, False: 371]
  ------------------
  235|     18|		case '3':
  ------------------
  |  Branch (235:3): [True: 2, False: 372]
  ------------------
  236|     18|		case '4':
  ------------------
  |  Branch (236:3): [True: 0, False: 374]
  ------------------
  237|     23|		case '5':
  ------------------
  |  Branch (237:3): [True: 5, False: 369]
  ------------------
  238|     31|		case '6':
  ------------------
  |  Branch (238:3): [True: 8, False: 366]
  ------------------
  239|     45|		case '7':
  ------------------
  |  Branch (239:3): [True: 14, False: 360]
  ------------------
  240|     61|		case '8':
  ------------------
  |  Branch (240:3): [True: 16, False: 358]
  ------------------
  241|     61|		case '9': goto yy10;
  ------------------
  |  Branch (241:3): [True: 0, False: 374]
  ------------------
  242|    313|		case ';':
  ------------------
  |  Branch (242:3): [True: 313, False: 61]
  ------------------
  243|    313|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|    313|#define YYSTAGN(t) t = NULL
  ------------------
  244|    313|			goto yy12;
  245|      0|		default: goto yy7;
  ------------------
  |  Branch (245:3): [True: 0, False: 374]
  ------------------
  246|    374|	}
  247|    717|yy11:
  248|    717|	YYSKIP();
  ------------------
  |  |   33|    717|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    717|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  249|    717|	yych = YYPEEK();
  ------------------
  |  |   31|    717|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    717|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    717|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 717, False: 0]
  |  |  ------------------
  ------------------
  250|    717|	switch (yych) {
  251|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (251:3): [True: 0, False: 717]
  ------------------
  252|    242|		case ';':
  ------------------
  |  Branch (252:3): [True: 242, False: 475]
  ------------------
  253|    242|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|    242|#define YYSTAGN(t) t = NULL
  ------------------
  254|    242|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    242|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    242|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  255|    242|			goto yy12;
  256|    475|		default:
  ------------------
  |  Branch (256:3): [True: 475, False: 242]
  ------------------
  257|    475|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    475|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    475|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  258|    475|			goto yy13;
  259|    717|	}
  260|  1.03k|yy12:
  261|  1.03k|	YYSKIP();
  ------------------
  |  |   33|  1.03k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|  1.03k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.03k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.03k, False: 0]
  |  |  ------------------
  ------------------
  263|  1.03k|	switch (yych) {
  264|    267|		case 'b':
  ------------------
  |  Branch (264:3): [True: 267, False: 763]
  ------------------
  265|    399|		case 'g':
  ------------------
  |  Branch (265:3): [True: 132, False: 898]
  ------------------
  266|    642|		case 'i':
  ------------------
  |  Branch (266:3): [True: 243, False: 787]
  ------------------
  267|  1.02k|		case 's': goto yy14;
  ------------------
  |  Branch (267:3): [True: 385, False: 645]
  ------------------
  268|      3|		default: goto yy7;
  ------------------
  |  Branch (268:3): [True: 3, False: 1.02k]
  ------------------
  269|  1.03k|	}
  270|  7.70k|yy13:
  271|  7.70k|	YYSKIP();
  ------------------
  |  |   33|  7.70k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  7.70k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  272|  7.70k|	yych = YYPEEK();
  ------------------
  |  |   31|  7.70k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 7.70k, False: 0]
  |  |  ------------------
  ------------------
  273|  7.70k|	switch (yych) {
  274|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (274:3): [True: 0, False: 7.70k]
  ------------------
  275|    475|		case ';':
  ------------------
  |  Branch (275:3): [True: 475, False: 7.22k]
  ------------------
  276|    475|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|    475|#define YYSTAGN(t) t = NULL
  ------------------
  277|    475|			goto yy12;
  278|  7.22k|		default: goto yy13;
  ------------------
  |  Branch (278:3): [True: 7.22k, False: 475]
  ------------------
  279|  7.70k|	}
  280|  1.02k|yy14:
  281|  1.02k|	YYSKIP();
  ------------------
  |  |   33|  1.02k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.02k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  282|  1.02k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.02k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.02k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.02k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.02k, False: 1]
  |  |  ------------------
  ------------------
  283|  1.02k|	switch (yych) {
  284|  1.02k|		case '=': goto yy5;
  ------------------
  |  Branch (284:3): [True: 1.02k, False: 1]
  ------------------
  285|      1|		default: goto yy7;
  ------------------
  |  Branch (285:3): [True: 1, False: 1.02k]
  ------------------
  286|  1.02k|	}
  287|  1.02k|}
  288|       |
  289|       |
  290|  4.21k| match:
  291|  4.21k|    if(nsu) {
  ------------------
  |  Branch (291:8): [True: 715, False: 3.49k]
  ------------------
  292|       |        /* NamespaceUri */
  293|    715|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  294|    715|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  295|    715|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    715|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (295:12): [True: 715, False: 0]
  ------------------
  296|       |            /* Return the entire NodeId string s=... */
  297|    715|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  298|    715|            id->identifierType = UA_NODEIDTYPE_STRING;
  299|    715|            return UA_String_copy(&total, &id->identifier.string);
  300|    715|        }
  301|  3.49k|    } else if(ns) {
  ------------------
  |  Branch (301:15): [True: 311, False: 3.18k]
  ------------------
  302|       |        /* NamespaceIndex */
  303|    311|        UA_UInt32 tmp;
  304|    311|        size_t len = (size_t)(body - 1 - ns);
  305|    311|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (305:12): [True: 0, False: 311]
  ------------------
  306|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  307|    311|        id->namespaceIndex = (UA_UInt16)tmp;
  308|    311|        if(nsMapping)
  ------------------
  |  Branch (308:12): [True: 0, False: 311]
  ------------------
  309|      0|            id->namespaceIndex =
  310|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  311|    311|    }
  312|       |
  313|       |    /* From the current position until the end */
  314|  3.49k|    return parse_nodeid_body(id, body, end, idEsc);
  315|  4.21k|}
ua_types_lex.c:escapedUri2Index:
   93|    724|                 const UA_NamespaceMapping *nsMapping) {
   94|    724|    if(!nsMapping)
  ------------------
  |  Branch (94:8): [True: 724, False: 0]
  ------------------
   95|    724|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    724|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   96|      0|    UA_String tmp = uri; 
   97|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
   98|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (98:8): [True: 0, False: 0]
  ------------------
   99|      0|        return res;
  100|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  101|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (101:8): [True: 0, False: 0]
  ------------------
  102|      0|        UA_String_clear(&uri);
  103|      0|    return res;
  104|      0|}
ua_types_lex.c:parse_nodeid_body:
  107|  3.49k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  108|  3.49k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.49k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  109|  3.49k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  110|  3.49k|    switch(*body) {
  111|    192|    case 'i':
  ------------------
  |  Branch (111:5): [True: 192, False: 3.30k]
  ------------------
  112|    192|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  113|    192|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (113:12): [True: 33, False: 159]
  ------------------
  114|     33|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     33|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  115|    192|        break;
  116|  2.61k|    case 's':
  ------------------
  |  Branch (116:5): [True: 2.61k, False: 887]
  ------------------
  117|  2.61k|        id->identifierType = UA_NODEIDTYPE_STRING;
  118|  2.61k|        res |= UA_String_copy(&str, &id->identifier.string);
  119|  2.61k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  120|  2.61k|        break;
  121|     10|    case 'g':
  ------------------
  |  Branch (121:5): [True: 10, False: 3.48k]
  ------------------
  122|     10|        id->identifierType = UA_NODEIDTYPE_GUID;
  123|     10|        res = parse_guid(&id->identifier.guid, str.data, end);
  124|     10|        break;
  125|    685|    case 'b':
  ------------------
  |  Branch (125:5): [True: 685, False: 2.81k]
  ------------------
  126|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  127|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  128|       |         * the NodeId identifier part. */
  129|    685|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  130|    685|        id->identifier.byteString.data =
  131|    685|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  132|    685|        if(!id->identifier.byteString.data && str.length > 0)
  ------------------
  |  Branch (132:12): [True: 34, False: 651]
  |  Branch (132:47): [True: 34, False: 0]
  ------------------
  133|     34|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     34|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  134|    685|        break;
  135|      0|    default:
  ------------------
  |  Branch (135:5): [True: 0, False: 3.49k]
  ------------------
  136|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|      0|        break;
  138|  3.49k|    }
  139|  3.49k|    return res;
  140|  3.49k|}
ua_types_lex.c:parse_qn:
  699|  78.3k|         UA_UInt16 defaultNamespaceIndex) {
  700|  78.3k|    size_t len;
  701|  78.3k|    UA_UInt32 tmp;
  702|  78.3k|    UA_String str;
  703|  78.3k|    UA_StatusCode res;
  704|       |
  705|  78.3k|    LexContext context;
  706|  78.3k|    memset(&context, 0, sizeof(LexContext));
  707|       |
  708|  78.3k|    const u8 *begin = pos;
  709|  78.3k|    UA_QualifiedName_init(qn);
  710|  78.3k|    qn->namespaceIndex = defaultNamespaceIndex;
  711|       |
  712|       |    
  713|  78.3k|{
  714|  78.3k|	u8 yych;
  715|  78.3k|	yych = YYPEEK();
  ------------------
  |  |   31|  78.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  78.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.91k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.91k, False: 76.4k]
  |  |  ------------------
  ------------------
  716|  78.3k|	switch (yych) {
  717|  76.4k|		case 0x00:
  ------------------
  |  Branch (717:3): [True: 76.4k, False: 1.91k]
  ------------------
  718|  76.4k|		case ';': goto yy41;
  ------------------
  |  Branch (718:3): [True: 0, False: 78.3k]
  ------------------
  719|    156|		case '0':
  ------------------
  |  Branch (719:3): [True: 156, False: 78.1k]
  ------------------
  720|    306|		case '1':
  ------------------
  |  Branch (720:3): [True: 150, False: 78.1k]
  ------------------
  721|    359|		case '2':
  ------------------
  |  Branch (721:3): [True: 53, False: 78.2k]
  ------------------
  722|    380|		case '3':
  ------------------
  |  Branch (722:3): [True: 21, False: 78.3k]
  ------------------
  723|    404|		case '4':
  ------------------
  |  Branch (723:3): [True: 24, False: 78.3k]
  ------------------
  724|    404|		case '5':
  ------------------
  |  Branch (724:3): [True: 0, False: 78.3k]
  ------------------
  725|    542|		case '6':
  ------------------
  |  Branch (725:3): [True: 138, False: 78.1k]
  ------------------
  726|    545|		case '7':
  ------------------
  |  Branch (726:3): [True: 3, False: 78.3k]
  ------------------
  727|    679|		case '8':
  ------------------
  |  Branch (727:3): [True: 134, False: 78.1k]
  ------------------
  728|    681|		case '9': goto yy44;
  ------------------
  |  Branch (728:3): [True: 2, False: 78.3k]
  ------------------
  729|  1.23k|		default: goto yy43;
  ------------------
  |  Branch (729:3): [True: 1.23k, False: 77.0k]
  ------------------
  730|  78.3k|	}
  731|  76.4k|yy41:
  732|  76.4k|	YYSKIP();
  ------------------
  |  |   33|  76.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  76.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  733|  78.3k|yy42:
  734|  78.3k|	{ pos = begin; goto match_name; }
  735|  1.23k|yy43:
  736|  1.23k|	YYSKIP();
  ------------------
  |  |   33|  1.23k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  737|  1.23k|	YYBACKUP();
  ------------------
  |  |   34|  1.23k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  1.23k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  738|  1.23k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.23k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.09k, False: 140]
  |  |  ------------------
  ------------------
  739|  1.23k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (739:6): [True: 143, False: 1.09k]
  ------------------
  740|  1.09k|	goto yy46;
  741|  1.09k|yy44:
  742|    681|	YYSKIP();
  ------------------
  |  |   33|    681|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    681|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  743|    681|	YYBACKUP();
  ------------------
  |  |   34|    681|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|    681|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    681|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  744|    681|	yych = YYPEEK();
  ------------------
  |  |   31|    681|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    681|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    491|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 491, False: 190]
  |  |  ------------------
  ------------------
  745|    681|	switch (yych) {
  746|      4|		case '0':
  ------------------
  |  Branch (746:3): [True: 4, False: 677]
  ------------------
  747|     15|		case '1':
  ------------------
  |  Branch (747:3): [True: 11, False: 670]
  ------------------
  748|     46|		case '2':
  ------------------
  |  Branch (748:3): [True: 31, False: 650]
  ------------------
  749|     47|		case '3':
  ------------------
  |  Branch (749:3): [True: 1, False: 680]
  ------------------
  750|     57|		case '4':
  ------------------
  |  Branch (750:3): [True: 10, False: 671]
  ------------------
  751|     61|		case '5':
  ------------------
  |  Branch (751:3): [True: 4, False: 677]
  ------------------
  752|     63|		case '6':
  ------------------
  |  Branch (752:3): [True: 2, False: 679]
  ------------------
  753|    141|		case '7':
  ------------------
  |  Branch (753:3): [True: 78, False: 603]
  ------------------
  754|    300|		case '8':
  ------------------
  |  Branch (754:3): [True: 159, False: 522]
  ------------------
  755|    302|		case '9':
  ------------------
  |  Branch (755:3): [True: 2, False: 679]
  ------------------
  756|    305|		case ':': goto yy50;
  ------------------
  |  Branch (756:3): [True: 3, False: 678]
  ------------------
  757|    376|		default: goto yy42;
  ------------------
  |  Branch (757:3): [True: 376, False: 305]
  ------------------
  758|    681|	}
  759|   295k|yy45:
  760|   295k|	YYSKIP();
  ------------------
  |  |   33|   295k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   295k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  761|   295k|	yych = YYPEEK();
  ------------------
  |  |   31|   295k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   295k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   294k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 294k, False: 1.02k]
  |  |  ------------------
  ------------------
  762|   296k|yy46:
  763|   296k|	switch (yych) {
  764|  1.08k|		case 0x00: goto yy47;
  ------------------
  |  Branch (764:3): [True: 1.08k, False: 295k]
  ------------------
  765|      9|		case ';': goto yy48;
  ------------------
  |  Branch (765:3): [True: 9, False: 296k]
  ------------------
  766|   295k|		default: goto yy45;
  ------------------
  |  Branch (766:3): [True: 295k, False: 1.09k]
  ------------------
  767|   296k|	}
  768|  1.37k|yy47:
  769|  1.37k|	YYRESTORE();
  ------------------
  |  |   35|  1.37k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|  1.37k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|  1.37k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  770|  1.37k|	goto yy42;
  771|      9|yy48:
  772|      9|	YYSKIP();
  ------------------
  |  |   33|      9|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      9|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  773|      9|	{ goto match_uri; }
  774|   363k|yy49:
  775|   363k|	YYSKIP();
  ------------------
  |  |   33|   363k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   363k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  776|   363k|	yych = YYPEEK();
  ------------------
  |  |   31|   363k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   363k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   363k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 363k, False: 121]
  |  |  ------------------
  ------------------
  777|   363k|yy50:
  778|   363k|	switch (yych) {
  779|   337k|		case '0':
  ------------------
  |  Branch (779:3): [True: 337k, False: 26.5k]
  ------------------
  780|   337k|		case '1':
  ------------------
  |  Branch (780:3): [True: 463, False: 363k]
  ------------------
  781|   343k|		case '2':
  ------------------
  |  Branch (781:3): [True: 5.51k, False: 358k]
  ------------------
  782|   349k|		case '3':
  ------------------
  |  Branch (782:3): [True: 5.69k, False: 358k]
  ------------------
  783|   354k|		case '4':
  ------------------
  |  Branch (783:3): [True: 5.85k, False: 358k]
  ------------------
  784|   355k|		case '5':
  ------------------
  |  Branch (784:3): [True: 220, False: 363k]
  ------------------
  785|   355k|		case '6':
  ------------------
  |  Branch (785:3): [True: 364, False: 363k]
  ------------------
  786|   356k|		case '7':
  ------------------
  |  Branch (786:3): [True: 506, False: 363k]
  ------------------
  787|   362k|		case '8':
  ------------------
  |  Branch (787:3): [True: 6.48k, False: 357k]
  ------------------
  788|   363k|		case '9': goto yy49;
  ------------------
  |  Branch (788:3): [True: 1.14k, False: 362k]
  ------------------
  789|     16|		case ':': goto yy51;
  ------------------
  |  Branch (789:3): [True: 16, False: 363k]
  ------------------
  790|    289|		default: goto yy47;
  ------------------
  |  Branch (790:3): [True: 289, False: 363k]
  ------------------
  791|   363k|	}
  792|     16|yy51:
  793|     16|	YYSKIP();
  ------------------
  |  |   33|     16|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     16|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  794|     16|	{ goto match_index; }
  795|   363k|}
  796|       |
  797|       |
  798|     16| match_index:
  799|     16|    len = (size_t)(pos - 1 - begin);
  800|     16|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (800:8): [True: 0, False: 16]
  ------------------
  801|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  802|     16|    qn->namespaceIndex = (UA_UInt16)tmp;
  803|     16|    goto match_name;
  804|       |
  805|      9| match_uri:
  806|      9|    str.length = (size_t)(pos - 1 - begin);
  807|      9|    str.data = (UA_Byte*)(uintptr_t)begin;
  808|      9|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  809|      9|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      9|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (809:8): [True: 9, False: 0]
  ------------------
  810|      9|        pos = begin; /* Use the entire string for the name */
  811|       |
  812|  78.3k| match_name:
  813|  78.3k|    str.length = (size_t)(end - pos);
  814|  78.3k|    str.data = (UA_Byte*)(uintptr_t)pos;
  815|  78.3k|    res = UA_String_copy(&str, &qn->name);
  816|  78.3k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  564|  78.3k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (564:23): [True: 78.3k, False: 24]
  |  |  ------------------
  ------------------
  817|  78.3k|        res = UA_String_unescape(&qn->name, false, escName);
  818|  78.3k|    return res;
  819|      9|}
ua_types_lex.c:parse_relativepath:
  970|    430|                   UA_UInt16 defaultNamespaceIndex) {
  971|    430|    UA_RelativePath_init(rp);
  972|    430|    UA_Boolean done = false;
  973|    430|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    430|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  974|  78.1k|    do {
  975|  78.1k|        res = parse_relativepathElement(rp, ppos, end, server, esc,
  976|  78.1k|                                        defaultNamespaceIndex, &done);
  977|  78.1k|    } while(!done);
  ------------------
  |  Branch (977:13): [True: 77.6k, False: 430]
  ------------------
  978|    430|    return res;
  979|    430|}
ua_types_lex.c:parse_relativepathElement:
  841|  78.1k|                          UA_UInt16 defaultTargetNamespaceIndex, UA_Boolean *done) {
  842|  78.1k|    const u8 *pos = *ppos;
  843|  78.1k|    if(pos == end) {
  ------------------
  |  Branch (843:8): [True: 282, False: 77.8k]
  ------------------
  844|    282|        *done = true;
  845|    282|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    282|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  846|    282|    }
  847|       |
  848|       |    /* Create the element on the stack.
  849|       |     * Moved into the rp upon successful parsing. */
  850|  77.8k|    UA_RelativePathElement current;
  851|  77.8k|    UA_RelativePathElement_init(&current);
  852|  77.8k|    current.includeSubtypes = true; /* Follow subtypes by default */
  853|       |
  854|       |    /* Which ReferenceType? */
  855|  77.8k|    const u8 *begin;
  856|  77.8k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  77.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  857|  77.8k|    switch(*pos) {
  858|  73.1k|    case '/':
  ------------------
  |  Branch (858:5): [True: 73.1k, False: 4.70k]
  ------------------
  859|  73.1k|        current.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HIERARCHICALREFERENCES);
  ------------------
  |  |   46|  73.1k|#define UA_NS0ID_HIERARCHICALREFERENCES 33 /* ReferenceType */
  ------------------
  860|  73.1k|        goto reftype_target;
  861|      0|    case '.':
  ------------------
  |  Branch (861:5): [True: 0, False: 77.8k]
  ------------------
  862|       |        /* Recognize the dot only for the and-escaping. The dot is not escaped
  863|       |         * for percent-escaping and commonly used as part of the browse-name. */
  864|      0|        if(esc != UA_ESCAPING_AND) {
  ------------------
  |  Branch (864:12): [True: 0, False: 0]
  ------------------
  865|      0|            *done = true;
  866|      0|            goto out;
  867|      0|        }
  868|      0|        current.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_AGGREGATES);
  ------------------
  |  |   55|      0|#define UA_NS0ID_AGGREGATES 44 /* ReferenceType */
  ------------------
  869|      0|        goto reftype_target;
  870|  4.64k|    case '<':
  ------------------
  |  Branch (870:5): [True: 4.64k, False: 73.1k]
  ------------------
  871|  4.64k|        break;
  872|     59|    default:
  ------------------
  |  Branch (872:5): [True: 59, False: 77.7k]
  ------------------
  873|     59|        *done = true;
  874|     59|        goto out;
  875|  77.8k|    }
  876|       |
  877|       |    /* ReferenceType with modifiers wrapped in angle brackets */
  878|  4.64k|    begin = ++pos;
  879|  32.4M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (879:11): [True: 32.4M, False: 67]
  ------------------
  880|  32.4M|        if((esc == UA_ESCAPING_AND || esc == UA_ESCAPING_AND_EXTENDED) && *pos == '&') {
  ------------------
  |  Branch (880:13): [True: 0, False: 32.4M]
  |  Branch (880:39): [True: 0, False: 32.4M]
  |  Branch (880:75): [True: 0, False: 0]
  ------------------
  881|      0|            pos++;
  882|      0|            continue;
  883|      0|        }
  884|  32.4M|        if((esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) && *pos == '%') {
  ------------------
  |  Branch (884:13): [True: 0, False: 32.4M]
  |  Branch (884:43): [True: 32.4M, False: 0]
  |  Branch (884:83): [True: 9.90M, False: 22.5M]
  ------------------
  885|  9.90M|            pos += 2;
  886|  9.90M|            continue;
  887|  9.90M|        }
  888|  22.5M|        if(*pos == '>')
  ------------------
  |  Branch (888:12): [True: 4.57k, False: 22.5M]
  ------------------
  889|  4.57k|            break;
  890|  22.5M|    }
  891|  4.64k|    if(pos > end) {
  ------------------
  |  Branch (891:8): [True: 0, False: 4.64k]
  ------------------
  892|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  893|      0|        goto out;
  894|      0|    }
  895|       |
  896|       |    /* Process modifiers */
  897|  5.19k|    for(; begin < pos; begin++) {
  ------------------
  |  Branch (897:11): [True: 5.19k, False: 0]
  ------------------
  898|  5.19k|        if(*begin == '#')
  ------------------
  |  Branch (898:12): [True: 388, False: 4.80k]
  ------------------
  899|    388|            current.includeSubtypes = false;
  900|  4.80k|        else if(*begin == '!')
  ------------------
  |  Branch (900:17): [True: 166, False: 4.64k]
  ------------------
  901|    166|            current.isInverse = true;
  902|  4.64k|        else
  903|  4.64k|            break;
  904|  5.19k|    }
  905|       |
  906|       |    /* Try to parse a NodeId for the ReferenceType (non-standard!) */
  907|  4.64k|    res = parse_nodeid(&current.referenceTypeId, begin, pos, esc, NULL);
  908|  4.64k|    if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  4.64k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (908:8): [True: 651, False: 3.99k]
  ------------------
  909|       |        /* Parse the the ReferenceType from its BrowseName (default) */
  910|    651|        UA_QualifiedName refqn;
  911|    651|        res = parse_qn(&refqn, begin, pos, esc, NULL, defaultTargetNamespaceIndex);
  912|    651|        res |= lookupRefType(server, &refqn, &current.referenceTypeId);
  913|    651|        UA_QualifiedName_clear(&refqn);
  914|    651|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    651|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (914:12): [True: 77, False: 574]
  ------------------
  915|     77|            goto out;
  916|    651|    }
  917|       |
  918|  77.6k| reftype_target:
  919|       |    /* Move pos to the end of the TargetName based on the escaping */
  920|  77.6k|    begin = ++pos;
  921|   442k|    while(pos < end && *pos >= '0' && *pos <= '9')
  ------------------
  |  Branch (921:11): [True: 441k, False: 238]
  |  Branch (921:24): [True: 368k, False: 72.8k]
  |  Branch (921:39): [True: 364k, False: 4.55k]
  ------------------
  922|   364k|        pos++;
  923|  77.6k|    if(pos < end && *pos == ':')
  ------------------
  |  Branch (923:8): [True: 77.4k, False: 238]
  |  Branch (923:21): [True: 16, False: 77.4k]
  ------------------
  924|     16|        pos++;
  925|   342k|    for(; pos < end; pos++) {
  ------------------
  |  Branch (925:11): [True: 342k, False: 284]
  ------------------
  926|   342k|        if((esc == UA_ESCAPING_AND || esc == UA_ESCAPING_AND_EXTENDED) && *pos == '&') {
  ------------------
  |  Branch (926:13): [True: 0, False: 342k]
  |  Branch (926:39): [True: 0, False: 342k]
  |  Branch (926:75): [True: 0, False: 0]
  ------------------
  927|      0|            pos++;
  928|      0|            continue;
  929|      0|        }
  930|   342k|        if((esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) && *pos == '%') {
  ------------------
  |  Branch (930:13): [True: 0, False: 342k]
  |  Branch (930:43): [True: 342k, False: 0]
  |  Branch (930:83): [True: 0, False: 342k]
  ------------------
  931|      0|            pos += 2;
  932|      0|            continue;
  933|      0|        }
  934|   342k|        if(esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (934:12): [True: 0, False: 342k]
  |  Branch (934:42): [True: 342k, False: 0]
  ------------------
  935|   342k|            if(isReservedPercentExtended(*pos))
  ------------------
  |  Branch (935:16): [True: 77.4k, False: 265k]
  ------------------
  936|  77.4k|                break;
  937|   342k|        } else {
  938|      0|            if(isReservedAnd(*pos))
  ------------------
  |  Branch (938:16): [True: 0, False: 0]
  ------------------
  939|      0|                break;
  940|      0|        }
  941|   342k|    }
  942|  77.6k|    if(pos > end) {
  ------------------
  |  Branch (942:8): [True: 4, False: 77.6k]
  ------------------
  943|      4|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  944|      4|        goto out;
  945|      4|    }
  946|       |
  947|       |    /* Parse the TargetName */
  948|  77.6k|    res = parse_qn(&current.targetName, begin, pos, esc,
  949|  77.6k|                   NULL, defaultTargetNamespaceIndex);
  950|  77.6k|    if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  77.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (950:8): [True: 0, False: 77.6k]
  ------------------
  951|      0|        UA_RelativePathElement_clear(&current);
  952|      0|        goto out;
  953|      0|    }
  954|       |
  955|       |    /* Add current to the rp */
  956|  77.6k|    res |= relativepath_addelem(rp, &current);
  957|  77.6k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  77.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (957:8): [True: 8, False: 77.6k]
  ------------------
  958|      8|        UA_RelativePathElement_clear(&current);
  959|       |
  960|  77.8k| out:
  961|       |    /* Return the status */
  962|  77.8k|    *ppos = pos;
  963|  77.8k|    *done |= (res != UA_STATUSCODE_GOOD);
  ------------------
  |  |   16|  77.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  964|  77.8k|    return res;
  965|  77.6k|}
ua_types_lex.c:relativepath_addelem:
  682|  77.6k|relativepath_addelem(UA_RelativePath *rp, UA_RelativePathElement *el) {
  683|       |    /* Allocate memory */
  684|  77.6k|    UA_RelativePathElement *newArray = (UA_RelativePathElement*)
  685|  77.6k|        UA_realloc(rp->elements, sizeof(UA_RelativePathElement) * (rp->elementsSize + 1));
  ------------------
  |  |   21|  77.6k|#define UA_realloc(ptr, size) UA_reallocSingleton(ptr, size)
  ------------------
  686|  77.6k|    if(!newArray)
  ------------------
  |  Branch (686:8): [True: 8, False: 77.6k]
  ------------------
  687|      8|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      8|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  688|  77.6k|    rp->elements = newArray;
  689|       |
  690|       |    /* Move to the target */
  691|  77.6k|    rp->elements[rp->elementsSize] = *el;
  692|  77.6k|    rp->elementsSize++;
  693|  77.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  77.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  694|  77.6k|}
ua_types_lex.c:parseAttributeOperand:
 1013|    450|                      UA_NodeId defaultId, UA_UInt16 defaultNamespaceIndex) {
 1014|       |    /* Initialize and set the default values */
 1015|    450|    UA_AttributeOperand_init(ao);
 1016|    450|    ao->nodeId = defaultId;
 1017|    450|    ao->attributeId = UA_ATTRIBUTEID_VALUE;
 1018|       |
 1019|       |    /* Nothing to parse */
 1020|    450|    if(str.length == 0)
  ------------------
  |  Branch (1020:8): [True: 0, False: 450]
  ------------------
 1021|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1022|       |
 1023|    450|    const u8 *pos = str.data;
 1024|    450|    const u8 *end = pos + str.length;
 1025|    450|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    450|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1026|       |
 1027|       |    /* Initial NodeId before the BrowsePath */
 1028|    450|    LexContext context;
 1029|    450|    memset(&context, 0, sizeof(LexContext));
 1030|       |    
 1031|    450|{
 1032|    450|	u8 yych;
 1033|    450|	yych = YYPEEK();
  ------------------
  |  |   31|    450|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    450|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    450|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 450, False: 0]
  |  |  ------------------
  ------------------
 1034|    450|	switch (yych) {
 1035|      6|		case 'b':
  ------------------
  |  Branch (1035:3): [True: 6, False: 444]
  ------------------
 1036|     16|		case 'g':
  ------------------
  |  Branch (1036:3): [True: 10, False: 440]
  ------------------
 1037|     22|		case 'i':
  ------------------
  |  Branch (1037:3): [True: 6, False: 444]
  ------------------
 1038|     96|		case 's': goto yy55;
  ------------------
  |  Branch (1038:3): [True: 74, False: 376]
  ------------------
 1039|     69|		case 'n': goto yy56;
  ------------------
  |  Branch (1039:3): [True: 69, False: 381]
  ------------------
 1040|    285|		default: goto yy53;
  ------------------
  |  Branch (1040:3): [True: 285, False: 165]
  ------------------
 1041|    450|	}
 1042|    285|yy53:
 1043|    285|	YYSKIP();
  ------------------
  |  |   33|    285|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    285|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1044|    295|yy54:
 1045|    295|	{ pos = str.data; goto parse_path; }
 1046|     96|yy55:
 1047|     96|	YYSKIP();
  ------------------
  |  |   33|     96|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     96|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1048|     96|	yych = YYPEEK();
  ------------------
  |  |   31|     96|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     96|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     96|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 96, False: 0]
  |  |  ------------------
  ------------------
 1049|     96|	switch (yych) {
 1050|     95|		case '=': goto yy57;
  ------------------
  |  Branch (1050:3): [True: 95, False: 1]
  ------------------
 1051|      1|		default: goto yy54;
  ------------------
  |  Branch (1051:3): [True: 1, False: 95]
  ------------------
 1052|     96|	}
 1053|     69|yy56:
 1054|     69|	YYSKIP();
  ------------------
  |  |   33|     69|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     69|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1055|     69|	YYBACKUP();
  ------------------
  |  |   34|     69|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|     69|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|     69|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1056|     69|	yych = YYPEEK();
  ------------------
  |  |   31|     69|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     69|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     69|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 69, False: 0]
  |  |  ------------------
  ------------------
 1057|     69|	switch (yych) {
 1058|     69|		case 's': goto yy58;
  ------------------
  |  Branch (1058:3): [True: 69, False: 0]
  ------------------
 1059|      0|		default: goto yy54;
  ------------------
  |  Branch (1059:3): [True: 0, False: 69]
  ------------------
 1060|     69|	}
 1061|    155|yy57:
 1062|    155|	YYSKIP();
  ------------------
  |  |   33|    155|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    155|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1063|    155|	{
 1064|       |        // Find the end position of the NodeId body and parse
 1065|   462k|        for(; pos < end; pos++) {
  ------------------
  |  Branch (1065:15): [True: 462k, False: 12]
  ------------------
 1066|   462k|            if(*pos == '%') {
  ------------------
  |  Branch (1066:16): [True: 6, False: 462k]
  ------------------
 1067|      6|                pos += 2;
 1068|      6|                continue;
 1069|      6|            }
 1070|   462k|            if(isReservedPercentExtended(*pos))
  ------------------
  |  Branch (1070:16): [True: 143, False: 462k]
  ------------------
 1071|    143|                break;
 1072|   462k|        }
 1073|    155|        if(pos > end) {
  ------------------
  |  Branch (1073:12): [True: 0, False: 155]
  ------------------
 1074|      0|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1075|      0|            goto cleanup;
 1076|      0|        }
 1077|    155|        res = parse_nodeid(&ao->nodeId, str.data, pos, UA_ESCAPING_PERCENT, NULL);
 1078|    155|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    155|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1078:12): [True: 20, False: 135]
  ------------------
 1079|     20|            goto cleanup;
 1080|    135|        goto parse_path;
 1081|    155|    }
 1082|    135|yy58:
 1083|     69|	YYSKIP();
  ------------------
  |  |   33|     69|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     69|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1084|     69|	yych = YYPEEK();
  ------------------
  |  |   31|     69|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     69|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     69|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 69, False: 0]
  |  |  ------------------
  ------------------
 1085|     69|	switch (yych) {
 1086|     57|		case '=': goto yy60;
  ------------------
  |  Branch (1086:3): [True: 57, False: 12]
  ------------------
 1087|     12|		case 'u': goto yy61;
  ------------------
  |  Branch (1087:3): [True: 12, False: 57]
  ------------------
 1088|      0|		default: goto yy59;
  ------------------
  |  Branch (1088:3): [True: 0, False: 69]
  ------------------
 1089|     69|	}
 1090|      9|yy59:
 1091|      9|	YYRESTORE();
  ------------------
  |  |   35|      9|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|      9|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|      9|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
 1092|      9|	goto yy54;
 1093|     57|yy60:
 1094|     57|	YYSKIP();
  ------------------
  |  |   33|     57|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     57|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1095|     57|	yych = YYPEEK();
  ------------------
  |  |   31|     57|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     57|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     57|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 57, False: 0]
  |  |  ------------------
  ------------------
 1096|     57|	switch (yych) {
 1097|      0|		case '0':
  ------------------
  |  Branch (1097:3): [True: 0, False: 57]
  ------------------
 1098|      8|		case '1':
  ------------------
  |  Branch (1098:3): [True: 8, False: 49]
  ------------------
 1099|     12|		case '2':
  ------------------
  |  Branch (1099:3): [True: 4, False: 53]
  ------------------
 1100|     50|		case '3':
  ------------------
  |  Branch (1100:3): [True: 38, False: 19]
  ------------------
 1101|     50|		case '4':
  ------------------
  |  Branch (1101:3): [True: 0, False: 57]
  ------------------
 1102|     51|		case '5':
  ------------------
  |  Branch (1102:3): [True: 1, False: 56]
  ------------------
 1103|     57|		case '6':
  ------------------
  |  Branch (1103:3): [True: 6, False: 51]
  ------------------
 1104|     57|		case '7':
  ------------------
  |  Branch (1104:3): [True: 0, False: 57]
  ------------------
 1105|     57|		case '8':
  ------------------
  |  Branch (1105:3): [True: 0, False: 57]
  ------------------
 1106|     57|		case '9': goto yy62;
  ------------------
  |  Branch (1106:3): [True: 0, False: 57]
  ------------------
 1107|      0|		default: goto yy59;
  ------------------
  |  Branch (1107:3): [True: 0, False: 57]
  ------------------
 1108|     57|	}
 1109|     12|yy61:
 1110|     12|	YYSKIP();
  ------------------
  |  |   33|     12|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     12|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1111|     12|	yych = YYPEEK();
  ------------------
  |  |   31|     12|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     12|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     12|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 12, False: 0]
  |  |  ------------------
  ------------------
 1112|     12|	switch (yych) {
 1113|      8|		case '=': goto yy63;
  ------------------
  |  Branch (1113:3): [True: 8, False: 4]
  ------------------
 1114|      4|		default: goto yy59;
  ------------------
  |  Branch (1114:3): [True: 4, False: 8]
  ------------------
 1115|     12|	}
 1116|   601k|yy62:
 1117|   601k|	YYSKIP();
  ------------------
  |  |   33|   601k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   601k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1118|   601k|	yych = YYPEEK();
  ------------------
  |  |   31|   601k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   601k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   601k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 601k, False: 0]
  |  |  ------------------
  ------------------
 1119|   601k|	switch (yych) {
 1120|   597k|		case '0':
  ------------------
  |  Branch (1120:3): [True: 597k, False: 4.63k]
  ------------------
 1121|   597k|		case '1':
  ------------------
  |  Branch (1121:3): [True: 539, False: 601k]
  ------------------
 1122|   598k|		case '2':
  ------------------
  |  Branch (1122:3): [True: 471, False: 601k]
  ------------------
 1123|   598k|		case '3':
  ------------------
  |  Branch (1123:3): [True: 518, False: 601k]
  ------------------
 1124|   599k|		case '4':
  ------------------
  |  Branch (1124:3): [True: 505, False: 601k]
  ------------------
 1125|   599k|		case '5':
  ------------------
  |  Branch (1125:3): [True: 467, False: 601k]
  ------------------
 1126|   600k|		case '6':
  ------------------
  |  Branch (1126:3): [True: 516, False: 601k]
  ------------------
 1127|   600k|		case '7':
  ------------------
  |  Branch (1127:3): [True: 532, False: 601k]
  ------------------
 1128|   601k|		case '8':
  ------------------
  |  Branch (1128:3): [True: 528, False: 601k]
  ------------------
 1129|   601k|		case '9': goto yy62;
  ------------------
  |  Branch (1129:3): [True: 505, False: 601k]
  ------------------
 1130|     56|		case ';': goto yy64;
  ------------------
  |  Branch (1130:3): [True: 56, False: 601k]
  ------------------
 1131|      1|		default: goto yy59;
  ------------------
  |  Branch (1131:3): [True: 1, False: 601k]
  ------------------
 1132|   601k|	}
 1133|    197|yy63:
 1134|    197|	YYSKIP();
  ------------------
  |  |   33|    197|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    197|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1135|    197|	yych = YYPEEK();
  ------------------
  |  |   31|    197|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    197|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    197|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 197, False: 0]
  |  |  ------------------
  ------------------
 1136|    197|	switch (yych) {
 1137|      3|		case 0x00: goto yy59;
  ------------------
  |  Branch (1137:3): [True: 3, False: 194]
  ------------------
 1138|      5|		case ';': goto yy64;
  ------------------
  |  Branch (1138:3): [True: 5, False: 192]
  ------------------
 1139|    189|		default: goto yy63;
  ------------------
  |  Branch (1139:3): [True: 189, False: 8]
  ------------------
 1140|    197|	}
 1141|     61|yy64:
 1142|     61|	YYSKIP();
  ------------------
  |  |   33|     61|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     61|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1143|     61|	yych = YYPEEK();
  ------------------
  |  |   31|     61|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     61|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     61|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 61, False: 0]
  |  |  ------------------
  ------------------
 1144|     61|	switch (yych) {
 1145|      3|		case 'b':
  ------------------
  |  Branch (1145:3): [True: 3, False: 58]
  ------------------
 1146|      3|		case 'g':
  ------------------
  |  Branch (1146:3): [True: 0, False: 61]
  ------------------
 1147|     60|		case 'i':
  ------------------
  |  Branch (1147:3): [True: 57, False: 4]
  ------------------
 1148|     60|		case 's': goto yy65;
  ------------------
  |  Branch (1148:3): [True: 0, False: 61]
  ------------------
 1149|      1|		default: goto yy59;
  ------------------
  |  Branch (1149:3): [True: 1, False: 60]
  ------------------
 1150|     61|	}
 1151|     60|yy65:
 1152|     60|	YYSKIP();
  ------------------
  |  |   33|     60|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     60|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1153|     60|	yych = YYPEEK();
  ------------------
  |  |   31|     60|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     60|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     60|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 60, False: 0]
  |  |  ------------------
  ------------------
 1154|     60|	switch (yych) {
 1155|     60|		case '=': goto yy57;
  ------------------
  |  Branch (1155:3): [True: 60, False: 0]
  ------------------
 1156|      0|		default: goto yy59;
  ------------------
  |  Branch (1156:3): [True: 0, False: 60]
  ------------------
 1157|     60|	}
 1158|     60|}
 1159|       |
 1160|       |
 1161|       |    /* Parse the BrowsePath */
 1162|    430| parse_path:
 1163|    430|    res = parse_relativepath(&ao->browsePath, &pos, end, NULL,
 1164|    430|                             UA_ESCAPING_PERCENT_EXTENDED, defaultNamespaceIndex);
 1165|    430|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    430|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1165:8): [True: 89, False: 341]
  ------------------
 1166|     89|        goto cleanup;
 1167|       |
 1168|       |    /* Parse the AttributeId */
 1169|    341|    if(pos < end && *pos == '#') {
  ------------------
  |  Branch (1169:8): [True: 59, False: 282]
  |  Branch (1169:21): [True: 14, False: 45]
  ------------------
 1170|     14|        const u8 *attr_pos = ++pos;
 1171|   292k|        while(pos < end && ((*pos >= 'a' && *pos <= 'z') ||
  ------------------
  |  Branch (1171:15): [True: 292k, False: 10]
  |  Branch (1171:30): [True: 280k, False: 11.5k]
  |  Branch (1171:45): [True: 280k, False: 0]
  ------------------
 1172|   292k|                            (*pos >= 'A' && *pos <= 'Z'))) {
  ------------------
  |  Branch (1172:30): [True: 11.5k, False: 4]
  |  Branch (1172:45): [True: 11.5k, False: 0]
  ------------------
 1173|   292k|            pos++;
 1174|   292k|        }
 1175|     14|        UA_String attrString = {(size_t)(pos - attr_pos), (UA_Byte*)(uintptr_t)attr_pos};
 1176|     14|        ao->attributeId = UA_AttributeId_fromName(attrString);
 1177|     14|        if(ao->attributeId == UA_ATTRIBUTEID_INVALID) {
  ------------------
  |  Branch (1177:12): [True: 14, False: 0]
  ------------------
 1178|     14|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1179|     14|            goto cleanup;
 1180|     14|        }
 1181|     14|    }
 1182|       |
 1183|       |    /* Parse the IndexRange */
 1184|    327|    if(pos < end && *pos == '[') {
  ------------------
  |  Branch (1184:8): [True: 45, False: 282]
  |  Branch (1184:21): [True: 26, False: 19]
  ------------------
 1185|     26|        const u8 *range_pos = ++pos;
 1186|  9.77M|        while(pos < end && *pos != ']') {
  ------------------
  |  Branch (1186:15): [True: 9.77M, False: 0]
  |  Branch (1186:28): [True: 9.77M, False: 26]
  ------------------
 1187|  9.77M|            pos++;
 1188|  9.77M|        }
 1189|     26|        if(pos == end) {
  ------------------
  |  Branch (1189:12): [True: 0, False: 26]
  ------------------
 1190|      0|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1191|      0|            goto cleanup;
 1192|      0|        }
 1193|     26|        UA_String rangeString = {(size_t)(pos - range_pos), (UA_Byte*)(uintptr_t)range_pos};
 1194|     26|        if(rangeString.length > 0)
  ------------------
  |  Branch (1194:12): [True: 26, False: 0]
  ------------------
 1195|     26|            res = UA_String_copy(&rangeString, &ao->indexRange);
 1196|     26|        pos++;
 1197|     26|    }
 1198|       |
 1199|       |    /* Check that we have parsed the entire string */
 1200|    327|    if(pos != end)
  ------------------
  |  Branch (1200:8): [True: 19, False: 308]
  ------------------
 1201|     19|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1202|       |
 1203|       |
 1204|    450| cleanup:
 1205|    450|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    450|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1205:8): [True: 142, False: 308]
  ------------------
 1206|    142|        UA_AttributeOperand_clear(ao);
 1207|    450|    return res;
 1208|    327|}

UA_AttributeId_fromName:
   55|     14|UA_AttributeId_fromName(const UA_String name) {
   56|    406|    for(size_t i = 0; i < 28; i++) {
  ------------------
  |  Branch (56:23): [True: 392, False: 14]
  ------------------
   57|    392|        if(strlen(attributeIdNames[i]) != name.length)
  ------------------
  |  Branch (57:12): [True: 392, False: 0]
  ------------------
   58|    392|            continue;
   59|      0|        for(size_t j = 0; j < name.length; j++) {
  ------------------
  |  Branch (59:27): [True: 0, False: 0]
  ------------------
   60|      0|            if((attributeIdNames[i][j] | 32) != (name.data[j] | 32))
  ------------------
  |  Branch (60:16): [True: 0, False: 0]
  ------------------
   61|      0|                goto next;
   62|      0|        }
   63|      0|        return (UA_AttributeId)i;
   64|      0|    next:
   65|      0|        continue;
   66|      0|    }
   67|     14|    return UA_ATTRIBUTEID_INVALID;
   68|     14|}
UA_readNumberWithBase:
  110|    519|UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) {
  111|    519|    UA_assert(buf);
  ------------------
  |  |  385|    519|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (111:5): [True: 519, False: 0]
  ------------------
  112|    519|    UA_assert(number);
  ------------------
  |  |  385|    519|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (112:5): [True: 519, False: 0]
  ------------------
  113|    519|    u32 n = 0;
  114|    519|    size_t progress = 0;
  115|       |    /* read numbers until the end or a non-number character appears */
  116|   360k|    while(progress < buflen) {
  ------------------
  |  Branch (116:11): [True: 359k, False: 486]
  ------------------
  117|   359k|        u8 c = buf[progress];
  118|   359k|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (118:12): [True: 359k, False: 3]
  |  Branch (118:24): [True: 359k, False: 30]
  |  Branch (118:36): [True: 359k, False: 0]
  ------------------
  119|   359k|           n = (n * base) + c - '0';
  120|     33|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (120:17): [True: 33, False: 0]
  |  Branch (120:29): [True: 29, False: 4]
  |  Branch (120:41): [True: 10, False: 19]
  |  Branch (120:53): [True: 0, False: 10]
  ------------------
  121|      0|           n = (n * base) + c-'a' + 10;
  122|     33|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (122:17): [True: 33, False: 0]
  |  Branch (122:29): [True: 29, False: 4]
  |  Branch (122:41): [True: 0, False: 29]
  |  Branch (122:53): [True: 0, False: 0]
  ------------------
  123|      0|           n = (n * base) + c-'A' + 10;
  124|     33|        else
  125|     33|           break;
  126|   359k|        ++progress;
  127|   359k|    }
  128|    519|    *number = n;
  129|    519|    return progress;
  130|    519|}
UA_readNumber:
  133|    519|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  134|    519|    return UA_readNumberWithBase(buf, buflen, number, 10);
  135|    519|}
lookupRefType:
  722|    651|lookupRefType(UA_Server *server, UA_QualifiedName *qn, UA_NodeId *outRefTypeId) {
  723|       |    /* Check well-known ReferenceTypes first */
  724|    651|    if(qn->namespaceIndex == 0) {
  ------------------
  |  Branch (724:8): [True: 651, False: 0]
  ------------------
  725|  3.30k|        for(size_t i = 0; i < KNOWNREFTYPES; i++) {
  ------------------
  |  |  700|  3.30k|#define KNOWNREFTYPES 17
  ------------------
  |  Branch (725:27): [True: 3.22k, False: 77]
  ------------------
  726|  3.22k|            if(UA_String_equal(&qn->name, &knownRefTypes[i].browseName)) {
  ------------------
  |  Branch (726:16): [True: 574, False: 2.65k]
  ------------------
  727|    574|                *outRefTypeId = UA_NODEID_NUMERIC(0, knownRefTypes[i].identifier);
  728|    574|                return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    574|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  729|    574|            }
  730|  3.22k|        }
  731|    651|    }
  732|       |
  733|       |    /* Browse the information model. Return the first results if the browse name
  734|       |     * in the hierarchy is ambiguous. */
  735|     77|    if(server) {
  ------------------
  |  Branch (735:8): [True: 0, False: 77]
  ------------------
  736|      0|        UA_BrowseDescription bd;
  737|      0|        UA_BrowseDescription_init(&bd);
  738|      0|        bd.nodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_REFERENCES);
  ------------------
  |  |   44|      0|#define UA_NS0ID_REFERENCES 31 /* ReferenceType */
  ------------------
  739|      0|        bd.browseDirection = UA_BROWSEDIRECTION_FORWARD;
  740|      0|        bd.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HASSUBTYPE);
  ------------------
  |  |   56|      0|#define UA_NS0ID_HASSUBTYPE 45 /* ReferenceType */
  ------------------
  741|      0|        bd.nodeClassMask = UA_NODECLASS_REFERENCETYPE;
  742|       |
  743|      0|        size_t resultsSize = 0;
  744|      0|        UA_ExpandedNodeId *results = NULL;
  745|      0|        UA_StatusCode res =
  746|      0|            UA_Server_browseRecursive(server, &bd, &resultsSize, &results);
  747|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (747:12): [True: 0, False: 0]
  ------------------
  748|      0|            return res;
  749|      0|        for(size_t i = 0; i < resultsSize; i++) {
  ------------------
  |  Branch (749:27): [True: 0, False: 0]
  ------------------
  750|      0|            UA_QualifiedName bn;
  751|      0|            UA_Server_readBrowseName(server, results[i].nodeId, &bn);
  752|      0|            if(UA_QualifiedName_equal(qn, &bn)) {
  ------------------
  |  Branch (752:16): [True: 0, False: 0]
  ------------------
  753|      0|                UA_QualifiedName_clear(&bn);
  754|      0|                *outRefTypeId = results[i].nodeId;
  755|      0|                UA_NodeId_clear(&results[i].nodeId);
  756|      0|                UA_Array_delete(results, resultsSize, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|      0|#define UA_TYPES_NODEID 16
  ------------------
  757|      0|                return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  758|      0|            }
  759|      0|            UA_QualifiedName_clear(&bn);
  760|      0|        }
  761|       |
  762|      0|        UA_Array_delete(results, resultsSize, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|      0|#define UA_TYPES_NODEID 16
  ------------------
  763|      0|    }
  764|       |
  765|     77|    return UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  232|     77|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
  766|     77|}
getRefTypeBrowseName:
  769|  4.32k|getRefTypeBrowseName(const UA_NodeId *refTypeId, UA_String *outBN) {
  770|       |    /* Canonical name known? */
  771|  4.32k|    if(refTypeId->namespaceIndex == 0 &&
  ------------------
  |  Branch (771:8): [True: 4.32k, False: 0]
  ------------------
  772|  4.32k|       refTypeId->identifierType == UA_NODEIDTYPE_NUMERIC) {
  ------------------
  |  Branch (772:8): [True: 670, False: 3.65k]
  ------------------
  773|  2.67k|        for(size_t i = 0; i < KNOWNREFTYPES; i++) {
  ------------------
  |  |  700|  2.67k|#define KNOWNREFTYPES 17
  ------------------
  |  Branch (773:27): [True: 2.63k, False: 36]
  ------------------
  774|  2.63k|            if(refTypeId->identifier.numeric != knownRefTypes[i].identifier)
  ------------------
  |  Branch (774:16): [True: 2.00k, False: 634]
  ------------------
  775|  2.00k|                continue;
  776|    634|            memcpy(outBN->data, knownRefTypes[i].browseName.data, knownRefTypes[i].browseName.length);
  777|    634|            outBN->length = knownRefTypes[i].browseName.length;
  778|    634|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    634|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  779|  2.63k|        }
  780|    670|    }
  781|       |
  782|       |    /* Print the NodeId */
  783|  3.69k|    return UA_NodeId_print(refTypeId, outBN);
  784|  4.32k|}
UA_String_unescape:
  798|  80.9k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  799|  80.9k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (799:8): [True: 0, False: 80.9k]
  ------------------
  800|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  801|       |
  802|       |    /* Does the string need escaping? */
  803|  80.9k|    UA_String tmp;
  804|  80.9k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  80.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  805|  80.9k|    u8 *pos = str->data;
  806|  80.9k|    u8 *end = str->data + str->length;
  807|  80.9k|    u8 escape_char = (esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (807:23): [True: 74, False: 80.8k]
  ------------------
  808|  80.9k|                      esc == UA_ESCAPING_PERCENT_EXTENDED) ? '%' : '&';
  ------------------
  |  Branch (808:23): [True: 80.8k, False: 0]
  ------------------
  809|  11.8M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (809:11): [True: 11.7M, False: 80.2k]
  ------------------
  810|  11.7M|        if(*pos == escape_char)
  ------------------
  |  Branch (810:12): [True: 676, False: 11.7M]
  ------------------
  811|    676|            goto escape;
  812|  11.7M|    }
  813|       |
  814|  80.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  80.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  815|       |
  816|    676| escape:
  817|    676|    if(copyEscape) {
  ------------------
  |  Branch (817:8): [True: 0, False: 676]
  ------------------
  818|      0|        res = UA_String_copy(str, &tmp);
  819|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (819:12): [True: 0, False: 0]
  ------------------
  820|      0|            return res;
  821|      0|        pos = tmp.data;
  822|      0|        end = tmp.data + tmp.length;
  823|      0|    }
  824|       |
  825|    676|    u8 byte = 0;
  826|    676|    u8 *writepos = pos;
  827|       |
  828|    676|    res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    676|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  829|    676|    if(esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (829:8): [True: 1, False: 675]
  ------------------
  830|    676|       esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (830:8): [True: 675, False: 0]
  ------------------
  831|       |        /* Percent-Escaping */
  832|  10.7M|        for(; pos < end; pos++) {
  ------------------
  |  Branch (832:15): [True: 10.7M, False: 631]
  ------------------
  833|  10.7M|            if(*pos == '%') {
  ------------------
  |  Branch (833:16): [True: 9.90M, False: 883k]
  ------------------
  834|  9.90M|                if(pos + 2 >= end || !isHex(pos[1]) || !isHex(pos[2]))
  ------------------
  |  Branch (834:20): [True: 0, False: 9.90M]
  |  Branch (834:38): [True: 42, False: 9.90M]
  |  Branch (834:56): [True: 3, False: 9.90M]
  ------------------
  835|     45|                    goto out;
  836|  9.90M|                if(pos[1] >= 'a')
  ------------------
  |  Branch (836:20): [True: 364, False: 9.90M]
  ------------------
  837|    364|                    byte = pos[1] - ('a' - 10);
  838|  9.90M|                else if(pos[1] >= 'A')
  ------------------
  |  Branch (838:25): [True: 8, False: 9.90M]
  ------------------
  839|      8|                    byte = pos[1] - ('A' - 10);
  840|  9.90M|                else
  841|  9.90M|                    byte = pos[1] - '0';
  842|  9.90M|                byte <<= 4;
  843|       |
  844|  9.90M|                if(pos[2] >= 'a')
  ------------------
  |  Branch (844:20): [True: 96.9k, False: 9.80M]
  ------------------
  845|  96.9k|                    byte += (u8)(pos[2] - ('a' - 10));
  846|  9.80M|                else if(pos[2] >= 'A')
  ------------------
  |  Branch (846:25): [True: 53, False: 9.80M]
  ------------------
  847|     53|                    byte += (u8)(pos[2] - ('A' - 10));
  848|  9.80M|                else
  849|  9.80M|                    byte += (u8)(pos[2] - '0');
  850|       |
  851|  9.90M|                pos += 2;
  852|  9.90M|                *writepos++ = byte;
  853|  9.90M|                continue;
  854|  9.90M|            }
  855|   883k|            *writepos++ = *pos;
  856|   883k|        }
  857|    676|    } else {
  858|       |        /* And-Escaping */
  859|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (859:15): [True: 0, False: 0]
  ------------------
  860|      0|            if(*pos == '&') {
  ------------------
  |  Branch (860:16): [True: 0, False: 0]
  ------------------
  861|      0|                pos++;
  862|      0|                if(pos == end)
  ------------------
  |  Branch (862:20): [True: 0, False: 0]
  ------------------
  863|      0|                    goto out;
  864|      0|            }
  865|      0|            *writepos++ = *pos;
  866|      0|        }
  867|      0|    }
  868|    631|    res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    631|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  869|       |
  870|    676| out:
  871|    676|    if(copyEscape) {
  ------------------
  |  Branch (871:8): [True: 0, False: 676]
  ------------------
  872|      0|        tmp.length = (size_t)(writepos - tmp.data);
  873|      0|        if(tmp.length == 0)
  ------------------
  |  Branch (873:12): [True: 0, False: 0]
  ------------------
  874|      0|            UA_String_clear(&tmp);
  875|      0|        if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (875:12): [True: 0, False: 0]
  ------------------
  876|      0|            *str = tmp;
  877|      0|        else
  878|      0|            UA_String_clear(&tmp);
  879|    676|    } else if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    676|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (879:15): [True: 631, False: 45]
  ------------------
  880|    631|        str->length = (size_t)(writepos - str->data);
  881|    631|    }
  882|    676|    return res;
  883|    631|}
UA_String_escapedSize:
  889|  82.3k|UA_String_escapedSize(const UA_String s, UA_Escaping esc) {
  890|       |    /* Find out the overhead from escaping */
  891|  82.3k|    size_t overhead = 0;
  892|  61.5M|    for(size_t j = 0; j < s.length; j++) {
  ------------------
  |  Branch (892:23): [True: 61.4M, False: 82.3k]
  ------------------
  893|  61.4M|        if(esc == UA_ESCAPING_AND_EXTENDED)
  ------------------
  |  Branch (893:12): [True: 0, False: 61.4M]
  ------------------
  894|      0|            overhead += isReservedAndExtended(s.data[j]);
  895|  61.4M|        else if(esc == UA_ESCAPING_AND)
  ------------------
  |  Branch (895:17): [True: 0, False: 61.4M]
  ------------------
  896|      0|            overhead += isReservedAnd(s.data[j]);
  897|  61.4M|        else if(esc == UA_ESCAPING_PERCENT)
  ------------------
  |  Branch (897:17): [True: 0, False: 61.4M]
  ------------------
  898|      0|            overhead += (isReservedPercent(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (898:26): [True: 0, False: 0]
  ------------------
  899|  61.4M|        else /* if(esc == UA_ESCAPING_PERCENT_EXTENDED) */
  900|  61.4M|            overhead += (isReservedPercentExtended(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (900:26): [True: 59.4M, False: 2.05M]
  ------------------
  901|  61.4M|    }
  902|       |
  903|  82.3k|    return s.length + overhead;
  904|  82.3k|}
UA_String_escapeInsert:
  907|  81.5k|UA_String_escapeInsert(u8 *pos, const UA_String s2, UA_Escaping esc) {
  908|  81.5k|    u8 *begin = pos;
  909|       |
  910|  81.5k|    if(esc == UA_ESCAPING_NONE) {
  ------------------
  |  Branch (910:8): [True: 2.29k, False: 79.2k]
  ------------------
  911|  20.3M|        for(size_t j = 0; j < s2.length; j++)
  ------------------
  |  Branch (911:27): [True: 20.3M, False: 2.29k]
  ------------------
  912|  20.3M|            *pos++ = s2.data[j];
  913|  79.2k|    } else if(esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (913:15): [True: 0, False: 79.2k]
  |  Branch (913:45): [True: 79.2k, False: 0]
  ------------------
  914|  20.7M|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (914:27): [True: 20.6M, False: 79.2k]
  ------------------
  915|  20.6M|            UA_Boolean reserved = (esc == UA_ESCAPING_PERCENT_EXTENDED) ?
  ------------------
  |  Branch (915:35): [True: 20.6M, False: 0]
  ------------------
  916|  20.6M|                isReservedPercentExtended(s2.data[j]) : isReservedPercent(s2.data[j]);
  917|  20.6M|            if(UA_LIKELY(!reserved)) {
  ------------------
  |  |  564|  20.6M|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (564:23): [True: 880k, False: 19.8M]
  |  |  ------------------
  ------------------
  918|   880k|                *pos++ = s2.data[j];
  919|  19.8M|            } else {
  920|  19.8M|                *pos++ = '%';
  921|  19.8M|                *pos++ = hexchars[s2.data[j] >> 4];
  922|  19.8M|                *pos++ = hexchars[s2.data[j] & 0x0f];
  923|  19.8M|            }
  924|  20.6M|        }
  925|  79.2k|    } else {
  926|      0|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (926:27): [True: 0, False: 0]
  ------------------
  927|      0|            UA_Boolean reserved = (esc == UA_ESCAPING_AND_EXTENDED) ?
  ------------------
  |  Branch (927:35): [True: 0, False: 0]
  ------------------
  928|      0|                isReservedAndExtended(s2.data[j]) : isReservedAnd(s2.data[j]);
  929|      0|            if(reserved)
  ------------------
  |  Branch (929:16): [True: 0, False: 0]
  ------------------
  930|      0|                *pos++ = '&';
  931|      0|            *pos++ = s2.data[j];
  932|      0|        }
  933|      0|    }
  934|       |
  935|  81.5k|    return (size_t)(pos - begin);
  936|  81.5k|}
UA_String_escapeAppend:
  939|  79.1k|UA_String_escapeAppend(UA_String *s, const UA_String s2, UA_Escaping esc) {
  940|  79.1k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (940:8): [True: 0, False: 79.1k]
  ------------------
  941|      0|        return UA_String_append(s, s2);
  942|       |
  943|       |    /* Allocate memory for the additional escaped string */
  944|  79.1k|    size_t escapedLength = UA_String_escapedSize(s2, esc);
  945|  79.1k|    UA_Byte *buf = (UA_Byte*)
  946|  79.1k|        UA_realloc(s->data, s->length + s2.length + escapedLength);
  ------------------
  |  |   21|  79.1k|#define UA_realloc(ptr, size) UA_reallocSingleton(ptr, size)
  ------------------
  947|  79.1k|    if(!buf)
  ------------------
  |  Branch (947:8): [True: 0, False: 79.1k]
  ------------------
  948|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  949|       |
  950|       |    /* Escape and insert at the end */
  951|  79.1k|    s->data = buf;
  952|  79.1k|    UA_String_escapeInsert(s->data + s->length, s2, esc);
  953|  79.1k|    s->length += escapedLength;
  954|  79.1k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  79.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  955|  79.1k|}
UA_AttributeOperand_print:
 1119|    308|                          UA_String *out) {
 1120|    308|    UA_String tmp = UA_STRING_NULL;
 1121|    308|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    308|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1122|       |
 1123|       |    /* Print the TypeDefinitionId */
 1124|    308|    if(!UA_NodeId_equal(&objectsFolder, &ao->nodeId)) {
  ------------------
  |  Branch (1124:8): [True: 132, False: 176]
  ------------------
 1125|    132|        UA_Byte nodeIdBuf[512];
 1126|    132|        UA_String nodeIdBufStr = {512, nodeIdBuf};
 1127|    132|        res |= nodeId_printEscape(&ao->nodeId, &nodeIdBufStr,
 1128|    132|                                  NULL, UA_ESCAPING_PERCENT_EXTENDED);
 1129|    132|        res |= UA_String_append(&tmp, nodeIdBufStr);
 1130|    132|    }
 1131|       |
 1132|       |    /* Print the BrowsePath */
 1133|    308|    UA_String rpstr = UA_STRING_NULL;
 1134|    308|    UA_assert(rpstr.data == NULL && rpstr.length == 0); /* pacify clang scan-build */
  ------------------
  |  |  385|    308|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1134:5): [True: 308, False: 0]
  |  Branch (1134:5): [True: 308, False: 0]
  ------------------
 1135|    308|    res |= printRelativePath(&ao->browsePath, &rpstr, UA_ESCAPING_PERCENT_EXTENDED);
 1136|    308|    res |= UA_String_append(&tmp, rpstr);
 1137|    308|    UA_String_clear(&rpstr);
 1138|       |
 1139|       |    /* Print the attribute name */
 1140|    308|    if(ao->attributeId != UA_ATTRIBUTEID_VALUE) {
  ------------------
  |  Branch (1140:8): [True: 0, False: 308]
  ------------------
 1141|      0|        const char *attrName= UA_AttributeId_name((UA_AttributeId)ao->attributeId);
 1142|      0|        res |= UA_String_append(&tmp, UA_STRING("#"));
 1143|      0|        res |= UA_String_append(&tmp, UA_STRING((char*)(uintptr_t)attrName));
 1144|      0|    }
 1145|       |
 1146|       |    /* Print the IndexRange */
 1147|    308|    if(ao->indexRange.length > 0) {
  ------------------
  |  Branch (1147:8): [True: 26, False: 282]
  ------------------
 1148|     26|        res |= UA_String_append(&tmp, UA_STRING("["));
 1149|     26|        res |= UA_String_append(&tmp, ao->indexRange);
 1150|     26|        res |= UA_String_append(&tmp, UA_STRING("]"));
 1151|     26|    }
 1152|       |
 1153|       |    /* Encoding failed, clean up */
 1154|    308|    if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    308|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1154:8): [True: 0, False: 308]
  ------------------
 1155|      0|        UA_String_clear(&tmp);
 1156|      0|        return res;
 1157|      0|    }
 1158|       |
 1159|    308|    return moveTmpToOut(&tmp, out);
 1160|    308|}
ua_util.c:isHex:
  791|  19.8M|isHex(u8 c) {
  792|  19.8M|    return ((c >= 'a' && c <= 'f') ||
  ------------------
  |  Branch (792:14): [True: 97.3k, False: 19.7M]
  |  Branch (792:26): [True: 97.2k, False: 21]
  ------------------
  793|  19.7M|            (c >= 'A' && c <= 'F') ||
  ------------------
  |  Branch (793:14): [True: 84, False: 19.7M]
  |  Branch (793:26): [True: 62, False: 22]
  ------------------
  794|  19.7M|            (c >= '0' && c <= '9'));
  ------------------
  |  Branch (794:14): [True: 19.7M, False: 23]
  |  Branch (794:26): [True: 19.7M, False: 22]
  ------------------
  795|  19.8M|}
ua_util.c:printRelativePath:
  995|    308|printRelativePath(const UA_RelativePath *rp, UA_String *out, UA_Escaping esc) {
  996|    308|    UA_String tmp = UA_STRING_NULL;
  997|    308|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    308|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  998|  75.9k|    for(size_t i = 0; i < rp->elementsSize && res == UA_STATUSCODE_GOOD; i++) {
  ------------------
  |  |   16|  75.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (998:23): [True: 75.6k, False: 308]
  |  Branch (998:47): [True: 75.6k, False: 0]
  ------------------
  999|       |        /* Print the reference type */
 1000|  75.6k|        UA_RelativePathElement *elm = &rp->elements[i];
 1001|  75.6k|        if(UA_NodeId_equal(&hierarchicalRefs, &elm->referenceTypeId) &&
  ------------------
  |  Branch (1001:12): [True: 72.4k, False: 3.23k]
  ------------------
 1002|  72.4k|           !elm->isInverse && elm->includeSubtypes) {
  ------------------
  |  Branch (1002:12): [True: 72.3k, False: 128]
  |  Branch (1002:31): [True: 72.2k, False: 128]
  ------------------
 1003|  72.2k|            res |= UA_String_append(&tmp, UA_STRING("/"));
 1004|  72.2k|        } else if(esc == UA_ESCAPING_AND &&
  ------------------
  |  Branch (1004:19): [True: 0, False: 3.48k]
  ------------------
 1005|      0|                  UA_NodeId_equal(&aggregatesRefs, &elm->referenceTypeId) &&
  ------------------
  |  Branch (1005:19): [True: 0, False: 0]
  ------------------
 1006|      0|                  !elm->isInverse && elm->includeSubtypes) {
  ------------------
  |  Branch (1006:19): [True: 0, False: 0]
  |  Branch (1006:38): [True: 0, False: 0]
  ------------------
 1007|      0|            res |= UA_String_append(&tmp, UA_STRING("."));
 1008|  3.48k|        } else {
 1009|  3.48k|            res |= UA_String_append(&tmp, UA_STRING("<"));
 1010|  3.48k|            if(!elm->includeSubtypes)
  ------------------
  |  Branch (1010:16): [True: 128, False: 3.35k]
  ------------------
 1011|    128|                res |= UA_String_append(&tmp, UA_STRING("#"));
 1012|  3.48k|            if(elm->isInverse)
  ------------------
  |  Branch (1012:16): [True: 166, False: 3.32k]
  ------------------
 1013|    166|                res |= UA_String_append(&tmp, UA_STRING("!"));
 1014|  3.48k|            if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.48k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1014:16): [True: 0, False: 3.48k]
  ------------------
 1015|      0|                break;
 1016|       |
 1017|  3.48k|            UA_Byte bnBuf[512];
 1018|  3.48k|            UA_String bnBufStr = {512, bnBuf};
 1019|  3.48k|            res = getRefTypeBrowseName(&elm->referenceTypeId, &bnBufStr);
 1020|  3.48k|            if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  3.48k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1020:16): [True: 840, False: 2.64k]
  ------------------
 1021|    840|                UA_String_init(&bnBufStr);
 1022|    840|                res = getRefTypeBrowseName(&elm->referenceTypeId, &bnBufStr);
 1023|    840|                if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    840|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1023:20): [True: 0, False: 840]
  ------------------
 1024|      0|                    break;
 1025|    840|            }
 1026|  3.48k|            res |= UA_String_escapeAppend(&tmp, bnBufStr, esc);
 1027|  3.48k|            res |= UA_String_append(&tmp, UA_STRING(">"));
 1028|  3.48k|            if(bnBufStr.data != bnBuf)
  ------------------
  |  Branch (1028:16): [True: 840, False: 2.64k]
  ------------------
 1029|    840|                UA_String_clear(&bnBufStr);
 1030|  3.48k|        }
 1031|       |
 1032|       |        /* Print the qualified name */
 1033|  75.6k|        UA_QualifiedName *qn = &elm->targetName;
 1034|  75.6k|        if(qn->namespaceIndex > 0) {
  ------------------
  |  Branch (1034:12): [True: 16, False: 75.6k]
  ------------------
 1035|     16|            char nsStr[8]; /* Enough for a uint16 */
 1036|     16|            itoaUnsigned(qn->namespaceIndex, nsStr, 10);
 1037|     16|            res |= UA_String_append(&tmp, UA_STRING(nsStr));
 1038|     16|            res |= UA_String_append(&tmp, UA_STRING(":"));
 1039|     16|        }
 1040|  75.6k|        res |= UA_String_escapeAppend(&tmp, qn->name, esc);
 1041|  75.6k|    }
 1042|       |
 1043|       |    /* Encoding failed, clean up */
 1044|    308|    if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    308|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1044:8): [True: 0, False: 308]
  ------------------
 1045|      0|        UA_String_clear(&tmp);
 1046|      0|        return res;
 1047|      0|    }
 1048|       |
 1049|    308|    return moveTmpToOut(&tmp, out);
 1050|    308|}
ua_util.c:moveTmpToOut:
  958|    616|moveTmpToOut(UA_String *tmp, UA_String *out) {
  959|       |    /* Output has zero length */
  960|    616|    if(tmp->length == 0) {
  ------------------
  |  Branch (960:8): [True: 22, False: 594]
  ------------------
  961|     22|        UA_assert(tmp->data == NULL);
  ------------------
  |  |  385|     22|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (961:9): [True: 22, False: 0]
  ------------------
  962|     22|        if(out->data == NULL)
  ------------------
  |  Branch (962:12): [True: 22, False: 0]
  ------------------
  963|     22|            out->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     22|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  964|     22|        out->length = 0;
  965|     22|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     22|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  966|     22|    }
  967|       |
  968|       |    /* No output buffer provided, return the tmp buffer */
  969|    594|    if(out->length == 0) {
  ------------------
  |  Branch (969:8): [True: 594, False: 0]
  ------------------
  970|    594|        *out = *tmp;
  971|    594|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    594|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  972|    594|    }
  973|       |
  974|       |    /* The provided buffer is too short */
  975|      0|    if(out->length < tmp->length) {
  ------------------
  |  Branch (975:8): [True: 0, False: 0]
  ------------------
  976|      0|        UA_String_clear(tmp);
  977|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  978|      0|    }
  979|       |
  980|       |    /* Copy output to the provided buffer */
  981|      0|    memcpy(out->data, tmp->data, tmp->length);
  982|      0|    out->length = tmp->length;
  983|      0|    UA_String_clear(tmp);
  984|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  985|      0|}

ua_util.c:isReservedPercent:
   95|  82.1M|isReservedPercent(u8 c) {
   96|  82.1M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 9.14k, False: 82.1M]
  |  Branch (96:26): [True: 5.37k, False: 82.1M]
  |  Branch (96:38): [True: 77.7M, False: 4.39M]
  |  Branch (96:50): [True: 232, False: 4.38M]
  ------------------
   97|  82.1M|}
ua_util.c:isReservedPercentExtended:
  100|  82.1M|isReservedPercentExtended(u8 c) {
  101|  82.1M|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 77.7M, False: 4.38M]
  |  Branch (101:37): [True: 3.75k, False: 4.38M]
  |  Branch (101:49): [True: 3.05k, False: 4.38M]
  |  Branch (101:61): [True: 1.84k, False: 4.38M]
  |  Branch (101:73): [True: 13.7k, False: 4.36M]
  ------------------
  102|  4.36M|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 351k, False: 4.01M]
  |  Branch (102:25): [True: 173k, False: 3.84M]
  |  Branch (102:37): [True: 191k, False: 3.65M]
  |  Branch (102:49): [True: 46.4k, False: 3.60M]
  |  Branch (102:61): [True: 12.2k, False: 3.59M]
  |  Branch (102:73): [True: 0, False: 3.59M]
  ------------------
  103|  3.59M|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 2.74k, False: 3.58M]
  |  Branch (103:25): [True: 636k, False: 2.95M]
  |  Branch (103:37): [True: 4.08k, False: 2.94M]
  |  Branch (103:50): [True: 6.48k, False: 2.94M]
  |  Branch (103:62): [True: 4.43k, False: 2.93M]
  ------------------
  104|  82.1M|}
ua_types_lex.c:isReservedPercentExtended:
  100|   804k|isReservedPercentExtended(u8 c) {
  101|   804k|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 13, False: 804k]
  |  Branch (101:37): [True: 0, False: 804k]
  |  Branch (101:49): [True: 0, False: 804k]
  |  Branch (101:61): [True: 6, False: 804k]
  |  Branch (101:73): [True: 1, False: 804k]
  ------------------
  102|   804k|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 0, False: 804k]
  |  Branch (102:25): [True: 0, False: 804k]
  |  Branch (102:37): [True: 0, False: 804k]
  |  Branch (102:49): [True: 0, False: 804k]
  |  Branch (102:61): [True: 4.45k, False: 800k]
  |  Branch (102:73): [True: 0, False: 800k]
  ------------------
  103|   800k|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 1, False: 800k]
  |  Branch (103:25): [True: 73.0k, False: 727k]
  |  Branch (103:37): [True: 0, False: 727k]
  |  Branch (103:50): [True: 0, False: 727k]
  |  Branch (103:62): [True: 0, False: 727k]
  ------------------
  104|   804k|}
ua_types_lex.c:isReservedPercent:
   95|   804k|isReservedPercent(u8 c) {
   96|   804k|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 0, False: 804k]
  |  Branch (96:26): [True: 0, False: 804k]
  |  Branch (96:38): [True: 13, False: 804k]
  |  Branch (96:50): [True: 0, False: 804k]
  ------------------
   97|   804k|}

UA_memoryManager_setLimitFromLast4Bytes:
  161|    296|int UA_memoryManager_setLimitFromLast4Bytes(const uint8_t *data, size_t size) {
  162|    296|    UA_mallocSingleton = UA_memoryManager_malloc;
  163|    296|    UA_freeSingleton = UA_memoryManager_free;
  164|    296|    UA_callocSingleton = UA_memoryManager_calloc;
  165|    296|    UA_reallocSingleton = UA_memoryManager_realloc;
  166|    296|    if(size <4)
  ------------------
  |  Branch (166:8): [True: 0, False: 296]
  ------------------
  167|      0|        return 0;
  168|       |    // just cast the last 4 bytes to uint32
  169|    296|    const uint32_t *newLimit = (const uint32_t*)(uintptr_t)&(data[size-4]);
  170|    296|    uint32_t limit;
  171|       |    // use memcopy to avoid asan complaining on misaligned memory
  172|    296|    memcpy(&limit, newLimit, sizeof(uint32_t));
  173|    296|    memoryLimit = limit;
  174|    296|    return 1;
  175|    296|}
custom_memory_manager.c:UA_memoryManager_malloc:
  114|    304|static void *UA_memoryManager_malloc(size_t size) {
  115|    304|    if(totalMemorySize + size > memoryLimit)
  ------------------
  |  Branch (115:8): [True: 20, False: 284]
  ------------------
  116|     20|        return NULL;
  117|    284|    void *addr = malloc(size);
  118|    284|    if(!addr)
  ------------------
  |  Branch (118:8): [True: 0, False: 284]
  ------------------
  119|      0|        return NULL;
  120|    284|    addToMap(size, addr);
  121|    284|    return addr;
  122|    284|}
custom_memory_manager.c:addToMap:
   52|   242k|static int addToMap(size_t size, void *addr) {
   53|   242k|    struct UA_mm_entry *newEntry = (struct UA_mm_entry*)malloc(sizeof(struct UA_mm_entry));
   54|   242k|    if(!newEntry) {
  ------------------
  |  Branch (54:8): [True: 0, False: 242k]
  ------------------
   55|       |        //printf("MemoryManager: Could not allocate memory");
   56|      0|        return 0;
   57|      0|    }
   58|   242k|    newEntry->size = size;
   59|   242k|    newEntry->address = addr;
   60|   242k|    newEntry->next = NULL;
   61|   242k|    pthread_mutex_lock(&mutex);
   62|   242k|    newEntry->prev = address_map_last;
   63|   242k|    if(address_map_last)
  ------------------
  |  Branch (63:8): [True: 242k, False: 130]
  ------------------
   64|   242k|        address_map_last->next = newEntry;
   65|   242k|    address_map_last = newEntry;
   66|   242k|    totalMemorySize += size;
   67|   242k|    if(address_map_first == NULL)
  ------------------
  |  Branch (67:8): [True: 130, False: 242k]
  ------------------
   68|    130|        address_map_first = newEntry;
   69|   242k|    pthread_mutex_unlock(&mutex);
   70|       |    //printf("Total size (malloc): %lld And new address: %p Entry %p\n", totalMemorySize, addr, (void*)newEntry);
   71|       |
   72|   242k|    return 1;
   73|   242k|}
custom_memory_manager.c:UA_memoryManager_free:
  146|  85.2k|static void UA_memoryManager_free(void* ptr) {
  147|  85.2k|    removeFromMap(ptr);
  148|  85.2k|    free(ptr);
  149|  85.2k|}
custom_memory_manager.c:removeFromMap:
   82|   322k|static int removeFromMap(void *addr) {
   83|   322k|    if(addr == NULL)
  ------------------
  |  Branch (83:8): [True: 79.1k, False: 242k]
  ------------------
   84|  79.1k|        return 1;
   85|       |
   86|   242k|    pthread_mutex_lock(&mutex);
   87|       |
   88|   242k|    struct UA_mm_entry *e = address_map_last;
   89|       |
   90|   584k|    while (e) {
  ------------------
  |  Branch (90:12): [True: 584k, False: 1]
  ------------------
   91|   584k|        if(e->address == addr) {
  ------------------
  |  Branch (91:12): [True: 242k, False: 341k]
  ------------------
   92|   242k|            if(e == address_map_first)
  ------------------
  |  Branch (92:16): [True: 134, False: 242k]
  ------------------
   93|    134|                address_map_first = e->next;
   94|   242k|            if(e == address_map_last)
  ------------------
  |  Branch (94:16): [True: 232k, False: 10.5k]
  ------------------
   95|   232k|                address_map_last = e->prev;
   96|   242k|            if(e->prev)
  ------------------
  |  Branch (96:16): [True: 242k, False: 134]
  ------------------
   97|   242k|                e->prev->next = e->next;
   98|   242k|            if(e->next)
  ------------------
  |  Branch (98:16): [True: 10.5k, False: 232k]
  ------------------
   99|  10.5k|                e->next->prev = e->prev;
  100|   242k|            totalMemorySize -= e->size;
  101|       |
  102|       |            //printf("Total size (free): %lld after addr %p and deleting %p\n", totalMemorySize, addr, (void*)e);
  103|   242k|            free(e);
  104|   242k|            pthread_mutex_unlock(&mutex);
  105|   242k|            return 1;
  106|   242k|        }
  107|   341k|        e = e->prev;
  108|   341k|    }
  109|      1|    pthread_mutex_unlock(&mutex);
  110|       |    //printf("MemoryManager: Entry with address %p not found", addr);
  111|      1|    return 0;
  112|   242k|}
custom_memory_manager.c:UA_memoryManager_calloc:
  124|  5.87k|static void *UA_memoryManager_calloc(size_t num, size_t size) {
  125|  5.87k|    if(totalMemorySize + (size * num) > memoryLimit)
  ------------------
  |  Branch (125:8): [True: 29, False: 5.84k]
  ------------------
  126|     29|        return NULL;
  127|  5.84k|    void *addr = calloc(num, size);
  128|  5.84k|    if(!addr)
  ------------------
  |  Branch (128:8): [True: 0, False: 5.84k]
  ------------------
  129|      0|        return NULL;
  130|  5.84k|    addToMap(size*num, addr);
  131|  5.84k|    return addr;
  132|  5.84k|}
custom_memory_manager.c:UA_memoryManager_realloc:
  134|   236k|static void *UA_memoryManager_realloc(void *ptr, size_t new_size) {
  135|   236k|    removeFromMap(ptr);
  136|   236k|    if(totalMemorySize + new_size > memoryLimit)
  ------------------
  |  Branch (136:8): [True: 8, False: 236k]
  ------------------
  137|      8|        return NULL;
  138|   236k|    void *addr = realloc(ptr, new_size);
  139|   236k|    if(!addr)
  ------------------
  |  Branch (139:8): [True: 0, False: 236k]
  ------------------
  140|      0|        return NULL;
  141|   236k|    addToMap(new_size, addr);
  142|   236k|    return addr;
  143|       |
  144|   236k|}

LLVMFuzzerTestOneInput:
   18|    296|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   19|    296|    if(size <= 6)
  ------------------
  |  Branch (19:8): [True: 0, False: 296]
  ------------------
   20|      0|        return 0;
   21|       |
   22|       |    // set the available memory
   23|    296|    if(!UA_memoryManager_setLimitFromLast4Bytes(data, size))
  ------------------
  |  Branch (23:8): [True: 0, False: 296]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    296|    data += 4;
   27|    296|    size -= 4;
   28|       |
   29|    296|    const UA_String input = {size, (UA_Byte *) (void *) data};
   30|    296|    UA_String out = UA_STRING_NULL;
   31|    296|    UA_String out2 = UA_STRING_NULL;
   32|       |
   33|    296|    UA_AttributeOperand ao;
   34|    296|    UA_AttributeOperand ao2;
   35|    296|    UA_AttributeOperand_init(&ao2);
   36|    296|    UA_StatusCode ret = UA_AttributeOperand_parse(&ao, input);
   37|    296|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    296|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (37:8): [True: 142, False: 154]
  ------------------
   38|    142|        return 0;
   39|       |
   40|    154|    ret = UA_AttributeOperand_print(&ao, &out);
   41|    154|    if(ret == UA_STATUSCODE_BADOUTOFMEMORY)
  ------------------
  |  |   31|    154|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  |  Branch (41:8): [True: 0, False: 154]
  ------------------
   42|      0|        goto cleanup;
   43|    154|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  385|    154|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (43:5): [True: 154, False: 0]
  ------------------
   44|       |
   45|    154|    ret = UA_AttributeOperand_parse(&ao2, out);
   46|    154|    if(ret == UA_STATUSCODE_BADOUTOFMEMORY)
  ------------------
  |  |   31|    154|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  |  Branch (46:8): [True: 0, False: 154]
  ------------------
   47|      0|        goto cleanup;
   48|    154|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  385|    154|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (48:5): [True: 154, False: 0]
  ------------------
   49|       |
   50|    154|    ret = UA_AttributeOperand_print(&ao2, &out2);
   51|    154|    if(ret == UA_STATUSCODE_BADOUTOFMEMORY)
  ------------------
  |  |   31|    154|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  |  Branch (51:8): [True: 0, False: 154]
  ------------------
   52|      0|        goto cleanup;
   53|    154|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  385|    154|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (53:5): [True: 154, False: 0]
  ------------------
   54|       |
   55|    154|    UA_assert(UA_String_equal(&out, &out2));
  ------------------
  |  |  385|    154|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (55:5): [True: 154, False: 0]
  ------------------
   56|    154|    UA_assert(UA_equal(&ao, &ao2, &UA_TYPES[UA_TYPES_ATTRIBUTEOPERAND]));
  ------------------
  |  |  385|    154|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (56:5): [True: 154, False: 0]
  ------------------
   57|       |
   58|    154| cleanup:
   59|    154|    UA_String_clear(&out);
   60|    154|    UA_String_clear(&out2);
   61|    154|    UA_AttributeOperand_clear(&ao);
   62|    154|    UA_AttributeOperand_clear(&ao2);
   63|    154|    return 0;
   64|    154|}

fuzz_attributeoperand.cc:_ZL24UA_AttributeOperand_initP19UA_AttributeOperand:
  224|    296|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_attributeoperand.cc:_ZL15UA_String_equalPK9UA_StringS1_:
  224|    154|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_attributeoperand.cc:_ZL15UA_String_clearP9UA_String:
  224|    308|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_attributeoperand.cc:_ZL25UA_AttributeOperand_clearP19UA_AttributeOperand:
  224|    308|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  224|    840|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_util.c:UA_String_init:
  224|    840|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_util.c:UA_String_equal:
  224|  3.22k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_util.c:UA_String_clear:
  224|  1.14k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_util.c:UA_NodeId_equal:
  224|  75.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  224|  81.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_clear:
  224|    651|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_RelativePath_init:
  224|    430|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_RelativePathElement_init:
  224|  77.8k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_RelativePathElement_clear:
  224|      8|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_AttributeOperand_init:
  224|    450|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  224|  78.3k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_AttributeOperand_clear:
  224|    142|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

