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|    680|UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) {
   76|       |    /* Empty base64 results in an empty byte-string */
   77|    680|    if(len == 0) {
  ------------------
  |  Branch (77:8): [True: 381, False: 299]
  ------------------
   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|    299|    size_t olen = (len / 4 * 3) + 4;
   84|    299|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |  350|    299|# define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   85|    299|    if(!out)
  ------------------
  |  Branch (85:8): [True: 18, False: 281]
  ------------------
   86|     18|        return NULL;
   87|       |
   88|       |    /* Iterate over the input */
   89|    281|    size_t pad = 0;
   90|    281|    unsigned char count = 0;
   91|    281|    unsigned char block[4];
   92|    281|    unsigned char *pos = out;
   93|  5.58k|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (93:23): [True: 5.31k, False: 270]
  ------------------
   94|  5.31k|        if(src[i] & 0x80)
  ------------------
  |  Branch (94:12): [True: 6, False: 5.30k]
  ------------------
   95|      6|            goto error; /* Non-ASCII input */
   96|  5.30k|        unsigned char tmp = dtable[src[i]];
   97|  5.30k|        if(tmp == 0x80)
  ------------------
  |  Branch (97:12): [True: 3, False: 5.30k]
  ------------------
   98|      3|            goto error; /* Not an allowed character */
   99|  5.30k|        if(tmp == 0x7f)
  ------------------
  |  Branch (99:12): [True: 194, False: 5.10k]
  ------------------
  100|    194|            continue; /* Whitespace is ignored to accomodate RFC 2045, used in
  101|       |                       * XML for xs:base64Binary. */
  102|  5.10k|        block[count++] = tmp;
  103|       |
  104|       |        /* Padding */
  105|  5.10k|        if(src[i] == '=') {
  ------------------
  |  Branch (105:12): [True: 144, False: 4.96k]
  ------------------
  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|  4.96k|        } else if(pad > 0) {
  ------------------
  |  Branch (110:19): [True: 0, False: 4.96k]
  ------------------
  111|      0|            goto error; /* Padding not terminated correctly */
  112|      0|        }
  113|       |
  114|       |        /* Write three output characters for four characters of input */
  115|  5.10k|        if(count == 4) {
  ------------------
  |  Branch (115:12): [True: 1.27k, False: 3.83k]
  ------------------
  116|  1.27k|            if(pad > 2)
  ------------------
  |  Branch (116:16): [True: 0, False: 1.27k]
  ------------------
  117|      0|                goto error; /* Invalid padding */
  118|  1.27k|            *pos++ = (block[0] << 2) | (block[1] >> 4);
  119|  1.27k|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  120|  1.27k|            *pos++ = (block[2] << 6) | block[3];
  121|  1.27k|            count = 0;
  122|  1.27k|            pos -= pad;
  123|  1.27k|            pad = 0;
  124|  1.27k|        }
  125|  5.10k|    }
  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);
  ------------------
  |  |  351|    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|     11| error:
  139|     11|    UA_free(out);
  ------------------
  |  |  351|     11|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  140|       |    return NULL;
  141|    270|}

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

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

UA_AttributeOperand_parse:
 1211|    433|UA_AttributeOperand_parse(UA_AttributeOperand *ao, const UA_String str) {
 1212|       |    /* Objects folder is the default */
 1213|    433|    return parseAttributeOperand(ao, str, UA_NS0ID(OBJECTSFOLDER), 0);
  ------------------
  |  |  457|    433|#define UA_NS0ID(ID) UA_NODEID_NUMERIC(0, UA_NS0ID_##ID)
  |  |  ------------------
  |  |  |  |   81|    433|#define UA_NS0ID_OBJECTSFOLDER 85 /* Object */
  |  |  ------------------
  ------------------
 1214|    433|}
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.77k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  145|  4.77k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  146|  4.77k|    LexContext context;
  147|  4.77k|    memset(&context, 0, sizeof(LexContext));
  148|  4.77k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  149|  4.77k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  150|       |
  151|       |    
  152|  4.77k|{
  153|  4.77k|	u8 yych;
  154|  4.77k|	yych = YYPEEK();
  ------------------
  |  |   31|  4.77k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 4.77k, False: 0]
  |  |  ------------------
  ------------------
  155|  4.77k|	switch (yych) {
  156|    680|		case 'b':
  ------------------
  |  Branch (156:3): [True: 680, False: 4.09k]
  ------------------
  157|    690|		case 'g':
  ------------------
  |  Branch (157:3): [True: 10, False: 4.76k]
  ------------------
  158|    825|		case 'i':
  ------------------
  |  Branch (158:3): [True: 135, False: 4.64k]
  ------------------
  159|  3.16k|		case 's':
  ------------------
  |  Branch (159:3): [True: 2.34k, False: 2.43k]
  ------------------
  160|  3.16k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  3.16k|#define YYSTAGN(t) t = NULL
  ------------------
  161|  3.16k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  3.16k|#define YYSTAGN(t) t = NULL
  ------------------
  162|  3.16k|			goto yy3;
  163|  1.03k|		case 'n': goto yy4;
  ------------------
  |  Branch (163:3): [True: 1.03k, False: 3.74k]
  ------------------
  164|    582|		default: goto yy1;
  ------------------
  |  Branch (164:3): [True: 582, False: 4.19k]
  ------------------
  165|  4.77k|	}
  166|    582|yy1:
  167|    582|	YYSKIP();
  ------------------
  |  |   33|    582|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    582|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  168|    587|yy2:
  169|    587|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|    587|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  170|  3.16k|yy3:
  171|  3.16k|	YYSKIP();
  ------------------
  |  |   33|  3.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  3.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|  3.16k|	yych = YYPEEK();
  ------------------
  |  |   31|  3.16k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 3.16k, False: 0]
  |  |  ------------------
  ------------------
  173|  3.16k|	switch (yych) {
  174|  3.16k|		case '=': goto yy5;
  ------------------
  |  Branch (174:3): [True: 3.16k, False: 1]
  ------------------
  175|      1|		default: goto yy2;
  ------------------
  |  Branch (175:3): [True: 1, False: 3.16k]
  ------------------
  176|  3.16k|	}
  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.19k|yy5:
  186|  4.19k|	YYSKIP();
  ------------------
  |  |   33|  4.19k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  4.19k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  187|  4.19k|	nsu = context.yyt2;
  188|  4.19k|	ns = context.yyt1;
  189|  4.19k|	YYSTAGP(body);
  ------------------
  |  |   36|  4.19k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  4.19k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  190|  4.19k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   38|  4.19k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  191|  4.19k|	{ 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|    314|		case '=': goto yy8;
  ------------------
  |  Branch (196:3): [True: 314, False: 716]
  ------------------
  197|    716|		case 'u': goto yy9;
  ------------------
  |  Branch (197:3): [True: 716, False: 314]
  ------------------
  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|    314|yy8:
  204|    314|	YYSKIP();
  ------------------
  |  |   33|    314|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    314|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  205|    314|	yych = YYPEEK();
  ------------------
  |  |   31|    314|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    314|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    314|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 314, False: 0]
  |  |  ------------------
  ------------------
  206|    314|	switch (yych) {
  207|    125|		case '0':
  ------------------
  |  Branch (207:3): [True: 125, False: 189]
  ------------------
  208|    143|		case '1':
  ------------------
  |  Branch (208:3): [True: 18, False: 296]
  ------------------
  209|    269|		case '2':
  ------------------
  |  Branch (209:3): [True: 126, False: 188]
  ------------------
  210|    307|		case '3':
  ------------------
  |  Branch (210:3): [True: 38, False: 276]
  ------------------
  211|    307|		case '4':
  ------------------
  |  Branch (211:3): [True: 0, False: 314]
  ------------------
  212|    310|		case '5':
  ------------------
  |  Branch (212:3): [True: 3, False: 311]
  ------------------
  213|    314|		case '6':
  ------------------
  |  Branch (213:3): [True: 4, False: 310]
  ------------------
  214|    314|		case '7':
  ------------------
  |  Branch (214:3): [True: 0, False: 314]
  ------------------
  215|    314|		case '8':
  ------------------
  |  Branch (215:3): [True: 0, False: 314]
  ------------------
  216|    314|		case '9':
  ------------------
  |  Branch (216:3): [True: 0, False: 314]
  ------------------
  217|    314|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|    314|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    314|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  218|    314|			goto yy10;
  219|      0|		default: goto yy7;
  ------------------
  |  Branch (219:3): [True: 0, False: 314]
  ------------------
  220|    314|	}
  221|    716|yy9:
  222|    716|	YYSKIP();
  ------------------
  |  |   33|    716|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    716|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  223|    716|	yych = YYPEEK();
  ------------------
  |  |   31|    716|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    716|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    716|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 716, False: 0]
  |  |  ------------------
  ------------------
  224|    716|	switch (yych) {
  225|    716|		case '=': goto yy11;
  ------------------
  |  Branch (225:3): [True: 716, False: 0]
  ------------------
  226|      0|		default: goto yy7;
  ------------------
  |  Branch (226:3): [True: 0, False: 716]
  ------------------
  227|    716|	}
  228|    392|yy10:
  229|    392|	YYSKIP();
  ------------------
  |  |   33|    392|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    392|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  230|    392|	yych = YYPEEK();
  ------------------
  |  |   31|    392|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    392|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    392|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 392, False: 0]
  |  |  ------------------
  ------------------
  231|    392|	switch (yych) {
  232|      4|		case '0':
  ------------------
  |  Branch (232:3): [True: 4, False: 388]
  ------------------
  233|     14|		case '1':
  ------------------
  |  Branch (233:3): [True: 10, False: 382]
  ------------------
  234|     19|		case '2':
  ------------------
  |  Branch (234:3): [True: 5, False: 387]
  ------------------
  235|     25|		case '3':
  ------------------
  |  Branch (235:3): [True: 6, False: 386]
  ------------------
  236|     25|		case '4':
  ------------------
  |  Branch (236:3): [True: 0, False: 392]
  ------------------
  237|     32|		case '5':
  ------------------
  |  Branch (237:3): [True: 7, False: 385]
  ------------------
  238|     38|		case '6':
  ------------------
  |  Branch (238:3): [True: 6, False: 386]
  ------------------
  239|     50|		case '7':
  ------------------
  |  Branch (239:3): [True: 12, False: 380]
  ------------------
  240|     78|		case '8':
  ------------------
  |  Branch (240:3): [True: 28, False: 364]
  ------------------
  241|     78|		case '9': goto yy10;
  ------------------
  |  Branch (241:3): [True: 0, False: 392]
  ------------------
  242|    314|		case ';':
  ------------------
  |  Branch (242:3): [True: 314, False: 78]
  ------------------
  243|    314|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|    314|#define YYSTAGN(t) t = NULL
  ------------------
  244|    314|			goto yy12;
  245|      0|		default: goto yy7;
  ------------------
  |  Branch (245:3): [True: 0, False: 392]
  ------------------
  246|    392|	}
  247|    716|yy11:
  248|    716|	YYSKIP();
  ------------------
  |  |   33|    716|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    716|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  249|    716|	yych = YYPEEK();
  ------------------
  |  |   31|    716|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    716|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    716|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 716, False: 0]
  |  |  ------------------
  ------------------
  250|    716|	switch (yych) {
  251|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (251:3): [True: 0, False: 716]
  ------------------
  252|    242|		case ';':
  ------------------
  |  Branch (252:3): [True: 242, False: 474]
  ------------------
  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|    474|		default:
  ------------------
  |  Branch (256:3): [True: 474, False: 242]
  ------------------
  257|    474|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    474|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    474|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  258|    474|			goto yy13;
  259|    716|	}
  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|    266|		case 'b':
  ------------------
  |  Branch (264:3): [True: 266, False: 764]
  ------------------
  265|    399|		case 'g':
  ------------------
  |  Branch (265:3): [True: 133, False: 897]
  ------------------
  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.20k|yy13:
  271|  7.20k|	YYSKIP();
  ------------------
  |  |   33|  7.20k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  7.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  272|  7.20k|	yych = YYPEEK();
  ------------------
  |  |   31|  7.20k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 7.20k, False: 0]
  |  |  ------------------
  ------------------
  273|  7.20k|	switch (yych) {
  274|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (274:3): [True: 0, False: 7.20k]
  ------------------
  275|    474|		case ';':
  ------------------
  |  Branch (275:3): [True: 474, False: 6.72k]
  ------------------
  276|    474|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|    474|#define YYSTAGN(t) t = NULL
  ------------------
  277|    474|			goto yy12;
  278|  6.72k|		default: goto yy13;
  ------------------
  |  Branch (278:3): [True: 6.72k, False: 474]
  ------------------
  279|  7.20k|	}
  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.19k| match:
  291|  4.19k|    if(nsu) {
  ------------------
  |  Branch (291:8): [True: 714, False: 3.47k]
  ------------------
  292|       |        /* NamespaceUri */
  293|    714|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  294|    714|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  295|    714|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    714|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (295:12): [True: 714, False: 0]
  ------------------
  296|       |            /* Return the entire NodeId string s=... */
  297|    714|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  298|    714|            id->identifierType = UA_NODEIDTYPE_STRING;
  299|    714|            return UA_String_copy(&total, &id->identifier.string);
  300|    714|        }
  301|  3.47k|    } else if(ns) {
  ------------------
  |  Branch (301:15): [True: 312, False: 3.16k]
  ------------------
  302|       |        /* NamespaceIndex */
  303|    312|        UA_UInt32 tmp;
  304|    312|        size_t len = (size_t)(body - 1 - ns);
  305|    312|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (305:12): [True: 0, False: 312]
  ------------------
  306|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  307|    312|        id->namespaceIndex = (UA_UInt16)tmp;
  308|    312|        if(nsMapping)
  ------------------
  |  Branch (308:12): [True: 0, False: 312]
  ------------------
  309|      0|            id->namespaceIndex =
  310|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  311|    312|    }
  312|       |
  313|       |    /* From the current position until the end */
  314|  3.47k|    return parse_nodeid_body(id, body, end, idEsc);
  315|  4.19k|}
ua_types_lex.c:escapedUri2Index:
   93|    722|                 const UA_NamespaceMapping *nsMapping) {
   94|    722|    if(!nsMapping)
  ------------------
  |  Branch (94:8): [True: 722, False: 0]
  ------------------
   95|    722|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    722|#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.47k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  108|  3.47k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  109|  3.47k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  110|  3.47k|    switch(*body) {
  111|    192|    case 'i':
  ------------------
  |  Branch (111:5): [True: 192, False: 3.28k]
  ------------------
  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: 32, False: 160]
  ------------------
  114|     32|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     32|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  115|    192|        break;
  116|  2.59k|    case 's':
  ------------------
  |  Branch (116:5): [True: 2.59k, False: 882]
  ------------------
  117|  2.59k|        id->identifierType = UA_NODEIDTYPE_STRING;
  118|  2.59k|        res |= UA_String_copy(&str, &id->identifier.string);
  119|  2.59k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  120|  2.59k|        break;
  121|     10|    case 'g':
  ------------------
  |  Branch (121:5): [True: 10, False: 3.46k]
  ------------------
  122|     10|        id->identifierType = UA_NODEIDTYPE_GUID;
  123|     10|        res = parse_guid(&id->identifier.guid, str.data, end);
  124|     10|        break;
  125|    680|    case 'b':
  ------------------
  |  Branch (125:5): [True: 680, False: 2.79k]
  ------------------
  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|    680|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  130|    680|        id->identifier.byteString.data =
  131|    680|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  132|    680|        if(!id->identifier.byteString.data && str.length > 0)
  ------------------
  |  Branch (132:12): [True: 29, False: 651]
  |  Branch (132:47): [True: 29, False: 0]
  ------------------
  133|     29|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     29|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  134|    680|        break;
  135|      0|    default:
  ------------------
  |  Branch (135:5): [True: 0, False: 3.47k]
  ------------------
  136|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|      0|        break;
  138|  3.47k|    }
  139|  3.47k|    return res;
  140|  3.47k|}
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.3k]
  |  |  ------------------
  ------------------
  716|  78.3k|	switch (yych) {
  717|  76.3k|		case 0x00:
  ------------------
  |  Branch (717:3): [True: 76.3k, False: 1.91k]
  ------------------
  718|  76.3k|		case ';': goto yy41;
  ------------------
  |  Branch (718:3): [True: 0, False: 78.3k]
  ------------------
  719|    158|		case '0':
  ------------------
  |  Branch (719:3): [True: 158, False: 78.1k]
  ------------------
  720|    310|		case '1':
  ------------------
  |  Branch (720:3): [True: 152, False: 78.1k]
  ------------------
  721|    361|		case '2':
  ------------------
  |  Branch (721:3): [True: 51, False: 78.2k]
  ------------------
  722|    380|		case '3':
  ------------------
  |  Branch (722:3): [True: 19, False: 78.2k]
  ------------------
  723|    405|		case '4':
  ------------------
  |  Branch (723:3): [True: 25, False: 78.2k]
  ------------------
  724|    406|		case '5':
  ------------------
  |  Branch (724:3): [True: 1, False: 78.3k]
  ------------------
  725|    545|		case '6':
  ------------------
  |  Branch (725:3): [True: 139, False: 78.1k]
  ------------------
  726|    548|		case '7':
  ------------------
  |  Branch (726:3): [True: 3, False: 78.3k]
  ------------------
  727|    681|		case '8':
  ------------------
  |  Branch (727:3): [True: 133, False: 78.1k]
  ------------------
  728|    683|		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.3k|yy41:
  732|  76.3k|	YYSKIP();
  ------------------
  |  |   33|  76.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  76.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  733|  78.2k|yy42:
  734|  78.2k|	{ 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: 138]
  |  |  ------------------
  ------------------
  739|  1.23k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (739:6): [True: 141, False: 1.09k]
  ------------------
  740|  1.09k|	goto yy46;
  741|  1.09k|yy44:
  742|    683|	YYSKIP();
  ------------------
  |  |   33|    683|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    683|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  743|    683|	YYBACKUP();
  ------------------
  |  |   34|    683|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|    683|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    683|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  744|    683|	yych = YYPEEK();
  ------------------
  |  |   31|    683|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    683|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    493|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 493, False: 190]
  |  |  ------------------
  ------------------
  745|    683|	switch (yych) {
  746|      4|		case '0':
  ------------------
  |  Branch (746:3): [True: 4, False: 679]
  ------------------
  747|     17|		case '1':
  ------------------
  |  Branch (747:3): [True: 13, False: 670]
  ------------------
  748|     46|		case '2':
  ------------------
  |  Branch (748:3): [True: 29, False: 654]
  ------------------
  749|     47|		case '3':
  ------------------
  |  Branch (749:3): [True: 1, False: 682]
  ------------------
  750|     58|		case '4':
  ------------------
  |  Branch (750:3): [True: 11, False: 672]
  ------------------
  751|     61|		case '5':
  ------------------
  |  Branch (751:3): [True: 3, False: 680]
  ------------------
  752|     63|		case '6':
  ------------------
  |  Branch (752:3): [True: 2, False: 681]
  ------------------
  753|    139|		case '7':
  ------------------
  |  Branch (753:3): [True: 76, False: 607]
  ------------------
  754|    299|		case '8':
  ------------------
  |  Branch (754:3): [True: 160, False: 523]
  ------------------
  755|    301|		case '9':
  ------------------
  |  Branch (755:3): [True: 2, False: 681]
  ------------------
  756|    304|		case ':': goto yy50;
  ------------------
  |  Branch (756:3): [True: 3, False: 680]
  ------------------
  757|    379|		default: goto yy42;
  ------------------
  |  Branch (757:3): [True: 379, False: 304]
  ------------------
  758|    683|	}
  759|   292k|yy45:
  760|   292k|	YYSKIP();
  ------------------
  |  |   33|   292k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   292k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  761|   292k|	yych = YYPEEK();
  ------------------
  |  |   31|   292k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   292k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   291k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 291k, False: 1.02k]
  |  |  ------------------
  ------------------
  762|   293k|yy46:
  763|   293k|	switch (yych) {
  764|  1.08k|		case 0x00: goto yy47;
  ------------------
  |  Branch (764:3): [True: 1.08k, False: 292k]
  ------------------
  765|      8|		case ';': goto yy48;
  ------------------
  |  Branch (765:3): [True: 8, False: 293k]
  ------------------
  766|   292k|		default: goto yy45;
  ------------------
  |  Branch (766:3): [True: 292k, False: 1.09k]
  ------------------
  767|   293k|	}
  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|      8|yy48:
  772|      8|	YYSKIP();
  ------------------
  |  |   33|      8|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      8|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  773|      8|	{ goto match_uri; }
  774|   356k|yy49:
  775|   356k|	YYSKIP();
  ------------------
  |  |   33|   356k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   356k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  776|   356k|	yych = YYPEEK();
  ------------------
  |  |   31|   356k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   356k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   355k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 355k, False: 118]
  |  |  ------------------
  ------------------
  777|   356k|yy50:
  778|   356k|	switch (yych) {
  779|   330k|		case '0':
  ------------------
  |  Branch (779:3): [True: 330k, False: 25.7k]
  ------------------
  780|   331k|		case '1':
  ------------------
  |  Branch (780:3): [True: 513, False: 355k]
  ------------------
  781|   336k|		case '2':
  ------------------
  |  Branch (781:3): [True: 5.26k, False: 351k]
  ------------------
  782|   341k|		case '3':
  ------------------
  |  Branch (782:3): [True: 5.43k, False: 350k]
  ------------------
  783|   347k|		case '4':
  ------------------
  |  Branch (783:3): [True: 5.60k, False: 350k]
  ------------------
  784|   347k|		case '5':
  ------------------
  |  Branch (784:3): [True: 270, False: 356k]
  ------------------
  785|   348k|		case '6':
  ------------------
  |  Branch (785:3): [True: 414, False: 355k]
  ------------------
  786|   348k|		case '7':
  ------------------
  |  Branch (786:3): [True: 552, False: 355k]
  ------------------
  787|   354k|		case '8':
  ------------------
  |  Branch (787:3): [True: 6.23k, False: 350k]
  ------------------
  788|   356k|		case '9': goto yy49;
  ------------------
  |  Branch (788:3): [True: 1.20k, False: 355k]
  ------------------
  789|     18|		case ':': goto yy51;
  ------------------
  |  Branch (789:3): [True: 18, False: 356k]
  ------------------
  790|    286|		default: goto yy47;
  ------------------
  |  Branch (790:3): [True: 286, False: 356k]
  ------------------
  791|   356k|	}
  792|     18|yy51:
  793|     18|	YYSKIP();
  ------------------
  |  |   33|     18|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     18|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  794|     18|	{ goto match_index; }
  795|   356k|}
  796|       |
  797|       |
  798|     18| match_index:
  799|     18|    len = (size_t)(pos - 1 - begin);
  800|     18|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (800:8): [True: 0, False: 18]
  ------------------
  801|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  802|     18|    qn->namespaceIndex = (UA_UInt16)tmp;
  803|     18|    goto match_name;
  804|       |
  805|      8| match_uri:
  806|      8|    str.length = (size_t)(pos - 1 - begin);
  807|      8|    str.data = (UA_Byte*)(uintptr_t)begin;
  808|      8|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  809|      8|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      8|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (809:8): [True: 8, False: 0]
  ------------------
  810|      8|        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))
  ------------------
  |  |  590|  78.3k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (590:23): [True: 78.2k, False: 26]
  |  |  ------------------
  ------------------
  817|  78.2k|        res = UA_String_unescape(&qn->name, false, escName);
  818|  78.3k|    return res;
  819|      8|}
ua_types_lex.c:parse_relativepath:
  970|    417|                   UA_UInt16 defaultNamespaceIndex) {
  971|    417|    UA_RelativePath_init(rp);
  972|    417|    UA_Boolean done = false;
  973|    417|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    417|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  974|  78.0k|    do {
  975|  78.0k|        res = parse_relativepathElement(rp, ppos, end, server, esc,
  976|  78.0k|                                        defaultNamespaceIndex, &done);
  977|  78.0k|    } while(!done);
  ------------------
  |  Branch (977:13): [True: 77.6k, False: 417]
  ------------------
  978|    417|    return res;
  979|    417|}
ua_types_lex.c:parse_relativepathElement:
  841|  78.0k|                          UA_UInt16 defaultTargetNamespaceIndex, UA_Boolean *done) {
  842|  78.0k|    const u8 *pos = *ppos;
  843|  78.0k|    if(pos == end) {
  ------------------
  |  Branch (843:8): [True: 280, False: 77.7k]
  ------------------
  844|    280|        *done = true;
  845|    280|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    280|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  846|    280|    }
  847|       |
  848|       |    /* Create the element on the stack.
  849|       |     * Moved into the rp upon successful parsing. */
  850|  77.7k|    UA_RelativePathElement current;
  851|  77.7k|    UA_RelativePathElement_init(&current);
  852|  77.7k|    current.includeSubtypes = true; /* Follow subtypes by default */
  853|       |
  854|       |    /* Which ReferenceType? */
  855|  77.7k|    const u8 *begin;
  856|  77.7k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  77.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  857|  77.7k|    switch(*pos) {
  858|  73.1k|    case '/':
  ------------------
  |  Branch (858:5): [True: 73.1k, False: 4.67k]
  ------------------
  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.7k]
  ------------------
  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.62k|    case '<':
  ------------------
  |  Branch (870:5): [True: 4.62k, False: 73.1k]
  ------------------
  871|  4.62k|        break;
  872|     52|    default:
  ------------------
  |  Branch (872:5): [True: 52, False: 77.7k]
  ------------------
  873|     52|        *done = true;
  874|     52|        goto out;
  875|  77.7k|    }
  876|       |
  877|       |    /* ReferenceType with modifiers wrapped in angle brackets */
  878|  4.62k|    begin = ++pos;
  879|  32.4M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (879:11): [True: 32.4M, False: 65]
  ------------------
  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.92M, False: 22.5M]
  ------------------
  885|  9.92M|            pos += 2;
  886|  9.92M|            continue;
  887|  9.92M|        }
  888|  22.5M|        if(*pos == '>')
  ------------------
  |  Branch (888:12): [True: 4.56k, False: 22.5M]
  ------------------
  889|  4.56k|            break;
  890|  22.5M|    }
  891|  4.62k|    if(pos > end) {
  ------------------
  |  Branch (891:8): [True: 0, False: 4.62k]
  ------------------
  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.18k|    for(; begin < pos; begin++) {
  ------------------
  |  Branch (897:11): [True: 5.18k, False: 0]
  ------------------
  898|  5.18k|        if(*begin == '#')
  ------------------
  |  Branch (898:12): [True: 391, False: 4.79k]
  ------------------
  899|    391|            current.includeSubtypes = false;
  900|  4.79k|        else if(*begin == '!')
  ------------------
  |  Branch (900:17): [True: 166, False: 4.62k]
  ------------------
  901|    166|            current.isInverse = true;
  902|  4.62k|        else
  903|  4.62k|            break;
  904|  5.18k|    }
  905|       |
  906|       |    /* Try to parse a NodeId for the ReferenceType (non-standard!) */
  907|  4.62k|    res = parse_nodeid(&current.referenceTypeId, begin, pos, esc, NULL);
  908|  4.62k|    if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  4.62k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (908:8): [True: 651, False: 3.97k]
  ------------------
  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: 74, False: 577]
  ------------------
  915|     74|            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|   434k|    while(pos < end && *pos >= '0' && *pos <= '9')
  ------------------
  |  Branch (921:11): [True: 434k, False: 234]
  |  Branch (921:24): [True: 361k, False: 72.8k]
  |  Branch (921:39): [True: 356k, False: 4.54k]
  ------------------
  922|   356k|        pos++;
  923|  77.6k|    if(pos < end && *pos == ':')
  ------------------
  |  Branch (923:8): [True: 77.4k, False: 234]
  |  Branch (923:21): [True: 18, False: 77.4k]
  ------------------
  924|     18|        pos++;
  925|   342k|    for(; pos < end; pos++) {
  ------------------
  |  Branch (925:11): [True: 342k, False: 282]
  ------------------
  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.3k, False: 265k]
  ------------------
  936|  77.3k|                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: 1, False: 77.6k]
  ------------------
  951|      1|        UA_RelativePathElement_clear(&current);
  952|      1|        goto out;
  953|      1|    }
  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: 6, False: 77.6k]
  ------------------
  958|      6|        UA_RelativePathElement_clear(&current);
  959|       |
  960|  77.7k| out:
  961|       |    /* Return the status */
  962|  77.7k|    *ppos = pos;
  963|  77.7k|    *done |= (res != UA_STATUSCODE_GOOD);
  ------------------
  |  |   16|  77.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  964|  77.7k|    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));
  ------------------
  |  |  353|  77.6k|# define UA_realloc(ptr, size) UA_reallocSingleton(ptr, size)
  ------------------
  686|  77.6k|    if(!newArray)
  ------------------
  |  Branch (686:8): [True: 6, False: 77.6k]
  ------------------
  687|      6|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      6|#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|    433|                      UA_NodeId defaultId, UA_UInt16 defaultNamespaceIndex) {
 1014|       |    /* Initialize and set the default values */
 1015|    433|    UA_AttributeOperand_init(ao);
 1016|    433|    ao->nodeId = defaultId;
 1017|    433|    ao->attributeId = UA_ATTRIBUTEID_VALUE;
 1018|       |
 1019|       |    /* Nothing to parse */
 1020|    433|    if(str.length == 0)
  ------------------
  |  Branch (1020:8): [True: 0, False: 433]
  ------------------
 1021|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1022|       |
 1023|    433|    const u8 *pos = str.data;
 1024|    433|    const u8 *end = pos + str.length;
 1025|    433|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    433|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1026|       |
 1027|       |    /* Initial NodeId before the BrowsePath */
 1028|    433|    LexContext context;
 1029|    433|    memset(&context, 0, sizeof(LexContext));
 1030|       |    
 1031|    433|{
 1032|    433|	u8 yych;
 1033|    433|	yych = YYPEEK();
  ------------------
  |  |   31|    433|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    433|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    433|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 433, False: 0]
  |  |  ------------------
  ------------------
 1034|    433|	switch (yych) {
 1035|      4|		case 'b':
  ------------------
  |  Branch (1035:3): [True: 4, False: 429]
  ------------------
 1036|     14|		case 'g':
  ------------------
  |  Branch (1036:3): [True: 10, False: 423]
  ------------------
 1037|     18|		case 'i':
  ------------------
  |  Branch (1037:3): [True: 4, False: 429]
  ------------------
 1038|     92|		case 's': goto yy55;
  ------------------
  |  Branch (1038:3): [True: 74, False: 359]
  ------------------
 1039|     69|		case 'n': goto yy56;
  ------------------
  |  Branch (1039:3): [True: 69, False: 364]
  ------------------
 1040|    272|		default: goto yy53;
  ------------------
  |  Branch (1040:3): [True: 272, False: 161]
  ------------------
 1041|    433|	}
 1042|    272|yy53:
 1043|    272|	YYSKIP();
  ------------------
  |  |   33|    272|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    272|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1044|    281|yy54:
 1045|    281|	{ pos = str.data; goto parse_path; }
 1046|     92|yy55:
 1047|     92|	YYSKIP();
  ------------------
  |  |   33|     92|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     92|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1048|     92|	yych = YYPEEK();
  ------------------
  |  |   31|     92|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     92|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     92|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 92, False: 0]
  |  |  ------------------
  ------------------
 1049|     92|	switch (yych) {
 1050|     91|		case '=': goto yy57;
  ------------------
  |  Branch (1050:3): [True: 91, False: 1]
  ------------------
 1051|      1|		default: goto yy54;
  ------------------
  |  Branch (1051:3): [True: 1, False: 91]
  ------------------
 1052|     92|	}
 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|    152|yy57:
 1062|    152|	YYSKIP();
  ------------------
  |  |   33|    152|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    152|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1063|    152|	{
 1064|       |        // Find the end position of the NodeId body and parse
 1065|   455k|        for(; pos < end; pos++) {
  ------------------
  |  Branch (1065:15): [True: 455k, False: 10]
  ------------------
 1066|   455k|            if(*pos == '%') {
  ------------------
  |  Branch (1066:16): [True: 6, False: 455k]
  ------------------
 1067|      6|                pos += 2;
 1068|      6|                continue;
 1069|      6|            }
 1070|   455k|            if(isReservedPercentExtended(*pos))
  ------------------
  |  Branch (1070:16): [True: 142, False: 455k]
  ------------------
 1071|    142|                break;
 1072|   455k|        }
 1073|    152|        if(pos > end) {
  ------------------
  |  Branch (1073:12): [True: 0, False: 152]
  ------------------
 1074|      0|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1075|      0|            goto cleanup;
 1076|      0|        }
 1077|    152|        res = parse_nodeid(&ao->nodeId, str.data, pos, UA_ESCAPING_PERCENT, NULL);
 1078|    152|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    152|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1078:12): [True: 16, False: 136]
  ------------------
 1079|     16|            goto cleanup;
 1080|    136|        goto parse_path;
 1081|    152|    }
 1082|    136|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|     58|		case '=': goto yy60;
  ------------------
  |  Branch (1086:3): [True: 58, False: 11]
  ------------------
 1087|     11|		case 'u': goto yy61;
  ------------------
  |  Branch (1087:3): [True: 11, False: 58]
  ------------------
 1088|      0|		default: goto yy59;
  ------------------
  |  Branch (1088:3): [True: 0, False: 69]
  ------------------
 1089|     69|	}
 1090|      8|yy59:
 1091|      8|	YYRESTORE();
  ------------------
  |  |   35|      8|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|      8|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|      8|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
 1092|      8|	goto yy54;
 1093|     58|yy60:
 1094|     58|	YYSKIP();
  ------------------
  |  |   33|     58|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     58|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1095|     58|	yych = YYPEEK();
  ------------------
  |  |   31|     58|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     58|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     58|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 58, False: 0]
  |  |  ------------------
  ------------------
 1096|     58|	switch (yych) {
 1097|      0|		case '0':
  ------------------
  |  Branch (1097:3): [True: 0, False: 58]
  ------------------
 1098|     11|		case '1':
  ------------------
  |  Branch (1098:3): [True: 11, False: 47]
  ------------------
 1099|     15|		case '2':
  ------------------
  |  Branch (1099:3): [True: 4, False: 54]
  ------------------
 1100|     51|		case '3':
  ------------------
  |  Branch (1100:3): [True: 36, False: 22]
  ------------------
 1101|     51|		case '4':
  ------------------
  |  Branch (1101:3): [True: 0, False: 58]
  ------------------
 1102|     54|		case '5':
  ------------------
  |  Branch (1102:3): [True: 3, False: 55]
  ------------------
 1103|     58|		case '6':
  ------------------
  |  Branch (1103:3): [True: 4, False: 54]
  ------------------
 1104|     58|		case '7':
  ------------------
  |  Branch (1104:3): [True: 0, False: 58]
  ------------------
 1105|     58|		case '8':
  ------------------
  |  Branch (1105:3): [True: 0, False: 58]
  ------------------
 1106|     58|		case '9': goto yy62;
  ------------------
  |  Branch (1106:3): [True: 0, False: 58]
  ------------------
 1107|      0|		default: goto yy59;
  ------------------
  |  Branch (1107:3): [True: 0, False: 58]
  ------------------
 1108|     58|	}
 1109|     11|yy61:
 1110|     11|	YYSKIP();
  ------------------
  |  |   33|     11|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     11|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1111|     11|	yych = YYPEEK();
  ------------------
  |  |   31|     11|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     11|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     11|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 11, False: 0]
  |  |  ------------------
  ------------------
 1112|     11|	switch (yych) {
 1113|      7|		case '=': goto yy63;
  ------------------
  |  Branch (1113:3): [True: 7, False: 4]
  ------------------
 1114|      4|		default: goto yy59;
  ------------------
  |  Branch (1114:3): [True: 4, False: 7]
  ------------------
 1115|     11|	}
 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.65k]
  ------------------
 1121|   597k|		case '1':
  ------------------
  |  Branch (1121:3): [True: 542, False: 601k]
  ------------------
 1122|   598k|		case '2':
  ------------------
  |  Branch (1122:3): [True: 473, False: 601k]
  ------------------
 1123|   598k|		case '3':
  ------------------
  |  Branch (1123:3): [True: 522, False: 601k]
  ------------------
 1124|   599k|		case '4':
  ------------------
  |  Branch (1124:3): [True: 505, False: 601k]
  ------------------
 1125|   599k|		case '5':
  ------------------
  |  Branch (1125:3): [True: 469, False: 601k]
  ------------------
 1126|   600k|		case '6':
  ------------------
  |  Branch (1126:3): [True: 514, False: 601k]
  ------------------
 1127|   600k|		case '7':
  ------------------
  |  Branch (1127:3): [True: 530, False: 601k]
  ------------------
 1128|   601k|		case '8':
  ------------------
  |  Branch (1128:3): [True: 540, False: 601k]
  ------------------
 1129|   601k|		case '9': goto yy62;
  ------------------
  |  Branch (1129:3): [True: 505, False: 601k]
  ------------------
 1130|     57|		case ';': goto yy64;
  ------------------
  |  Branch (1130:3): [True: 57, False: 601k]
  ------------------
 1131|      1|		default: goto yy59;
  ------------------
  |  Branch (1131:3): [True: 1, False: 601k]
  ------------------
 1132|   601k|	}
 1133|    183|yy63:
 1134|    183|	YYSKIP();
  ------------------
  |  |   33|    183|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    183|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1135|    183|	yych = YYPEEK();
  ------------------
  |  |   31|    183|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    183|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    183|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 183, False: 0]
  |  |  ------------------
  ------------------
 1136|    183|	switch (yych) {
 1137|      2|		case 0x00: goto yy59;
  ------------------
  |  Branch (1137:3): [True: 2, False: 181]
  ------------------
 1138|      5|		case ';': goto yy64;
  ------------------
  |  Branch (1138:3): [True: 5, False: 178]
  ------------------
 1139|    176|		default: goto yy63;
  ------------------
  |  Branch (1139:3): [True: 176, False: 7]
  ------------------
 1140|    183|	}
 1141|     62|yy64:
 1142|     62|	YYSKIP();
  ------------------
  |  |   33|     62|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     62|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1143|     62|	yych = YYPEEK();
  ------------------
  |  |   31|     62|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     62|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     62|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 62, False: 0]
  |  |  ------------------
  ------------------
 1144|     62|	switch (yych) {
 1145|      3|		case 'b':
  ------------------
  |  Branch (1145:3): [True: 3, False: 59]
  ------------------
 1146|      3|		case 'g':
  ------------------
  |  Branch (1146:3): [True: 0, False: 62]
  ------------------
 1147|     61|		case 'i':
  ------------------
  |  Branch (1147:3): [True: 58, False: 4]
  ------------------
 1148|     61|		case 's': goto yy65;
  ------------------
  |  Branch (1148:3): [True: 0, False: 62]
  ------------------
 1149|      1|		default: goto yy59;
  ------------------
  |  Branch (1149:3): [True: 1, False: 61]
  ------------------
 1150|     62|	}
 1151|     61|yy65:
 1152|     61|	YYSKIP();
  ------------------
  |  |   33|     61|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     61|#define YYCURSOR pos
  |  |  ------------------
  ------------------
 1153|     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]
  |  |  ------------------
  ------------------
 1154|     61|	switch (yych) {
 1155|     61|		case '=': goto yy57;
  ------------------
  |  Branch (1155:3): [True: 61, False: 0]
  ------------------
 1156|      0|		default: goto yy59;
  ------------------
  |  Branch (1156:3): [True: 0, False: 61]
  ------------------
 1157|     61|	}
 1158|     61|}
 1159|       |
 1160|       |
 1161|       |    /* Parse the BrowsePath */
 1162|    417| parse_path:
 1163|    417|    res = parse_relativepath(&ao->browsePath, &pos, end, NULL,
 1164|    417|                             UA_ESCAPING_PERCENT_EXTENDED, defaultNamespaceIndex);
 1165|    417|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    417|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1165:8): [True: 85, False: 332]
  ------------------
 1166|     85|        goto cleanup;
 1167|       |
 1168|       |    /* Parse the AttributeId */
 1169|    332|    if(pos < end && *pos == '#') {
  ------------------
  |  Branch (1169:8): [True: 52, False: 280]
  |  Branch (1169:21): [True: 14, False: 38]
  ------------------
 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|    318|    if(pos < end && *pos == '[') {
  ------------------
  |  Branch (1184:8): [True: 38, False: 280]
  |  Branch (1184:21): [True: 20, False: 18]
  ------------------
 1185|     20|        const u8 *range_pos = ++pos;
 1186|  8.03M|        while(pos < end && *pos != ']') {
  ------------------
  |  Branch (1186:15): [True: 8.03M, False: 0]
  |  Branch (1186:28): [True: 8.03M, False: 20]
  ------------------
 1187|  8.03M|            pos++;
 1188|  8.03M|        }
 1189|     20|        if(pos == end) {
  ------------------
  |  Branch (1189:12): [True: 0, False: 20]
  ------------------
 1190|      0|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1191|      0|            goto cleanup;
 1192|      0|        }
 1193|     20|        UA_String rangeString = {(size_t)(pos - range_pos), (UA_Byte*)(uintptr_t)range_pos};
 1194|     20|        if(rangeString.length > 0)
  ------------------
  |  Branch (1194:12): [True: 20, False: 0]
  ------------------
 1195|     20|            res = UA_String_copy(&rangeString, &ao->indexRange);
 1196|     20|        pos++;
 1197|     20|    }
 1198|       |
 1199|       |    /* Check that we have parsed the entire string */
 1200|    318|    if(pos != end)
  ------------------
  |  Branch (1200:8): [True: 18, False: 300]
  ------------------
 1201|     18|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1202|       |
 1203|       |
 1204|    433| cleanup:
 1205|    433|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    433|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1205:8): [True: 133, False: 300]
  ------------------
 1206|    133|        UA_AttributeOperand_clear(ao);
 1207|    433|    return res;
 1208|    318|}

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|    522|UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) {
  111|    522|    UA_assert(buf);
  ------------------
  |  |  411|    522|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (111:5): [True: 522, False: 0]
  ------------------
  112|    522|    UA_assert(number);
  ------------------
  |  |  411|    522|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (112:5): [True: 522, False: 0]
  ------------------
  113|    522|    u32 n = 0;
  114|    522|    size_t progress = 0;
  115|       |    /* read numbers until the end or a non-number character appears */
  116|   358k|    while(progress < buflen) {
  ------------------
  |  Branch (116:11): [True: 357k, False: 490]
  ------------------
  117|   357k|        u8 c = buf[progress];
  118|   357k|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (118:12): [True: 357k, False: 3]
  |  Branch (118:24): [True: 357k, False: 29]
  |  Branch (118:36): [True: 357k, False: 0]
  ------------------
  119|   357k|           n = (n * base) + c - '0';
  120|     32|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (120:17): [True: 32, False: 0]
  |  Branch (120:29): [True: 27, False: 5]
  |  Branch (120:41): [True: 10, False: 17]
  |  Branch (120:53): [True: 0, False: 10]
  ------------------
  121|      0|           n = (n * base) + c-'a' + 10;
  122|     32|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (122:17): [True: 32, False: 0]
  |  Branch (122:29): [True: 27, False: 5]
  |  Branch (122:41): [True: 0, False: 27]
  |  Branch (122:53): [True: 0, False: 0]
  ------------------
  123|      0|           n = (n * base) + c-'A' + 10;
  124|     32|        else
  125|     32|           break;
  126|   357k|        ++progress;
  127|   357k|    }
  128|    522|    *number = n;
  129|    522|    return progress;
  130|    522|}
UA_readNumber:
  133|    522|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  134|    522|    return UA_readNumberWithBase(buf, buflen, number, 10);
  135|    522|}
lookupRefType:
  734|    651|lookupRefType(UA_Server *server, UA_QualifiedName *qn, UA_NodeId *outRefTypeId) {
  735|       |    /* Check well-known ReferenceTypes first */
  736|    651|    if(qn->namespaceIndex == 0) {
  ------------------
  |  Branch (736:8): [True: 651, False: 0]
  ------------------
  737|  3.25k|        for(size_t i = 0; i < KNOWNREFTYPES; i++) {
  ------------------
  |  |  712|  3.25k|#define KNOWNREFTYPES 17
  ------------------
  |  Branch (737:27): [True: 3.17k, False: 74]
  ------------------
  738|  3.17k|            if(UA_String_equal(&qn->name, &knownRefTypes[i].browseName)) {
  ------------------
  |  Branch (738:16): [True: 577, False: 2.60k]
  ------------------
  739|    577|                *outRefTypeId = UA_NODEID_NUMERIC(0, knownRefTypes[i].identifier);
  740|    577|                return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    577|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  741|    577|            }
  742|  3.17k|        }
  743|    651|    }
  744|       |
  745|       |    /* Browse the information model. Return the first results if the browse name
  746|       |     * in the hierarchy is ambiguous. */
  747|     74|    if(server) {
  ------------------
  |  Branch (747:8): [True: 0, False: 74]
  ------------------
  748|      0|        UA_BrowseDescription bd;
  749|      0|        UA_BrowseDescription_init(&bd);
  750|      0|        bd.nodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_REFERENCES);
  ------------------
  |  |   44|      0|#define UA_NS0ID_REFERENCES 31 /* ReferenceType */
  ------------------
  751|      0|        bd.browseDirection = UA_BROWSEDIRECTION_FORWARD;
  752|      0|        bd.referenceTypeId = UA_NODEID_NUMERIC(0, UA_NS0ID_HASSUBTYPE);
  ------------------
  |  |   56|      0|#define UA_NS0ID_HASSUBTYPE 45 /* ReferenceType */
  ------------------
  753|      0|        bd.nodeClassMask = UA_NODECLASS_REFERENCETYPE;
  754|       |
  755|      0|        size_t resultsSize = 0;
  756|      0|        UA_ExpandedNodeId *results = NULL;
  757|      0|        UA_StatusCode res =
  758|      0|            UA_Server_browseRecursive(server, &bd, &resultsSize, &results);
  759|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (759:12): [True: 0, False: 0]
  ------------------
  760|      0|            return res;
  761|      0|        for(size_t i = 0; i < resultsSize; i++) {
  ------------------
  |  Branch (761:27): [True: 0, False: 0]
  ------------------
  762|      0|            UA_QualifiedName bn;
  763|      0|            UA_Server_readBrowseName(server, results[i].nodeId, &bn);
  764|      0|            if(UA_QualifiedName_equal(qn, &bn)) {
  ------------------
  |  Branch (764:16): [True: 0, False: 0]
  ------------------
  765|      0|                UA_QualifiedName_clear(&bn);
  766|      0|                *outRefTypeId = results[i].nodeId;
  767|      0|                UA_NodeId_clear(&results[i].nodeId);
  768|      0|                UA_Array_delete(results, resultsSize, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|      0|#define UA_TYPES_NODEID 16
  ------------------
  769|      0|                return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  770|      0|            }
  771|      0|            UA_QualifiedName_clear(&bn);
  772|      0|        }
  773|       |
  774|      0|        UA_Array_delete(results, resultsSize, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|      0|#define UA_TYPES_NODEID 16
  ------------------
  775|      0|    }
  776|       |
  777|     74|    return UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  232|     74|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
  778|     74|}
getRefTypeBrowseName:
  781|  4.30k|getRefTypeBrowseName(const UA_NodeId *refTypeId, UA_String *outBN) {
  782|       |    /* Canonical name known? */
  783|  4.30k|    if(refTypeId->namespaceIndex == 0 &&
  ------------------
  |  Branch (783:8): [True: 4.30k, False: 0]
  ------------------
  784|  4.30k|       refTypeId->identifierType == UA_NODEIDTYPE_NUMERIC) {
  ------------------
  |  Branch (784:8): [True: 670, False: 3.63k]
  ------------------
  785|  2.67k|        for(size_t i = 0; i < KNOWNREFTYPES; i++) {
  ------------------
  |  |  712|  2.67k|#define KNOWNREFTYPES 17
  ------------------
  |  Branch (785:27): [True: 2.63k, False: 36]
  ------------------
  786|  2.63k|            if(refTypeId->identifier.numeric != knownRefTypes[i].identifier)
  ------------------
  |  Branch (786:16): [True: 2.00k, False: 634]
  ------------------
  787|  2.00k|                continue;
  788|    634|            memcpy(outBN->data, knownRefTypes[i].browseName.data, knownRefTypes[i].browseName.length);
  789|    634|            outBN->length = knownRefTypes[i].browseName.length;
  790|    634|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    634|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  791|  2.63k|        }
  792|    670|    }
  793|       |
  794|       |    /* Print the NodeId */
  795|  3.67k|    return UA_NodeId_print(refTypeId, outBN);
  796|  4.30k|}
UA_String_unescape:
  810|  80.8k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  811|  80.8k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (811:8): [True: 0, False: 80.8k]
  ------------------
  812|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  813|       |
  814|       |    /* Does the string need escaping? */
  815|  80.8k|    UA_String tmp;
  816|  80.8k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  80.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  817|  80.8k|    u8 *pos = str->data;
  818|  80.8k|    u8 *end = str->data + str->length;
  819|  80.8k|    u8 escape_char = (esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (819:23): [True: 74, False: 80.8k]
  ------------------
  820|  80.8k|                      esc == UA_ESCAPING_PERCENT_EXTENDED) ? '%' : '&';
  ------------------
  |  Branch (820:23): [True: 80.8k, False: 0]
  ------------------
  821|  11.8M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (821:11): [True: 11.7M, False: 80.2k]
  ------------------
  822|  11.7M|        if(*pos == escape_char)
  ------------------
  |  Branch (822:12): [True: 670, False: 11.7M]
  ------------------
  823|    670|            goto escape;
  824|  11.7M|    }
  825|       |
  826|  80.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  80.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  827|       |
  828|    670| escape:
  829|    670|    if(copyEscape) {
  ------------------
  |  Branch (829:8): [True: 0, False: 670]
  ------------------
  830|      0|        res = UA_String_copy(str, &tmp);
  831|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (831:12): [True: 0, False: 0]
  ------------------
  832|      0|            return res;
  833|      0|        pos = tmp.data;
  834|      0|        end = tmp.data + tmp.length;
  835|      0|    }
  836|       |
  837|    670|    u8 byte = 0;
  838|    670|    u8 *writepos = pos;
  839|       |
  840|    670|    res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    670|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  841|    670|    if(esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (841:8): [True: 1, False: 669]
  ------------------
  842|    670|       esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (842:8): [True: 669, False: 0]
  ------------------
  843|       |        /* Percent-Escaping */
  844|  10.7M|        for(; pos < end; pos++) {
  ------------------
  |  Branch (844:15): [True: 10.7M, False: 627]
  ------------------
  845|  10.7M|            if(*pos == '%') {
  ------------------
  |  Branch (845:16): [True: 9.92M, False: 834k]
  ------------------
  846|  9.92M|                if(pos + 2 >= end || !isHex(pos[1]) || !isHex(pos[2]))
  ------------------
  |  Branch (846:20): [True: 0, False: 9.92M]
  |  Branch (846:38): [True: 40, False: 9.92M]
  |  Branch (846:56): [True: 3, False: 9.92M]
  ------------------
  847|     43|                    goto out;
  848|  9.92M|                if(pos[1] >= 'a')
  ------------------
  |  Branch (848:20): [True: 330, False: 9.92M]
  ------------------
  849|    330|                    byte = pos[1] - ('a' - 10);
  850|  9.92M|                else if(pos[1] >= 'A')
  ------------------
  |  Branch (850:25): [True: 8, False: 9.92M]
  ------------------
  851|      8|                    byte = pos[1] - ('A' - 10);
  852|  9.92M|                else
  853|  9.92M|                    byte = pos[1] - '0';
  854|  9.92M|                byte <<= 4;
  855|       |
  856|  9.92M|                if(pos[2] >= 'a')
  ------------------
  |  Branch (856:20): [True: 97.0k, False: 9.82M]
  ------------------
  857|  97.0k|                    byte += (u8)(pos[2] - ('a' - 10));
  858|  9.82M|                else if(pos[2] >= 'A')
  ------------------
  |  Branch (858:25): [True: 53, False: 9.82M]
  ------------------
  859|     53|                    byte += (u8)(pos[2] - ('A' - 10));
  860|  9.82M|                else
  861|  9.82M|                    byte += (u8)(pos[2] - '0');
  862|       |
  863|  9.92M|                pos += 2;
  864|  9.92M|                *writepos++ = byte;
  865|  9.92M|                continue;
  866|  9.92M|            }
  867|   834k|            *writepos++ = *pos;
  868|   834k|        }
  869|    670|    } else {
  870|       |        /* And-Escaping */
  871|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (871:15): [True: 0, False: 0]
  ------------------
  872|      0|            if(*pos == '&') {
  ------------------
  |  Branch (872:16): [True: 0, False: 0]
  ------------------
  873|      0|                pos++;
  874|      0|                if(pos == end)
  ------------------
  |  Branch (874:20): [True: 0, False: 0]
  ------------------
  875|      0|                    goto out;
  876|      0|            }
  877|      0|            *writepos++ = *pos;
  878|      0|        }
  879|      0|    }
  880|    627|    res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    627|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  881|       |
  882|    670| out:
  883|    670|    if(copyEscape) {
  ------------------
  |  Branch (883:8): [True: 0, False: 670]
  ------------------
  884|      0|        tmp.length = (size_t)(writepos - tmp.data);
  885|      0|        if(tmp.length == 0)
  ------------------
  |  Branch (885:12): [True: 0, False: 0]
  ------------------
  886|      0|            UA_String_clear(&tmp);
  887|      0|        if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (887:12): [True: 0, False: 0]
  ------------------
  888|      0|            *str = tmp;
  889|      0|        else
  890|      0|            UA_String_clear(&tmp);
  891|    670|    } else if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    670|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (891:15): [True: 627, False: 43]
  ------------------
  892|    627|        str->length = (size_t)(writepos - str->data);
  893|    627|    }
  894|    670|    return res;
  895|    627|}
UA_String_escapedSize:
  901|  82.3k|UA_String_escapedSize(const UA_String s, UA_Escaping esc) {
  902|       |    /* Find out the overhead from escaping */
  903|  82.3k|    size_t overhead = 0;
  904|  61.6M|    for(size_t j = 0; j < s.length; j++) {
  ------------------
  |  Branch (904:23): [True: 61.5M, False: 82.3k]
  ------------------
  905|  61.5M|        if(esc == UA_ESCAPING_AND_EXTENDED)
  ------------------
  |  Branch (905:12): [True: 0, False: 61.5M]
  ------------------
  906|      0|            overhead += isReservedAndExtended(s.data[j]);
  907|  61.5M|        else if(esc == UA_ESCAPING_AND)
  ------------------
  |  Branch (907:17): [True: 0, False: 61.5M]
  ------------------
  908|      0|            overhead += isReservedAnd(s.data[j]);
  909|  61.5M|        else if(esc == UA_ESCAPING_PERCENT)
  ------------------
  |  Branch (909:17): [True: 0, False: 61.5M]
  ------------------
  910|      0|            overhead += (isReservedPercent(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (910:26): [True: 0, False: 0]
  ------------------
  911|  61.5M|        else /* if(esc == UA_ESCAPING_PERCENT_EXTENDED) */
  912|  61.5M|            overhead += (isReservedPercentExtended(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (912:26): [True: 59.5M, False: 2.04M]
  ------------------
  913|  61.5M|    }
  914|       |
  915|  82.3k|    return s.length + overhead;
  916|  82.3k|}
UA_String_escapeInsert:
  919|  81.4k|UA_String_escapeInsert(u8 *pos, const UA_String s2, UA_Escaping esc) {
  920|  81.4k|    u8 *begin = pos;
  921|       |
  922|  81.4k|    if(esc == UA_ESCAPING_NONE) {
  ------------------
  |  Branch (922:8): [True: 2.27k, False: 79.2k]
  ------------------
  923|  20.4M|        for(size_t j = 0; j < s2.length; j++)
  ------------------
  |  Branch (923:27): [True: 20.4M, False: 2.27k]
  ------------------
  924|  20.4M|            *pos++ = s2.data[j];
  925|  79.2k|    } else if(esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (925:15): [True: 0, False: 79.2k]
  |  Branch (925:45): [True: 79.2k, False: 0]
  ------------------
  926|  20.7M|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (926:27): [True: 20.7M, False: 79.2k]
  ------------------
  927|  20.7M|            UA_Boolean reserved = (esc == UA_ESCAPING_PERCENT_EXTENDED) ?
  ------------------
  |  Branch (927:35): [True: 20.7M, False: 0]
  ------------------
  928|  20.7M|                isReservedPercentExtended(s2.data[j]) : isReservedPercent(s2.data[j]);
  929|  20.7M|            if(UA_LIKELY(!reserved)) {
  ------------------
  |  |  590|  20.7M|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (590:23): [True: 871k, False: 19.8M]
  |  |  ------------------
  ------------------
  930|   871k|                *pos++ = s2.data[j];
  931|  19.8M|            } else {
  932|  19.8M|                *pos++ = '%';
  933|  19.8M|                *pos++ = hexchars[s2.data[j] >> 4];
  934|  19.8M|                *pos++ = hexchars[s2.data[j] & 0x0f];
  935|  19.8M|            }
  936|  20.7M|        }
  937|  79.2k|    } else {
  938|      0|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (938:27): [True: 0, False: 0]
  ------------------
  939|      0|            UA_Boolean reserved = (esc == UA_ESCAPING_AND_EXTENDED) ?
  ------------------
  |  Branch (939:35): [True: 0, False: 0]
  ------------------
  940|      0|                isReservedAndExtended(s2.data[j]) : isReservedAnd(s2.data[j]);
  941|      0|            if(reserved)
  ------------------
  |  Branch (941:16): [True: 0, False: 0]
  ------------------
  942|      0|                *pos++ = '&';
  943|      0|            *pos++ = s2.data[j];
  944|      0|        }
  945|      0|    }
  946|       |
  947|  81.4k|    return (size_t)(pos - begin);
  948|  81.4k|}
UA_String_escapeAppend:
  951|  79.1k|UA_String_escapeAppend(UA_String *s, const UA_String s2, UA_Escaping esc) {
  952|  79.1k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (952:8): [True: 0, False: 79.1k]
  ------------------
  953|      0|        return UA_String_append(s, s2);
  954|       |
  955|       |    /* Allocate memory for the additional escaped string */
  956|  79.1k|    size_t escapedLength = UA_String_escapedSize(s2, esc);
  957|  79.1k|    UA_Byte *buf = (UA_Byte*)
  958|  79.1k|        UA_realloc(s->data, s->length + s2.length + escapedLength);
  ------------------
  |  |  353|  79.1k|# define UA_realloc(ptr, size) UA_reallocSingleton(ptr, size)
  ------------------
  959|  79.1k|    if(!buf)
  ------------------
  |  Branch (959:8): [True: 0, False: 79.1k]
  ------------------
  960|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  961|       |
  962|       |    /* Escape and insert at the end */
  963|  79.1k|    s->data = buf;
  964|  79.1k|    UA_String_escapeInsert(s->data + s->length, s2, esc);
  965|  79.1k|    s->length += escapedLength;
  966|  79.1k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  79.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  967|  79.1k|}
UA_AttributeOperand_print:
 1131|    300|                          UA_String *out) {
 1132|    300|    UA_String tmp = UA_STRING_NULL;
 1133|    300|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    300|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1134|       |
 1135|       |    /* Print the TypeDefinitionId */
 1136|    300|    if(!UA_NodeId_equal(&objectsFolder, &ao->nodeId)) {
  ------------------
  |  Branch (1136:8): [True: 132, False: 168]
  ------------------
 1137|    132|        UA_Byte nodeIdBuf[512];
 1138|    132|        UA_String nodeIdBufStr = {512, nodeIdBuf};
 1139|    132|        res |= nodeId_printEscape(&ao->nodeId, &nodeIdBufStr,
 1140|    132|                                  NULL, UA_ESCAPING_PERCENT_EXTENDED);
 1141|    132|        res |= UA_String_append(&tmp, nodeIdBufStr);
 1142|    132|    }
 1143|       |
 1144|       |    /* Print the BrowsePath */
 1145|    300|    UA_String rpstr = UA_STRING_NULL;
 1146|    300|    UA_assert(rpstr.data == NULL && rpstr.length == 0); /* pacify clang scan-build */
  ------------------
  |  |  411|    300|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1146:5): [True: 300, False: 0]
  |  Branch (1146:5): [True: 300, False: 0]
  ------------------
 1147|    300|    res |= printRelativePath(&ao->browsePath, &rpstr, UA_ESCAPING_PERCENT_EXTENDED);
 1148|    300|    res |= UA_String_append(&tmp, rpstr);
 1149|    300|    UA_String_clear(&rpstr);
 1150|       |
 1151|       |    /* Print the attribute name */
 1152|    300|    if(ao->attributeId != UA_ATTRIBUTEID_VALUE) {
  ------------------
  |  Branch (1152:8): [True: 0, False: 300]
  ------------------
 1153|      0|        const char *attrName= UA_AttributeId_name((UA_AttributeId)ao->attributeId);
 1154|      0|        res |= UA_String_append(&tmp, UA_STRING("#"));
 1155|      0|        res |= UA_String_append(&tmp, UA_STRING((char*)(uintptr_t)attrName));
 1156|      0|    }
 1157|       |
 1158|       |    /* Print the IndexRange */
 1159|    300|    if(ao->indexRange.length > 0) {
  ------------------
  |  Branch (1159:8): [True: 20, False: 280]
  ------------------
 1160|     20|        res |= UA_String_append(&tmp, UA_STRING("["));
 1161|     20|        res |= UA_String_append(&tmp, ao->indexRange);
 1162|     20|        res |= UA_String_append(&tmp, UA_STRING("]"));
 1163|     20|    }
 1164|       |
 1165|       |    /* Encoding failed, clean up */
 1166|    300|    if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    300|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1166:8): [True: 0, False: 300]
  ------------------
 1167|      0|        UA_String_clear(&tmp);
 1168|      0|        return res;
 1169|      0|    }
 1170|       |
 1171|    300|    return moveTmpToOut(&tmp, out);
 1172|    300|}
ua_util.c:isHex:
  803|  19.8M|isHex(u8 c) {
  804|  19.8M|    return ((c >= 'a' && c <= 'f') ||
  ------------------
  |  Branch (804:14): [True: 97.3k, False: 19.7M]
  |  Branch (804:26): [True: 97.3k, False: 20]
  ------------------
  805|  19.7M|            (c >= 'A' && c <= 'F') ||
  ------------------
  |  Branch (805:14): [True: 83, False: 19.7M]
  |  Branch (805:26): [True: 62, False: 21]
  ------------------
  806|  19.7M|            (c >= '0' && c <= '9'));
  ------------------
  |  Branch (806:14): [True: 19.7M, False: 22]
  |  Branch (806:26): [True: 19.7M, False: 21]
  ------------------
  807|  19.8M|}
ua_util.c:printRelativePath:
 1007|    300|printRelativePath(const UA_RelativePath *rp, UA_String *out, UA_Escaping esc) {
 1008|    300|    UA_String tmp = UA_STRING_NULL;
 1009|    300|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    300|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1010|  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 (1010:23): [True: 75.6k, False: 300]
  |  Branch (1010:47): [True: 75.6k, False: 0]
  ------------------
 1011|       |        /* Print the reference type */
 1012|  75.6k|        UA_RelativePathElement *elm = &rp->elements[i];
 1013|  75.6k|        if(UA_NodeId_equal(&hierarchicalRefs, &elm->referenceTypeId) &&
  ------------------
  |  Branch (1013:12): [True: 72.4k, False: 3.21k]
  ------------------
 1014|  72.4k|           !elm->isInverse && elm->includeSubtypes) {
  ------------------
  |  Branch (1014:12): [True: 72.3k, False: 128]
  |  Branch (1014:31): [True: 72.2k, False: 128]
  ------------------
 1015|  72.2k|            res |= UA_String_append(&tmp, UA_STRING("/"));
 1016|  72.2k|        } else if(esc == UA_ESCAPING_AND &&
  ------------------
  |  Branch (1016:19): [True: 0, False: 3.47k]
  ------------------
 1017|      0|                  UA_NodeId_equal(&aggregatesRefs, &elm->referenceTypeId) &&
  ------------------
  |  Branch (1017:19): [True: 0, False: 0]
  ------------------
 1018|      0|                  !elm->isInverse && elm->includeSubtypes) {
  ------------------
  |  Branch (1018:19): [True: 0, False: 0]
  |  Branch (1018:38): [True: 0, False: 0]
  ------------------
 1019|      0|            res |= UA_String_append(&tmp, UA_STRING("."));
 1020|  3.47k|        } else {
 1021|  3.47k|            res |= UA_String_append(&tmp, UA_STRING("<"));
 1022|  3.47k|            if(!elm->includeSubtypes)
  ------------------
  |  Branch (1022:16): [True: 128, False: 3.34k]
  ------------------
 1023|    128|                res |= UA_String_append(&tmp, UA_STRING("#"));
 1024|  3.47k|            if(elm->isInverse)
  ------------------
  |  Branch (1024:16): [True: 166, False: 3.30k]
  ------------------
 1025|    166|                res |= UA_String_append(&tmp, UA_STRING("!"));
 1026|  3.47k|            if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1026:16): [True: 0, False: 3.47k]
  ------------------
 1027|      0|                break;
 1028|       |
 1029|  3.47k|            UA_Byte bnBuf[512];
 1030|  3.47k|            UA_String bnBufStr = {512, bnBuf};
 1031|  3.47k|            res = getRefTypeBrowseName(&elm->referenceTypeId, &bnBufStr);
 1032|  3.47k|            if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  3.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1032:16): [True: 838, False: 2.63k]
  ------------------
 1033|    838|                UA_String_init(&bnBufStr);
 1034|    838|                res = getRefTypeBrowseName(&elm->referenceTypeId, &bnBufStr);
 1035|    838|                if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    838|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1035:20): [True: 0, False: 838]
  ------------------
 1036|      0|                    break;
 1037|    838|            }
 1038|  3.47k|            res |= UA_String_escapeAppend(&tmp, bnBufStr, esc);
 1039|  3.47k|            res |= UA_String_append(&tmp, UA_STRING(">"));
 1040|  3.47k|            if(bnBufStr.data != bnBuf)
  ------------------
  |  Branch (1040:16): [True: 838, False: 2.63k]
  ------------------
 1041|    838|                UA_String_clear(&bnBufStr);
 1042|  3.47k|        }
 1043|       |
 1044|       |        /* Print the qualified name */
 1045|  75.6k|        UA_QualifiedName *qn = &elm->targetName;
 1046|  75.6k|        if(qn->namespaceIndex > 0) {
  ------------------
  |  Branch (1046:12): [True: 18, False: 75.6k]
  ------------------
 1047|     18|            char nsStr[8]; /* Enough for a uint16 */
 1048|     18|            itoaUnsigned(qn->namespaceIndex, nsStr, 10);
 1049|     18|            res |= UA_String_append(&tmp, UA_STRING(nsStr));
 1050|     18|            res |= UA_String_append(&tmp, UA_STRING(":"));
 1051|     18|        }
 1052|  75.6k|        res |= UA_String_escapeAppend(&tmp, qn->name, esc);
 1053|  75.6k|    }
 1054|       |
 1055|       |    /* Encoding failed, clean up */
 1056|    300|    if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    300|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1056:8): [True: 0, False: 300]
  ------------------
 1057|      0|        UA_String_clear(&tmp);
 1058|      0|        return res;
 1059|      0|    }
 1060|       |
 1061|    300|    return moveTmpToOut(&tmp, out);
 1062|    300|}
ua_util.c:moveTmpToOut:
  970|    600|moveTmpToOut(UA_String *tmp, UA_String *out) {
  971|       |    /* Output has zero length */
  972|    600|    if(tmp->length == 0) {
  ------------------
  |  Branch (972:8): [True: 18, False: 582]
  ------------------
  973|     18|        UA_assert(tmp->data == NULL);
  ------------------
  |  |  411|     18|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (973:9): [True: 18, False: 0]
  ------------------
  974|     18|        if(out->data == NULL)
  ------------------
  |  Branch (974:12): [True: 18, False: 0]
  ------------------
  975|     18|            out->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     18|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  976|     18|        out->length = 0;
  977|     18|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     18|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  978|     18|    }
  979|       |
  980|       |    /* No output buffer provided, return the tmp buffer */
  981|    582|    if(out->length == 0) {
  ------------------
  |  Branch (981:8): [True: 582, False: 0]
  ------------------
  982|    582|        *out = *tmp;
  983|    582|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    582|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  984|    582|    }
  985|       |
  986|       |    /* The provided buffer is too short */
  987|      0|    if(out->length < tmp->length) {
  ------------------
  |  Branch (987:8): [True: 0, False: 0]
  ------------------
  988|      0|        UA_String_clear(tmp);
  989|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  990|      0|    }
  991|       |
  992|       |    /* Copy output to the provided buffer */
  993|      0|    memcpy(out->data, tmp->data, tmp->length);
  994|      0|    out->length = tmp->length;
  995|      0|    UA_String_clear(tmp);
  996|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  997|      0|}

ua_util.c:isReservedPercent:
   95|  82.2M|isReservedPercent(u8 c) {
   96|  82.2M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 9.05k, False: 82.2M]
  |  Branch (96:26): [True: 5.22k, False: 82.2M]
  |  Branch (96:38): [True: 77.9M, False: 4.37M]
  |  Branch (96:50): [True: 232, False: 4.37M]
  ------------------
   97|  82.2M|}
ua_util.c:isReservedPercentExtended:
  100|  82.2M|isReservedPercentExtended(u8 c) {
  101|  82.2M|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 77.9M, False: 4.37M]
  |  Branch (101:37): [True: 3.75k, False: 4.36M]
  |  Branch (101:49): [True: 3.01k, False: 4.36M]
  |  Branch (101:61): [True: 2.89k, False: 4.36M]
  |  Branch (101:73): [True: 13.7k, False: 4.34M]
  ------------------
  102|  4.34M|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 351k, False: 3.99M]
  |  Branch (102:25): [True: 173k, False: 3.82M]
  |  Branch (102:37): [True: 191k, False: 3.63M]
  |  Branch (102:49): [True: 46.3k, False: 3.58M]
  |  Branch (102:61): [True: 12.2k, False: 3.57M]
  |  Branch (102:73): [True: 0, False: 3.57M]
  ------------------
  103|  3.57M|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 2.72k, False: 3.57M]
  |  Branch (103:25): [True: 636k, False: 2.93M]
  |  Branch (103:37): [True: 4.06k, False: 2.93M]
  |  Branch (103:50): [True: 6.27k, False: 2.92M]
  |  Branch (103:62): [True: 4.40k, False: 2.91M]
  ------------------
  104|  82.2M|}
ua_types_lex.c:isReservedPercentExtended:
  100|   798k|isReservedPercentExtended(u8 c) {
  101|   798k|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 10, False: 798k]
  |  Branch (101:37): [True: 0, False: 798k]
  |  Branch (101:49): [True: 0, False: 798k]
  |  Branch (101:61): [True: 4, False: 798k]
  |  Branch (101:73): [True: 1, False: 798k]
  ------------------
  102|   798k|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 0, False: 798k]
  |  Branch (102:25): [True: 0, False: 798k]
  |  Branch (102:37): [True: 0, False: 798k]
  |  Branch (102:49): [True: 0, False: 798k]
  |  Branch (102:61): [True: 4.44k, False: 793k]
  |  Branch (102:73): [True: 0, False: 793k]
  ------------------
  103|   793k|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 1, False: 793k]
  |  Branch (103:25): [True: 73.0k, False: 720k]
  |  Branch (103:37): [True: 0, False: 720k]
  |  Branch (103:50): [True: 0, False: 720k]
  |  Branch (103:62): [True: 0, False: 720k]
  ------------------
  104|   798k|}
ua_types_lex.c:isReservedPercent:
   95|   798k|isReservedPercent(u8 c) {
   96|   798k|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 0, False: 798k]
  |  Branch (96:26): [True: 0, False: 798k]
  |  Branch (96:38): [True: 10, False: 798k]
  |  Branch (96:50): [True: 0, False: 798k]
  ------------------
   97|   798k|}

UA_memoryManager_setLimitFromLast4Bytes:
  156|    283|int UA_memoryManager_setLimitFromLast4Bytes(const uint8_t *data, size_t size) {
  157|    283|    UA_mallocSingleton = UA_memoryManager_malloc;
  158|    283|    UA_freeSingleton = UA_memoryManager_free;
  159|    283|    UA_callocSingleton = UA_memoryManager_calloc;
  160|    283|    UA_reallocSingleton = UA_memoryManager_realloc;
  161|    283|    if(size <4)
  ------------------
  |  Branch (161:8): [True: 0, False: 283]
  ------------------
  162|      0|        return 0;
  163|       |    // just cast the last 4 bytes to uint32
  164|    283|    const uint32_t *newLimit = (const uint32_t*)(uintptr_t)&(data[size-4]);
  165|    283|    uint32_t limit;
  166|       |    // use memcopy to avoid asan complaining on misaligned memory
  167|    283|    memcpy(&limit, newLimit, sizeof(uint32_t));
  168|    283|    memoryLimit = limit;
  169|    283|    return 1;
  170|    283|}
custom_memory_manager.c:UA_memoryManager_malloc:
  109|    299|static void *UA_memoryManager_malloc(size_t size) {
  110|    299|    if(totalMemorySize + size > memoryLimit)
  ------------------
  |  Branch (110:8): [True: 18, False: 281]
  ------------------
  111|     18|        return NULL;
  112|    281|    void *addr = malloc(size);
  113|    281|    if(!addr)
  ------------------
  |  Branch (113:8): [True: 0, False: 281]
  ------------------
  114|      0|        return NULL;
  115|    281|    addToMap(size, addr);
  116|    281|    return addr;
  117|    281|}
custom_memory_manager.c:addToMap:
   47|   242k|static int addToMap(size_t size, void *addr) {
   48|   242k|    struct UA_mm_entry *newEntry = (struct UA_mm_entry*)malloc(sizeof(struct UA_mm_entry));
   49|   242k|    if(!newEntry) {
  ------------------
  |  Branch (49:8): [True: 0, False: 242k]
  ------------------
   50|       |        //printf("MemoryManager: Could not allocate memory");
   51|      0|        return 0;
   52|      0|    }
   53|   242k|    newEntry->size = size;
   54|   242k|    newEntry->address = addr;
   55|   242k|    newEntry->next = NULL;
   56|   242k|    pthread_mutex_lock(&mutex);
   57|   242k|    newEntry->prev = address_map_last;
   58|   242k|    if(address_map_last)
  ------------------
  |  Branch (58:8): [True: 242k, False: 129]
  ------------------
   59|   242k|        address_map_last->next = newEntry;
   60|   242k|    address_map_last = newEntry;
   61|   242k|    totalMemorySize += size;
   62|   242k|    if(address_map_first == NULL)
  ------------------
  |  Branch (62:8): [True: 129, False: 242k]
  ------------------
   63|    129|        address_map_first = newEntry;
   64|   242k|    pthread_mutex_unlock(&mutex);
   65|       |    //printf("Total size (malloc): %lld And new address: %p Entry %p\n", totalMemorySize, addr, (void*)newEntry);
   66|       |
   67|   242k|    return 1;
   68|   242k|}
custom_memory_manager.c:UA_memoryManager_free:
  141|  85.1k|static void UA_memoryManager_free(void* ptr) {
  142|  85.1k|    removeFromMap(ptr);
  143|  85.1k|    free(ptr);
  144|  85.1k|}
custom_memory_manager.c:removeFromMap:
   77|   321k|static int removeFromMap(void *addr) {
   78|   321k|    if(addr == NULL)
  ------------------
  |  Branch (78:8): [True: 79.0k, False: 242k]
  ------------------
   79|  79.0k|        return 1;
   80|       |
   81|   242k|    pthread_mutex_lock(&mutex);
   82|       |
   83|   242k|    struct UA_mm_entry *e = address_map_last;
   84|       |
   85|   583k|    while (e) {
  ------------------
  |  Branch (85:12): [True: 583k, False: 0]
  ------------------
   86|   583k|        if(e->address == addr) {
  ------------------
  |  Branch (86:12): [True: 242k, False: 340k]
  ------------------
   87|   242k|            if(e == address_map_first)
  ------------------
  |  Branch (87:16): [True: 130, False: 242k]
  ------------------
   88|    130|                address_map_first = e->next;
   89|   242k|            if(e == address_map_last)
  ------------------
  |  Branch (89:16): [True: 232k, False: 10.4k]
  ------------------
   90|   232k|                address_map_last = e->prev;
   91|   242k|            if(e->prev)
  ------------------
  |  Branch (91:16): [True: 242k, False: 130]
  ------------------
   92|   242k|                e->prev->next = e->next;
   93|   242k|            if(e->next)
  ------------------
  |  Branch (93:16): [True: 10.4k, False: 232k]
  ------------------
   94|  10.4k|                e->next->prev = e->prev;
   95|   242k|            totalMemorySize -= e->size;
   96|       |
   97|       |            //printf("Total size (free): %lld after addr %p and deleting %p\n", totalMemorySize, addr, (void*)e);
   98|   242k|            free(e);
   99|   242k|            pthread_mutex_unlock(&mutex);
  100|   242k|            return 1;
  101|   242k|        }
  102|   340k|        e = e->prev;
  103|   340k|    }
  104|      0|    pthread_mutex_unlock(&mutex);
  105|       |    //printf("MemoryManager: Entry with address %p not found", addr);
  106|      0|    return 0;
  107|   242k|}
custom_memory_manager.c:UA_memoryManager_calloc:
  119|  5.85k|static void *UA_memoryManager_calloc(size_t num, size_t size) {
  120|  5.85k|    if(totalMemorySize + (size * num) > memoryLimit)
  ------------------
  |  Branch (120:8): [True: 31, False: 5.82k]
  ------------------
  121|     31|        return NULL;
  122|  5.82k|    void *addr = calloc(num, size);
  123|  5.82k|    if(!addr)
  ------------------
  |  Branch (123:8): [True: 0, False: 5.82k]
  ------------------
  124|      0|        return NULL;
  125|  5.82k|    addToMap(size*num, addr);
  126|  5.82k|    return addr;
  127|  5.82k|}
custom_memory_manager.c:UA_memoryManager_realloc:
  129|   236k|static void *UA_memoryManager_realloc(void *ptr, size_t new_size) {
  130|   236k|    removeFromMap(ptr);
  131|   236k|    if(totalMemorySize + new_size > memoryLimit)
  ------------------
  |  Branch (131:8): [True: 6, False: 236k]
  ------------------
  132|      6|        return NULL;
  133|   236k|    void *addr = realloc(ptr, new_size);
  134|   236k|    if(!addr)
  ------------------
  |  Branch (134:8): [True: 0, False: 236k]
  ------------------
  135|      0|        return NULL;
  136|   236k|    addToMap(new_size, addr);
  137|   236k|    return addr;
  138|       |
  139|   236k|}

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

fuzz_attributeoperand.cc:_ZL24UA_AttributeOperand_initP19UA_AttributeOperand:
  222|    283|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_attributeoperand.cc:_ZL15UA_String_equalPK9UA_StringS1_:
  222|    150|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_attributeoperand.cc:_ZL15UA_String_clearP9UA_String:
  222|    300|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_attributeoperand.cc:_ZL25UA_AttributeOperand_clearP19UA_AttributeOperand:
  222|    300|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  222|    838|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_util.c:UA_String_init:
  222|    838|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_util.c:UA_String_equal:
  222|  3.17k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_util.c:UA_String_clear:
  222|  1.13k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_util.c:UA_NodeId_equal:
  222|  75.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  222|  81.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_clear:
  222|    651|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_RelativePath_init:
  222|    417|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_RelativePathElement_init:
  222|  77.7k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_RelativePathElement_clear:
  222|      7|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_AttributeOperand_init:
  222|    433|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  222|  78.3k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_AttributeOperand_clear:
  222|    133|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

