UA_unbase64:
   75|  2.76k|UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) {
   76|       |    /* Empty base64 results in an empty byte-string */
   77|  2.76k|    if(len == 0) {
  ------------------
  |  Branch (77:8): [True: 946, False: 1.81k]
  ------------------
   78|    946|        *out_len = 0;
   79|    946|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    946|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
   80|    946|    }
   81|       |
   82|       |    /* Allocate the output string. Append four bytes to allow missing padding */
   83|  1.81k|    size_t olen = (len / 4 * 3) + 4;
   84|  1.81k|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |   18|  1.81k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   85|  1.81k|    if(!out)
  ------------------
  |  Branch (85:8): [True: 6, False: 1.81k]
  ------------------
   86|      6|        return NULL;
   87|       |
   88|       |    /* Iterate over the input */
   89|  1.81k|    size_t pad = 0;
   90|  1.81k|    unsigned char count = 0;
   91|  1.81k|    unsigned char block[4];
   92|  1.81k|    unsigned char *pos = out;
   93|  47.5k|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (93:23): [True: 45.7k, False: 1.75k]
  ------------------
   94|  45.7k|        if(src[i] & 0x80)
  ------------------
  |  Branch (94:12): [True: 23, False: 45.7k]
  ------------------
   95|     23|            goto error; /* Non-ASCII input */
   96|  45.7k|        unsigned char tmp = dtable[src[i]];
   97|  45.7k|        if(tmp == 0x80)
  ------------------
  |  Branch (97:12): [True: 21, False: 45.7k]
  ------------------
   98|     21|            goto error; /* Not an allowed character */
   99|  45.7k|        if(tmp == 0x7f)
  ------------------
  |  Branch (99:12): [True: 2.91k, False: 42.7k]
  ------------------
  100|  2.91k|            continue; /* Whitespace is ignored to accomodate RFC 2045, used in
  101|       |                       * XML for xs:base64Binary. */
  102|  42.7k|        block[count++] = tmp;
  103|       |
  104|       |        /* Padding */
  105|  42.7k|        if(src[i] == '=') {
  ------------------
  |  Branch (105:12): [True: 218, False: 42.5k]
  ------------------
  106|    218|            if(count < 3) /* Padding can only be the last two bytes of a block */
  ------------------
  |  Branch (106:16): [True: 7, False: 211]
  ------------------
  107|      7|                goto error;
  108|    211|            block[count-1] = 0;
  109|    211|            pad++;
  110|  42.5k|        } else if(pad > 0) {
  ------------------
  |  Branch (110:19): [True: 3, False: 42.5k]
  ------------------
  111|      3|            goto error; /* Padding not terminated correctly */
  112|      3|        }
  113|       |
  114|       |        /* Write three output characters for four characters of input */
  115|  42.7k|        if(count == 4) {
  ------------------
  |  Branch (115:12): [True: 10.6k, False: 32.1k]
  ------------------
  116|  10.6k|            if(pad > 2)
  ------------------
  |  Branch (116:16): [True: 0, False: 10.6k]
  ------------------
  117|      0|                goto error; /* Invalid padding */
  118|  10.6k|            *pos++ = (block[0] << 2) | (block[1] >> 4);
  119|  10.6k|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  120|  10.6k|            *pos++ = (block[2] << 6) | block[3];
  121|  10.6k|            count = 0;
  122|  10.6k|            pos -= pad;
  123|  10.6k|            pad = 0;
  124|  10.6k|        }
  125|  42.7k|    }
  126|       |
  127|       |    /* Input length not a multiple of four */
  128|  1.75k|    if(count > 0)
  ------------------
  |  Branch (128:8): [True: 35, False: 1.72k]
  ------------------
  129|     35|        goto error;
  130|       |
  131|  1.72k|    *out_len = (size_t)(pos - out);
  132|  1.72k|    if(*out_len == 0) {
  ------------------
  |  Branch (132:8): [True: 860, False: 862]
  ------------------
  133|    860|        UA_free(out);
  ------------------
  |  |   19|    860|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  134|    860|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    860|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  135|    860|    }
  136|    862|    return out;
  137|       |
  138|     89| error:
  139|     89|    UA_free(out);
  ------------------
  |  |   19|     89|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  140|       |    return NULL;
  141|  1.72k|}

cj5_parse:
  305|  7.92k|          cj5_options *options) {
  306|  7.92k|    cj5_result r;
  307|  7.92k|    cj5__parser parser;
  308|  7.92k|    memset(&parser, 0x0, sizeof(parser));
  309|  7.92k|    parser.curr_tok_idx = 0;
  310|  7.92k|    parser.json5 = json5;
  311|  7.92k|    parser.len = len;
  312|  7.92k|    parser.tokens = tokens;
  313|  7.92k|    parser.max_tokens = max_tokens;
  314|       |
  315|  7.92k|    if(options)
  ------------------
  |  Branch (315:8): [True: 7.92k, False: 0]
  ------------------
  316|  7.92k|        parser.stop_early = options->stop_early;
  317|       |
  318|  7.92k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  7.92k|    char nesting[CJ5_MAX_NESTING]; // Contains either '\0', '{' or '[' for the
  320|       |                                   // type of nesting at each depth. '\0'
  321|       |                                   // indicates we are out of the root object.
  322|  7.92k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  7.92k|    next[0] = 'v';  // The root is a "value" (object, array or primitive). If we
  325|       |                    // detect a colon after the first value then everything is
  326|       |                    // wrapped into a "virtual root object" and the parsing is
  327|       |                    // restarted.
  328|  7.92k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  7.92k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  9.48k| start_parsing:
  333|  60.2M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 60.2M, False: 7.51k]
  ------------------
  334|  60.2M|        char c = json5[parser.pos];
  335|  60.2M|        switch(c) {
  336|   536k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 536k, False: 59.6M]
  ------------------
  337|  1.56M|        case '\r':
  ------------------
  |  Branch (337:9): [True: 1.02M, False: 59.2M]
  ------------------
  338|  4.02M|        case '\t':
  ------------------
  |  Branch (338:9): [True: 2.46M, False: 57.7M]
  ------------------
  339|  4.29M|        case ' ':
  ------------------
  |  Branch (339:9): [True: 265k, False: 59.9M]
  ------------------
  340|  4.29M|            break;
  341|       |
  342|  8.86k|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 8.86k, False: 60.2M]
  ------------------
  343|  13.4k|        case '/':
  ------------------
  |  Branch (343:9): [True: 4.57k, False: 60.2M]
  ------------------
  344|  13.4k|            cj5__skip_comment(&parser);
  345|  13.4k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 5.73k, False: 7.70k]
  ------------------
  346|  5.73k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 146, False: 5.58k]
  ------------------
  347|    146|                goto finish;
  348|  13.2k|            break;
  349|       |
  350|   299k|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 299k, False: 59.9M]
  ------------------
  351|   340k|        case '[':
  ------------------
  |  Branch (351:9): [True: 41.0k, False: 60.1M]
  ------------------
  352|       |            // Check the nesting depth
  353|   340k|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|   340k|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 2, False: 340k]
  ------------------
  354|      2|                parser.error = CJ5_ERROR_INVALID;
  355|      2|                goto finish;
  356|      2|            }
  357|       |
  358|       |            // Correct next?
  359|   340k|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 32, False: 340k]
  ------------------
  360|     32|                parser.error = CJ5_ERROR_INVALID;
  361|     32|                goto finish;
  362|     32|            }
  363|       |
  364|   340k|            depth++; // Increase the nesting depth
  365|   340k|            nesting[depth] = c; // Set the nesting type
  366|   340k|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 299k, False: 41.0k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|   340k|            token = cj5__alloc_token(&parser);
  370|   340k|            if(token) {
  ------------------
  |  Branch (370:16): [True: 199k, False: 140k]
  ------------------
  371|   199k|                token->parent_id = parser.curr_tok_idx;
  372|   199k|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 172k, False: 26.4k]
  ------------------
  373|   199k|                token->start = parser.pos;
  374|   199k|                token->size = 0;
  375|   199k|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|   199k|            }
  378|   340k|            break;
  379|       |
  380|   296k|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 296k, False: 59.9M]
  ------------------
  381|   336k|        case ']':
  ------------------
  |  Branch (381:9): [True: 39.9k, False: 60.1M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|   336k|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 18, False: 336k]
  ------------------
  385|     18|                parser.error = CJ5_ERROR_INVALID;
  386|     18|                goto finish;
  387|     18|            }
  388|       |
  389|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  390|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  391|       |            // when a key or a comma is expected.
  392|   336k|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 7, False: 336k]
  ------------------
  393|   336k|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 296k, False: 39.9k]
  |  Branch (393:29): [True: 231k, False: 65.0k]
  |  Branch (393:51): [True: 5, False: 231k]
  ------------------
  394|     12|                parser.error = CJ5_ERROR_INVALID;
  395|     12|                goto finish;
  396|     12|            }
  397|       |
  398|   336k|            if(token) {
  ------------------
  |  Branch (398:16): [True: 194k, False: 142k]
  ------------------
  399|       |                // Finalize the current token
  400|   194k|                token->end = parser.pos;
  401|       |
  402|       |                // Move to the parent and increase the parent size. Omit this
  403|       |                // when we leave the root (parent the same as the current
  404|       |                // token).
  405|   194k|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 188k, False: 5.76k]
  ------------------
  406|   188k|                    parser.curr_tok_idx = token->parent_id;
  407|   188k|                    token = &tokens[token->parent_id];
  408|   188k|                    token->size++;
  409|   188k|                }
  410|   194k|            }
  411|       |
  412|       |            // Step one level up
  413|   336k|            depth--;
  414|   336k|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 6.11k, False: 330k]
  ------------------
  415|       |                                                  // object. then we do not look for
  416|       |                                                  // another element.
  417|       |
  418|       |            // The first element was successfully parsed. Stop early or try to
  419|       |            // parse the full input string?
  420|   336k|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 6.11k, False: 330k]
  |  Branch (420:30): [True: 0, False: 6.11k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|   336k|            break;
  424|       |
  425|  4.43M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 4.43M, False: 55.8M]
  ------------------
  426|  4.43M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 1.20k, False: 4.43M]
  ------------------
  427|  1.20k|                parser.error = CJ5_ERROR_INVALID;
  428|  1.20k|                goto finish;
  429|  1.20k|            }
  430|  4.43M|            next[depth] = 'v';
  431|  4.43M|            break;
  432|       |
  433|  23.2M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 23.2M, False: 36.9M]
  ------------------
  434|  23.2M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 12, False: 23.2M]
  ------------------
  435|     12|                parser.error = CJ5_ERROR_INVALID;
  436|     12|                goto finish;
  437|     12|            }
  438|  23.2M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 4.19M, False: 19.0M]
  ------------------
  439|  23.2M|            break;
  440|       |
  441|  27.5M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 27.5M, False: 32.6M]
  ------------------
  442|  27.5M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 23.1M, False: 4.43M]
  ------------------
  443|  23.1M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  23.1M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 23.1M, False: 1.57k]
  ------------------
  445|       |                    // Parent is object or array
  446|  23.1M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 22.7M, False: 444k]
  ------------------
  447|  22.7M|                        token->size++;
  448|  23.1M|                    next[depth] = ',';
  449|  23.1M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|  1.57k|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|  1.57k|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 1.57k]
  ------------------
  457|      0|                        goto finish;
  458|  1.57k|                }
  459|  23.1M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 4.43M, False: 239]
  ------------------
  460|  4.43M|                cj5__parse_key(&parser);
  461|  4.43M|                if(token)
  ------------------
  |  Branch (461:20): [True: 4.06M, False: 365k]
  ------------------
  462|  4.06M|                    token->size++; // Keys count towards the length
  463|  4.43M|                next[depth] = ':';
  464|  4.43M|            } else {
  465|    239|                parser.error = CJ5_ERROR_INVALID;
  466|    239|            }
  467|       |
  468|  27.5M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 14.2M, False: 13.2M]
  |  Branch (468:32): [True: 543, False: 14.2M]
  ------------------
  469|    543|                goto finish;
  470|       |
  471|  27.5M|            break;
  472|  60.2M|        }
  473|  60.2M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  7.51k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 182, False: 7.33k]
  ------------------
  477|    182|        parser.error = CJ5_ERROR_INCOMPLETE;
  478|    182|        goto finish;
  479|    182|    }
  480|       |
  481|       |    // Close the virtual root object if there is one
  482|  7.33k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 1.11k, False: 6.21k]
  |  Branch (482:29): [True: 1.08k, False: 35]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|  1.08k|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 1.07k, False: 8]
  |  Branch (484:30): [True: 78, False: 998]
  ------------------
  485|     78|            parser.error = CJ5_ERROR_INVALID;
  486|  1.08k|        tokens[0].end = parser.pos - 1;
  487|  1.08k|    }
  488|       |
  489|  9.48k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  9.48k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 2.77k, False: 6.71k]
  ------------------
  493|  2.77k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 2.23k, False: 542]
  ------------------
  494|  2.23k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 1.95k, False: 279]
  |  Branch (494:22): [True: 1.55k, False: 394]
  ------------------
  495|  1.55k|        parser.token_count = 0;
  496|  1.55k|        token = cj5__alloc_token(&parser);
  497|  1.55k|        if(token) {
  ------------------
  |  Branch (497:12): [True: 1.55k, False: 0]
  ------------------
  498|  1.55k|            token->parent_id = 0;
  499|  1.55k|            token->type = CJ5_TOKEN_OBJECT;
  500|  1.55k|            token->start = 0;
  501|  1.55k|            token->size = 0;
  502|       |
  503|  1.55k|            nesting[0] = '{';
  504|  1.55k|            next[0] = 'k';
  505|       |
  506|  1.55k|            parser.curr_tok_idx = 0;
  507|  1.55k|            parser.pos = 0;
  508|  1.55k|            parser.error = CJ5_ERROR_NONE;
  509|  1.55k|            goto start_parsing;
  510|  1.55k|        }
  511|  1.55k|    }
  512|       |
  513|  7.92k|    memset(&r, 0x0, sizeof(r));
  514|  7.92k|    r.error = parser.error;
  515|  7.92k|    r.error_pos = parser.pos;
  516|  7.92k|    r.num_tokens = parser.token_count; // How many tokens (would) have been
  517|       |                                       // consumed by the parser?
  518|       |
  519|       |    // Not a single token was parsed -> return an error
  520|  7.92k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 29, False: 7.89k]
  ------------------
  521|     29|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  7.92k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 6.68k, False: 1.24k]
  ------------------
  525|  6.68k|        r.tokens = tokens;
  526|  6.68k|        r.json5 = json5;
  527|  6.68k|    }
  528|       |
  529|  7.92k|    return r;
  530|  9.48k|}
cj5_get_str:
  628|   172k|            char *buf, unsigned int *buflen) {
  629|   172k|    const cj5_token *token = &r->tokens[tok_index];
  630|   172k|    if(token->type != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (630:8): [True: 0, False: 172k]
  ------------------
  631|      0|        return CJ5_ERROR_INVALID;
  632|       |
  633|   172k|    const char *pos = &r->json5[token->start];
  634|   172k|    const char *end = &r->json5[token->end + 1];
  635|   172k|    unsigned int outpos = 0;
  636|  22.0M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (636:11): [True: 21.8M, False: 172k]
  ------------------
  637|  21.8M|        uint8_t c = (uint8_t)*pos;
  638|       |        // Unprintable ascii characters must be escaped
  639|  21.8M|        if(c < ' ' || c == 127)
  ------------------
  |  Branch (639:12): [True: 32, False: 21.8M]
  |  Branch (639:23): [True: 6, False: 21.8M]
  ------------------
  640|     38|            return CJ5_ERROR_INVALID;
  641|       |
  642|       |        // Unescaped Ascii character or utf8 byte
  643|  21.8M|        if(c != '\\') {
  ------------------
  |  Branch (643:12): [True: 21.7M, False: 42.4k]
  ------------------
  644|  21.7M|            buf[outpos++] = (char)c;
  645|  21.7M|            continue;
  646|  21.7M|        }
  647|       |
  648|       |        // End of input before the escaped character
  649|  42.4k|        if(pos + 1 >= end)
  ------------------
  |  Branch (649:12): [True: 0, False: 42.4k]
  ------------------
  650|      0|            return CJ5_ERROR_INCOMPLETE;
  651|       |
  652|       |        // Process escaped character
  653|  42.4k|        pos++;
  654|  42.4k|        c = (uint8_t)*pos;
  655|  42.4k|        switch(c) {
  656|    253|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (656:9): [True: 253, False: 42.1k]
  ------------------
  657|  1.01k|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (657:9): [True: 1.01k, False: 41.4k]
  ------------------
  658|  1.67k|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (658:9): [True: 1.67k, False: 40.7k]
  ------------------
  659|    332|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (659:9): [True: 332, False: 42.0k]
  ------------------
  660|  6.12k|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (660:9): [True: 6.12k, False: 36.3k]
  ------------------
  661|  23.1k|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (661:9): [True: 23.1k, False: 19.2k]
  ------------------
  662|  9.85k|        case 'u': {
  ------------------
  |  Branch (662:9): [True: 9.85k, False: 32.5k]
  ------------------
  663|       |            // Parse a unicode code point
  664|  9.85k|            if(pos + 4 >= end)
  ------------------
  |  Branch (664:16): [True: 3, False: 9.85k]
  ------------------
  665|      3|                return CJ5_ERROR_INCOMPLETE;
  666|  9.85k|            pos++;
  667|  9.85k|            uint32_t utf;
  668|  9.85k|            cj5_error_code err = parse_codepoint(pos, &utf);
  669|  9.85k|            if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (669:16): [True: 19, False: 9.83k]
  ------------------
  670|     19|                return err;
  671|  9.83k|            pos += 3;
  672|       |
  673|       |            // Parse a surrogate pair
  674|  9.83k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (674:16): [True: 4.57k, False: 5.26k]
  |  Branch (674:33): [True: 3.98k, False: 590]
  ------------------
  675|  3.98k|                if(pos + 6 >= end)
  ------------------
  |  Branch (675:20): [True: 15, False: 3.96k]
  ------------------
  676|     15|                    return CJ5_ERROR_INVALID;
  677|  3.96k|                if(pos[1] != '\\' && pos[2] != 'u')
  ------------------
  |  Branch (677:20): [True: 586, False: 3.38k]
  |  Branch (677:38): [True: 13, False: 573]
  ------------------
  678|     13|                    return CJ5_ERROR_INVALID;
  679|  3.95k|                pos += 3;
  680|  3.95k|                uint32_t utf2;
  681|  3.95k|                err = parse_codepoint(pos, &utf2);
  682|  3.95k|                if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (682:20): [True: 17, False: 3.93k]
  ------------------
  683|     17|                    return err;
  684|  3.93k|                pos += 3;
  685|       |                // High or low surrogate pair
  686|  3.93k|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (686:23): [True: 3.21k, False: 724]
  ------------------
  687|  3.21k|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  688|  3.93k|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  689|  3.93k|            }
  690|       |
  691|       |            // Write the utf8 bytes of the code point
  692|  9.78k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  693|  9.78k|            if(len == 0)
  ------------------
  |  Branch (693:16): [True: 34, False: 9.75k]
  ------------------
  694|     34|                return CJ5_ERROR_INVALID; // Not a utf8 string
  695|  9.75k|            outpos += len;
  696|  9.75k|            break;
  697|  9.78k|        }
  698|  42.4k|        }
  699|  42.4k|    }
  700|       |
  701|       |    // Terminate with \0
  702|   172k|    buf[outpos] = 0;
  703|       |
  704|       |    // Set the output length
  705|   172k|    if(buflen)
  ------------------
  |  Branch (705:8): [True: 172k, False: 0]
  ------------------
  706|   172k|        *buflen = outpos;
  707|   172k|    return CJ5_ERROR_NONE;
  708|   172k|}
cj5.c:cj5__skip_comment:
  260|  13.4k|cj5__skip_comment(cj5__parser* parser) {
  261|  13.4k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  13.4k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 8.86k, False: 4.57k]
  ------------------
  265|  9.20k|    skip_line:
  266|  3.86M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 3.86M, False: 61]
  ------------------
  267|  3.86M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 9.14k, False: 3.85M]
  ------------------
  268|  9.14k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  9.14k|                return;
  270|  9.14k|            }
  271|  3.85M|            parser->pos++;
  272|  3.85M|        }
  273|     61|        return;
  274|  9.20k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  4.57k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 31, False: 4.54k]
  ------------------
  278|     31|        parser->error = CJ5_ERROR_INVALID;
  279|     31|        return;
  280|     31|    }
  281|  4.54k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  4.54k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 342, False: 4.19k]
  ------------------
  285|    342|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|  4.19k|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 4.17k, False: 29]
  ------------------
  289|  4.17k|        parser->pos++;
  290|  2.34M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 2.34M, False: 86]
  ------------------
  291|  2.34M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 10.2k, False: 2.33M]
  |  Branch (291:45): [True: 4.08k, False: 6.13k]
  ------------------
  292|  4.08k|                parser->pos++;
  293|  4.08k|                return;
  294|  4.08k|            }
  295|  2.34M|        }
  296|  4.17k|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|    115|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|    115|}
cj5.c:cj5__alloc_token:
   88|  27.9M|cj5__alloc_token(cj5__parser *parser) {
   89|  27.9M|    cj5_token* token = NULL;
   90|  27.9M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 13.4M, False: 14.4M]
  ------------------
   91|  13.4M|        token = &parser->tokens[parser->token_count];
   92|  13.4M|        memset(token, 0x0, sizeof(cj5_token));
   93|  14.4M|    } else {
   94|  14.4M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  14.4M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  27.9M|    parser->token_count++;
  100|  27.9M|    return token;
  101|  27.9M|}
cj5.c:cj5__parse_primitive:
  152|  23.1M|cj5__parse_primitive(cj5__parser* parser) {
  153|  23.1M|    const char* json5 = parser->json5;
  154|  23.1M|    unsigned int len = parser->len;
  155|  23.1M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  23.1M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 1.42M, False: 21.7M]
  ------------------
  159|  21.7M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 1.51k, False: 21.7M]
  ------------------
  160|  1.42M|        cj5__parse_string(parser);
  161|  1.42M|        return;
  162|  1.42M|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  21.7M|    uint32_t fourcc = 0;
  167|  21.7M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 21.7M, False: 749]
  ------------------
  168|  21.7M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  21.7M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  21.7M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  21.7M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  21.7M|    }
  173|       |    
  174|  21.7M|    cj5_token_type type;
  175|  21.7M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 43.9k, False: 21.6M]
  ------------------
  176|  43.9k|        type = CJ5_TOKEN_NULL;
  177|  43.9k|        parser->pos += 3;
  178|  21.6M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 650, False: 21.6M]
  ------------------
  179|    650|        type = CJ5_TOKEN_BOOL;
  180|    650|        parser->pos += 3;
  181|  21.6M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 1.43k, False: 21.6M]
  ------------------
  182|       |        // "false" has five characters
  183|  1.43k|        type = CJ5_TOKEN_BOOL;
  184|  1.43k|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 2, False: 1.43k]
  |  Branch (184:32): [True: 25, False: 1.40k]
  ------------------
  185|     27|            parser->error = CJ5_ERROR_INVALID;
  186|     27|            return;
  187|     27|        }
  188|  1.40k|        parser->pos += 4;
  189|  21.6M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  21.6M|        type = CJ5_TOKEN_NUMBER;
  193|  64.7M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 64.7M, False: 1.08k]
  ------------------
  194|  64.7M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|   129M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 37.0M, False: 27.6M]
  ------------------
  195|  37.0M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 37.0M, False: 1.63k]
  ------------------
  196|  37.0M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|   101M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 25.1M, False: 11.8M]
  ------------------
  197|  25.1M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|  89.8M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 22.2M, False: 2.86M]
  ------------------
  198|  22.2M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 22.2M, False: 1.45k]
  |  Branch (198:48): [True: 21.6M, False: 584k]
  ------------------
  199|  21.6M|                break;
  200|  21.6M|            }
  201|  64.7M|        }
  202|  21.6M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  21.6M|    }
  205|       |
  206|  21.7M|    cj5_token *token = cj5__alloc_token(parser);
  207|  21.7M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 10.2M, False: 11.4M]
  ------------------
  208|  10.2M|        token->type = type;
  209|  10.2M|        token->start = start;
  210|  10.2M|        token->end = parser->pos;
  211|  10.2M|        token->size = parser->pos - start + 1;
  212|  10.2M|        token->parent_id = parser->curr_tok_idx;
  213|  10.2M|    }
  214|  21.7M|}
cj5.c:cj5__parse_string:
  104|  3.11M|cj5__parse_string(cj5__parser *parser) {
  105|  3.11M|    const char *json5 = parser->json5;
  106|  3.11M|    unsigned int len = parser->len;
  107|  3.11M|    unsigned int start = parser->pos;
  108|  3.11M|    char str_open = json5[start];
  109|       |
  110|  3.11M|    parser->pos++;
  111|  83.7M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 83.7M, False: 144]
  ------------------
  112|  83.7M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  83.7M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 3.11M, False: 80.6M]
  ------------------
  116|  3.11M|            cj5_token *token = cj5__alloc_token(parser);
  117|  3.11M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 1.58M, False: 1.53M]
  ------------------
  118|  1.58M|                token->type = CJ5_TOKEN_STRING;
  119|  1.58M|                token->start = start + 1;
  120|  1.58M|                token->end = parser->pos - 1;
  121|  1.58M|                token->size = token->end - token->start + 1;
  122|  1.58M|                token->parent_id = parser->curr_tok_idx;
  123|  1.58M|            } 
  124|  3.11M|            return;
  125|  3.11M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  80.6M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 4, False: 80.6M]
  ------------------
  129|      4|            parser->error = CJ5_ERROR_INVALID;
  130|      4|            return;
  131|      4|        }
  132|       |
  133|       |        // Skip escape character
  134|  80.6M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 826k, False: 79.8M]
  ------------------
  135|   826k|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 4, False: 826k]
  ------------------
  136|      4|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      4|                return;
  138|      4|            }
  139|   826k|            parser->pos++;
  140|   826k|        }
  141|  80.6M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|    144|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|    144|}
cj5.c:cj5__isrange:
   79|   148M|cj5__isrange(char ch, char from, char to) {
   80|   148M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|   148M|}
cj5.c:cj5__parse_key:
  217|  4.43M|cj5__parse_key(cj5__parser* parser) {
  218|  4.43M|    const char* json5 = parser->json5;
  219|  4.43M|    unsigned int start = parser->pos;
  220|  4.43M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  4.43M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 1.69M, False: 2.73M]
  |  Branch (223:32): [True: 1.86k, False: 2.73M]
  ------------------
  224|  1.69M|        cj5__parse_string(parser);
  225|  1.69M|        return;
  226|  1.69M|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|  2.73M|    unsigned int len = parser->len;
  230|  10.9M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 10.9M, False: 83]
  ------------------
  231|  10.9M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  21.8M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 3.99M, False: 6.91M]
  |  |  ------------------
  ------------------
  232|  6.91M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  17.8M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 3.67M, False: 3.24M]
  |  |  ------------------
  ------------------
  233|  3.24M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 1.75k, False: 3.24M]
  |  Branch (233:41): [True: 3.50k, False: 3.24M]
  ------------------
  234|  7.67M|            continue;
  235|  3.24M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|  6.48M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 505k, False: 2.73M]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 505k, False: 7]
  ------------------
  236|   505k|            continue;
  237|  2.73M|        break;
  238|  3.24M|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|  2.73M|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 125, False: 2.73M]
  ------------------
  242|    125|        parser->error = CJ5_ERROR_INVALID;
  243|    125|        return;
  244|    125|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|  2.73M|    parser->pos--;
  248|       |
  249|  2.73M|    token = cj5__alloc_token(parser);
  250|  2.73M|    if(token) {
  ------------------
  |  Branch (250:8): [True: 1.42M, False: 1.31M]
  ------------------
  251|  1.42M|        token->type = CJ5_TOKEN_STRING;
  252|  1.42M|        token->start = start;
  253|  1.42M|        token->end = parser->pos;
  254|  1.42M|        token->size = parser->pos - start + 1;
  255|  1.42M|        token->parent_id = parser->curr_tok_idx;
  256|  1.42M|    }
  257|  2.73M|}
cj5.c:parse_codepoint:
  607|  13.8k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|  13.8k|    uint32_t utf = 0;
  609|  68.9k|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 55.1k, False: 13.7k]
  ------------------
  610|  55.1k|        char byte = pos[i];
  611|  55.1k|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  55.1k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 14.0k, False: 41.1k]
  |  |  ------------------
  ------------------
  612|  14.0k|            byte = (char)(byte - '0');
  613|  41.1k|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 31.0k, False: 10.1k]
  ------------------
  614|  31.0k|            byte = (char)(byte - ('a' - 10));
  615|  31.0k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 10.0k, False: 36]
  ------------------
  616|  10.0k|            byte = (char)(byte - ('A' - 10));
  617|  10.0k|        } else {
  618|     36|            return CJ5_ERROR_INVALID;
  619|     36|        }
  620|  55.1k|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  55.1k|    }
  622|  13.7k|    *out_utf = utf;
  623|  13.7k|    return CJ5_ERROR_NONE;
  624|  13.8k|}

musl_tm_to_secs:
  149|    357|musl_tm_to_secs(const struct musl_tm *tm) {
  150|    357|    int is_leap;
  151|    357|    long long year = tm->tm_year;
  152|    357|    int month = tm->tm_mon;
  153|    357|    if (month >= 12 || month < 0) {
  ------------------
  |  Branch (153:9): [True: 296, False: 61]
  |  Branch (153:24): [True: 17, False: 44]
  ------------------
  154|    313|        int adj = month / 12;
  155|    313|        month %= 12;
  156|    313|        if (month < 0) {
  ------------------
  |  Branch (156:13): [True: 17, False: 296]
  ------------------
  157|     17|            adj--;
  158|     17|            month += 12;
  159|     17|        }
  160|    313|        year += adj;
  161|    313|    }
  162|    357|    long long t = musl_year_to_secs(year, &is_leap);
  163|    357|    t += musl_month_to_secs(month, is_leap);
  164|    357|    t += 86400LL * (tm->tm_mday-1);
  165|    357|    t += 3600LL * tm->tm_hour;
  166|    357|    t += 60LL * tm->tm_min;
  167|    357|    t += tm->tm_sec;
  168|    357|    return t;
  169|    357|}
libc_time.c:musl_year_to_secs:
  101|    357|musl_year_to_secs(const long long year, int *is_leap) {
  102|    357|    if (year-2ULL <= 136) {
  ------------------
  |  Branch (102:9): [True: 38, False: 319]
  ------------------
  103|     38|        int y = (int)year;
  104|     38|        int leaps = (y-68)>>2;
  105|     38|        if (!((y-68)&3)) {
  ------------------
  |  Branch (105:13): [True: 6, False: 32]
  ------------------
  106|      6|            leaps--;
  107|      6|            if (is_leap) *is_leap = 1;
  ------------------
  |  Branch (107:17): [True: 6, False: 0]
  ------------------
  108|     32|        } else if (is_leap) *is_leap = 0;
  ------------------
  |  Branch (108:20): [True: 32, False: 0]
  ------------------
  109|     38|        return 31536000*(y-70) + 86400*leaps;
  110|     38|    }
  111|       |
  112|    319|    int cycles, centuries, leaps, rem, dummy;
  113|       |
  114|    319|    if (!is_leap) is_leap = &dummy;
  ------------------
  |  Branch (114:9): [True: 0, False: 319]
  ------------------
  115|    319|    cycles = (int)((year-100) / 400);
  116|    319|    rem = (int)((year-100) % 400);
  117|    319|    if (rem < 0) {
  ------------------
  |  Branch (117:9): [True: 196, False: 123]
  ------------------
  118|    196|        cycles--;
  119|    196|        rem += 400;
  120|    196|    }
  121|    319|    if (!rem) {
  ------------------
  |  Branch (121:9): [True: 10, False: 309]
  ------------------
  122|     10|        *is_leap = 1;
  123|     10|        centuries = 0;
  124|     10|        leaps = 0;
  125|    309|    } else {
  126|    309|        if (rem >= 200) {
  ------------------
  |  Branch (126:13): [True: 106, False: 203]
  ------------------
  127|    106|            if (rem >= 300) centuries = 3, rem -= 300;
  ------------------
  |  Branch (127:17): [True: 73, False: 33]
  ------------------
  128|     33|            else centuries = 2, rem -= 200;
  129|    203|        } else {
  130|    203|            if (rem >= 100) centuries = 1, rem -= 100;
  ------------------
  |  Branch (130:17): [True: 37, False: 166]
  ------------------
  131|    166|            else centuries = 0;
  132|    203|        }
  133|    309|        if (!rem) {
  ------------------
  |  Branch (133:13): [True: 1, False: 308]
  ------------------
  134|      1|            *is_leap = 0;
  135|      1|            leaps = 0;
  136|    308|        } else {
  137|    308|            leaps = rem / 4;
  138|    308|            rem %= 4;
  139|    308|            *is_leap = !rem;
  140|    308|        }
  141|    309|    }
  142|       |
  143|    319|    leaps += 97*cycles + 24*centuries - *is_leap;
  144|       |
  145|    319|    return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
  146|    357|}
libc_time.c:musl_month_to_secs:
   93|    357|musl_month_to_secs(int month, int is_leap) {
   94|    357|    int t = secs_through_month[month];
   95|    357|    if (is_leap && month >= 2)
  ------------------
  |  Branch (95:9): [True: 120, False: 237]
  |  Branch (95:20): [True: 91, False: 29]
  ------------------
   96|     91|        t+=86400;
   97|    357|    return t;
   98|    357|}

parseUInt64:
   30|  3.91M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  3.91M|    size_t i = 0;
   32|  3.91M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  3.91M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 215k, False: 3.70M]
  |  Branch (35:20): [True: 186k, False: 29.2k]
  |  Branch (35:37): [True: 10.6k, False: 175k]
  ------------------
   36|  10.6k|        i = 2;
   37|  59.6k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 49.4k, False: 10.1k]
  ------------------
   38|  49.4k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  49.4k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 49.2k, False: 204]
  |  Branch (39:28): [True: 40.3k, False: 8.90k]
  ------------------
   40|  40.3k|                c = (uint8_t)(c - '0');
   41|  9.10k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 8.89k, False: 208]
  |  Branch (41:33): [True: 8.63k, False: 258]
  ------------------
   42|  8.63k|                c = (uint8_t)(c - 'a' + 10);
   43|    466|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 259, False: 207]
  |  Branch (43:33): [True: 0, False: 259]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    466|            else
   46|    466|                break;
   47|  49.0k|            n = (n << 4) | (c & 0xF);
   48|  49.0k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 5, False: 48.9k]
  ------------------
   49|      5|                return 0;
   50|  48.9k|            prev = n;
   51|  48.9k|        }
   52|  10.6k|        *result = n;
   53|  10.6k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 10.6k, False: 31]
  ------------------
   54|  10.6k|    }
   55|       |
   56|       |    /* Decimal */
   57|  14.0M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 10.1M, False: 3.87M]
  ------------------
   58|  10.1M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 8.81k, False: 10.1M]
  |  Branch (58:28): [True: 27.7k, False: 10.0M]
  ------------------
   59|  36.5k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  10.0M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  10.0M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 10, False: 10.0M]
  ------------------
   63|     10|            return 0;
   64|  10.0M|        prev = n;
   65|  10.0M|    }
   66|  3.90M|    *result = n;
   67|  3.90M|    return i;
   68|  3.90M|}
parseInt64:
   71|  1.36M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.36M|    size_t i = 0;
   74|  1.36M|    bool neg = false;
   75|  1.36M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 728, False: 1.36M]
  |  Branch (75:23): [True: 326, False: 1.36M]
  ------------------
   76|  1.05k|        neg = (*str == '-');
   77|  1.05k|        i++;
   78|  1.05k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.36M|    uint64_t n = 0;
   82|  1.36M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.36M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 90, False: 1.36M]
  ------------------
   84|     90|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.36M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 1.36M, False: 719]
  ------------------
   88|  1.36M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 62, False: 1.36M]
  ------------------
   89|     62|            return 0;
   90|  1.36M|        *result = (int64_t)n;
   91|  1.36M|    } else {
   92|    719|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 1, False: 718]
  ------------------
   93|      1|            return 0;
   94|    718|        *result = -(int64_t)n;
   95|    718|    }
   96|  1.36M|    return len + i;
   97|  1.36M|}
parseDouble:
   99|   529k|size_t parseDouble(const char *str, size_t size, double *result) {
  100|   529k|    char buf[2000];
  101|   529k|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 1, False: 529k]
  ------------------
  102|      1|        return 0;
  103|   529k|    memcpy(buf, str, size);
  104|   529k|    buf[size] = 0;
  105|   529k|    errno = 0;
  106|   529k|    char *endptr;
  107|   529k|    *result = strtod(buf, &endptr);
  108|   529k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 198, False: 528k]
  |  Branch (108:22): [True: 0, False: 198]
  ------------------
  109|      0|        return 0;
  110|   529k|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|   529k|}

cj5.c:utf8_from_codepoint:
   39|  9.78k|utf8_from_codepoint(unsigned char *str, unsigned codepoint) {
   40|  9.78k|    if(UTF_LIKELY(codepoint <= 0x7F)) { /* Plain ASCII */
  ------------------
  |  |   24|  9.78k|# define UTF_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (24:24): [True: 813, False: 8.97k]
  |  |  ------------------
  ------------------
   41|    813|        str[0] = (unsigned char)codepoint;
   42|    813|        return 1;
   43|    813|    }
   44|  8.97k|    if(UTF_LIKELY(codepoint <= 0x07FF)) { /* 2-byte unicode */
  ------------------
  |  |   24|  8.97k|# define UTF_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (24:24): [True: 602, False: 8.37k]
  |  |  ------------------
  ------------------
   45|    602|        str[0] = (unsigned char)(((codepoint >> 6) & 0x1F) | 0xC0);
   46|    602|        str[1] = (unsigned char)(((codepoint >> 0) & 0x3F) | 0x80);
   47|    602|        return 2;
   48|    602|    }
   49|  8.37k|    if(UTF_LIKELY(codepoint <= 0xFFFF)) { /* 3-byte unicode */
  ------------------
  |  |   24|  8.37k|# define UTF_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (24:24): [True: 4.43k, False: 3.93k]
  |  |  ------------------
  ------------------
   50|  4.43k|        str[0] = (unsigned char)(((codepoint >> 12) & 0x0F) | 0xE0);
   51|  4.43k|        str[1] = (unsigned char)(((codepoint >>  6) & 0x3F) | 0x80);
   52|  4.43k|        str[2] = (unsigned char)(((codepoint >>  0) & 0x3F) | 0x80);
   53|  4.43k|        return 3;
   54|  4.43k|    }
   55|  3.93k|    if(UTF_LIKELY(codepoint <= 0x10FFFF)) { /* 4-byte unicode */
  ------------------
  |  |   24|  3.93k|# define UTF_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (24:24): [True: 3.90k, False: 34]
  |  |  ------------------
  ------------------
   56|  3.90k|        str[0] = (unsigned char)(((codepoint >> 18) & 0x07) | 0xF0);
   57|  3.90k|        str[1] = (unsigned char)(((codepoint >> 12) & 0x3F) | 0x80);
   58|  3.90k|        str[2] = (unsigned char)(((codepoint >>  6) & 0x3F) | 0x80);
   59|  3.90k|        str[3] = (unsigned char)(((codepoint >>  0) & 0x3F) | 0x80);
   60|  3.90k|        return 4;
   61|  3.90k|    }
   62|     34|    return 0; /* Not a unicode codepoint */
   63|  3.93k|}

findEncodingMetaData:
  277|  4.59k|                     UA_UInt16 dsWriterId) {
  278|  4.59k|    if(!eo)
  ------------------
  |  Branch (278:8): [True: 0, False: 4.59k]
  ------------------
  279|      0|        return NULL;
  280|  4.59k|    for(size_t i = 0; i < eo->metaDataSize; i++) {
  ------------------
  |  Branch (280:23): [True: 0, False: 4.59k]
  ------------------
  281|      0|        if(eo->metaData[i].dataSetWriterId == dsWriterId)
  ------------------
  |  Branch (281:12): [True: 0, False: 0]
  ------------------
  282|      0|            return &eo->metaData[i];
  283|      0|    }
  284|  4.59k|    return NULL;
  285|  4.59k|}
UA_NetworkMessage_clear:
 1039|  6.68k|UA_NetworkMessage_clear(UA_NetworkMessage* p) {
 1040|  6.68k|    if(p->promotedFieldsEnabled) {
  ------------------
  |  Branch (1040:8): [True: 0, False: 6.68k]
  ------------------
 1041|      0|        UA_Array_delete(p->promotedFields, p->promotedFieldsSize,
 1042|      0|                        &UA_TYPES[UA_TYPES_VARIANT]);
  ------------------
  |  |  803|      0|#define UA_TYPES_VARIANT 23
  ------------------
 1043|      0|    }
 1044|       |
 1045|  6.68k|    if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) {
  ------------------
  |  Branch (1045:8): [True: 6.68k, False: 0]
  ------------------
 1046|  6.68k|        if(p->payload.dataSetMessages) {
  ------------------
  |  Branch (1046:12): [True: 6.15k, False: 532]
  ------------------
 1047|  12.4k|            for(size_t i = 0; i < p->messageCount; i++)
  ------------------
  |  Branch (1047:31): [True: 6.28k, False: 6.15k]
  ------------------
 1048|  6.28k|                UA_DataSetMessage_clear(&p->payload.dataSetMessages[i]);
 1049|  6.15k|            UA_free(p->payload.dataSetMessages);
  ------------------
  |  |   19|  6.15k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1050|  6.15k|        }
 1051|  6.68k|    }
 1052|       |
 1053|  6.68k|    UA_ByteString_clear(&p->securityFooter);
 1054|  6.68k|    UA_String_clear(&p->messageId);
 1055|       |
 1056|  6.68k|    if(p->publisherIdEnabled &&
  ------------------
  |  Branch (1056:8): [True: 4, False: 6.67k]
  ------------------
 1057|      4|       p->publisherId.idType == UA_PUBLISHERIDTYPE_STRING)
  ------------------
  |  Branch (1057:8): [True: 1, False: 3]
  ------------------
 1058|      1|       UA_String_clear(&p->publisherId.id.string);
 1059|       |
 1060|  6.68k|    memset(p, 0, sizeof(UA_NetworkMessage));
 1061|  6.68k|}
UA_DataSetMessage_clear:
 1862|  6.28k|UA_DataSetMessage_clear(UA_DataSetMessage* p) {
 1863|  6.28k|    if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) {
  ------------------
  |  Branch (1863:8): [True: 6.28k, False: 0]
  ------------------
 1864|  6.28k|        if(p->data.keyFrameFields)
  ------------------
  |  Branch (1864:12): [True: 4.59k, False: 1.69k]
  ------------------
 1865|  4.59k|            UA_Array_delete(p->data.keyFrameFields, p->fieldCount,
 1866|  4.59k|                            &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  769|  4.59k|#define UA_TYPES_DATAVALUE 22
  ------------------
 1867|  6.28k|    } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) {
  ------------------
  |  Branch (1867:15): [True: 0, False: 0]
  ------------------
 1868|      0|        if(p->data.deltaFrameFields) {
  ------------------
  |  Branch (1868:12): [True: 0, False: 0]
  ------------------
 1869|      0|            for(UA_UInt16 i = 0; i < p->fieldCount; i++)
  ------------------
  |  Branch (1869:34): [True: 0, False: 0]
  ------------------
 1870|      0|                UA_DataValue_clear(&p->data.deltaFrameFields[i].value);
 1871|      0|            UA_free(p->data.deltaFrameFields);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1872|      0|        }
 1873|      0|    }
 1874|       |
 1875|  6.28k|    memset(p, 0, sizeof(UA_DataSetMessage));
 1876|  6.28k|}

UA_NetworkMessage_decodeJson:
  540|  7.39k|                             const UA_DecodeJsonOptions *jo) {
  541|       |    /* Set up the context */
  542|  7.39k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
  543|  7.39k|    PubSubDecodeJsonCtx ctx;
  544|  7.39k|    memset(&ctx, 0, sizeof(PubSubDecodeJsonCtx));
  545|  7.39k|    ctx.ctx.tokens = tokens;
  546|  7.39k|    if(eo)
  ------------------
  |  Branch (546:8): [True: 0, False: 7.39k]
  ------------------
  547|      0|        ctx.eo = *eo;
  548|  7.39k|    if(jo) {
  ------------------
  |  Branch (548:8): [True: 0, False: 7.39k]
  ------------------
  549|      0|        ctx.ctx.namespaceMapping = jo->namespaceMapping;
  550|      0|        ctx.ctx.serverUrisSize = jo->serverUrisSize;
  551|      0|        ctx.ctx.serverUris = jo->serverUris;
  552|      0|        ctx.ctx.customTypes = jo->customTypes;
  553|      0|    }
  554|       |
  555|  7.39k|    status ret = tokenize(&ctx.ctx, src, UA_JSON_MAXTOKENCOUNT, NULL);
  ------------------
  |  |   20|  7.39k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
  556|  7.39k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  7.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (556:8): [True: 715, False: 6.68k]
  ------------------
  557|    715|        goto cleanup;
  558|       |
  559|  6.68k|    ret = NetworkMessage_decodeJsonInternal(&ctx, dst);
  560|  6.68k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  6.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (560:8): [True: 6.67k, False: 10]
  ------------------
  561|  6.67k|        UA_NetworkMessage_clear(dst);
  562|       |
  563|  7.39k| cleanup:
  564|       |    /* Free token array on the heap */
  565|  7.39k|    if(ctx.ctx.tokens != tokens)
  ------------------
  |  Branch (565:8): [True: 542, False: 6.85k]
  ------------------
  566|    542|        UA_free((void*)(uintptr_t)ctx.ctx.tokens);
  ------------------
  |  |   19|    542|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  567|  7.39k|    return ret;
  568|  6.68k|}
ua_pubsub_networkmessage_json.c:NetworkMessage_decodeJsonInternal:
  458|  6.68k|                                  UA_NetworkMessage *dst) {
  459|  6.68k|    memset(dst, 0, sizeof(UA_NetworkMessage));
  460|  6.68k|    dst->chunkMessage = false;
  461|  6.68k|    dst->groupHeaderEnabled = false;
  462|  6.68k|    dst->payloadHeaderEnabled = false;
  463|  6.68k|    dst->picosecondsEnabled = false;
  464|  6.68k|    dst->promotedFieldsEnabled = false;
  465|       |
  466|       |    /* The NetworkMessage must be a JSON object */
  467|  6.68k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (467:8): [True: 99, False: 6.58k]
  ------------------
  468|     99|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     99|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  469|       |
  470|       |    /* Is Messages an Array? How big? */
  471|  6.58k|    size_t searchResultMessages = 0;
  472|  6.58k|    status found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGES, &searchResultMessages);
  473|  6.58k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  6.58k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (473:8): [True: 174, False: 6.41k]
  ------------------
  474|    174|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|    174|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  475|  6.41k|    const cj5_token *bodyToken = &ctx->ctx.tokens[searchResultMessages];
  476|  6.41k|    size_t messageCount = 1;
  477|  6.41k|    if(bodyToken->type == CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (477:8): [True: 2.67k, False: 3.73k]
  ------------------
  478|  2.67k|        messageCount = (size_t)bodyToken->size;
  479|       |
  480|       |    /* Too many DataSetMessages */
  481|  6.41k|    if(messageCount > UA_NETWORKMESSAGE_MAXMESSAGECOUNT)
  ------------------
  |  |  136|  6.41k|#define UA_NETWORKMESSAGE_MAXMESSAGECOUNT 32
  ------------------
  |  Branch (481:8): [True: 1, False: 6.40k]
  ------------------
  482|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  483|       |
  484|       |    /* MessageType */
  485|  6.40k|    UA_Boolean isUaData = true;
  486|  6.40k|    size_t searchResultMessageType = 0;
  487|  6.40k|    found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGETYPE, &searchResultMessageType);
  488|  6.40k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  6.40k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (488:8): [True: 60, False: 6.34k]
  ------------------
  489|     60|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     60|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  490|  6.34k|    size_t size = getTokenLength(&ctx->ctx.tokens[searchResultMessageType]);
  491|  6.34k|    const char* msgType = &ctx->ctx.json5[ctx->ctx.tokens[searchResultMessageType].start];
  492|  6.34k|    if(size == 7) { //ua-data
  ------------------
  |  Branch (492:8): [True: 6.22k, False: 125]
  ------------------
  493|  6.22k|        if(strncmp(msgType, "ua-data", size) != 0)
  ------------------
  |  Branch (493:12): [True: 62, False: 6.16k]
  ------------------
  494|     62|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     62|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  495|  6.16k|        isUaData = true;
  496|  6.16k|    } else if(size == 11) { //ua-metadata
  ------------------
  |  Branch (496:15): [True: 96, False: 29]
  ------------------
  497|     96|        if(strncmp(msgType, "ua-metadata", size) != 0)
  ------------------
  |  Branch (497:12): [True: 95, False: 1]
  ------------------
  498|     95|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     95|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  499|      1|        isUaData = false;
  500|     29|    } else {
  501|     29|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     29|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  502|     29|    }
  503|       |
  504|       |    //TODO: MetaData
  505|  6.16k|    if(!isUaData)
  ------------------
  |  Branch (505:8): [True: 1, False: 6.16k]
  ------------------
  506|      1|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|      1|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  507|       |
  508|  6.16k|    dst->payload.dataSetMessages = (UA_DataSetMessage*)
  509|  6.16k|        UA_calloc(messageCount, sizeof(UA_DataSetMessage));
  ------------------
  |  |   20|  6.16k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  510|  6.16k|    if(!dst->payload.dataSetMessages)
  ------------------
  |  Branch (510:8): [True: 11, False: 6.15k]
  ------------------
  511|     11|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|     11|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  512|  6.15k|    dst->messageCount = (UA_Byte)messageCount;
  513|       |
  514|       |    /* Network Message */
  515|  6.15k|    UA_String messageType;
  516|  6.15k|    DecodeEntry entries[5] = {
  517|  6.15k|        {UA_DECODEKEY_MESSAGEID, &dst->messageId, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  6.15k|#define UA_TYPES_STRING 11
  ------------------
  518|  6.15k|        {UA_DECODEKEY_MESSAGETYPE, &messageType, NULL, false, NULL},
  519|  6.15k|        {UA_DECODEKEY_PUBLISHERID, &dst->publisherId, decodePublisherIdJsonInternal, false, NULL},
  520|  6.15k|        {UA_DECODEKEY_DATASETCLASSID, &dst->dataSetClassId, NULL, false, &UA_TYPES[UA_TYPES_GUID]},
  ------------------
  |  |  463|  6.15k|#define UA_TYPES_GUID 13
  ------------------
  521|  6.15k|        {UA_DECODEKEY_MESSAGES, dst, (decodeJsonSignature)DatasetMessage_Array_decodeJsonInternal, false, NULL}
  522|  6.15k|    };
  523|       |
  524|  6.15k|    status ret = decodeFields(&ctx->ctx, entries, 5);
  525|  6.15k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  6.15k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (525:8): [True: 6.14k, False: 10]
  ------------------
  526|  6.14k|        return ret;
  527|       |
  528|     10|    dst->messageIdEnabled = entries[0].found;
  529|     10|    dst->publisherIdEnabled = entries[2].found;
  530|     10|    dst->dataSetClassIdEnabled = entries[3].found;
  531|     10|    dst->payloadHeaderEnabled = true;
  532|       |
  533|     10|    return ret;
  534|  6.15k|}
ua_pubsub_networkmessage_json.c:decodePublisherIdJsonInternal:
  441|    216|                              const UA_DataType *type) {
  442|    216|    UA_PublisherId *p = (UA_PublisherId*)dst;
  443|    216|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER) {
  ------------------
  |  Branch (443:8): [True: 186, False: 30]
  ------------------
  444|       |        /* Store in biggest possible integer. The problem is that with a UInt64
  445|       |         * is that a string is expected for it in JSON. Therefore, the maximum
  446|       |         * value is set to UInt32. */
  447|    186|        p->idType = UA_PUBLISHERIDTYPE_UINT32;
  448|    186|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32](ctx, &p->id.uint32, NULL);
  449|    186|    } else if(currentTokenType(ctx) == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (449:15): [True: 26, False: 4]
  ------------------
  450|     26|        p->idType = UA_PUBLISHERIDTYPE_STRING;
  451|     26|        return decodeJsonJumpTable[UA_DATATYPEKIND_STRING](ctx, &p->id.string, NULL);
  452|     26|    }
  453|      4|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  454|    216|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Array_decodeJsonInternal:
  412|  5.77k|                                        const UA_DataType *_) {
  413|       |    /* Array or object */
  414|  5.77k|    size_t length = 1;
  415|  5.77k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_ARRAY) {
  ------------------
  |  Branch (415:8): [True: 2.64k, False: 3.13k]
  ------------------
  416|  2.64k|        length = (size_t)ctx->ctx.tokens[ctx->ctx.index].size;
  417|       |
  418|       |        /* Go to the first array member */
  419|  2.64k|        ctx->ctx.index++;
  420|       |
  421|       |        /* Return early for empty arrays */
  422|  2.64k|        if(length == 0)
  ------------------
  |  Branch (422:12): [True: 12, False: 2.63k]
  ------------------
  423|     12|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     12|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  424|  3.13k|    } else if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (424:15): [True: 270, False: 2.86k]
  ------------------
  425|    270|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    270|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  426|    270|    }
  427|       |
  428|       |    /* Decode array members */
  429|  5.49k|    UA_NetworkMessage *nm = (UA_NetworkMessage*)dst;
  430|  5.49k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (430:23): [True: 5.49k, False: 1]
  ------------------
  431|  5.49k|        status ret = DatasetMessage_Payload_decodeJsonInternal(ctx, nm, i);
  432|  5.49k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.49k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (432:12): [True: 5.49k, False: 1]
  ------------------
  433|  5.49k|            return ret;
  434|  5.49k|    }
  435|       |
  436|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  437|  5.49k|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Payload_decodeJsonInternal:
  371|  5.49k|                                          size_t dsmIndex) {
  372|  5.49k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[dsmIndex];
  373|  5.49k|    UA_ConfigurationVersionDataType cvd;
  374|  5.49k|    struct PayloadData pd;
  375|  5.49k|    pd.nm = nm;
  376|  5.49k|    pd.dsmIndex = dsmIndex;
  377|       |
  378|  5.49k|    DecodeEntry entries[7] = {
  379|  5.49k|        {UA_DECODEKEY_DATASETWRITERID, &nm->dataSetWriterIds[dsmIndex], NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.49k|#define UA_TYPES_UINT16 4
  ------------------
  380|  5.49k|        {UA_DECODEKEY_SEQUENCENUMBER, &dsm->header.dataSetMessageSequenceNr, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.49k|#define UA_TYPES_UINT16 4
  ------------------
  381|  5.49k|        {UA_DECODEKEY_METADATAVERSION, &cvd, &MetaDataVersion_decodeJsonInternal, false, NULL},
  382|  5.49k|        {UA_DECODEKEY_TIMESTAMP, &dsm->header.timestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  5.49k|#define UA_TYPES_DATETIME 12
  ------------------
  383|  5.49k|        {UA_DECODEKEY_DSM_STATUS, &dsm->header.status, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.49k|#define UA_TYPES_UINT16 4
  ------------------
  384|  5.49k|        {UA_DECODEKEY_MESSAGETYPE, NULL, NULL, false, NULL},
  385|  5.49k|        {UA_DECODEKEY_PAYLOAD, &pd, (decodeJsonSignature)DataSetPayload_decodeJsonInternal, false, NULL}
  386|  5.49k|    };
  387|  5.49k|    status ret = decodeFields(&ctx->ctx, entries, 7);
  388|       |
  389|       |    /* Error or no DatasetWriterId found or no payload found */
  390|  5.49k|    if(ret != UA_STATUSCODE_GOOD || !entries[0].found || !entries[6].found)
  ------------------
  |  |   16|  10.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (390:8): [True: 3.58k, False: 1.91k]
  |  Branch (390:37): [True: 1.91k, False: 5]
  |  Branch (390:58): [True: 4, False: 1]
  ------------------
  391|  5.49k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|  5.49k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  392|       |
  393|       |    /* TODO: Check FieldEncoding1 and FieldEncoding2 to determine the field encoding */
  394|      1|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  395|      1|    dsm->header.dataSetMessageSequenceNrEnabled = entries[1].found;
  396|      1|    dsm->header.configVersionMajorVersion = cvd.majorVersion;
  397|      1|    dsm->header.configVersionMinorVersion = cvd.minorVersion;
  398|      1|    dsm->header.configVersionMajorVersionEnabled = entries[2].found;
  399|      1|    dsm->header.configVersionMinorVersionEnabled = entries[2].found;
  400|      1|    dsm->header.timestampEnabled = entries[3].found;
  401|      1|    dsm->header.statusEnabled = entries[4].found;
  402|       |
  403|      1|    dsm->header.dataSetMessageType = UA_DATASETMESSAGE_DATAKEYFRAME;
  404|      1|    dsm->header.picoSecondsIncluded = false;
  405|      1|    dsm->header.dataSetMessageValid = true;
  406|      1|    dsm->header.fieldEncoding = UA_FIELDENCODING_VARIANT;
  407|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  408|  5.49k|}
ua_pubsub_networkmessage_json.c:MetaDataVersion_decodeJsonInternal:
  289|      2|MetaDataVersion_decodeJsonInternal(ParseCtx *ctx, void* cvd, const UA_DataType *_) {
  290|      2|    return decodeJsonJumpTable[UA_DATATYPEKIND_STRUCTURE]
  291|      2|        (ctx, cvd, &UA_TYPES[UA_TYPES_CONFIGURATIONVERSIONDATATYPE]);
  ------------------
  |  | 2146|      2|#define UA_TYPES_CONFIGURATIONVERSIONDATATYPE 57
  ------------------
  292|      2|}
ua_pubsub_networkmessage_json.c:DataSetPayload_decodeJsonInternal:
  312|  4.60k|DataSetPayload_decodeJsonInternal(PubSubDecodeJsonCtx *ctx, void *data, const UA_DataType *_) {
  313|  4.60k|    struct PayloadData *pd = (struct PayloadData*)data;
  314|  4.60k|    UA_NetworkMessage *nm = pd->nm;
  315|  4.60k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[pd->dsmIndex];
  316|       |
  317|  4.60k|    dsm->header.dataSetMessageValid = true;
  318|       |
  319|  4.60k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (319:8): [True: 1, False: 4.59k]
  ------------------
  320|      1|        ctx->ctx.index++;
  321|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  322|      1|    }
  323|       |
  324|  4.59k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (324:8): [True: 3, False: 4.59k]
  ------------------
  325|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  326|       |
  327|       |    /* The number of key-value pairs */
  328|  4.59k|    UA_assert(ctx->ctx.tokens[ctx->ctx.index].size % 2 == 0);
  ------------------
  |  |  395|  4.59k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (328:5): [True: 4.59k, False: 0]
  ------------------
  329|  4.59k|    size_t length = (size_t)(ctx->ctx.tokens[ctx->ctx.index].size) / 2;
  330|       |
  331|  4.59k|    if(length > UA_UINT16_MAX)
  ------------------
  |  |   91|  4.59k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (331:8): [True: 1, False: 4.59k]
  ------------------
  332|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  333|       |
  334|  4.59k|    dsm->data.keyFrameFields = (UA_DataValue *)
  335|  4.59k|        UA_Array_new(length, &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  769|  4.59k|#define UA_TYPES_DATAVALUE 22
  ------------------
  336|  4.59k|    if(!dsm->data.keyFrameFields)
  ------------------
  |  Branch (336:8): [True: 2, False: 4.59k]
  ------------------
  337|      2|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      2|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  338|  4.59k|    dsm->fieldCount = (UA_UInt16)length;
  339|       |
  340|  4.59k|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  341|       |
  342|  4.59k|    const UA_DataSetMessage_EncodingMetaData *emd =
  343|  4.59k|            findEncodingMetaData(&ctx->eo, nm->dataSetWriterIds[pd->dsmIndex]);
  344|       |
  345|       |    /* Iterate over the key/value pairs in the object. Keys are stored in fieldnames. */
  346|  4.59k|    ctx->ctx.index++; /* Go to the first key */
  347|  4.59k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.59k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  348|  70.8k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (348:23): [True: 69.2k, False: 1.57k]
  ------------------
  349|  69.2k|        UA_assert(currentTokenType(&ctx->ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  395|  69.2k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (349:9): [True: 69.2k, False: 0]
  ------------------
  350|  69.2k|        UA_String fieldName = UA_STRING_NULL;
  351|  69.2k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_STRING](&ctx->ctx, &fieldName, NULL);
  352|  69.2k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  69.2k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  69.2k|    do {                                                                                 \
  |  |  |  |  173|  69.2k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  69.2k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (575:25): [True: 1, False: 69.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|      1|        }                                                                                \
  |  |  |  |  176|  69.2k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 69.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|       |
  354|  69.2k|        size_t index = decodingFieldIndex(emd, fieldName, i);
  355|  69.2k|        if(index >= length) {
  ------------------
  |  Branch (355:12): [True: 0, False: 69.2k]
  ------------------
  356|      0|            UA_String_clear(&fieldName);
  357|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  358|      0|        }
  359|  69.2k|        UA_DataValue_clear(&dsm->data.keyFrameFields[index]);
  360|  69.2k|        UA_String_clear(&fieldName);
  361|  69.2k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_DATAVALUE]
  362|  69.2k|            (&ctx->ctx, &dsm->data.keyFrameFields[index], NULL);
  363|  69.2k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  69.2k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  69.2k|    do {                                                                                 \
  |  |  |  |  173|  69.2k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  69.2k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (575:25): [True: 3.02k, False: 66.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|  3.02k|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|  3.02k|        }                                                                                \
  |  |  |  |  176|  69.2k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|  69.2k|    }
  365|       |
  366|  1.57k|    return ret;
  367|  4.59k|}
ua_pubsub_networkmessage_json.c:decodingFieldIndex:
  296|  69.2k|                   UA_String name, size_t origIndex) {
  297|  69.2k|    if(!emd)
  ------------------
  |  Branch (297:8): [True: 69.2k, False: 0]
  ------------------
  298|  69.2k|        return origIndex;
  299|      0|    for(size_t i = 0; i < emd->fieldsSize; i++) {
  ------------------
  |  Branch (299:23): [True: 0, False: 0]
  ------------------
  300|      0|        if(UA_String_equal(&name, &emd->fields[i].name))
  ------------------
  |  Branch (300:12): [True: 0, False: 0]
  ------------------
  301|      0|            return i;
  302|      0|    }
  303|      0|    return origIndex;
  304|      0|}

UA_findDataTypeWithCustom:
   66|  41.9k|                          const UA_DataTypeArray *customTypes) {
   67|       |    /* Always look in built-in types first (may contain data types from all
   68|       |     * namespaces).
   69|       |     *
   70|       |     * TODO: The standard-defined types are ordered. See if binary search is
   71|       |     * more efficient. */
   72|  14.3M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  14.3M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (72:23): [True: 14.3M, False: 36.7k]
  ------------------
   73|  14.3M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (73:12): [True: 5.28k, False: 14.3M]
  ------------------
   74|  5.28k|            return &UA_TYPES[i];
   75|  14.3M|    }
   76|       |
   77|       |    /* Search in the customTypes */
   78|  36.7k|    while(customTypes) {
  ------------------
  |  Branch (78:11): [True: 0, False: 36.7k]
  ------------------
   79|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (79:27): [True: 0, False: 0]
  ------------------
   80|      0|            if(nodeIdOrder(&customTypes->types[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (80:16): [True: 0, False: 0]
  ------------------
   81|      0|                return &customTypes->types[i];
   82|      0|        }
   83|      0|        customTypes = customTypes->next;
   84|      0|    }
   85|       |
   86|  36.7k|    return NULL;
   87|  36.7k|}
UA_ByteString_allocBuffer:
  763|  35.6k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  764|  35.6k|    UA_ByteString_init(bs);
  765|  35.6k|    if(length == 0) {
  ------------------
  |  Branch (765:8): [True: 381, False: 35.2k]
  ------------------
  766|    381|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    381|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  767|    381|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    381|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  768|    381|    }
  769|  35.2k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  35.2k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  770|  35.2k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  575|  35.2k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (575:25): [True: 3, False: 35.2k]
  |  |  ------------------
  ------------------
  771|      3|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      3|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  772|  35.2k|    bs->length = length;
  773|  35.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  35.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  774|  35.2k|}
UA_new:
 1917|  60.5k|UA_new(const UA_DataType *type) {
 1918|  60.5k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  60.5k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1919|  60.5k|    return p;
 1920|  60.5k|}
UA_copy:
 2093|  95.4k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2094|  95.4k|    memset(dst, 0, type->memSize); /* init */
 2095|  95.4k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2096|  95.4k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  95.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2096:8): [True: 5, False: 95.4k]
  ------------------
 2097|      5|        UA_clear(dst, type);
 2098|  95.4k|    return retval;
 2099|  95.4k|}
UA_clear:
 2196|  1.30M|UA_clear(void *p, const UA_DataType *type) {
 2197|  1.30M|    clearJumpTable[type->typeKind](p, type);
 2198|  1.30M|    memset(p, 0, type->memSize); /* init */
 2199|  1.30M|}
UA_delete:
 2202|  3.46k|UA_delete(void *p, const UA_DataType *type) {
 2203|  3.46k|    clearJumpTable[type->typeKind](p, type);
 2204|  3.46k|    UA_free(p);
  ------------------
  |  |   19|  3.46k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2205|  3.46k|}
UA_Array_new:
 2664|  4.59k|UA_Array_new(size_t size, const UA_DataType *type) {
 2665|  4.59k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|  4.59k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2665:8): [True: 0, False: 4.59k]
  ------------------
 2666|      0|        return NULL;
 2667|  4.59k|    if(size == 0)
  ------------------
  |  Branch (2667:8): [True: 4, False: 4.59k]
  ------------------
 2668|      4|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      4|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2669|  4.59k|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  4.59k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2670|  4.59k|}
UA_Array_copy:
 2674|  95.4k|              void **dst, const UA_DataType *type) {
 2675|  95.4k|    if(size == 0) {
  ------------------
  |  Branch (2675:8): [True: 3.37k, False: 92.0k]
  ------------------
 2676|  3.37k|        if(src == NULL)
  ------------------
  |  Branch (2676:12): [True: 0, False: 3.37k]
  ------------------
 2677|      0|            *dst = NULL;
 2678|  3.37k|        else
 2679|  3.37k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  3.37k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2680|  3.37k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.37k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2681|  3.37k|    }
 2682|       |
 2683|       |    /* Check the array consistency -- defensive programming in case the user
 2684|       |     * manually created an inconsistent array */
 2685|  92.0k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  575|   184k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (575:25): [True: 0, False: 92.0k]
  |  |  |  Branch (575:43): [True: 0, False: 92.0k]
  |  |  |  Branch (575:43): [True: 0, False: 92.0k]
  |  |  ------------------
  ------------------
 2686|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2687|       |
 2688|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2689|  92.0k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  92.0k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2690|  92.0k|    if(!*dst)
  ------------------
  |  Branch (2690:8): [True: 5, False: 92.0k]
  ------------------
 2691|      5|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2692|       |
 2693|  92.0k|    if(type->pointerFree) {
  ------------------
  |  Branch (2693:8): [True: 92.0k, False: 0]
  ------------------
 2694|  92.0k|        memcpy(*dst, src, type->memSize * size);
 2695|  92.0k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  92.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2696|  92.0k|    }
 2697|       |
 2698|      0|    uintptr_t ptrs = (uintptr_t)src;
 2699|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2700|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2701|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2701:23): [True: 0, False: 0]
  ------------------
 2702|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2703|      0|        ptrs += type->memSize;
 2704|      0|        ptrd += type->memSize;
 2705|      0|    }
 2706|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2706:8): [True: 0, False: 0]
  ------------------
 2707|      0|        UA_Array_delete(*dst, size, type);
 2708|       |        *dst = NULL;
 2709|      0|    }
 2710|      0|    return retval;
 2711|  92.0k|}
UA_Array_delete:
 2802|   443k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2803|   443k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2803:8): [True: 60.5k, False: 382k]
  ------------------
 2804|  60.5k|        uintptr_t ptr = (uintptr_t)p;
 2805|  1.09M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2805:27): [True: 1.03M, False: 60.5k]
  ------------------
 2806|  1.03M|            UA_clear((void*)ptr, type);
 2807|  1.03M|            ptr += type->memSize;
 2808|  1.03M|        }
 2809|  60.5k|    }
 2810|   443k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|   443k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2811|   443k|}
ua_types.c:Variant_clear:
 1383|   970k|Variant_clear(void *p, const UA_DataType *_) {
 1384|   970k|    UA_Variant *v = (UA_Variant *)p;
 1385|       |
 1386|       |    /* The content is "borrowed" */
 1387|   970k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1387:8): [True: 0, False: 970k]
  ------------------
 1388|      0|        return;
 1389|       |
 1390|       |    /* Delete the value */
 1391|   970k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  63.0k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1391:8): [True: 63.0k, False: 907k]
  |  Branch (1391:19): [True: 60.9k, False: 2.08k]
  ------------------
 1392|  60.9k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1392:12): [True: 57.1k, False: 3.89k]
  ------------------
 1393|  57.1k|            v->arrayLength = 1;
 1394|  60.9k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1395|  60.9k|        v->data = NULL;
 1396|  60.9k|    }
 1397|       |
 1398|       |    /* Delete the array dimensions */
 1399|   970k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|   970k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1399:8): [True: 475, False: 970k]
  ------------------
 1400|    475|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|    475|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1401|   970k|}
ua_types.c:DataValue_clear:
 1847|   964k|DataValue_clear(void *p, const UA_DataType *_) {
 1848|   964k|    UA_DataValue *dv = (UA_DataValue *)p;
 1849|       |    Variant_clear(&dv->value, NULL);
 1850|   964k|}
ua_types.c:String_copy:
  281|  95.4k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  282|  95.4k|    const UA_String *srcS = (const UA_String*)src;
  283|  95.4k|    UA_String *dstS = (UA_String *)dst;
  284|  95.4k|    UA_StatusCode res =
  285|  95.4k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  286|  95.4k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  95.4k|#define UA_TYPES_BYTE 2
  ------------------
  287|  95.4k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  95.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (287:8): [True: 95.4k, False: 5]
  ------------------
  288|  95.4k|        dstS->length = srcS->length;
  289|  95.4k|    return res;
  290|  95.4k|}
ua_types.c:nopClear:
 2158|  3.61k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  293|   376k|String_clear(void *p, const UA_DataType *_) {
  294|   376k|    UA_String *s = (UA_String*)p;
  295|   376k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|   376k|#define UA_TYPES_BYTE 2
  ------------------
  296|   376k|}
ua_types.c:NodeId_clear:
  778|  60.1k|NodeId_clear(void *p, const UA_DataType *_) {
  779|  60.1k|    UA_NodeId *id = (UA_NodeId*)p;
  780|  60.1k|    switch(id->identifierType) {
  781|  36.8k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (781:5): [True: 36.8k, False: 23.3k]
  ------------------
  782|  38.2k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (782:5): [True: 1.40k, False: 58.7k]
  ------------------
  783|  38.2k|        String_clear(&id->identifier.string, NULL);
  784|  38.2k|        break;
  785|  21.9k|    default: break;
  ------------------
  |  Branch (785:5): [True: 21.9k, False: 38.2k]
  ------------------
  786|  60.1k|    }
  787|  60.1k|}
ua_types.c:ExpandedNodeId_clear:
 1079|  4.29k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1080|  4.29k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1081|  4.29k|    NodeId_clear(&id->nodeId, NULL);
 1082|       |    String_clear(&id->namespaceUri, NULL);
 1083|  4.29k|}
ua_types.c:QualifiedName_clear:
  397|  62.1k|QualifiedName_clear(void *p, const UA_DataType *_) {
  398|  62.1k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  399|       |    String_clear(&qn->name, NULL);
  400|  62.1k|}
ua_types.c:LocalizedText_clear:
 1830|  17.2k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1831|  17.2k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1832|  17.2k|    String_clear(&lt->locale, NULL);
 1833|       |    String_clear(&lt->text, NULL);
 1834|  17.2k|}
ua_types.c:ExtensionObject_clear:
 1252|  50.7k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1253|  50.7k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1254|  50.7k|    switch(eo->encoding) {
 1255|  11.1k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1255:5): [True: 11.1k, False: 39.6k]
  ------------------
 1256|  47.0k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1256:5): [True: 35.9k, False: 14.8k]
  ------------------
 1257|  47.3k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1257:5): [True: 270, False: 50.4k]
  ------------------
 1258|  47.3k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1259|  47.3k|        String_clear(&eo->content.encoded.body, NULL);
 1260|  47.3k|        break;
 1261|  3.46k|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1261:5): [True: 3.46k, False: 47.3k]
  ------------------
 1262|  3.46k|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1262:12): [True: 3.46k, False: 0]
  ------------------
 1263|  3.46k|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1264|  3.46k|        break;
 1265|      0|    default:
  ------------------
  |  Branch (1265:5): [True: 0, False: 50.7k]
  ------------------
 1266|      0|        break;
 1267|  50.7k|    }
 1268|  50.7k|}
ua_types.c:DiagnosticInfo_clear:
 1877|    444|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1878|    444|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1879|       |
 1880|    444|    String_clear(&di->additionalInfo, NULL);
 1881|    444|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1881:8): [True: 0, False: 444]
  |  Branch (1881:38): [True: 0, False: 0]
  ------------------
 1882|      0|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1883|      0|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1884|      0|    }
 1885|    444|}
ua_types.c:clearStructure:
 2102|    447|clearStructure(void *p, const UA_DataType *type) {
 2103|    447|    uintptr_t ptr = (uintptr_t)p;
 2104|  2.25k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2104:23): [True: 1.80k, False: 447]
  ------------------
 2105|  1.80k|        const UA_DataTypeMember *m = &type->members[i];
 2106|  1.80k|        const UA_DataType *mt = m->memberType;
 2107|  1.80k|        ptr += m->padding;
 2108|  1.80k|        if(!m->isOptional) {
  ------------------
  |  Branch (2108:12): [True: 1.80k, False: 0]
  ------------------
 2109|  1.80k|            if(!m->isArray) {
  ------------------
  |  Branch (2109:16): [True: 1.49k, False: 311]
  ------------------
 2110|  1.49k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2111|  1.49k|                ptr += mt->memSize;
 2112|  1.49k|            } else {
 2113|    311|                size_t length = *(size_t*)ptr;
 2114|    311|                ptr += sizeof(size_t);
 2115|    311|                UA_Array_delete(*(void**)ptr, length, mt);
 2116|    311|                ptr += sizeof(void*);
 2117|    311|            }
 2118|  1.80k|        } else { /* field is optional */
 2119|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2119:16): [True: 0, False: 0]
  ------------------
 2120|       |                /* optional scalar field is contained */
 2121|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2121:20): [True: 0, False: 0]
  ------------------
 2122|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2123|      0|                ptr += sizeof(void *);
 2124|      0|            } else {
 2125|       |                /* optional array field is contained */
 2126|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2126:20): [True: 0, False: 0]
  ------------------
 2127|      0|                    size_t length = *(size_t *)ptr;
 2128|      0|                    ptr += sizeof(size_t);
 2129|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2130|      0|                    ptr += sizeof(void *);
 2131|      0|                } else { /* optional array field not contained */
 2132|      0|                    ptr += sizeof(size_t);
 2133|      0|                    ptr += sizeof(void *);
 2134|      0|                }
 2135|      0|            }
 2136|      0|        }
 2137|  1.80k|    }
 2138|    447|}
ua_types.c:nodeIdOrder:
 2280|  14.3M|nodeIdOrder(const UA_NodeId *p1, const UA_NodeId *p2, const UA_DataType *_) {
 2281|       |    /* Compare namespaceIndex */
 2282|  14.3M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2282:8): [True: 341k, False: 13.9M]
  ------------------
 2283|   341k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2283:16): [True: 341k, False: 0]
  ------------------
 2284|       |
 2285|       |    /* Compare identifierType */
 2286|  13.9M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2286:8): [True: 13.0M, False: 906k]
  ------------------
 2287|  13.0M|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2287:16): [True: 13.0M, False: 0]
  ------------------
 2288|       |
 2289|       |    /* Compare the identifier */
 2290|   906k|    switch(p1->identifierType) {
 2291|   906k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2291:5): [True: 906k, False: 0]
  ------------------
 2292|   906k|    default:
  ------------------
  |  Branch (2292:5): [True: 0, False: 906k]
  ------------------
 2293|   906k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2293:12): [True: 901k, False: 5.28k]
  ------------------
 2294|   901k|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2294:20): [True: 64.8k, False: 836k]
  ------------------
 2295|   836k|                UA_ORDER_LESS : UA_ORDER_MORE;
 2296|  5.28k|        return UA_ORDER_EQ;
 2297|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2297:5): [True: 0, False: 906k]
  ------------------
 2298|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2299|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2299:5): [True: 0, False: 906k]
  ------------------
 2300|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2300:5): [True: 0, False: 906k]
  ------------------
 2301|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2302|   906k|    }
 2303|   906k|}

lookAheadForKey:
 1426|   334k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1427|       |    /* The current index must point to the beginning of an object.
 1428|       |     * This has to be ensured by the caller. */
 1429|   334k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  395|   334k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1429:5): [True: 334k, False: 0]
  ------------------
 1430|       |
 1431|   334k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  232|   334k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1432|   334k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1433|   334k|    unsigned int end = ctx->tokens[ctx->index].end;
 1434|   334k|    ctx->index++; /* Move to the first key */
 1435|  2.66M|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1435:11): [True: 2.65M, False: 4.58k]
  ------------------
 1436|  2.65M|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1436:11): [True: 2.50M, False: 157k]
  ------------------
 1437|       |        /* Key must be a string */
 1438|  2.50M|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  395|  2.50M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1438:9): [True: 2.50M, False: 0]
  ------------------
 1439|       |
 1440|       |        /* Move index to the value */
 1441|  2.50M|        ctx->index++;
 1442|       |
 1443|       |        /* Value for the key must exist */
 1444|  2.50M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  395|  2.50M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1444:9): [True: 2.50M, False: 0]
  ------------------
 1445|       |
 1446|       |        /* Compare the key (previous index) */
 1447|  2.50M|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1447:12): [True: 172k, False: 2.32M]
  ------------------
 1448|   172k|            *resultIndex = ctx->index; /* Point result to the current index */
 1449|   172k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   172k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1450|   172k|            break;
 1451|   172k|        }
 1452|       |
 1453|  2.32M|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1454|  2.32M|    }
 1455|   334k|    ctx->index = oldIndex; /* Restore the old index */
 1456|   334k|    return ret;
 1457|   334k|}
decodeFields:
 2245|  70.3k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2246|  70.3k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  70.3k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  70.3k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 70.3k]
  |  |  ------------------
  |  | 1024|  70.3k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  70.3k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 70.3k]
  |  |  ------------------
  ------------------
 2247|  70.3k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1047|  70.3k|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|  70.3k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 258, False: 70.0k]
  |  |  ------------------
  |  | 1049|    258|        ctx->index++;                                \
  |  | 1050|    258|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|    258|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|  70.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 70.0k]
  |  |  ------------------
  ------------------
 2248|       |
 2249|  70.0k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  70.0k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2249:8): [True: 0, False: 70.0k]
  ------------------
 2250|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2251|       |
 2252|       |    /* Keys and values are counted separately */
 2253|  70.0k|    CHECK_OBJECT;
  ------------------
  |  | 1042|  70.0k|#define CHECK_OBJECT do {                                \
  |  | 1043|  70.0k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 21, False: 70.0k]
  |  |  ------------------
  |  | 1044|     21|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  70.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 70.0k]
  |  |  ------------------
  ------------------
 2254|  70.0k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  395|  70.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2254:5): [True: 70.0k, False: 0]
  ------------------
 2255|  70.0k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2256|       |
 2257|  70.0k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2258|  70.0k|    ctx->depth++;
 2259|       |
 2260|  70.0k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  70.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2261|   161k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2261:25): [True: 101k, False: 60.1k]
  ------------------
 2262|       |        /* Key must be a string */
 2263|   101k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  395|   101k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2263:9): [True: 101k, False: 0]
  ------------------
 2264|   101k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  395|   101k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2264:9): [True: 101k, False: 0]
  ------------------
 2265|       |
 2266|       |        /* Search for the decoding entry matching the key. Start at the key
 2267|       |         * index to speed-up the case where they key-order is the same as the
 2268|       |         * entry-order. */
 2269|   101k|        DecodeEntry *entry = NULL;
 2270|   189k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2270:29): [True: 189k, False: 341]
  ------------------
 2271|   189k|            size_t ii = i;
 2272|   193k|            while(ii >= entryCount)
  ------------------
  |  Branch (2272:19): [True: 4.14k, False: 189k]
  ------------------
 2273|  4.14k|                ii -= entryCount;
 2274|       |
 2275|       |            /* Compare the key */
 2276|   189k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2276:16): [True: 88.5k, False: 100k]
  ------------------
 2277|   189k|                      entries[ii].fieldName) != 0)
 2278|  88.5k|                continue;
 2279|       |
 2280|       |            /* Key was already used -> duplicate, abort */
 2281|   100k|            if(entries[ii].found) {
  ------------------
  |  Branch (2281:16): [True: 3, False: 100k]
  ------------------
 2282|      3|                ctx->depth--;
 2283|      3|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2284|      3|            }
 2285|       |
 2286|       |            /* Found the key */
 2287|   100k|            entries[ii].found = true;
 2288|   100k|            entry = &entries[ii];
 2289|   100k|            break;
 2290|   100k|        }
 2291|       |
 2292|       |        /* The key is unknown */
 2293|   101k|        if(!entry) {
  ------------------
  |  Branch (2293:12): [True: 341, False: 100k]
  ------------------
 2294|    341|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    341|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2295|    341|            break;
 2296|    341|        }
 2297|       |
 2298|       |        /* Go from key to value */
 2299|   100k|        ctx->index++;
 2300|   100k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  395|   100k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2300:9): [True: 100k, False: 0]
  ------------------
 2301|       |
 2302|       |        /* An entry that was expected but shall not be decoded.
 2303|       |         * Jump over the value. */
 2304|   100k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2304:12): [True: 90.3k, False: 10.5k]
  |  Branch (2304:32): [True: 88.8k, False: 1.41k]
  ------------------
 2305|  88.8k|            skipObject(ctx);
 2306|  88.8k|            continue;
 2307|  88.8k|        }
 2308|       |
 2309|       |        /* A null-value, skip the decoding (the value is already initialized) */
 2310|  12.0k|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2310:12): [True: 199, False: 11.8k]
  |  Branch (2310:55): [True: 196, False: 3]
  ------------------
 2311|    196|            ctx->index++; /* skip null value */
 2312|    196|            continue;
 2313|    196|        }
 2314|       |
 2315|       |        /* Decode. This also moves to the next key or right after the object for
 2316|       |         * the last value. */
 2317|  11.8k|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2317:42): [True: 10.5k, False: 1.21k]
  ------------------
 2318|  10.5k|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2319|  11.8k|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2320|  11.8k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  11.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2320:12): [True: 9.56k, False: 2.25k]
  ------------------
 2321|  9.56k|            break;
 2322|  11.8k|    }
 2323|       |
 2324|  70.0k|    ctx->depth--;
 2325|  70.0k|    return ret;
 2326|  70.0k|}
tokenize:
 2457|  7.92k|         size_t *decodedLength) {
 2458|       |    /* Tokenize */
 2459|  7.92k|    cj5_options options;
 2460|  7.92k|    options.stop_early = (decodedLength != NULL);
 2461|  7.92k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2462|  7.92k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2463|       |
 2464|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2465|       |     * have needed */
 2466|  7.92k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2466:8): [True: 542, False: 7.38k]
  ------------------
 2467|    542|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2467:8): [True: 542, False: 0]
  ------------------
 2468|    542|        ctx->tokens = (cj5_token*)
 2469|    542|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    542|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2470|    542|        if(!ctx->tokens)
  ------------------
  |  Branch (2470:12): [True: 13, False: 529]
  ------------------
 2471|     13|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|     13|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2472|    529|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2473|    542|    }
 2474|       |
 2475|       |    /* Cannot recover from other errors */
 2476|  7.38k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2476:8): [True: 702, False: 6.68k]
  ------------------
 2477|    702|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    702|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2478|       |
 2479|  6.68k|    if(decodedLength)
  ------------------
  |  Branch (2479:8): [True: 0, False: 6.68k]
  ------------------
 2480|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2481|       |
 2482|       |    /* Set up the context */
 2483|  6.68k|    ctx->json5 = (char*)src->data;
 2484|  6.68k|    ctx->depth = 0;
 2485|  6.68k|    ctx->tokensSize = r.num_tokens;
 2486|  6.68k|    ctx->index = 0;
 2487|  6.68k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  6.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2488|  7.38k|}
ua_types_encoding_json.c:jsoneq:
 1078|  2.69M|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1079|       |    /* TODO: necessary?
 1080|       |       if(json == NULL
 1081|       |            || tok == NULL
 1082|       |            || searchKey == NULL) {
 1083|       |        return -1;
 1084|       |    } */
 1085|       |
 1086|  2.69M|    size_t len = getTokenLength(tok);
 1087|  2.69M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1087:8): [True: 2.69M, False: 0]
  ------------------
 1088|  2.69M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1088:8): [True: 283k, False: 2.40M]
  ------------------
 1089|   283k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1089:8): [True: 273k, False: 9.64k]
  ------------------
 1090|   273k|        return 0;
 1091|       |
 1092|  2.41M|    return -1;
 1093|  2.69M|}
ua_types_encoding_json.c:skipObject:
 1062|  2.53M|skipObject(ParseCtx *ctx) {
 1063|  2.53M|    unsigned int end = ctx->tokens[ctx->index].end;
 1064|  35.1M|    do {
 1065|  35.1M|        ctx->index++;
 1066|  35.1M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1066:13): [True: 35.1M, False: 10.1k]
  ------------------
 1067|  35.1M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1067:13): [True: 32.6M, False: 2.52M]
  ------------------
 1068|  2.53M|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2200|    405|DECODE_JSON(DiagnosticInfo) {
 2201|    405|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2202|    405|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1047|    405|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|    405|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 98, False: 307]
  |  |  ------------------
  |  | 1049|     98|        ctx->index++;                                \
  |  | 1050|     98|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|     98|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|    307|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 307]
  |  |  ------------------
  ------------------
 2203|    307|    CHECK_OBJECT;
  ------------------
  |  | 1042|    307|#define CHECK_OBJECT do {                                \
  |  | 1043|    307|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 21, False: 286]
  |  |  ------------------
  |  | 1044|     21|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|    286|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 286]
  |  |  ------------------
  ------------------
 2204|       |
 2205|    286|    DecodeEntry entries[7] = {
 2206|    286|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2207|    286|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    286|#define UA_TYPES_INT32 5
  ------------------
 2208|    286|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2209|    286|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    286|#define UA_TYPES_INT32 5
  ------------------
 2210|    286|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2211|    286|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    286|#define UA_TYPES_INT32 5
  ------------------
 2212|    286|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2213|    286|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    286|#define UA_TYPES_INT32 5
  ------------------
 2214|    286|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2215|    286|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|    286|#define UA_TYPES_STRING 11
  ------------------
 2216|    286|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2217|    286|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|    286|#define UA_TYPES_STATUSCODE 18
  ------------------
 2218|    286|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2219|    286|         DiagnosticInfoInner_decodeJson, false, NULL}
 2220|    286|    };
 2221|    286|    status ret = decodeFields(ctx, entries, 7);
 2222|       |
 2223|    286|    dst->hasSymbolicId = entries[0].found;
 2224|    286|    dst->hasNamespaceUri = entries[1].found;
 2225|    286|    dst->hasLocalizedText = entries[2].found;
 2226|    286|    dst->hasLocale = entries[3].found;
 2227|    286|    dst->hasAdditionalInfo = entries[4].found;
 2228|    286|    dst->hasInnerStatusCode = entries[5].found;
 2229|    286|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2230|    286|    return ret;
 2231|    307|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1095|    140|DECODE_JSON(Boolean) {
 1096|    140|    UA_Boolean *dst = (UA_Boolean*)p;
 1097|    140|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|    140|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|    140|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 140]
  |  |  ------------------
  |  | 1024|    140|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|    140|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 140]
  |  |  ------------------
  ------------------
 1098|    140|    CHECK_BOOL;
  ------------------
  |  | 1032|    140|#define CHECK_BOOL do {                                \
  |  | 1033|    140|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 63, False: 77]
  |  |  ------------------
  |  | 1034|     63|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   43|     63|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|     77|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1035:14): [Folded, False: 77]
  |  |  ------------------
  ------------------
 1099|     77|    GET_TOKEN;
  ------------------
  |  | 1018|     77|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|     77|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|     77|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 77]
  |  |  ------------------
  ------------------
 1100|       |
 1101|     77|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1101:8): [True: 67, False: 10]
  ------------------
 1102|     67|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1102:8): [True: 67, False: 0]
  |  Branch (1102:38): [True: 67, False: 0]
  ------------------
 1103|     67|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1103:8): [True: 67, False: 0]
  |  Branch (1103:38): [True: 67, False: 0]
  ------------------
 1104|     67|        *dst = true;
 1105|     67|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1105:15): [True: 10, False: 0]
  ------------------
 1106|     10|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1106:15): [True: 10, False: 0]
  |  Branch (1106:45): [True: 10, False: 0]
  ------------------
 1107|     10|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1107:15): [True: 10, False: 0]
  |  Branch (1107:45): [True: 10, False: 0]
  ------------------
 1108|     10|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1108:15): [True: 10, False: 0]
  ------------------
 1109|     10|        *dst = false;
 1110|     10|    } else {
 1111|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1112|      0|    }
 1113|       |
 1114|     77|    ctx->index++;
 1115|     77|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     77|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1116|     77|}
ua_types_encoding_json.c:SByte_decodeJson:
 1203|   255k|DECODE_JSON(SByte) {
 1204|   255k|    UA_SByte *dst = (UA_SByte*)p;
 1205|   255k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   255k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   255k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 255k]
  |  |  ------------------
  |  | 1024|   255k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   255k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 255k]
  |  |  ------------------
  ------------------
 1206|   255k|    CHECK_NUMBER;
  ------------------
  |  | 1027|   255k|#define CHECK_NUMBER do {                                \
  |  | 1028|   255k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 25, False: 255k]
  |  |  ------------------
  |  | 1029|     25|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     25|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|   255k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 255k]
  |  |  ------------------
  ------------------
 1207|   255k|    GET_TOKEN;
  ------------------
  |  | 1018|   255k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   255k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   255k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 255k]
  |  |  ------------------
  ------------------
 1208|   255k|    UA_Int64 out = 0;
 1209|   255k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1210|   255k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   16|   510k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|   510k|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   254k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1210:8): [True: 69, False: 255k]
  |  Branch (1210:35): [True: 112, False: 254k]
  |  Branch (1210:57): [True: 56, False: 254k]
  ------------------
 1211|    237|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    237|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1212|   254k|    *dst = (UA_SByte)out;
 1213|   254k|    ctx->index++;
 1214|   254k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   254k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1215|   255k|}
ua_types_encoding_json.c:parseSignedInteger:
 1135|  1.36M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1136|  1.36M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1137|  1.36M|    if(len == 0)
  ------------------
  |  Branch (1137:8): [True: 117, False: 1.36M]
  ------------------
 1138|    117|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    117|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1139|       |
 1140|       |    /* There must only be whitespace between the end of the parsed number and
 1141|       |     * the end of the token */
 1142|  1.43M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1142:25): [True: 69.5k, False: 1.36M]
  ------------------
 1143|  69.5k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1143:12): [True: 35.2k, False: 34.2k]
  |  Branch (1143:35): [True: 100, False: 35.1k]
  ------------------
 1144|    100|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    100|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1145|  69.5k|    }
 1146|       |
 1147|  1.36M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.36M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1148|  1.36M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1150|  66.6k|DECODE_JSON(Byte) {
 1151|  66.6k|    UA_Byte *dst = (UA_Byte*)p;
 1152|  66.6k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  66.6k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  66.6k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 66.6k]
  |  |  ------------------
  |  | 1024|  66.6k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  66.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 66.6k]
  |  |  ------------------
  ------------------
 1153|  66.6k|    CHECK_NUMBER;
  ------------------
  |  | 1027|  66.6k|#define CHECK_NUMBER do {                                \
  |  | 1028|  66.6k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 17, False: 66.6k]
  |  |  ------------------
  |  | 1029|     17|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|  66.6k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 66.6k]
  |  |  ------------------
  ------------------
 1154|  66.6k|    GET_TOKEN;
  ------------------
  |  | 1018|  66.6k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  66.6k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  66.6k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 66.6k]
  |  |  ------------------
  ------------------
 1155|  66.6k|    UA_UInt64 out = 0;
 1156|  66.6k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1157|  66.6k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   16|   133k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|  66.5k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1157:8): [True: 36, False: 66.5k]
  |  Branch (1157:35): [True: 117, False: 66.4k]
  ------------------
 1158|    153|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    153|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1159|  66.4k|    *dst = (UA_Byte)out;
 1160|  66.4k|    ctx->index++;
 1161|  66.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  66.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1162|  66.6k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1119|  2.47M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1120|  2.47M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1121|  2.47M|    if(len == 0)
  ------------------
  |  Branch (1121:8): [True: 93, False: 2.47M]
  ------------------
 1122|     93|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     93|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1123|       |
 1124|       |    /* There must only be whitespace between the end of the parsed number and
 1125|       |     * the end of the token */
 1126|  2.52M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1126:25): [True: 45.2k, False: 2.47M]
  ------------------
 1127|  45.2k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1127:12): [True: 5.63k, False: 39.6k]
  |  Branch (1127:35): [True: 157, False: 5.47k]
  ------------------
 1128|    157|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    157|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1129|  45.2k|    }
 1130|       |
 1131|  2.47M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.47M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1132|  2.47M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1217|  53.1k|DECODE_JSON(Int16) {
 1218|  53.1k|    UA_Int16 *dst = (UA_Int16*)p;
 1219|  53.1k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  53.1k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  53.1k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 53.1k]
  |  |  ------------------
  |  | 1024|  53.1k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  53.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 53.1k]
  |  |  ------------------
  ------------------
 1220|  53.1k|    CHECK_NUMBER;
  ------------------
  |  | 1027|  53.1k|#define CHECK_NUMBER do {                                \
  |  | 1028|  53.1k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 15, False: 53.1k]
  |  |  ------------------
  |  | 1029|     15|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|  53.1k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 53.1k]
  |  |  ------------------
  ------------------
 1221|  53.1k|    GET_TOKEN;
  ------------------
  |  | 1018|  53.1k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  53.1k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  53.1k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 53.1k]
  |  |  ------------------
  ------------------
 1222|  53.1k|    UA_Int64 out = 0;
 1223|  53.1k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1224|  53.1k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   16|   106k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|   106k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|  52.9k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1224:8): [True: 42, False: 53.0k]
  |  Branch (1224:35): [True: 81, False: 52.9k]
  |  Branch (1224:57): [True: 48, False: 52.9k]
  ------------------
 1225|    171|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    171|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1226|  52.9k|    *dst = (UA_Int16)out;
 1227|  52.9k|    ctx->index++;
 1228|  52.9k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  52.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1229|  53.1k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1164|   903k|DECODE_JSON(UInt16) {
 1165|   903k|    UA_UInt16 *dst = (UA_UInt16*)p;
 1166|   903k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   903k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   903k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 903k]
  |  |  ------------------
  |  | 1024|   903k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   903k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 903k]
  |  |  ------------------
  ------------------
 1167|   903k|    CHECK_NUMBER;
  ------------------
  |  | 1027|   903k|#define CHECK_NUMBER do {                                \
  |  | 1028|   903k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 21, False: 903k]
  |  |  ------------------
  |  | 1029|     21|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|   903k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 903k]
  |  |  ------------------
  ------------------
 1168|   903k|    GET_TOKEN;
  ------------------
  |  | 1018|   903k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   903k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   903k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 903k]
  |  |  ------------------
  ------------------
 1169|   903k|    UA_UInt64 out = 0;
 1170|   903k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1171|   903k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   16|  1.80M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|   903k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1171:8): [True: 71, False: 903k]
  |  Branch (1171:35): [True: 202, False: 903k]
  ------------------
 1172|    273|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    273|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1173|   903k|    *dst = (UA_UInt16)out;
 1174|   903k|    ctx->index++;
 1175|   903k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   903k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1176|   903k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1231|   512k|DECODE_JSON(Int32) {
 1232|   512k|    UA_Int32 *dst = (UA_Int32*)p;
 1233|   512k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   512k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   512k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 512k]
  |  |  ------------------
  |  | 1024|   512k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   512k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 512k]
  |  |  ------------------
  ------------------
 1234|   512k|    CHECK_NUMBER;
  ------------------
  |  | 1027|   512k|#define CHECK_NUMBER do {                                \
  |  | 1028|   512k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 15, False: 512k]
  |  |  ------------------
  |  | 1029|     15|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|   512k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 512k]
  |  |  ------------------
  ------------------
 1235|   512k|    GET_TOKEN;
  ------------------
  |  | 1018|   512k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   512k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   512k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 512k]
  |  |  ------------------
  ------------------
 1236|   512k|    UA_Int64 out = 0;
 1237|   512k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1238|   512k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   16|  1.02M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|  1.02M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|   512k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1238:8): [True: 49, False: 512k]
  |  Branch (1238:35): [True: 68, False: 512k]
  |  Branch (1238:57): [True: 10, False: 512k]
  ------------------
 1239|    127|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    127|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1240|   512k|    *dst = (UA_Int32)out;
 1241|   512k|    ctx->index++;
 1242|   512k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   512k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1243|   512k|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1178|   978k|DECODE_JSON(UInt32) {
 1179|   978k|    UA_UInt32 *dst = (UA_UInt32*)p;
 1180|   978k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   978k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   978k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 978k]
  |  |  ------------------
  |  | 1024|   978k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   978k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 978k]
  |  |  ------------------
  ------------------
 1181|   978k|    CHECK_NUMBER;
  ------------------
  |  | 1027|   978k|#define CHECK_NUMBER do {                                \
  |  | 1028|   978k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 37, False: 978k]
  |  |  ------------------
  |  | 1029|     37|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|   978k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 978k]
  |  |  ------------------
  ------------------
 1182|   978k|    GET_TOKEN;
  ------------------
  |  | 1018|   978k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   978k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   978k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 978k]
  |  |  ------------------
  ------------------
 1183|   978k|    UA_UInt64 out = 0;
 1184|   978k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1185|   978k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|  1.95M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|   978k|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1185:8): [True: 73, False: 978k]
  |  Branch (1185:35): [True: 92, False: 978k]
  ------------------
 1186|    165|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    165|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1187|   978k|    *dst = (UA_UInt32)out;
 1188|   978k|    ctx->index++;
 1189|   978k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   978k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1190|   978k|}
ua_types_encoding_json.c:Int64_decodeJson:
 1245|   547k|DECODE_JSON(Int64) {
 1246|   547k|    UA_Int64 *dst = (UA_Int64*)p;
 1247|   547k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   547k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   547k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 547k]
  |  |  ------------------
  |  | 1024|   547k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   547k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 547k]
  |  |  ------------------
  ------------------
 1248|   547k|    GET_TOKEN;
  ------------------
  |  | 1018|   547k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   547k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   547k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 547k]
  |  |  ------------------
  ------------------
 1249|   547k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1250|   547k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   547k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1250:8): [True: 57, False: 547k]
  ------------------
 1251|     57|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     57|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1252|   547k|    ctx->index++;
 1253|   547k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   547k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1254|   547k|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1192|   528k|DECODE_JSON(UInt64) {
 1193|   528k|    UA_UInt64 *dst = (UA_UInt64*)p;
 1194|   528k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   528k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   528k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 528k]
  |  |  ------------------
  |  | 1024|   528k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   528k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 528k]
  |  |  ------------------
  ------------------
 1195|   528k|    GET_TOKEN;
  ------------------
  |  | 1018|   528k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   528k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   528k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 528k]
  |  |  ------------------
  ------------------
 1196|   528k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1197|   528k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   528k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1197:8): [True: 70, False: 527k]
  ------------------
 1198|     70|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     70|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1199|   527k|    ctx->index++;
 1200|   527k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   527k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1201|   528k|}
ua_types_encoding_json.c:Float_decodeJson:
 1317|   517k|DECODE_JSON(Float) {
 1318|   517k|    UA_Float *dst = (UA_Float*)p;
 1319|   517k|    UA_Double v = 0.0;
 1320|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1321|   517k|    *dst = (UA_Float)v;
 1322|   517k|    return res;
 1323|   517k|}
ua_types_encoding_json.c:Double_decodeJson:
 1257|   530k|DECODE_JSON(Double) {
 1258|   530k|    UA_Double *dst = (UA_Double*)p;
 1259|   530k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   530k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   530k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 530k]
  |  |  ------------------
  |  | 1024|   530k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   530k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 530k]
  |  |  ------------------
  ------------------
 1260|   530k|    GET_TOKEN;
  ------------------
  |  | 1018|   530k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   530k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   530k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 530k]
  |  |  ------------------
  ------------------
 1261|       |
 1262|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1263|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1264|       |     * Sanity check.
 1265|       |     */
 1266|   530k|    if(tokenSize > 2000)
  ------------------
  |  Branch (1266:8): [True: 4, False: 530k]
  ------------------
 1267|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1268|       |
 1269|   530k|    cj5_token_type tokenType = currentTokenType(ctx);
 1270|       |
 1271|       |    /* It could be a String with Nan, Infinity */
 1272|   530k|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1272:8): [True: 943, False: 529k]
  ------------------
 1273|    943|        ctx->index++;
 1274|       |
 1275|    943|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1275:12): [True: 214, False: 729]
  |  Branch (1275:30): [True: 195, False: 19]
  ------------------
 1276|    195|            *dst = INFINITY;
 1277|    195|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    195|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1278|    195|        }
 1279|       |
 1280|    748|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1280:12): [True: 245, False: 503]
  |  Branch (1280:30): [True: 223, False: 22]
  ------------------
 1281|       |            /* workaround an MSVC 2013 issue */
 1282|    223|            *dst = -INFINITY;
 1283|    223|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    223|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1284|    223|        }
 1285|       |
 1286|    525|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1286:12): [True: 230, False: 295]
  |  Branch (1286:30): [True: 204, False: 26]
  ------------------
 1287|    204|            *dst = NAN;
 1288|    204|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    204|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1289|    204|        }
 1290|       |
 1291|    321|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1291:12): [True: 220, False: 101]
  |  Branch (1291:30): [True: 209, False: 11]
  ------------------
 1292|    209|            *dst = NAN;
 1293|    209|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    209|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1294|    209|        }
 1295|       |
 1296|    112|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    112|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1297|    321|    }
 1298|       |
 1299|   529k|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1299:8): [True: 7, False: 529k]
  ------------------
 1300|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1301|       |
 1302|   529k|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1303|   529k|    if(len == 0)
  ------------------
  |  Branch (1303:8): [True: 7, False: 529k]
  ------------------
 1304|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1305|       |
 1306|       |    /* There must only be whitespace between the end of the parsed number and
 1307|       |     * the end of the token */
 1308|   529k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1308:25): [True: 29, False: 529k]
  ------------------
 1309|     29|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1309:12): [True: 29, False: 0]
  |  Branch (1309:35): [True: 29, False: 0]
  ------------------
 1310|     29|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     29|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1311|     29|    }
 1312|       |
 1313|   529k|    ctx->index++;
 1314|   529k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   529k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1315|   529k|}
ua_types_encoding_json.c:String_decodeJson:
 1335|   174k|DECODE_JSON(String) {
 1336|   174k|    UA_String *dst = (UA_String*)p;
 1337|   174k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   174k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   174k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 174k]
  |  |  ------------------
  |  | 1024|   174k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   174k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 174k]
  |  |  ------------------
  ------------------
 1338|   174k|    CHECK_STRING;
  ------------------
  |  | 1037|   174k|#define CHECK_STRING do {                                \
  |  | 1038|   174k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 66, False: 174k]
  |  |  ------------------
  |  | 1039|     66|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     66|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   174k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 174k]
  |  |  ------------------
  ------------------
 1339|   174k|    GET_TOKEN;
  ------------------
  |  | 1018|   174k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   174k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   174k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 174k]
  |  |  ------------------
  ------------------
 1340|   174k|    (void)tokenData;
 1341|       |
 1342|       |    /* Empty string? */
 1343|   174k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1343:8): [True: 1.88k, False: 172k]
  ------------------
 1344|  1.88k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.88k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1345|  1.88k|        dst->length = 0;
 1346|  1.88k|        ctx->index++;
 1347|  1.88k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.88k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1348|  1.88k|    }
 1349|       |
 1350|       |    /* The decoded utf8 is at most of the same length as the source string */
 1351|   172k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|   172k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1352|   172k|    if(!outBuf)
  ------------------
  |  Branch (1352:8): [True: 9, False: 172k]
  ------------------
 1353|      9|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      9|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1354|       |
 1355|       |    /* Decode the string */
 1356|   172k|    cj5_result r;
 1357|   172k|    r.tokens = ctx->tokens;
 1358|   172k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1359|   172k|    r.json5 = ctx->json5;
 1360|   172k|    unsigned int len = 0;
 1361|   172k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1362|   172k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1362:8): [True: 139, False: 172k]
  ------------------
 1363|    139|        UA_free(outBuf);
  ------------------
  |  |   19|    139|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1364|    139|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    139|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1365|    139|    }
 1366|       |
 1367|       |    /* Set the output */
 1368|   172k|    dst->length = len;
 1369|   172k|    if(dst->length > 0) {
  ------------------
  |  Branch (1369:8): [True: 172k, False: 0]
  ------------------
 1370|   172k|        dst->data = (UA_Byte*)outBuf;
 1371|   172k|    } else {
 1372|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1373|      0|        UA_free(outBuf);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1374|      0|    }
 1375|       |
 1376|   172k|    ctx->index++;
 1377|   172k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   172k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1378|   172k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1482|    534|DECODE_JSON(DateTime) {
 1483|    534|    UA_DateTime *dst = (UA_DateTime*)p;
 1484|    534|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|    534|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|    534|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 534]
  |  |  ------------------
  |  | 1024|    534|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|    534|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 534]
  |  |  ------------------
  ------------------
 1485|    534|    CHECK_STRING;
  ------------------
  |  | 1037|    534|#define CHECK_STRING do {                                \
  |  | 1038|    534|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 13, False: 521]
  |  |  ------------------
  |  | 1039|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|    521|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 521]
  |  |  ------------------
  ------------------
 1486|    521|    GET_TOKEN;
  ------------------
  |  | 1018|    521|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|    521|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|    521|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 521]
  |  |  ------------------
  ------------------
 1487|       |
 1488|       |    /* The last character has to be 'Z'. We can omit some length checks later on
 1489|       |     * because we know the atoi functions stop before the 'Z'. */
 1490|    521|    if(tokenSize == 0 || tokenData[tokenSize-1] != 'Z')
  ------------------
  |  Branch (1490:8): [True: 5, False: 516]
  |  Branch (1490:26): [True: 23, False: 493]
  ------------------
 1491|     28|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     28|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1492|       |
 1493|    493|    struct musl_tm dts;
 1494|    493|    memset(&dts, 0, sizeof(dts));
 1495|       |
 1496|    493|    size_t pos = 0;
 1497|    493|    size_t len;
 1498|       |
 1499|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
 1500|       |     * to five with an optional plus or minus in front due to the range of the
 1501|       |     * DateTime 64bit integer. But in that case we require the year and the
 1502|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
 1503|       |     * starts. */
 1504|    493|    if(tokenData[0] == '-' || tokenData[0] == '+')
  ------------------
  |  Branch (1504:8): [True: 47, False: 446]
  |  Branch (1504:31): [True: 5, False: 441]
  ------------------
 1505|     52|        pos++;
 1506|    493|    UA_Int64 year = 0;
 1507|    493|    len = parseInt64(&tokenData[pos], 5, &year);
 1508|    493|    pos += len;
 1509|    493|    if(len != 4 && tokenData[pos] != '-')
  ------------------
  |  Branch (1509:8): [True: 360, False: 133]
  |  Branch (1509:20): [True: 63, False: 297]
  ------------------
 1510|     63|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     63|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1511|    430|    if(tokenData[0] == '-')
  ------------------
  |  Branch (1511:8): [True: 38, False: 392]
  ------------------
 1512|     38|        year = -year;
 1513|    430|    dts.tm_year = (UA_Int16)year - 1900;
 1514|    430|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1514:8): [True: 407, False: 23]
  ------------------
 1515|    407|        pos++;
 1516|       |
 1517|       |    /* Parse the month */
 1518|    430|    UA_UInt64 month = 0;
 1519|    430|    len = parseUInt64(&tokenData[pos], 2, &month);
 1520|    430|    pos += len;
 1521|    430|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    430|    do {                                                                                 \
  |  |  173|    430|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|    430|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 33, False: 397]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     33|            EVAL_ON_ERROR;                                                               \
  |  |  175|     33|        }                                                                                \
  |  |  176|    430|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 397]
  |  |  ------------------
  ------------------
 1522|    397|    dts.tm_mon = (UA_UInt16)month - 1;
 1523|    397|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1523:8): [True: 1, False: 396]
  ------------------
 1524|      1|        pos++;
 1525|       |
 1526|       |    /* Parse the day and check the T between date and time */
 1527|    397|    UA_UInt64 day = 0;
 1528|    397|    len = parseUInt64(&tokenData[pos], 2, &day);
 1529|    397|    pos += len;
 1530|    397|    UA_CHECK(len == 2 || tokenData[pos] != 'T',
  ------------------
  |  |  172|    397|    do {                                                                                 \
  |  |  173|    397|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|    728|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 1, False: 396]
  |  |  |  |  |  Branch (575:43): [True: 66, False: 331]
  |  |  |  |  |  Branch (575:43): [True: 330, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  175|      1|        }                                                                                \
  |  |  176|    397|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 396]
  |  |  ------------------
  ------------------
 1531|    397|             return UA_STATUSCODE_BADDECODINGERROR);
 1532|    396|    dts.tm_mday = (UA_UInt16)day;
 1533|    396|    pos++;
 1534|       |
 1535|       |    /* Parse the hour */
 1536|    396|    UA_UInt64 hour = 0;
 1537|    396|    len = parseUInt64(&tokenData[pos], 2, &hour);
 1538|    396|    pos += len;
 1539|    396|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    396|    do {                                                                                 \
  |  |  173|    396|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|    396|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 17, False: 379]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     17|            EVAL_ON_ERROR;                                                               \
  |  |  175|     17|        }                                                                                \
  |  |  176|    396|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 379]
  |  |  ------------------
  ------------------
 1540|    379|    dts.tm_hour = (UA_UInt16)hour;
 1541|    379|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1541:8): [True: 1, False: 378]
  ------------------
 1542|      1|        pos++;
 1543|       |
 1544|       |    /* Parse the minute */
 1545|    379|    UA_UInt64 min = 0;
 1546|    379|    len = parseUInt64(&tokenData[pos], 2, &min);
 1547|    379|    pos += len;
 1548|    379|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    379|    do {                                                                                 \
  |  |  173|    379|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|    379|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 12, False: 367]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     12|            EVAL_ON_ERROR;                                                               \
  |  |  175|     12|        }                                                                                \
  |  |  176|    379|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 367]
  |  |  ------------------
  ------------------
 1549|    367|    dts.tm_min = (UA_UInt16)min;
 1550|    367|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1550:8): [True: 1, False: 366]
  ------------------
 1551|      1|        pos++;
 1552|       |
 1553|       |    /* Parse the second */
 1554|    367|    UA_UInt64 sec = 0;
 1555|    367|    len = parseUInt64(&tokenData[pos], 2, &sec);
 1556|    367|    pos += len;
 1557|    367|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    367|    do {                                                                                 \
  |  |  173|    367|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|    367|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 10, False: 357]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     10|            EVAL_ON_ERROR;                                                               \
  |  |  175|     10|        }                                                                                \
  |  |  176|    367|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 357]
  |  |  ------------------
  ------------------
 1558|    357|    dts.tm_sec = (UA_UInt16)sec;
 1559|       |
 1560|       |    /* Compute the seconds since the Unix epoch */
 1561|    357|    long long sinceunix = musl_tm_to_secs(&dts);
 1562|       |
 1563|       |    /* Are we within the range that can be represented? */
 1564|    357|    long long sinceunix_min =
 1565|    357|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|    357|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|    357|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|    357|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    357|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    357|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1566|    357|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|    357|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    357|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    357|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    357|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|    357|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    357|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    357|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1567|    357|        (long long)1; /* manual correction due to rounding */
 1568|    357|    long long sinceunix_max = (long long)
 1569|    357|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|    357|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|    357|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    357|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    357|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    357|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|    357|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    357|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    357|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1570|    357|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (1570:8): [True: 35, False: 322]
  |  Branch (1570:37): [True: 7, False: 315]
  ------------------
 1571|     42|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     42|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1572|       |
 1573|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
 1574|       |     * underflow/overflow. This is reverted once the fractional part has been
 1575|       |     * added. */
 1576|    315|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (1576:18): [True: 113, False: 202]
  ------------------
 1577|    315|    UA_DateTime dt = (UA_DateTime)
 1578|    315|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|    315|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    315|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    315|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    315|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|    315|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    315|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    315|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|    315|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    315|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    315|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1579|       |
 1580|       |    /* Parse the fraction of the second if defined */
 1581|    315|    if(tokenData[pos] == ',' || tokenData[pos] == '.') {
  ------------------
  |  Branch (1581:8): [True: 26, False: 289]
  |  Branch (1581:33): [True: 30, False: 259]
  ------------------
 1582|     56|        pos++;
 1583|     56|        double frac = 0.0;
 1584|     56|        double denom = 0.1;
 1585|   168k|        while(pos < tokenSize &&
  ------------------
  |  Branch (1585:15): [True: 168k, False: 0]
  ------------------
 1586|   168k|              tokenData[pos] >= '0' && tokenData[pos] <= '9') {
  ------------------
  |  Branch (1586:15): [True: 168k, False: 18]
  |  Branch (1586:40): [True: 168k, False: 38]
  ------------------
 1587|   168k|            frac += denom * (tokenData[pos] - '0');
 1588|   168k|            denom *= 0.1;
 1589|   168k|            pos++;
 1590|   168k|        }
 1591|     56|        frac += 0.00000005; /* Correct rounding when converting to integer */
 1592|     56|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|     56|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|     56|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|     56|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1593|     56|    }
 1594|       |
 1595|       |    /* Remove the underflow/overflow protection (see above) */
 1596|    315|    if(sinceunix > 0) {
  ------------------
  |  Branch (1596:8): [True: 113, False: 202]
  ------------------
 1597|    113|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|    113|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|    113|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    113|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    113|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1597:12): [True: 0, False: 113]
  ------------------
 1598|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1599|    113|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|    113|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    113|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    113|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1600|    202|    } else {
 1601|    202|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|    202|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|    202|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|    202|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    202|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    202|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1601:12): [True: 1, False: 201]
  ------------------
 1602|      1|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1603|    201|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|    201|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    201|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    201|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|    201|    }
 1605|       |
 1606|       |    /* We must be at the end of the string (ending with 'Z' as checked above) */
 1607|    314|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1607:8): [True: 47, False: 267]
  ------------------
 1608|     47|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     47|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1609|       |
 1610|    267|    *dst = dt;
 1611|       |
 1612|    267|    ctx->index++;
 1613|    267|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    267|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1614|    314|}
ua_types_encoding_json.c:Guid_decodeJson:
 1325|     61|DECODE_JSON(Guid) {
 1326|     61|    UA_Guid *dst = (UA_Guid*)p;
 1327|     61|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|     61|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|     61|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 61]
  |  |  ------------------
  |  | 1024|     61|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|     61|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 61]
  |  |  ------------------
  ------------------
 1328|     61|    CHECK_STRING;
  ------------------
  |  | 1037|     61|#define CHECK_STRING do {                                \
  |  | 1038|     61|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 5, False: 56]
  |  |  ------------------
  |  | 1039|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|     56|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 56]
  |  |  ------------------
  ------------------
 1329|     56|    GET_TOKEN;
  ------------------
  |  | 1018|     56|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|     56|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|     56|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 56]
  |  |  ------------------
  ------------------
 1330|     56|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1331|     56|    ctx->index++;
 1332|     56|    return UA_Guid_parse(dst, str);
 1333|     61|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1380|  2.12k|DECODE_JSON(ByteString) {
 1381|  2.12k|    UA_ByteString *dst = (UA_ByteString*)p;
 1382|  2.12k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  2.12k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  2.12k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 2.12k]
  |  |  ------------------
  |  | 1024|  2.12k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  2.12k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 2.12k]
  |  |  ------------------
  ------------------
 1383|  2.12k|    CHECK_STRING;
  ------------------
  |  | 1037|  2.12k|#define CHECK_STRING do {                                \
  |  | 1038|  2.12k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 10, False: 2.11k]
  |  |  ------------------
  |  | 1039|     10|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  2.11k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 2.11k]
  |  |  ------------------
  ------------------
 1384|  2.11k|    GET_TOKEN;
  ------------------
  |  | 1018|  2.11k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  2.11k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  2.11k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 2.11k]
  |  |  ------------------
  ------------------
 1385|       |
 1386|       |    /* Empty bytestring? */
 1387|  2.11k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1387:8): [True: 756, False: 1.36k]
  ------------------
 1388|    756|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    756|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1389|    756|        dst->length = 0;
 1390|  1.36k|    } else {
 1391|  1.36k|        size_t flen = 0;
 1392|  1.36k|        unsigned char* unB64 =
 1393|  1.36k|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1394|  1.36k|        if(unB64 == 0)
  ------------------
  |  Branch (1394:12): [True: 57, False: 1.30k]
  ------------------
 1395|     57|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     57|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1396|  1.30k|        dst->data = (u8*)unB64;
 1397|  1.30k|        dst->length = flen;
 1398|  1.30k|    }
 1399|       |
 1400|  2.05k|    ctx->index++;
 1401|  2.05k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.05k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1402|  2.11k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1459|  43.5k|DECODE_JSON(NodeId) {
 1460|  43.5k|    UA_NodeId *dst = (UA_NodeId*)p;
 1461|  43.5k|    UA_String str;
 1462|  43.5k|    UA_String_init(&str);
 1463|  43.5k|    status res = String_decodeJson(ctx, &str, NULL);
 1464|  43.5k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  43.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1464:8): [True: 43.5k, False: 59]
  ------------------
 1465|  43.5k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1466|  43.5k|    UA_String_clear(&str);
 1467|  43.5k|    return res;
 1468|  43.5k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1470|  3.62k|DECODE_JSON(ExpandedNodeId) {
 1471|  3.62k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1472|  3.62k|    UA_String str;
 1473|  3.62k|    UA_String_init(&str);
 1474|  3.62k|    status res = String_decodeJson(ctx, &str, NULL);
 1475|  3.62k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.62k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1475:8): [True: 3.60k, False: 19]
  ------------------
 1476|  3.60k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1477|  3.60k|                                        ctx->serverUrisSize, ctx->serverUris);
 1478|  3.62k|    UA_String_clear(&str);
 1479|  3.62k|    return res;
 1480|  3.62k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1616|    251|DECODE_JSON(StatusCode) {
 1617|    251|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1618|    251|    CHECK_OBJECT;
  ------------------
  |  | 1042|    251|#define CHECK_OBJECT do {                                \
  |  | 1043|    251|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 10, False: 241]
  |  |  ------------------
  |  | 1044|     10|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|    241|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 241]
  |  |  ------------------
  ------------------
 1619|    241|    DecodeEntry entries[2] = {
 1620|    241|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|    241|#define UA_TYPES_UINT32 6
  ------------------
 1621|    241|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1622|    241|    };
 1623|    241|    return decodeFields(ctx, entries, 2);
 1624|    251|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1414|  57.7k|DECODE_JSON(QualifiedName) {
 1415|  57.7k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1416|  57.7k|    UA_String str;
 1417|  57.7k|    UA_String_init(&str);
 1418|  57.7k|    status res = String_decodeJson(ctx, &str, NULL);
 1419|  57.7k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  57.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1419:8): [True: 57.6k, False: 13]
  ------------------
 1420|  57.6k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1421|  57.7k|    UA_String_clear(&str);
 1422|  57.7k|    return res;
 1423|  57.7k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1404|    729|DECODE_JSON(LocalizedText) {
 1405|    729|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1406|    729|    CHECK_OBJECT;
  ------------------
  |  | 1042|    729|#define CHECK_OBJECT do {                                \
  |  | 1043|    729|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 14, False: 715]
  |  |  ------------------
  |  | 1044|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|    715|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 715]
  |  |  ------------------
  ------------------
 1407|    715|    DecodeEntry entries[2] = {
 1408|    715|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|    715|#define UA_TYPES_STRING 11
  ------------------
 1409|    715|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|    715|#define UA_TYPES_STRING 11
  ------------------
 1410|    715|    };
 1411|    715|    return decodeFields(ctx, entries, 2);
 1412|    729|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2017|  42.5k|DECODE_JSON(ExtensionObject) {
 2018|  42.5k|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2019|  42.5k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1047|  42.5k|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|  42.5k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 0, False: 42.5k]
  |  |  ------------------
  |  | 1049|      0|        ctx->index++;                                \
  |  | 1050|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|  42.5k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 42.5k]
  |  |  ------------------
  ------------------
 2020|  42.5k|    CHECK_OBJECT;
  ------------------
  |  | 1042|  42.5k|#define CHECK_OBJECT do {                                \
  |  | 1043|  42.5k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 46, False: 42.4k]
  |  |  ------------------
  |  | 1044|     46|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     46|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  42.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 42.4k]
  |  |  ------------------
  ------------------
 2021|       |
 2022|       |    /* Empty object -> Null ExtensionObject */
 2023|  42.4k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2023:8): [True: 2.49k, False: 39.9k]
  ------------------
 2024|  2.49k|        ctx->index++; /* Skip the empty ExtensionObject */
 2025|  2.49k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.49k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2026|  2.49k|    }
 2027|       |
 2028|       |    /* Store the index where the ExtensionObject begins */
 2029|  39.9k|    size_t beginIndex = ctx->index;
 2030|       |
 2031|       |    /* Search for non-JSON encoding */
 2032|  39.9k|    UA_UInt64 encoding = 0;
 2033|  39.9k|    size_t encIndex = 0;
 2034|  39.9k|    status ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2035|  39.9k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  39.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2035:8): [True: 8.13k, False: 31.8k]
  ------------------
 2036|  8.13k|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2037|  8.13k|        size_t len = parseUInt64(extObjEncoding,
 2038|  8.13k|                                 getTokenLength(&ctx->tokens[encIndex]),
 2039|  8.13k|                                 &encoding);
 2040|  8.13k|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2040:12): [True: 3, False: 8.13k]
  |  Branch (2040:24): [True: 127, False: 8.00k]
  ------------------
 2041|    130|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    130|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2042|  8.13k|    }
 2043|       |
 2044|       |    /* Get the type NodeId index */
 2045|  39.8k|    size_t typeIdIndex = 0;
 2046|  39.8k|    ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2047|  39.8k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  39.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2047:8): [True: 55, False: 39.8k]
  ------------------
 2048|     55|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     55|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2049|       |
 2050|       |    /* Decode the type NodeId */
 2051|  39.8k|    UA_NodeId typeId;
 2052|  39.8k|    UA_NodeId_init(&typeId);
 2053|  39.8k|    ctx->index = (UA_UInt16)typeIdIndex;
 2054|  39.8k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|  39.8k|#define UA_TYPES_NODEID 16
  ------------------
 2055|  39.8k|    ctx->index = beginIndex;
 2056|  39.8k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  39.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2056:8): [True: 163, False: 39.6k]
  ------------------
 2057|    163|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2058|    163|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    163|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2059|    163|    }
 2060|       |
 2061|       |    /* Lookup the type */
 2062|  39.6k|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2063|       |
 2064|       |    /* Unknown body type */
 2065|  39.6k|    if(!type) {
  ------------------
  |  Branch (2065:8): [True: 36.1k, False: 3.46k]
  ------------------
 2066|       |        /* FIXME: We need UA_EXTENSIONOBJECT_ENCODED_JSON when we parse an
 2067|       |         * unknown type in JSON. But it is not defined in the standard. */
 2068|  36.1k|        dst->encoding = (encoding != 2) ?
  ------------------
  |  Branch (2068:25): [True: 35.9k, False: 270]
  ------------------
 2069|  35.9k|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2070|  36.1k|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2071|  36.1k|        dst->content.encoded.typeId = typeId;
 2072|       |
 2073|       |        /* Get the body field index */
 2074|  36.1k|        size_t bodyIndex = 0;
 2075|  36.1k|        ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex);
 2076|  36.1k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  36.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2076:12): [True: 33.2k, False: 2.87k]
  ------------------
 2077|       |            /* Only JSON structures can be encoded in-situ */
 2078|  33.2k|            if(encoding != 0)
  ------------------
  |  Branch (2078:16): [True: 6, False: 33.2k]
  ------------------
 2079|      6|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2080|       |
 2081|       |            /* Extract the entire ExtensionObject object as the body */
 2082|  33.2k|            size_t parentIndex = ctx->index;
 2083|  33.2k|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2084|  33.2k|            if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  33.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2084:16): [True: 3, False: 33.2k]
  ------------------
 2085|      3|                return ret;
 2086|       |
 2087|       |            /* Remove the UaEncoding and UaTypeId field from the encoding.
 2088|       |             * Remove the later field first. */
 2089|  33.2k|            if(encIndex != 0 && encIndex > typeIdIndex)
  ------------------
  |  Branch (2089:16): [True: 6.83k, False: 26.4k]
  |  Branch (2089:33): [True: 6.37k, False: 455]
  ------------------
 2090|  6.37k|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2091|  6.37k|                                        parentIndex, encIndex);
 2092|       |
 2093|  33.2k|            removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2094|  33.2k|                                    parentIndex, typeIdIndex);
 2095|       |
 2096|  33.2k|            if(encIndex != 0 && encIndex < typeIdIndex)
  ------------------
  |  Branch (2096:16): [True: 6.83k, False: 26.4k]
  |  Branch (2096:33): [True: 455, False: 6.37k]
  ------------------
 2097|    455|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2098|    455|                                        parentIndex, encIndex);
 2099|       |
 2100|  33.2k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  33.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2101|  33.2k|        }
 2102|       |
 2103|  2.87k|        ctx->index = bodyIndex;
 2104|  2.87k|        if(encoding != 0) {
  ------------------
  |  Branch (2104:12): [True: 520, False: 2.35k]
  ------------------
 2105|       |            /* Decode the body as a ByteString */
 2106|    520|            ret = ByteString_decodeJson(ctx, &dst->content.encoded.body, NULL);
 2107|  2.35k|        } else {
 2108|       |            /* Use the JSON encoding directly */
 2109|  2.35k|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2110|  2.35k|        }
 2111|  2.87k|        ctx->index = beginIndex;
 2112|  2.87k|        skipObject(ctx);
 2113|  2.87k|        return ret;
 2114|  36.1k|    }
 2115|       |
 2116|       |    /* No need to keep the TypeId */
 2117|  3.46k|    UA_NodeId_clear(&typeId);
 2118|       |
 2119|       |    /* Disallow directly nested ExtensionObjects */
 2120|  3.46k|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  3.46k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2120:8): [True: 2, False: 3.46k]
  ------------------
 2121|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2122|       |
 2123|       |    /* Allocate memory for the decoded data */
 2124|  3.46k|    dst->content.decoded.data = UA_new(type);
 2125|  3.46k|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2125:8): [True: 1, False: 3.46k]
  ------------------
 2126|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2127|  3.46k|    dst->content.decoded.type = type;
 2128|  3.46k|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2129|       |
 2130|       |    /* Get the body field index */
 2131|  3.46k|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2132|  3.46k|    size_t bodyIndex = ctx->index;
 2133|  3.46k|    ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex); /* Can fail */
 2134|  3.46k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  3.46k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2134:8): [True: 3.28k, False: 182]
  ------------------
 2135|  3.28k|        ctx->index = bodyIndex;
 2136|  3.28k|        ret = decodeType(ctx, dst->content.decoded.data, type);
 2137|  3.28k|        ctx->index = beginIndex;
 2138|  3.28k|        skipObject(ctx);
 2139|  3.28k|        return ret;
 2140|  3.28k|    }
 2141|       |
 2142|    182|    return decodeType(ctx, dst->content.decoded.data, type);
 2143|  3.46k|}
ua_types_encoding_json.c:tokenToByteString:
 1950|  35.6k|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 1951|  35.6k|    GET_TOKEN;
  ------------------
  |  | 1018|  35.6k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  35.6k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  35.6k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 35.6k]
  |  |  ------------------
  ------------------
 1952|  35.6k|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 1953|  35.6k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  35.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1953:8): [True: 3, False: 35.6k]
  ------------------
 1954|      3|        return res;
 1955|  35.6k|    memcpy(p->data, tokenData, tokenSize);
 1956|  35.6k|    skipObject(ctx);
 1957|  35.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  35.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1958|  35.6k|}
ua_types_encoding_json.c:removeFieldFromEncoding:
 1966|  40.1k|                        size_t parentIndex, size_t tokenIndex) {
 1967|       |    /* Which part of the encoding to cut out */
 1968|  40.1k|    unsigned objStart = ctx->tokens[parentIndex].start;
 1969|  40.1k|    unsigned objEnd = ctx->tokens[parentIndex].end;
 1970|  40.1k|    unsigned start = ctx->tokens[tokenIndex-1].start;
 1971|  40.1k|    unsigned end = ctx->tokens[tokenIndex].end + 1; /* One char after */
 1972|       |
 1973|  40.1k|    UA_Boolean haveBefore = (parentIndex < tokenIndex - 2);
 1974|  40.1k|    if(haveBefore) {
  ------------------
  |  Branch (1974:8): [True: 30.9k, False: 9.15k]
  ------------------
 1975|       |        /* Find where the previous token ended. This also removes the comma
 1976|       |         * between the previous and the current element. */
 1977|   341k|        for(size_t i = parentIndex + 2; i < tokenIndex - 1; i++) {
  ------------------
  |  Branch (1977:41): [True: 310k, False: 30.9k]
  ------------------
 1978|   310k|            if(ctx->tokens[i].end + 1 > start)
  ------------------
  |  Branch (1978:16): [True: 0, False: 310k]
  ------------------
 1979|      0|                start = ctx->tokens[i].end + 1;
 1980|   310k|        }
 1981|  30.9k|        if(ctx->json5[start] == '"' || ctx->json5[start] == '\'')
  ------------------
  |  Branch (1981:12): [True: 0, False: 30.9k]
  |  Branch (1981:40): [True: 0, False: 30.9k]
  ------------------
 1982|      0|            start++;
 1983|  30.9k|    } else {
 1984|       |        /* No previous element. Remove the quoation marks of the field name. */
 1985|  9.15k|        start = ctx->tokens[tokenIndex-1].start;
 1986|  9.15k|        if(start > 0 && (ctx->json5[start-1] == '"' || ctx->json5[start-1] == '\''))
  ------------------
  |  Branch (1986:12): [True: 9.15k, False: 0]
  |  Branch (1986:26): [True: 0, False: 9.15k]
  |  Branch (1986:56): [True: 197, False: 8.95k]
  ------------------
 1987|    197|            start--;
 1988|       |
 1989|       |        /* Find the beginning of the next field in the object.
 1990|       |         * This removes the comma after the current field. */
 1991|  9.15k|        size_t oldIndex = ctx->index;
 1992|  9.15k|        ctx->index = tokenIndex;
 1993|  9.15k|        skipObject(ctx);
 1994|  9.15k|        if(ctx->index < ctx->tokensSize && ctx->tokens[ctx->index].start < objEnd) {
  ------------------
  |  Branch (1994:12): [True: 9.15k, False: 0]
  |  Branch (1994:44): [True: 2.69k, False: 6.45k]
  ------------------
 1995|  2.69k|            end = ctx->tokens[ctx->index].start;
 1996|  2.69k|            if(ctx->json5[end-1] == '"' || ctx->json5[end-1] == '\'')
  ------------------
  |  Branch (1996:16): [True: 1.86k, False: 829]
  |  Branch (1996:44): [True: 194, False: 635]
  ------------------
 1997|  2.06k|                end--;
 1998|  2.69k|        }
 1999|  9.15k|        ctx->index = oldIndex;
 2000|  9.15k|    }
 2001|       |
 2002|  40.1k|    UA_assert(end > start);
  ------------------
  |  |  395|  40.1k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2002:5): [True: 40.1k, False: 0]
  ------------------
 2003|  40.1k|    UA_assert(start > objStart);
  ------------------
  |  |  395|  40.1k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2003:5): [True: 40.1k, False: 0]
  ------------------
 2004|       |
 2005|       |    /* Move the offset from ctx->json5 to encoding->data */
 2006|  40.1k|    start -= objStart;
 2007|  40.1k|    end -= objStart;
 2008|       |
 2009|  40.1k|    UA_assert(end <= encoding->length);
  ------------------
  |  |  395|  40.1k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2009:5): [True: 40.1k, False: 0]
  ------------------
 2010|       |
 2011|       |    /* Cut out the field we want to remove */
 2012|  40.1k|    size_t after_len = encoding->length - end;
 2013|  40.1k|    memmove(encoding->data + start, encoding->data + end, after_len);
 2014|  40.1k|    encoding->length -= (end - start);
 2015|  40.1k|}
ua_types_encoding_json.c:DataValue_decodeJson:
 1910|  70.0k|DECODE_JSON(DataValue) {
 1911|  70.0k|    UA_DataValue *dst = (UA_DataValue*)p;
 1912|  70.0k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1047|  70.0k|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|  70.0k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 10.0k, False: 60.0k]
  |  |  ------------------
  |  | 1049|  10.0k|        ctx->index++;                                \
  |  | 1050|  10.0k|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|  10.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|  60.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 60.0k]
  |  |  ------------------
  ------------------
 1913|  60.0k|    CHECK_OBJECT;
  ------------------
  |  | 1042|  60.0k|#define CHECK_OBJECT do {                                \
  |  | 1043|  60.0k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 57, False: 59.9k]
  |  |  ------------------
  |  | 1044|     57|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     57|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  59.9k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 59.9k]
  |  |  ------------------
  ------------------
 1914|       |
 1915|       |    /* Decode the Variant in-situ */
 1916|  59.9k|    size_t beginIndex = ctx->index;
 1917|  59.9k|    status ret = decodeJSONVariant(ctx, &dst->value);
 1918|  59.9k|    ctx->index = beginIndex;
 1919|  59.9k|    dst->hasValue = (dst->value.type != NULL);
 1920|  59.9k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  59.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1920:8): [True: 2.95k, False: 56.9k]
  ------------------
 1921|  2.95k|        return ret;
 1922|       |
 1923|       |    /* Decode the other members (skip the Variant members) */
 1924|  56.9k|    DecodeEntry entries[8] = {
 1925|  56.9k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 1926|  56.9k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 1927|  56.9k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 1928|  56.9k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|  56.9k|#define UA_TYPES_STATUSCODE 18
  ------------------
 1929|  56.9k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 1930|  56.9k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  56.9k|#define UA_TYPES_DATETIME 12
  ------------------
 1931|  56.9k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 1932|  56.9k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  56.9k|#define UA_TYPES_UINT16 4
  ------------------
 1933|  56.9k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 1934|  56.9k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  56.9k|#define UA_TYPES_DATETIME 12
  ------------------
 1935|  56.9k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 1936|  56.9k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|  56.9k|#define UA_TYPES_UINT16 4
  ------------------
 1937|  56.9k|    };
 1938|       |
 1939|  56.9k|    ret = decodeFields(ctx, entries, 8);
 1940|  56.9k|    dst->hasStatus = entries[3].found;
 1941|  56.9k|    dst->hasSourceTimestamp = entries[4].found;
 1942|  56.9k|    dst->hasSourcePicoseconds = entries[5].found;
 1943|  56.9k|    dst->hasServerTimestamp = entries[6].found;
 1944|  56.9k|    dst->hasServerPicoseconds = entries[7].found;
 1945|  56.9k|    return ret;
 1946|  59.9k|}
ua_types_encoding_json.c:decodeJSONVariant:
 1780|  66.2k|decodeJSONVariant(ParseCtx *ctx, UA_Variant *dst) {
 1781|       |    /* Empty variant == null */
 1782|  66.2k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (1782:8): [True: 2.68k, False: 63.5k]
  ------------------
 1783|  2.68k|        ctx->index++;
 1784|  2.68k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1785|  2.68k|    }
 1786|       |
 1787|       |    /* Search the value field */
 1788|  63.5k|    size_t valueIndex = 0;
 1789|  63.5k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 1790|       |
 1791|       |    /* Search for the dimensions field */
 1792|  63.5k|    size_t dimIndex = 0;
 1793|  63.5k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 1794|       |
 1795|       |    /* Parse the type kind */
 1796|  63.5k|    size_t typeIndex = 0;
 1797|  63.5k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 1798|  63.5k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1798:8): [True: 72, False: 63.4k]
  |  Branch (1798:26): [True: 4, False: 63.4k]
  ------------------
 1799|     76|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     76|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1800|  63.4k|    UA_UInt64 typeKind = 0;
 1801|  63.4k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 1802|  63.4k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 1803|  63.4k|    if(len == 0)
  ------------------
  |  Branch (1803:8): [True: 7, False: 63.4k]
  ------------------
 1804|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1805|       |
 1806|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 1807|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 1808|  63.4k|    typeKind--;
 1809|  63.4k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (1809:8): [True: 118, False: 63.3k]
  ------------------
 1810|    118|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    118|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1811|  63.3k|    const UA_DataType *type = &UA_TYPES[typeKind];
 1812|       |
 1813|       |    /* Value is an array? */
 1814|  63.3k|    UA_Boolean isArray =
 1815|  63.3k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (1815:10): [True: 33.7k, False: 29.5k]
  |  Branch (1815:28): [True: 5.97k, False: 27.7k]
  ------------------
 1816|       |
 1817|       |    /* Adjust the depth and set the value index as current */
 1818|  63.3k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  63.3k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1818:8): [True: 0, False: 63.3k]
  ------------------
 1819|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1820|  63.3k|    size_t beginIndex = ctx->index;
 1821|  63.3k|    ctx->index = valueIndex;
 1822|  63.3k|    ctx->depth++;
 1823|       |
 1824|       |    /* Decode the value */
 1825|  63.3k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  63.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1826|  63.3k|    if(!isArray) {
  ------------------
  |  Branch (1826:8): [True: 57.3k, False: 5.97k]
  ------------------
 1827|       |        /* Scalar with dimensions -> error */
 1828|  57.3k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1828:12): [True: 18, False: 57.3k]
  ------------------
 1829|     18|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1830|     18|            goto out;
 1831|     18|        }
 1832|       |
 1833|       |        /* A variant cannot contain a variant. But it can contain an array of
 1834|       |         * variants */
 1835|  57.3k|        if(type->typeKind == UA_DATATYPEKIND_VARIANT) {
  ------------------
  |  Branch (1835:12): [True: 1, False: 57.3k]
  ------------------
 1836|      1|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1837|      1|            goto out;
 1838|      1|        }
 1839|       |
 1840|       |        /* Decode a value wrapped in an ExtensionObject */
 1841|  57.3k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (1841:12): [True: 27.7k, False: 29.5k]
  |  Branch (1841:30): [True: 574, False: 27.2k]
  ------------------
 1842|    574|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 1843|    574|            goto out;
 1844|    574|        }
 1845|       |
 1846|       |        /* Allocate memory for the value */
 1847|  56.7k|        dst->data = UA_new(type);
 1848|  56.7k|        if(!dst->data) {
  ------------------
  |  Branch (1848:12): [True: 2, False: 56.7k]
  ------------------
 1849|      2|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      2|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1850|      2|            goto out;
 1851|      2|        }
 1852|  56.7k|        dst->type = type;
 1853|       |
 1854|       |        /* Decode the value */
 1855|  56.7k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (1855:12): [True: 27.2k, False: 29.5k]
  |  Branch (1855:30): [True: 27.0k, False: 213]
  ------------------
 1856|  27.0k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 1857|  56.7k|    } else {
 1858|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 1859|       |         * members must all have the same type. */
 1860|  5.97k|        const UA_DataType *unwrapType = NULL;
 1861|  5.97k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  5.97k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1861:12): [True: 4.20k, False: 1.76k]
  ------------------
 1862|  4.20k|            unwrapType = getArrayUnwrapType(ctx);
 1863|  5.97k|        if(unwrapType) {
  ------------------
  |  Branch (1863:12): [True: 84, False: 5.89k]
  ------------------
 1864|     84|            dst->type = unwrapType;
 1865|     84|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 1866|  5.89k|        } else {
 1867|  5.89k|            dst->type = type;
 1868|  5.89k|            res = Array_decodeJson(ctx, &dst->data, type);
 1869|  5.89k|        }
 1870|       |
 1871|       |        /* Decode array dimensions */
 1872|  5.97k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1872:12): [True: 1.11k, False: 4.86k]
  ------------------
 1873|  1.11k|            ctx->index = dimIndex;
 1874|  1.11k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 1875|  1.11k|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  1.11k|#define UA_TYPES_UINT32 6
  ------------------
 1876|       |
 1877|       |            /* Help clang-analyzer */
 1878|  1.11k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  395|  1.11k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1878:13): [True: 272, False: 841]
  |  Branch (1878:13): [True: 841, False: 0]
  ------------------
 1879|       |
 1880|       |            /* Validate the dimensions */
 1881|  1.11k|            size_t total = 1;
 1882|   946k|            for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1882:31): [True: 945k, False: 1.11k]
  ------------------
 1883|   945k|                total *= dst->arrayDimensions[i];
 1884|  1.11k|            if(total != dst->arrayLength)
  ------------------
  |  Branch (1884:16): [True: 168, False: 945]
  ------------------
 1885|    168|                res |= UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    168|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1886|       |
 1887|       |            /* Only keep >= 2 dimensions */
 1888|  1.11k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (1888:16): [True: 366, False: 747]
  ------------------
 1889|    366|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|    366|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1890|    366|                dst->arrayDimensions = NULL;
 1891|    366|                dst->arrayDimensionsSize = 0;
 1892|    366|            }
 1893|  1.11k|        }
 1894|  5.97k|    }
 1895|       |
 1896|  63.3k| out:
 1897|  63.3k|    ctx->index = beginIndex;
 1898|  63.3k|    skipObject(ctx);
 1899|  63.3k|    ctx->depth--;
 1900|  63.3k|    return res;
 1901|  63.3k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2147|    574|                                        const UA_DataType *type) {
 2148|    574|    (void) type;
 2149|    574|    UA_Variant *dst = (UA_Variant*)p;
 2150|       |
 2151|       |    /* ExtensionObject with null body */
 2152|    574|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2152:8): [True: 194, False: 380]
  ------------------
 2153|    194|        dst->data = UA_ExtensionObject_new();
 2154|    194|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    194|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2155|    194|        ctx->index++;
 2156|    194|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    194|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2157|    194|    }
 2158|       |
 2159|       |    /* Decode the ExtensionObject */
 2160|    380|    UA_ExtensionObject eo;
 2161|    380|    UA_ExtensionObject_init(&eo);
 2162|    380|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2163|    380|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    380|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2163:8): [True: 223, False: 157]
  ------------------
 2164|    223|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2165|    223|        return ret;
 2166|    223|    }
 2167|       |
 2168|       |    /* The content is still encoded, cannot unwrap */
 2169|    157|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2169:8): [True: 144, False: 13]
  ------------------
 2170|    144|        goto use_eo;
 2171|       |
 2172|       |    /* The content is a builtin type that could have been directly encoded in
 2173|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2174|       |     * means for us, that somebody made an extra effort to explicitly get an
 2175|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2176|       |     * the same JSON again when encoding again. */
 2177|     13|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2177:8): [True: 11, False: 2]
  ------------------
 2178|     11|        goto use_eo;
 2179|       |
 2180|       |    /* Unwrap the ExtensionObject */
 2181|      2|    dst->data = eo.content.decoded.data;
 2182|      2|    dst->type = eo.content.decoded.type;
 2183|      2|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2184|       |
 2185|    155| use_eo:
 2186|       |    /* Don't unwrap */
 2187|    155|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|    155|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2188|    155|    if(!dst->data) {
  ------------------
  |  Branch (2188:8): [True: 1, False: 154]
  ------------------
 2189|      1|        UA_ExtensionObject_clear(&eo);
 2190|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2191|      1|    }
 2192|    154|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    154|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2193|    154|    *(UA_ExtensionObject*)dst->data = eo;
 2194|    154|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    154|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2195|    155|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1661|  4.20k|getArrayUnwrapType(ParseCtx *ctx) {
 1662|  4.20k|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  395|  4.20k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1662:5): [True: 4.20k, False: 0]
  ------------------
 1663|       |
 1664|       |    /* Return early for empty arrays */
 1665|  4.20k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1666|  4.20k|    if(length == 0)
  ------------------
  |  Branch (1666:8): [True: 725, False: 3.48k]
  ------------------
 1667|    725|        return NULL;
 1668|       |
 1669|       |    /* Save the original index and go to the first array member */
 1670|  3.48k|    size_t oldIndex = ctx->index;
 1671|  3.48k|    ctx->index++;
 1672|       |
 1673|       |    /* Lookup the type for the first array member */
 1674|  3.48k|    UA_NodeId typeId;
 1675|  3.48k|    UA_NodeId_init(&typeId);
 1676|  3.48k|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1677|  3.48k|    if(!typeOfBody) {
  ------------------
  |  Branch (1677:8): [True: 1.66k, False: 1.81k]
  ------------------
 1678|  1.66k|        ctx->index = oldIndex; /* Restore the index */
 1679|  1.66k|        return NULL;
 1680|  1.66k|    }
 1681|       |
 1682|       |    /* Get the TypeId encoding for faster comparison below.
 1683|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 1684|  1.81k|    size_t typeIdIndex = 0;
 1685|  1.81k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1686|  1.81k|    (void)ret;
 1687|  1.81k|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  395|  1.81k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1687:5): [True: 1.81k, False: 0]
  ------------------
 1688|  1.81k|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 1689|  1.81k|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 1690|       |
 1691|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 1692|       |     * the first member. We still haven't checked the encoding type. */
 1693|  3.49k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1693:23): [True: 3.40k, False: 84]
  ------------------
 1694|       |        /* Array element must be an object */
 1695|  3.40k|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (1695:12): [True: 13, False: 3.39k]
  ------------------
 1696|     13|            ctx->index = oldIndex; /* Restore the index */
 1697|     13|            return NULL;
 1698|     13|        }
 1699|       |
 1700|       |        /* Check for non-JSON encoding */
 1701|  3.39k|        size_t encIndex = 0;
 1702|  3.39k|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 1703|  3.39k|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  3.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1703:12): [True: 371, False: 3.02k]
  ------------------
 1704|    371|            ctx->index = oldIndex; /* Restore the index */
 1705|    371|            return NULL;
 1706|    371|        }
 1707|       |
 1708|       |        /* Get the type NodeId index */
 1709|  3.02k|        size_t memberTypeIdIndex = 0;
 1710|  3.02k|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 1711|  3.02k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  3.02k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1711:12): [True: 260, False: 2.76k]
  ------------------
 1712|    260|            ctx->index = oldIndex; /* Restore the index */
 1713|    260|            return NULL;
 1714|    260|        }
 1715|       |
 1716|       |        /* Is it the same type? Compare raw NodeId string */
 1717|  2.76k|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 1718|  2.76k|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 1719|  2.76k|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (1719:12): [True: 660, False: 2.10k]
  ------------------
 1720|  2.10k|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (1720:12): [True: 427, False: 1.67k]
  ------------------
 1721|  1.08k|            ctx->index = oldIndex; /* Restore the index */
 1722|  1.08k|            return NULL;
 1723|  1.08k|        }
 1724|       |
 1725|       |        /* Skip to the next array member */
 1726|  1.67k|        skipObject(ctx);
 1727|  1.67k|    }
 1728|       |
 1729|     84|    ctx->index = oldIndex; /* Restore the index */
 1730|     84|    return typeOfBody;
 1731|  1.81k|}
ua_types_encoding_json.c:getExtensionObjectType:
 1629|  3.48k|getExtensionObjectType(ParseCtx *ctx) {
 1630|  3.48k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1630:8): [True: 296, False: 3.18k]
  ------------------
 1631|    296|        return NULL;
 1632|       |
 1633|       |    /* Get the type NodeId index */
 1634|  3.18k|    size_t typeIdIndex = 0;
 1635|  3.18k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1636|  3.18k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.18k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1636:8): [True: 717, False: 2.47k]
  ------------------
 1637|    717|        return NULL;
 1638|       |
 1639|  2.47k|    size_t oldIndex = ctx->index;
 1640|  2.47k|    ctx->index = (UA_UInt16)typeIdIndex;
 1641|       |
 1642|       |    /* Decode the type NodeId */
 1643|  2.47k|    UA_NodeId typeId;
 1644|  2.47k|    UA_NodeId_init(&typeId);
 1645|  2.47k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|  2.47k|#define UA_TYPES_NODEID 16
  ------------------
 1646|  2.47k|    ctx->index = oldIndex;
 1647|  2.47k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  2.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1647:8): [True: 117, False: 2.35k]
  ------------------
 1648|    117|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1649|    117|        return NULL;
 1650|    117|    }
 1651|       |
 1652|       |    /* Lookup an return */
 1653|  2.35k|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1654|  2.35k|    UA_NodeId_clear(&typeId);
 1655|  2.35k|    return type;
 1656|  2.47k|}
ua_types_encoding_json.c:Array_decodeJsonUnwrapExtensionObject:
 1735|     84|                                      const UA_DataType *type) {
 1736|     84|    size_t *size_ptr = (size_t*) dst - 1; /* Save the length pointer of the array */
 1737|     84|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1738|       |
 1739|       |    /* Known from the previous unwrapping-check */
 1740|     84|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  395|     84|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1740:5): [True: 84, False: 0]
  ------------------
 1741|     84|    UA_assert(length > 0);
  ------------------
  |  |  395|     84|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1741:5): [True: 84, False: 0]
  ------------------
 1742|       |
 1743|     84|    ctx->index++; /* Go to first array member */
 1744|       |
 1745|       |    /* Allocate memory */
 1746|     84|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|     84|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1747|     84|    if(*dst == NULL)
  ------------------
  |  Branch (1747:8): [True: 1, False: 83]
  ------------------
 1748|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1749|       |
 1750|       |    /* Decode array members */
 1751|     83|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     83|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1752|     83|    uintptr_t ptr = (uintptr_t)*dst;
 1753|    191|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1753:23): [True: 152, False: 39]
  ------------------
 1754|    152|        UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  395|    152|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1754:9): [True: 152, False: 0]
  ------------------
 1755|    152|        if(type->typeKind == UA_DATATYPEKIND_STRUCTURE) {
  ------------------
  |  Branch (1755:12): [True: 12, False: 140]
  ------------------
 1756|       |            /* Decode structure in-situ in the ExtensionObject */
 1757|     12|            ret = decodeJsonStructure(ctx, (void*)ptr, type);
 1758|    140|        } else {
 1759|       |            /* Get the body field and decode it */
 1760|    140|            DecodeEntry entries[3] = {
 1761|    140|                {UA_JSONKEY_TYPEID, NULL, NULL, false, NULL},
 1762|    140|                {UA_JSONKEY_BODY, (void*)ptr, NULL, false, type},
 1763|    140|                {UA_JSONKEY_ENCODING, NULL, NULL, false, NULL}
 1764|    140|            };
 1765|    140|            ret = decodeFields(ctx, entries, 3);
 1766|    140|        }
 1767|    152|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    152|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1767:12): [True: 44, False: 108]
  ------------------
 1768|     44|            UA_Array_delete(*dst, i+1, type);
 1769|     44|            *dst = NULL;
 1770|     44|            return ret;
 1771|     44|        }
 1772|    108|        ptr += type->memSize;
 1773|    108|    }
 1774|       |
 1775|     39|    *size_ptr = length; /* All good, set the size */
 1776|     39|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     39|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1777|     83|}
ua_types_encoding_json.c:Array_decodeJson:
 2329|  7.00k|Array_decodeJson(ParseCtx *ctx, void **dst, const UA_DataType *type) {
 2330|       |    /* Save the length of the array */
 2331|  7.00k|    size_t *size_ptr = (size_t*) dst - 1;
 2332|       |
 2333|  7.00k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2333:8): [True: 14, False: 6.99k]
  ------------------
 2334|     14|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2335|       |
 2336|  6.99k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2337|       |
 2338|  6.99k|    ctx->index++; /* Go to first array member or to the first element after
 2339|       |                   * the array (if empty) */
 2340|       |
 2341|       |    /* Return early for empty arrays */
 2342|  6.99k|    if(length == 0) {
  ------------------
  |  Branch (2342:8): [True: 1.34k, False: 5.65k]
  ------------------
 2343|  1.34k|        *size_ptr = length;
 2344|  1.34k|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.34k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2345|  1.34k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.34k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2346|  1.34k|    }
 2347|       |
 2348|       |    /* Allocate memory */
 2349|  5.65k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  5.65k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2350|  5.65k|    if(*dst == NULL)
  ------------------
  |  Branch (2350:8): [True: 4, False: 5.64k]
  ------------------
 2351|      4|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      4|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2352|       |
 2353|       |    /* Decode array members */
 2354|  5.64k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2355|  5.64k|    uintptr_t ptr = (uintptr_t)*dst;
 2356|  4.46M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2356:23): [True: 4.46M, False: 4.69k]
  ------------------
 2357|  4.46M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2357:12): [True: 918, False: 4.45M]
  ------------------
 2358|    918|            ptr += type->memSize;
 2359|    918|            ctx->index++;
 2360|    918|            continue;
 2361|    918|        }
 2362|       |
 2363|  4.45M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2364|  4.45M|        ptr += type->memSize;
 2365|  4.45M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  4.45M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2365:12): [True: 952, False: 4.45M]
  ------------------
 2366|    952|            UA_Array_delete(*dst, i+1, type);
 2367|    952|            *dst = NULL;
 2368|    952|            return ret;
 2369|    952|        }
 2370|  4.45M|    }
 2371|       |
 2372|  4.69k|    *size_ptr = length; /* All good, set the size */
 2373|  4.69k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.69k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2374|  5.64k|}
ua_types_encoding_json.c:Variant_decodeJson:
 1903|  6.34k|DECODE_JSON(Variant) {
 1904|  6.34k|    UA_Variant *dst = (UA_Variant*)p;
 1905|  6.34k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1047|  6.34k|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|  6.34k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 72, False: 6.27k]
  |  |  ------------------
  |  | 1049|     72|        ctx->index++;                                \
  |  | 1050|     72|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|     72|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|  6.27k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 6.27k]
  |  |  ------------------
  ------------------
 1906|  6.27k|    CHECK_OBJECT;
  ------------------
  |  | 1042|  6.27k|#define CHECK_OBJECT do {                                \
  |  | 1043|  6.27k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 12, False: 6.26k]
  |  |  ------------------
  |  | 1044|     12|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  6.26k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 6.26k]
  |  |  ------------------
  ------------------
 1907|  6.26k|    return decodeJSONVariant(ctx, dst);
 1908|  6.27k|}
ua_types_encoding_json.c:decodeJsonStructure:
 2377|    309|decodeJsonStructure(ParseCtx *ctx, void *dst, const UA_DataType *type) {
 2378|       |    /* Check the recursion limit */
 2379|    309|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|    309|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2379:8): [True: 0, False: 309]
  ------------------
 2380|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2381|    309|    ctx->depth++;
 2382|       |
 2383|    309|    uintptr_t ptr = (uintptr_t)dst;
 2384|    309|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    309|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2385|    309|    u8 membersSize = type->membersSize;
 2386|    309|    UA_STACKARRAY(DecodeEntry, entries, membersSize);
  ------------------
  |  |  371|    309|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 2387|  1.74k|    for(size_t i = 0; i < membersSize; ++i) {
  ------------------
  |  Branch (2387:23): [True: 1.43k, False: 309]
  ------------------
 2388|  1.43k|        const UA_DataTypeMember *m = &type->members[i];
 2389|  1.43k|        const UA_DataType *mt = m->memberType;
 2390|  1.43k|        entries[i].type = mt;
 2391|  1.43k|        entries[i].fieldName = m->memberName;
 2392|  1.43k|        entries[i].found = false;
 2393|  1.43k|        if(!m->isArray) {
  ------------------
  |  Branch (2393:12): [True: 1.14k, False: 297]
  ------------------
 2394|  1.14k|            ptr += m->padding;
 2395|  1.14k|            entries[i].fieldPointer = (void*)ptr;
 2396|  1.14k|            entries[i].function = NULL;
 2397|  1.14k|            ptr += mt->memSize;
 2398|  1.14k|        } else {
 2399|    297|            ptr += m->padding;
 2400|    297|            ptr += sizeof(size_t);
 2401|    297|            entries[i].fieldPointer = (void*)ptr;
 2402|    297|            entries[i].function = (decodeJsonSignature)Array_decodeJson;
 2403|    297|            ptr += sizeof(void*);
 2404|    297|        }
 2405|  1.43k|    }
 2406|       |
 2407|    309|    ret = decodeFields(ctx, entries, membersSize);
 2408|       |
 2409|    309|    if(ctx->depth == 0)
  ------------------
  |  Branch (2409:8): [True: 0, False: 309]
  ------------------
 2410|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2411|    309|    ctx->depth--;
 2412|    309|    return ret;
 2413|    309|}

ua_types_encoding_json.c:currentTokenType:
  104|  6.81M|cj5_token_type currentTokenType(const ParseCtx *ctx) {
  105|  6.81M|    return ctx->tokens[ctx->index].type;
  106|  6.81M|}
ua_types_encoding_json.c:getTokenLength:
  109|  7.35M|size_t getTokenLength(const cj5_token *t) {
  110|  7.35M|    return (size_t)(1u + t->end - t->start);
  111|  7.35M|}
ua_pubsub_networkmessage_json.c:currentTokenType:
  104|  94.2k|cj5_token_type currentTokenType(const ParseCtx *ctx) {
  105|  94.2k|    return ctx->tokens[ctx->index].type;
  106|  94.2k|}
ua_pubsub_networkmessage_json.c:getTokenLength:
  109|  6.34k|size_t getTokenLength(const cj5_token *t) {
  110|  6.34k|    return (size_t)(1u + t->end - t->start);
  111|  6.34k|}

UA_Guid_parse:
   86|     56|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|     56|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|     56|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     56|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 50, False: 6]
  ------------------
   89|     50|        *guid = UA_GUID_NULL;
   90|     56|    return res;
   91|     56|}
UA_NodeId_parseEx:
  323|  43.5k|                  const UA_NamespaceMapping *nsMapping) {
  324|  43.5k|    UA_StatusCode res =
  325|  43.5k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  43.5k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  43.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 377, False: 43.1k]
  ------------------
  327|    377|        UA_NodeId_clear(id);
  328|  43.5k|    return res;
  329|  43.5k|}
UA_ExpandedNodeId_parseEx:
  671|  3.60k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  3.60k|    UA_StatusCode res =
  673|  3.60k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  3.60k|                             nsMapping, serverUrisSize, serverUris);
  675|  3.60k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.60k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 485, False: 3.11k]
  ------------------
  676|    485|        UA_ExpandedNodeId_clear(id);
  677|  3.60k|    return res;
  678|  3.60k|}
UA_QualifiedName_parseEx:
  831|  57.6k|                         const UA_NamespaceMapping *nsMapping) {
  832|  57.6k|    const u8 *pos = str.data;
  833|  57.6k|    const u8 *end = str.data + str.length;
  834|  57.6k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  835|  57.6k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  57.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 1, False: 57.6k]
  ------------------
  836|      1|        UA_QualifiedName_clear(qn);
  837|  57.6k|    return res;
  838|  57.6k|}
ua_types_lex.c:parse_guid:
   50|     82|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|     82|    size_t len = (size_t)(e - s);
   52|     82|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 16, False: 66]
  |  Branch (52:21): [True: 12, False: 54]
  |  Branch (52:36): [True: 3, False: 51]
  |  Branch (52:52): [True: 10, False: 41]
  ------------------
   53|     41|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     41|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|     41|    UA_UInt32 tmp;
   56|     41|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 7, False: 34]
  ------------------
   57|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|     34|    guid->data1 = tmp;
   59|       |
   60|     34|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 4, False: 30]
  ------------------
   61|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|     30|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|     30|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 5, False: 25]
  ------------------
   65|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|     25|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|     25|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 4, False: 21]
  ------------------
   69|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|     21|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|     21|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 4, False: 17]
  ------------------
   73|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|     17|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|     88|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 80, False: 8]
  ------------------
   77|     80|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 9, False: 71]
  ------------------
   78|      9|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|     71|        guid->data4[pos] = (UA_Byte)tmp;
   80|     71|    }
   81|       |
   82|      8|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      8|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|     17|}
ua_types_lex.c:parse_nodeid:
  148|  43.5k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  43.5k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  43.5k|    LexContext context;
  151|  43.5k|    memset(&context, 0, sizeof(LexContext));
  152|  43.5k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  43.5k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  43.5k|{
  157|  43.5k|	u8 yych;
  158|  43.5k|	yych = YYPEEK();
  ------------------
  |  |   33|  43.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  43.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  43.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 43.5k, False: 9]
  |  |  ------------------
  ------------------
  159|  43.5k|	switch (yych) {
  160|    536|		case 'b':
  ------------------
  |  Branch (160:3): [True: 536, False: 42.9k]
  ------------------
  161|    566|		case 'g':
  ------------------
  |  Branch (161:3): [True: 30, False: 43.4k]
  ------------------
  162|  8.19k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 7.63k, False: 35.8k]
  ------------------
  163|  40.7k|		case 's':
  ------------------
  |  Branch (163:3): [True: 32.5k, False: 10.9k]
  ------------------
  164|  40.7k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  40.7k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  40.7k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  40.7k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  40.7k|			goto yy3;
  167|  2.70k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 2.70k, False: 40.8k]
  ------------------
  168|     59|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 59, False: 43.4k]
  ------------------
  169|  43.5k|	}
  170|     59|yy1:
  171|     59|	YYSKIP();
  ------------------
  |  |   35|     59|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     59|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|    294|yy2:
  173|    294|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|    294|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  40.7k|yy3:
  175|  40.7k|	YYSKIP();
  ------------------
  |  |   35|  40.7k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  40.7k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  40.7k|	yych = YYPEEK();
  ------------------
  |  |   33|  40.7k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  40.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  40.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 40.7k, False: 14]
  |  |  ------------------
  ------------------
  177|  40.7k|	switch (yych) {
  178|  40.7k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 40.7k, False: 28]
  ------------------
  179|     28|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 28, False: 40.7k]
  ------------------
  180|  40.7k|	}
  181|  2.70k|yy4:
  182|  2.70k|	YYSKIP();
  ------------------
  |  |   35|  2.70k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.70k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  2.70k|	YYBACKUP();
  ------------------
  |  |   36|  2.70k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  2.70k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.70k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  2.70k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.70k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.69k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.69k, False: 3]
  |  |  ------------------
  ------------------
  185|  2.70k|	switch (yych) {
  186|  2.68k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 2.68k, False: 19]
  ------------------
  187|     19|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 19, False: 2.68k]
  ------------------
  188|  2.70k|	}
  189|  43.2k|yy5:
  190|  43.2k|	YYSKIP();
  ------------------
  |  |   35|  43.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  43.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  43.2k|	nsu = context.yyt2;
  192|  43.2k|	ns = context.yyt1;
  193|  43.2k|	YYSTAGP(body);
  ------------------
  |  |   38|  43.2k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  43.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  43.2k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  43.2k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  43.2k|	{ goto match; }
  196|  2.68k|yy6:
  197|  2.68k|	YYSKIP();
  ------------------
  |  |   35|  2.68k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.68k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  2.68k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.68k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.68k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.67k, False: 3]
  |  |  ------------------
  ------------------
  199|  2.68k|	switch (yych) {
  200|  1.54k|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 1.54k, False: 1.13k]
  ------------------
  201|  1.13k|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 1.13k, False: 1.55k]
  ------------------
  202|      3|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 3, False: 2.67k]
  ------------------
  203|  2.68k|	}
  204|    188|yy7:
  205|    188|	YYRESTORE();
  ------------------
  |  |   37|    188|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    188|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    188|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    188|	goto yy2;
  207|  1.54k|yy8:
  208|  1.54k|	YYSKIP();
  ------------------
  |  |   35|  1.54k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|  1.54k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.54k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.54k, False: 3]
  |  |  ------------------
  ------------------
  210|  1.54k|	switch (yych) {
  211|    550|		case '0':
  ------------------
  |  Branch (211:3): [True: 550, False: 997]
  ------------------
  212|  1.03k|		case '1':
  ------------------
  |  Branch (212:3): [True: 484, False: 1.06k]
  ------------------
  213|  1.15k|		case '2':
  ------------------
  |  Branch (213:3): [True: 123, False: 1.42k]
  ------------------
  214|  1.17k|		case '3':
  ------------------
  |  Branch (214:3): [True: 16, False: 1.53k]
  ------------------
  215|  1.29k|		case '4':
  ------------------
  |  Branch (215:3): [True: 121, False: 1.42k]
  ------------------
  216|  1.41k|		case '5':
  ------------------
  |  Branch (216:3): [True: 121, False: 1.42k]
  ------------------
  217|  1.44k|		case '6':
  ------------------
  |  Branch (217:3): [True: 32, False: 1.51k]
  ------------------
  218|  1.47k|		case '7':
  ------------------
  |  Branch (218:3): [True: 24, False: 1.52k]
  ------------------
  219|  1.50k|		case '8':
  ------------------
  |  Branch (219:3): [True: 38, False: 1.50k]
  ------------------
  220|  1.53k|		case '9':
  ------------------
  |  Branch (220:3): [True: 29, False: 1.51k]
  ------------------
  221|  1.53k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  1.53k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.53k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|  1.53k|			goto yy10;
  223|      9|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 9, False: 1.53k]
  ------------------
  224|  1.54k|	}
  225|  1.13k|yy9:
  226|  1.13k|	YYSKIP();
  ------------------
  |  |   35|  1.13k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|  1.13k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.13k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.12k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.12k, False: 4]
  |  |  ------------------
  ------------------
  228|  1.13k|	switch (yych) {
  229|  1.12k|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 1.12k, False: 5]
  ------------------
  230|      5|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 5, False: 1.12k]
  ------------------
  231|  1.13k|	}
  232|  6.44k|yy10:
  233|  6.44k|	YYSKIP();
  ------------------
  |  |   35|  6.44k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.44k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  6.44k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.44k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.44k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.33k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.33k, False: 102]
  |  |  ------------------
  ------------------
  235|  6.44k|	switch (yych) {
  236|  1.55k|		case '0':
  ------------------
  |  Branch (236:3): [True: 1.55k, False: 4.88k]
  ------------------
  237|  1.98k|		case '1':
  ------------------
  |  Branch (237:3): [True: 423, False: 6.01k]
  ------------------
  238|  2.33k|		case '2':
  ------------------
  |  Branch (238:3): [True: 349, False: 6.09k]
  ------------------
  239|  2.76k|		case '3':
  ------------------
  |  Branch (239:3): [True: 430, False: 6.01k]
  ------------------
  240|  3.06k|		case '4':
  ------------------
  |  Branch (240:3): [True: 306, False: 6.13k]
  ------------------
  241|  3.31k|		case '5':
  ------------------
  |  Branch (241:3): [True: 251, False: 6.18k]
  ------------------
  242|  3.64k|		case '6':
  ------------------
  |  Branch (242:3): [True: 322, False: 6.11k]
  ------------------
  243|  4.00k|		case '7':
  ------------------
  |  Branch (243:3): [True: 362, False: 6.07k]
  ------------------
  244|  4.45k|		case '8':
  ------------------
  |  Branch (244:3): [True: 455, False: 5.98k]
  ------------------
  245|  4.90k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 445, False: 5.99k]
  ------------------
  246|  1.43k|		case ';':
  ------------------
  |  Branch (246:3): [True: 1.43k, False: 5.00k]
  ------------------
  247|  1.43k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.43k|#define YYSTAGN(t) t = NULL
  ------------------
  248|  1.43k|			goto yy12;
  249|    104|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 104, False: 6.33k]
  ------------------
  250|  6.44k|	}
  251|  1.12k|yy11:
  252|  1.12k|	YYSKIP();
  ------------------
  |  |   35|  1.12k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.12k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|  1.12k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.12k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.12k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.12k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.12k, False: 4]
  |  |  ------------------
  ------------------
  254|  1.12k|	switch (yych) {
  255|      4|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 4, False: 1.12k]
  ------------------
  256|    398|		case ';':
  ------------------
  |  Branch (256:3): [True: 398, False: 729]
  ------------------
  257|    398|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    398|#define YYSTAGN(t) t = NULL
  ------------------
  258|    398|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    398|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    398|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|    398|			goto yy12;
  260|    725|		default:
  ------------------
  |  Branch (260:3): [True: 725, False: 402]
  ------------------
  261|    725|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    725|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    725|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    725|			goto yy13;
  263|  1.12k|	}
  264|  2.54k|yy12:
  265|  2.54k|	YYSKIP();
  ------------------
  |  |   35|  2.54k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.54k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  2.54k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.54k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.52k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.52k, False: 15]
  |  |  ------------------
  ------------------
  267|  2.54k|	switch (yych) {
  268|    285|		case 'b':
  ------------------
  |  Branch (268:3): [True: 285, False: 2.25k]
  ------------------
  269|    499|		case 'g':
  ------------------
  |  Branch (269:3): [True: 214, False: 2.33k]
  ------------------
  270|    725|		case 'i':
  ------------------
  |  Branch (270:3): [True: 226, False: 2.31k]
  ------------------
  271|  2.52k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 1.80k, False: 741]
  ------------------
  272|     16|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 16, False: 2.52k]
  ------------------
  273|  2.54k|	}
  274|  8.60k|yy13:
  275|  8.60k|	YYSKIP();
  ------------------
  |  |   35|  8.60k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.60k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|  8.60k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.60k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.60k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.59k, False: 13]
  |  |  ------------------
  ------------------
  277|  8.60k|	switch (yych) {
  278|     13|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 13, False: 8.59k]
  ------------------
  279|    712|		case ';':
  ------------------
  |  Branch (279:3): [True: 712, False: 7.89k]
  ------------------
  280|    712|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    712|#define YYSTAGN(t) t = NULL
  ------------------
  281|    712|			goto yy12;
  282|  7.88k|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 7.88k, False: 725]
  ------------------
  283|  8.60k|	}
  284|  2.52k|yy14:
  285|  2.52k|	YYSKIP();
  ------------------
  |  |   35|  2.52k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.52k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  2.52k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.52k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.52k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.50k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.50k, False: 24]
  |  |  ------------------
  ------------------
  287|  2.52k|	switch (yych) {
  288|  2.49k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 2.49k, False: 34]
  ------------------
  289|     34|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 34, False: 2.49k]
  ------------------
  290|  2.52k|	}
  291|  2.52k|}
  292|       |
  293|       |
  294|  43.2k| match:
  295|  43.2k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 1.08k, False: 42.1k]
  ------------------
  296|       |        /* NamespaceUri */
  297|  1.08k|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|  1.08k|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|  1.08k|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.08k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 1.08k, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|  1.08k|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|  1.08k|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|  1.08k|            return UA_String_copy(&total, &id->identifier.string);
  304|  1.08k|        }
  305|  42.1k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 1.41k, False: 40.7k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|  1.41k|        UA_UInt32 tmp;
  308|  1.41k|        size_t len = (size_t)(body - 1 - ns);
  309|  1.41k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 1.41k]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|  1.41k|        id->namespaceIndex = (UA_UInt16)tmp;
  312|  1.41k|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 1.41k]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|  1.41k|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  42.1k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  43.2k|}
ua_types_lex.c:escapedUri2Index:
   95|  1.95k|                 const UA_NamespaceMapping *nsMapping) {
   96|  1.95k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 1.95k, False: 0]
  ------------------
   97|  1.95k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|  1.95k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   98|      0|    UA_String tmp = uri; 
   99|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
  100|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (100:8): [True: 0, False: 0]
  ------------------
  101|      0|        return res;
  102|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  103|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (103:8): [True: 0, False: 0]
  ------------------
  104|      0|        UA_String_clear(&uri);
  105|      0|    return res;
  106|      0|}
ua_types_lex.c:parse_nodeid_body:
  109|  44.3k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  44.3k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  44.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  44.3k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  44.3k|    switch(*body) {
  113|  8.15k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 8.15k, False: 36.1k]
  ------------------
  114|  8.15k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  8.15k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 68, False: 8.08k]
  ------------------
  116|     68|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  8.15k|        break;
  118|  34.7k|    case 's':
  ------------------
  |  Branch (118:5): [True: 34.7k, False: 9.58k]
  ------------------
  119|  34.7k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  34.7k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  34.7k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  34.7k|        break;
  123|     26|    case 'g':
  ------------------
  |  Branch (123:5): [True: 26, False: 44.3k]
  ------------------
  124|     26|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     26|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     26|        break;
  127|  1.40k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 1.40k, False: 42.9k]
  ------------------
  128|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  129|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  130|       |         * the NodeId identifier part. */
  131|  1.40k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  1.40k|        id->identifier.byteString.data =
  133|  1.40k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  1.40k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 38, False: 1.36k]
  ------------------
  135|     38|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  395|     38|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 38, False: 0]
  ------------------
  136|     38|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   43|     38|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     38|        }
  138|  1.40k|        break;
  139|  1.40k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 44.3k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  44.3k|    }
  143|  44.3k|    return res;
  144|  44.3k|}
ua_types_lex.c:parse_expandednodeid:
  339|  3.60k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  3.60k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  3.60k|    LexContext context;
  342|  3.60k|    memset(&context, 0, sizeof(LexContext));
  343|  3.60k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  3.60k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  3.60k|{
  348|  3.60k|	u8 yych;
  349|  3.60k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.60k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.60k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.59k, False: 4]
  |  |  ------------------
  ------------------
  350|  3.60k|	switch (yych) {
  351|    378|		case 'b':
  ------------------
  |  Branch (351:3): [True: 378, False: 3.22k]
  ------------------
  352|    385|		case 'g':
  ------------------
  |  Branch (352:3): [True: 7, False: 3.59k]
  ------------------
  353|    648|		case 'i':
  ------------------
  |  Branch (353:3): [True: 263, False: 3.33k]
  ------------------
  354|    648|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    648|#define YYSTAGN(t) t = NULL
  ------------------
  355|    648|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    648|#define YYSTAGN(t) t = NULL
  ------------------
  356|    648|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    648|#define YYSTAGN(t) t = NULL
  ------------------
  357|    648|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    648|#define YYSTAGN(t) t = NULL
  ------------------
  358|    648|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    648|#define YYSTAGN(t) t = NULL
  ------------------
  359|    648|			goto yy18;
  360|  1.05k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 1.05k, False: 2.55k]
  ------------------
  361|  1.05k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.05k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  1.05k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.05k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  1.05k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.05k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  1.05k|			goto yy19;
  365|  1.89k|		case 's':
  ------------------
  |  Branch (365:3): [True: 1.89k, False: 1.70k]
  ------------------
  366|  1.89k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.89k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  1.89k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.89k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  1.89k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.89k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  1.89k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.89k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  1.89k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.89k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  1.89k|			goto yy20;
  372|      8|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 8, False: 3.59k]
  ------------------
  373|  3.60k|	}
  374|      8|yy16:
  375|      8|	YYSKIP();
  ------------------
  |  |   35|      8|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      8|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    434|yy17:
  377|    434|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|    434|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|    648|yy18:
  379|    648|	YYSKIP();
  ------------------
  |  |   35|    648|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    648|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|    648|	yych = YYPEEK();
  ------------------
  |  |   33|    648|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    648|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    638|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 638, False: 10]
  |  |  ------------------
  ------------------
  381|    648|	switch (yych) {
  382|    624|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 624, False: 24]
  ------------------
  383|     24|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 24, False: 624]
  ------------------
  384|    648|	}
  385|  1.05k|yy19:
  386|  1.05k|	YYSKIP();
  ------------------
  |  |   35|  1.05k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.05k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  1.05k|	YYBACKUP();
  ------------------
  |  |   36|  1.05k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.05k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.05k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  1.05k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.05k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.05k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.05k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.05k, False: 1]
  |  |  ------------------
  ------------------
  389|  1.05k|	switch (yych) {
  390|  1.04k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 1.04k, False: 3]
  ------------------
  391|      3|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 3, False: 1.04k]
  ------------------
  392|  1.05k|	}
  393|  1.89k|yy20:
  394|  1.89k|	YYSKIP();
  ------------------
  |  |   35|  1.89k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.89k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  1.89k|	YYBACKUP();
  ------------------
  |  |   36|  1.89k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.89k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.89k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  1.89k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.89k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.89k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.89k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.89k, False: 1]
  |  |  ------------------
  ------------------
  397|  1.89k|	switch (yych) {
  398|    199|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 199, False: 1.69k]
  ------------------
  399|  1.69k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.69k, False: 201]
  ------------------
  400|      2|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 2, False: 1.89k]
  ------------------
  401|  1.89k|	}
  402|  3.16k|yy21:
  403|  3.16k|	YYSKIP();
  ------------------
  |  |   35|  3.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  3.16k|	svr = context.yyt5;
  405|  3.16k|	svu = context.yyt1;
  406|  3.16k|	sve = context.yyt2;
  407|  3.16k|	ns = context.yyt3;
  408|  3.16k|	nsu = context.yyt4;
  409|  3.16k|	YYSTAGP(body);
  ------------------
  |  |   38|  3.16k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  3.16k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  3.16k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  3.16k|	{ goto match; }
  412|  1.50k|yy22:
  413|  1.50k|	YYSKIP();
  ------------------
  |  |   35|  1.50k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.50k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  1.50k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.50k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.50k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.50k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.50k, False: 5]
  |  |  ------------------
  ------------------
  415|  1.50k|	switch (yych) {
  416|    339|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 339, False: 1.16k]
  ------------------
  417|  1.16k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 1.16k, False: 346]
  ------------------
  418|      7|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 7, False: 1.50k]
  ------------------
  419|  1.50k|	}
  420|    397|yy23:
  421|    397|	YYRESTORE();
  ------------------
  |  |   37|    397|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    397|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    397|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    397|	goto yy17;
  423|  1.69k|yy24:
  424|  1.69k|	YYSKIP();
  ------------------
  |  |   35|  1.69k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.69k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.69k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.69k, False: 1]
  |  |  ------------------
  ------------------
  426|  1.69k|	switch (yych) {
  427|    624|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 624, False: 1.07k]
  ------------------
  428|  1.06k|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 1.06k, False: 630]
  ------------------
  429|      6|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 6, False: 1.68k]
  ------------------
  430|  1.69k|	}
  431|    339|yy25:
  432|    339|	YYSKIP();
  ------------------
  |  |   35|    339|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    339|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|    339|	yych = YYPEEK();
  ------------------
  |  |   33|    339|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    339|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    337|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 337, False: 2]
  |  |  ------------------
  ------------------
  434|    339|	switch (yych) {
  435|    172|		case '0':
  ------------------
  |  Branch (435:3): [True: 172, False: 167]
  ------------------
  436|    186|		case '1':
  ------------------
  |  Branch (436:3): [True: 14, False: 325]
  ------------------
  437|    205|		case '2':
  ------------------
  |  Branch (437:3): [True: 19, False: 320]
  ------------------
  438|    234|		case '3':
  ------------------
  |  Branch (438:3): [True: 29, False: 310]
  ------------------
  439|    240|		case '4':
  ------------------
  |  Branch (439:3): [True: 6, False: 333]
  ------------------
  440|    245|		case '5':
  ------------------
  |  Branch (440:3): [True: 5, False: 334]
  ------------------
  441|    314|		case '6':
  ------------------
  |  Branch (441:3): [True: 69, False: 270]
  ------------------
  442|    319|		case '7':
  ------------------
  |  Branch (442:3): [True: 5, False: 334]
  ------------------
  443|    330|		case '8':
  ------------------
  |  Branch (443:3): [True: 11, False: 328]
  ------------------
  444|    335|		case '9':
  ------------------
  |  Branch (444:3): [True: 5, False: 334]
  ------------------
  445|    335|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    335|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    335|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    335|			goto yy29;
  447|      4|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 4, False: 335]
  ------------------
  448|    339|	}
  449|  1.16k|yy26:
  450|  1.16k|	YYSKIP();
  ------------------
  |  |   35|  1.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  1.16k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.16k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.16k, False: 1]
  |  |  ------------------
  ------------------
  452|  1.16k|	switch (yych) {
  453|  1.15k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 1.15k, False: 9]
  ------------------
  454|      9|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 9, False: 1.15k]
  ------------------
  455|  1.16k|	}
  456|    624|yy27:
  457|    624|	YYSKIP();
  ------------------
  |  |   35|    624|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    624|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|    624|	yych = YYPEEK();
  ------------------
  |  |   33|    624|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    624|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    623|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 623, False: 1]
  |  |  ------------------
  ------------------
  459|    624|	switch (yych) {
  460|    612|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 612, False: 12]
  ------------------
  461|     12|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 12, False: 612]
  ------------------
  462|    624|	}
  463|  1.06k|yy28:
  464|  1.06k|	YYSKIP();
  ------------------
  |  |   35|  1.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|  1.06k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.06k, False: 1]
  |  |  ------------------
  ------------------
  466|  1.06k|	switch (yych) {
  467|  1.04k|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 1.04k, False: 18]
  ------------------
  468|     18|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 18, False: 1.04k]
  ------------------
  469|  1.06k|	}
  470|  4.31k|yy29:
  471|  4.31k|	YYSKIP();
  ------------------
  |  |   35|  4.31k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.31k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  4.31k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.31k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.31k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.23k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.23k, False: 81]
  |  |  ------------------
  ------------------
  473|  4.31k|	switch (yych) {
  474|  1.02k|		case '0':
  ------------------
  |  Branch (474:3): [True: 1.02k, False: 3.29k]
  ------------------
  475|  1.28k|		case '1':
  ------------------
  |  Branch (475:3): [True: 263, False: 4.04k]
  ------------------
  476|  1.57k|		case '2':
  ------------------
  |  Branch (476:3): [True: 289, False: 4.02k]
  ------------------
  477|  1.93k|		case '3':
  ------------------
  |  Branch (477:3): [True: 367, False: 3.94k]
  ------------------
  478|  2.26k|		case '4':
  ------------------
  |  Branch (478:3): [True: 321, False: 3.99k]
  ------------------
  479|  2.56k|		case '5':
  ------------------
  |  Branch (479:3): [True: 303, False: 4.00k]
  ------------------
  480|  2.96k|		case '6':
  ------------------
  |  Branch (480:3): [True: 401, False: 3.91k]
  ------------------
  481|  3.25k|		case '7':
  ------------------
  |  Branch (481:3): [True: 292, False: 4.02k]
  ------------------
  482|  3.57k|		case '8':
  ------------------
  |  Branch (482:3): [True: 323, False: 3.98k]
  ------------------
  483|  3.97k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 398, False: 3.91k]
  ------------------
  484|    243|		case ';':
  ------------------
  |  Branch (484:3): [True: 243, False: 4.06k]
  ------------------
  485|    243|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    243|#define YYSTAGN(t) t = NULL
  ------------------
  486|    243|			goto yy33;
  487|     92|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 92, False: 4.22k]
  ------------------
  488|  4.31k|	}
  489|  1.15k|yy30:
  490|  1.15k|	YYSKIP();
  ------------------
  |  |   35|  1.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  1.15k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.15k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.15k, False: 1]
  |  |  ------------------
  ------------------
  492|  1.15k|	switch (yych) {
  493|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 1, False: 1.15k]
  ------------------
  494|    381|		case ';':
  ------------------
  |  Branch (494:3): [True: 381, False: 771]
  ------------------
  495|    381|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    381|#define YYSTAGN(t) t = NULL
  ------------------
  496|    381|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    381|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    381|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    381|			goto yy33;
  498|    770|		default:
  ------------------
  |  Branch (498:3): [True: 770, False: 382]
  ------------------
  499|    770|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    770|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    770|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    770|			goto yy34;
  501|  1.15k|	}
  502|    612|yy31:
  503|    612|	YYSKIP();
  ------------------
  |  |   35|    612|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    612|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|    612|	yych = YYPEEK();
  ------------------
  |  |   33|    612|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    612|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    611|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 611, False: 1]
  |  |  ------------------
  ------------------
  505|    612|	switch (yych) {
  506|    331|		case '0':
  ------------------
  |  Branch (506:3): [True: 331, False: 281]
  ------------------
  507|    383|		case '1':
  ------------------
  |  Branch (507:3): [True: 52, False: 560]
  ------------------
  508|    400|		case '2':
  ------------------
  |  Branch (508:3): [True: 17, False: 595]
  ------------------
  509|    439|		case '3':
  ------------------
  |  Branch (509:3): [True: 39, False: 573]
  ------------------
  510|    459|		case '4':
  ------------------
  |  Branch (510:3): [True: 20, False: 592]
  ------------------
  511|    525|		case '5':
  ------------------
  |  Branch (511:3): [True: 66, False: 546]
  ------------------
  512|    538|		case '6':
  ------------------
  |  Branch (512:3): [True: 13, False: 599]
  ------------------
  513|    564|		case '7':
  ------------------
  |  Branch (513:3): [True: 26, False: 586]
  ------------------
  514|    579|		case '8':
  ------------------
  |  Branch (514:3): [True: 15, False: 597]
  ------------------
  515|    588|		case '9':
  ------------------
  |  Branch (515:3): [True: 9, False: 603]
  ------------------
  516|    588|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|    588|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    588|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|    588|			goto yy35;
  518|     24|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 24, False: 588]
  ------------------
  519|    612|	}
  520|  1.04k|yy32:
  521|  1.04k|	YYSKIP();
  ------------------
  |  |   35|  1.04k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.04k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|  1.04k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.04k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.04k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.04k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.04k, False: 1]
  |  |  ------------------
  ------------------
  523|  1.04k|	switch (yych) {
  524|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 1, False: 1.04k]
  ------------------
  525|    396|		case ';':
  ------------------
  |  Branch (525:3): [True: 396, False: 650]
  ------------------
  526|    396|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    396|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    396|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|    396|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    396|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    396|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    396|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    396|#define YYSTAGN(t) t = NULL
  ------------------
  529|    396|			goto yy37;
  530|    649|		default:
  ------------------
  |  Branch (530:3): [True: 649, False: 397]
  ------------------
  531|    649|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    649|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    649|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    649|			goto yy36;
  533|  1.04k|	}
  534|  1.38k|yy33:
  535|  1.38k|	YYSKIP();
  ------------------
  |  |   35|  1.38k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.38k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  1.38k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.38k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.37k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.37k, False: 7]
  |  |  ------------------
  ------------------
  537|  1.38k|	switch (yych) {
  538|    366|		case 'b':
  ------------------
  |  Branch (538:3): [True: 366, False: 1.01k]
  ------------------
  539|    564|		case 'g':
  ------------------
  |  Branch (539:3): [True: 198, False: 1.18k]
  ------------------
  540|    843|		case 'i':
  ------------------
  |  Branch (540:3): [True: 279, False: 1.10k]
  ------------------
  541|  1.36k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 526, False: 857]
  ------------------
  542|     14|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 14, False: 1.36k]
  ------------------
  543|  1.38k|	}
  544|   162k|yy34:
  545|   162k|	YYSKIP();
  ------------------
  |  |   35|   162k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   162k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|   162k|	yych = YYPEEK();
  ------------------
  |  |   33|   162k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   162k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   162k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 162k, False: 11]
  |  |  ------------------
  ------------------
  547|   162k|	switch (yych) {
  548|     11|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 11, False: 162k]
  ------------------
  549|    759|		case ';':
  ------------------
  |  Branch (549:3): [True: 759, False: 161k]
  ------------------
  550|    759|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    759|#define YYSTAGN(t) t = NULL
  ------------------
  551|    759|			goto yy33;
  552|   161k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 161k, False: 770]
  ------------------
  553|   162k|	}
  554|   179k|yy35:
  555|   179k|	YYSKIP();
  ------------------
  |  |   35|   179k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   179k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|   179k|	yych = YYPEEK();
  ------------------
  |  |   33|   179k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   179k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   179k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 179k, False: 86]
  |  |  ------------------
  ------------------
  557|   179k|	switch (yych) {
  558|   175k|		case '0':
  ------------------
  |  Branch (558:3): [True: 175k, False: 3.96k]
  ------------------
  559|   175k|		case '1':
  ------------------
  |  Branch (559:3): [True: 274, False: 178k]
  ------------------
  560|   175k|		case '2':
  ------------------
  |  Branch (560:3): [True: 260, False: 179k]
  ------------------
  561|   176k|		case '3':
  ------------------
  |  Branch (561:3): [True: 396, False: 178k]
  ------------------
  562|   176k|		case '4':
  ------------------
  |  Branch (562:3): [True: 319, False: 178k]
  ------------------
  563|   177k|		case '5':
  ------------------
  |  Branch (563:3): [True: 824, False: 178k]
  ------------------
  564|   177k|		case '6':
  ------------------
  |  Branch (564:3): [True: 288, False: 178k]
  ------------------
  565|   178k|		case '7':
  ------------------
  |  Branch (565:3): [True: 494, False: 178k]
  ------------------
  566|   178k|		case '8':
  ------------------
  |  Branch (566:3): [True: 253, False: 179k]
  ------------------
  567|   178k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 273, False: 178k]
  ------------------
  568|    476|		case ';':
  ------------------
  |  Branch (568:3): [True: 476, False: 178k]
  ------------------
  569|    476|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    476|#define YYSTAGN(t) t = NULL
  ------------------
  570|    476|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    476|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    476|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|    476|			goto yy37;
  572|    112|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 112, False: 179k]
  ------------------
  573|   179k|	}
  574|  2.86M|yy36:
  575|  2.86M|	YYSKIP();
  ------------------
  |  |   35|  2.86M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.86M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  2.86M|	yych = YYPEEK();
  ------------------
  |  |   33|  2.86M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.86M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.86M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.86M, False: 25]
  |  |  ------------------
  ------------------
  577|  2.86M|	switch (yych) {
  578|     25|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 25, False: 2.86M]
  ------------------
  579|    624|		case ';':
  ------------------
  |  Branch (579:3): [True: 624, False: 2.86M]
  ------------------
  580|    624|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    624|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    624|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    624|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    624|#define YYSTAGN(t) t = NULL
  ------------------
  582|    624|			goto yy37;
  583|  2.86M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 2.86M, False: 649]
  ------------------
  584|  2.86M|	}
  585|  1.49k|yy37:
  586|  1.49k|	YYSKIP();
  ------------------
  |  |   35|  1.49k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.49k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.49k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.49k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.49k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.48k, False: 7]
  |  |  ------------------
  ------------------
  588|  1.49k|	switch (yych) {
  589|    197|		case 'b':
  ------------------
  |  Branch (589:3): [True: 197, False: 1.29k]
  ------------------
  590|    408|		case 'g':
  ------------------
  |  Branch (590:3): [True: 211, False: 1.28k]
  ------------------
  591|    611|		case 'i':
  ------------------
  |  Branch (591:3): [True: 203, False: 1.29k]
  ------------------
  592|  1.01k|		case 's':
  ------------------
  |  Branch (592:3): [True: 402, False: 1.09k]
  ------------------
  593|  1.01k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.01k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.01k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.01k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.01k|			goto yy38;
  596|    467|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 467, False: 1.02k]
  ------------------
  597|     16|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 16, False: 1.48k]
  ------------------
  598|  1.49k|	}
  599|  2.38k|yy38:
  600|  2.38k|	YYSKIP();
  ------------------
  |  |   35|  2.38k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.38k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  2.38k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.38k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.35k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.35k, False: 27]
  |  |  ------------------
  ------------------
  602|  2.38k|	switch (yych) {
  603|  2.34k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 2.34k, False: 37]
  ------------------
  604|     37|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 37, False: 2.34k]
  ------------------
  605|  2.38k|	}
  606|    467|yy39:
  607|    467|	YYSKIP();
  ------------------
  |  |   35|    467|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    467|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|    467|	yych = YYPEEK();
  ------------------
  |  |   33|    467|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    467|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    466|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 466, False: 1]
  |  |  ------------------
  ------------------
  609|    467|	switch (yych) {
  610|    459|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 459, False: 8]
  ------------------
  611|      8|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 8, False: 459]
  ------------------
  612|    467|	}
  613|    467|}
  614|       |
  615|       |
  616|  3.16k| match:
  617|  3.16k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 976, False: 2.19k]
  ------------------
  618|       |        /* ServerUri */
  619|    976|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|    976|        size_t i = 0;
  621|    976|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 976]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|    976|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 976, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|    976|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|    976|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|    976|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|    976|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  2.19k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 465, False: 1.72k]
  ------------------
  634|       |        /* ServerIndex */
  635|    465|        size_t len = (size_t)(sve - svr);
  636|    465|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 465]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|    465|    }
  639|       |
  640|  2.19k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 923, False: 1.26k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    923|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    923|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    923|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  644|       |        /* Try to map the NamespaceUri to its NamespaceIndex for ServerIndex == 0.
  645|       |         * If this fails, keep the full NamespaceUri. */
  646|    923|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 670, False: 253]
  ------------------
  647|    670|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    923|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    923|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 923, False: 0]
  ------------------
  649|    923|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    923|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    923|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 1, False: 922]
  ------------------
  651|      1|            return res;
  652|  1.26k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 239, False: 1.03k]
  ------------------
  653|       |        /* NamespaceIndex */
  654|    239|        UA_UInt32 tmp;
  655|    239|        size_t len = (size_t)(body - 1 - ns);
  656|    239|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 239]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|    239|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|    239|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 239]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|    239|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  2.19k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  2.19k|}
ua_types_lex.c:parse_qn:
  707|  57.6k|         UA_UInt16 defaultNamespaceIndex) {
  708|  57.6k|    size_t len;
  709|  57.6k|    UA_UInt32 tmp;
  710|  57.6k|    UA_String str;
  711|  57.6k|    UA_StatusCode res;
  712|       |
  713|  57.6k|    LexContext context;
  714|  57.6k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  57.6k|    const u8 *begin = pos;
  717|  57.6k|    UA_QualifiedName_init(qn);
  718|  57.6k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  57.6k|{
  722|  57.6k|	u8 yych;
  723|  57.6k|	yych = YYPEEK();
  ------------------
  |  |   33|  57.6k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  57.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  55.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 55.9k, False: 1.77k]
  |  |  ------------------
  ------------------
  724|  57.6k|	switch (yych) {
  725|  1.77k|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 1.77k, False: 55.9k]
  ------------------
  726|  2.80k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 1.03k, False: 56.6k]
  ------------------
  727|    748|		case '0':
  ------------------
  |  Branch (727:3): [True: 748, False: 56.9k]
  ------------------
  728|  1.20k|		case '1':
  ------------------
  |  Branch (728:3): [True: 458, False: 57.2k]
  ------------------
  729|  5.89k|		case '2':
  ------------------
  |  Branch (729:3): [True: 4.69k, False: 52.9k]
  ------------------
  730|  6.39k|		case '3':
  ------------------
  |  Branch (730:3): [True: 500, False: 57.1k]
  ------------------
  731|  25.2k|		case '4':
  ------------------
  |  Branch (731:3): [True: 18.8k, False: 38.7k]
  ------------------
  732|  26.8k|		case '5':
  ------------------
  |  Branch (732:3): [True: 1.55k, False: 56.1k]
  ------------------
  733|  44.3k|		case '6':
  ------------------
  |  Branch (733:3): [True: 17.5k, False: 40.1k]
  ------------------
  734|  46.7k|		case '7':
  ------------------
  |  Branch (734:3): [True: 2.42k, False: 55.2k]
  ------------------
  735|  49.2k|		case '8':
  ------------------
  |  Branch (735:3): [True: 2.44k, False: 55.2k]
  ------------------
  736|  50.0k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 783, False: 56.9k]
  ------------------
  737|  4.87k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 4.87k, False: 52.8k]
  ------------------
  738|  57.6k|	}
  739|  2.80k|yy41:
  740|  2.80k|	YYSKIP();
  ------------------
  |  |   35|  2.80k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.80k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  56.6k|yy42:
  742|  56.6k|	{ pos = begin; goto match_name; }
  743|  4.87k|yy43:
  744|  4.87k|	YYSKIP();
  ------------------
  |  |   35|  4.87k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.87k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  4.87k|	YYBACKUP();
  ------------------
  |  |   36|  4.87k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  4.87k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  4.87k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  4.87k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.87k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.87k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.70k, False: 2.16k]
  |  |  ------------------
  ------------------
  747|  4.87k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 2.16k, False: 2.70k]
  ------------------
  748|  2.70k|	goto yy46;
  749|  50.0k|yy44:
  750|  50.0k|	YYSKIP();
  ------------------
  |  |   35|  50.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  50.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  50.0k|	YYBACKUP();
  ------------------
  |  |   36|  50.0k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  50.0k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  50.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  50.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  50.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  50.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  20.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 20.3k, False: 29.6k]
  |  |  ------------------
  ------------------
  753|  50.0k|	switch (yych) {
  754|    354|		case '0':
  ------------------
  |  Branch (754:3): [True: 354, False: 49.6k]
  ------------------
  755|    639|		case '1':
  ------------------
  |  Branch (755:3): [True: 285, False: 49.7k]
  ------------------
  756|  1.40k|		case '2':
  ------------------
  |  Branch (756:3): [True: 763, False: 49.2k]
  ------------------
  757|  2.40k|		case '3':
  ------------------
  |  Branch (757:3): [True: 1.00k, False: 49.0k]
  ------------------
  758|  5.04k|		case '4':
  ------------------
  |  Branch (758:3): [True: 2.64k, False: 47.3k]
  ------------------
  759|  5.18k|		case '5':
  ------------------
  |  Branch (759:3): [True: 138, False: 49.8k]
  ------------------
  760|  5.36k|		case '6':
  ------------------
  |  Branch (760:3): [True: 179, False: 49.8k]
  ------------------
  761|  6.22k|		case '7':
  ------------------
  |  Branch (761:3): [True: 854, False: 49.1k]
  ------------------
  762|  7.02k|		case '8':
  ------------------
  |  Branch (762:3): [True: 801, False: 49.2k]
  ------------------
  763|  7.12k|		case '9':
  ------------------
  |  Branch (763:3): [True: 106, False: 49.9k]
  ------------------
  764|  7.52k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 397, False: 49.6k]
  ------------------
  765|  42.4k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 42.4k, False: 7.52k]
  ------------------
  766|  50.0k|	}
  767|  55.1k|yy45:
  768|  55.1k|	YYSKIP();
  ------------------
  |  |   35|  55.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  55.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  55.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  55.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  55.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  52.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 52.6k, False: 2.47k]
  |  |  ------------------
  ------------------
  770|  57.8k|yy46:
  771|  57.8k|	switch (yych) {
  772|  2.51k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 2.51k, False: 55.3k]
  ------------------
  773|    197|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 197, False: 57.6k]
  ------------------
  774|  55.1k|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 55.1k, False: 2.70k]
  ------------------
  775|  57.8k|	}
  776|  9.20k|yy47:
  777|  9.20k|	YYRESTORE();
  ------------------
  |  |   37|  9.20k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  9.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  9.20k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  9.20k|	goto yy42;
  779|    197|yy48:
  780|    197|	YYSKIP();
  ------------------
  |  |   35|    197|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    197|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    197|	{ goto match_uri; }
  782|   149k|yy49:
  783|   149k|	YYSKIP();
  ------------------
  |  |   35|   149k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   149k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|   149k|	yych = YYPEEK();
  ------------------
  |  |   33|   149k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   149k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   147k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 147k, False: 1.89k]
  |  |  ------------------
  ------------------
  785|   157k|yy50:
  786|   157k|	switch (yych) {
  787|  53.9k|		case '0':
  ------------------
  |  Branch (787:3): [True: 53.9k, False: 103k]
  ------------------
  788|  63.8k|		case '1':
  ------------------
  |  Branch (788:3): [True: 9.85k, False: 147k]
  ------------------
  789|   117k|		case '2':
  ------------------
  |  Branch (789:3): [True: 53.7k, False: 103k]
  ------------------
  790|   118k|		case '3':
  ------------------
  |  Branch (790:3): [True: 1.30k, False: 155k]
  ------------------
  791|   124k|		case '4':
  ------------------
  |  Branch (791:3): [True: 5.77k, False: 151k]
  ------------------
  792|   128k|		case '5':
  ------------------
  |  Branch (792:3): [True: 4.11k, False: 153k]
  ------------------
  793|   129k|		case '6':
  ------------------
  |  Branch (793:3): [True: 858, False: 156k]
  ------------------
  794|   146k|		case '7':
  ------------------
  |  Branch (794:3): [True: 16.4k, False: 140k]
  ------------------
  795|   149k|		case '8':
  ------------------
  |  Branch (795:3): [True: 3.09k, False: 154k]
  ------------------
  796|   149k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 426, False: 156k]
  ------------------
  797|    827|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 827, False: 156k]
  ------------------
  798|  6.69k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 6.69k, False: 150k]
  ------------------
  799|   157k|	}
  800|    827|yy51:
  801|    827|	YYSKIP();
  ------------------
  |  |   35|    827|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    827|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    827|	{ goto match_index; }
  803|   157k|}
  804|       |
  805|       |
  806|    827| match_index:
  807|    827|    len = (size_t)(pos - 1 - begin);
  808|    827|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 827]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    827|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    827|    goto match_name;
  812|       |
  813|    197| match_uri:
  814|    197|    str.length = (size_t)(pos - 1 - begin);
  815|    197|    str.data = (UA_Byte*)(uintptr_t)begin;
  816|    197|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  817|    197|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (817:8): [True: 197, False: 0]
  ------------------
  818|    197|        pos = begin; /* Use the entire string for the name */
  819|       |
  820|  57.6k| match_name:
  821|  57.6k|    str.length = (size_t)(end - pos);
  822|  57.6k|    str.data = (UA_Byte*)(uintptr_t)pos;
  823|  57.6k|    res = UA_String_copy(&str, &qn->name);
  824|  57.6k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  574|  57.6k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (574:23): [True: 57.6k, False: 1]
  |  |  ------------------
  ------------------
  825|  57.6k|        res = UA_String_unescape(&qn->name, false, escName);
  826|  57.6k|    return res;
  827|    197|}

UA_readNumberWithBase:
  110|  11.3k|UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) {
  111|  11.3k|    UA_assert(buf);
  ------------------
  |  |  395|  11.3k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (111:5): [True: 11.3k, False: 0]
  ------------------
  112|  11.3k|    UA_assert(number);
  ------------------
  |  |  395|  11.3k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (112:5): [True: 11.3k, False: 0]
  ------------------
  113|  11.3k|    u32 n = 0;
  114|  11.3k|    size_t progress = 0;
  115|       |    /* read numbers until the end or a non-number character appears */
  116|  3.03M|    while(progress < buflen) {
  ------------------
  |  Branch (116:11): [True: 3.02M, False: 11.2k]
  ------------------
  117|  3.02M|        u8 c = buf[progress];
  118|  3.02M|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (118:12): [True: 3.02M, False: 24]
  |  Branch (118:24): [True: 3.02M, False: 660]
  |  Branch (118:36): [True: 3.02M, False: 0]
  ------------------
  119|  3.02M|           n = (n * base) + c - '0';
  120|    684|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (120:17): [True: 684, False: 0]
  |  Branch (120:29): [True: 417, False: 267]
  |  Branch (120:41): [True: 394, False: 23]
  |  Branch (120:53): [True: 373, False: 21]
  ------------------
  121|    373|           n = (n * base) + c-'a' + 10;
  122|    311|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (122:17): [True: 311, False: 0]
  |  Branch (122:29): [True: 279, False: 32]
  |  Branch (122:41): [True: 227, False: 52]
  |  Branch (122:53): [True: 210, False: 17]
  ------------------
  123|    210|           n = (n * base) + c-'A' + 10;
  124|    101|        else
  125|    101|           break;
  126|  3.02M|        ++progress;
  127|  3.02M|    }
  128|  11.3k|    *number = n;
  129|  11.3k|    return progress;
  130|  11.3k|}
UA_readNumber:
  133|  11.0k|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  134|  11.0k|    return UA_readNumberWithBase(buf, buflen, number, 10);
  135|  11.0k|}
UA_String_unescape:
  798|  92.4k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  799|  92.4k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (799:8): [True: 92.4k, False: 0]
  ------------------
  800|  92.4k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  92.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  801|       |
  802|       |    /* Does the string need escaping? */
  803|      0|    UA_String tmp;
  804|      0|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  805|      0|    u8 *pos = str->data;
  806|      0|    u8 *end = str->data + str->length;
  807|      0|    u8 escape_char = (esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (807:23): [True: 0, False: 0]
  ------------------
  808|      0|                      esc == UA_ESCAPING_PERCENT_EXTENDED) ? '%' : '&';
  ------------------
  |  Branch (808:23): [True: 0, False: 0]
  ------------------
  809|      0|    for(; pos < end; pos++) {
  ------------------
  |  Branch (809:11): [True: 0, False: 0]
  ------------------
  810|      0|        if(*pos == escape_char)
  ------------------
  |  Branch (810:12): [True: 0, False: 0]
  ------------------
  811|      0|            goto escape;
  812|      0|    }
  813|       |
  814|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  815|       |
  816|      0| escape:
  817|      0|    if(copyEscape) {
  ------------------
  |  Branch (817:8): [True: 0, False: 0]
  ------------------
  818|      0|        res = UA_String_copy(str, &tmp);
  819|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (819:12): [True: 0, False: 0]
  ------------------
  820|      0|            return res;
  821|      0|        pos = tmp.data;
  822|      0|        end = tmp.data + tmp.length;
  823|      0|    }
  824|       |
  825|      0|    u8 byte = 0;
  826|      0|    u8 *writepos = pos;
  827|       |
  828|      0|    res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  829|      0|    if(esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (829:8): [True: 0, False: 0]
  ------------------
  830|      0|       esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (830:8): [True: 0, False: 0]
  ------------------
  831|       |        /* Percent-Escaping */
  832|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (832:15): [True: 0, False: 0]
  ------------------
  833|      0|            if(*pos == '%') {
  ------------------
  |  Branch (833:16): [True: 0, False: 0]
  ------------------
  834|      0|                if(pos + 2 >= end || !isHex(pos[1]) || !isHex(pos[2]))
  ------------------
  |  Branch (834:20): [True: 0, False: 0]
  |  Branch (834:38): [True: 0, False: 0]
  |  Branch (834:56): [True: 0, False: 0]
  ------------------
  835|      0|                    goto out;
  836|      0|                if(pos[1] >= 'a')
  ------------------
  |  Branch (836:20): [True: 0, False: 0]
  ------------------
  837|      0|                    byte = pos[1] - ('a' - 10);
  838|      0|                else if(pos[1] >= 'A')
  ------------------
  |  Branch (838:25): [True: 0, False: 0]
  ------------------
  839|      0|                    byte = pos[1] - ('A' - 10);
  840|      0|                else
  841|      0|                    byte = pos[1] - '0';
  842|      0|                byte <<= 4;
  843|       |
  844|      0|                if(pos[2] >= 'a')
  ------------------
  |  Branch (844:20): [True: 0, False: 0]
  ------------------
  845|      0|                    byte += (u8)(pos[2] - ('a' - 10));
  846|      0|                else if(pos[2] >= 'A')
  ------------------
  |  Branch (846:25): [True: 0, False: 0]
  ------------------
  847|      0|                    byte += (u8)(pos[2] - ('A' - 10));
  848|      0|                else
  849|      0|                    byte += (u8)(pos[2] - '0');
  850|       |
  851|      0|                pos += 2;
  852|      0|                *writepos++ = byte;
  853|      0|                continue;
  854|      0|            }
  855|      0|            *writepos++ = *pos;
  856|      0|        }
  857|      0|    } else {
  858|       |        /* And-Escaping */
  859|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (859:15): [True: 0, False: 0]
  ------------------
  860|      0|            if(*pos == '&') {
  ------------------
  |  Branch (860:16): [True: 0, False: 0]
  ------------------
  861|      0|                pos++;
  862|      0|                if(pos == end)
  ------------------
  |  Branch (862:20): [True: 0, False: 0]
  ------------------
  863|      0|                    goto out;
  864|      0|            }
  865|      0|            *writepos++ = *pos;
  866|      0|        }
  867|      0|    }
  868|      0|    res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  869|       |
  870|      0| out:
  871|      0|    if(copyEscape) {
  ------------------
  |  Branch (871:8): [True: 0, False: 0]
  ------------------
  872|      0|        tmp.length = (size_t)(writepos - tmp.data);
  873|      0|        if(tmp.length == 0)
  ------------------
  |  Branch (873:12): [True: 0, False: 0]
  ------------------
  874|      0|            UA_String_clear(&tmp);
  875|      0|        if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (875:12): [True: 0, False: 0]
  ------------------
  876|      0|            *str = tmp;
  877|      0|        else
  878|      0|            UA_String_clear(&tmp);
  879|      0|    } else if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (879:15): [True: 0, False: 0]
  ------------------
  880|      0|        str->length = (size_t)(writepos - str->data);
  881|      0|    }
  882|      0|    return res;
  883|      0|}

ua_types_encoding_json.c:isTrue:
  167|  1.96k|isTrue(uint8_t expr) {
  168|  1.96k|    return expr;
  169|  1.96k|}
ua_pubsub_networkmessage_json.c:isTrue:
  167|   138k|isTrue(uint8_t expr) {
  168|   138k|    return expr;
  169|   138k|}
ua_pubsub_networkmessage_json.c:isGood:
  157|   138k|isGood(UA_StatusCode code) {
  158|   138k|    return code == UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   138k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  159|   138k|}

UA_memoryManager_setLimitFromLast4Bytes:
  161|  7.39k|int UA_memoryManager_setLimitFromLast4Bytes(const uint8_t *data, size_t size) {
  162|  7.39k|    UA_mallocSingleton = UA_memoryManager_malloc;
  163|  7.39k|    UA_freeSingleton = UA_memoryManager_free;
  164|  7.39k|    UA_callocSingleton = UA_memoryManager_calloc;
  165|  7.39k|    UA_reallocSingleton = UA_memoryManager_realloc;
  166|  7.39k|    if(size <4)
  ------------------
  |  Branch (166:8): [True: 0, False: 7.39k]
  ------------------
  167|      0|        return 0;
  168|       |    // just cast the last 4 bytes to uint32
  169|  7.39k|    uint32_t limit;
  170|  7.39k|    memcpy(&limit, &data[size-4], sizeof(uint32_t));
  171|  7.39k|    memoryLimit = limit;
  172|  7.39k|    return 1;
  173|  7.39k|}
custom_memory_manager.c:UA_memoryManager_malloc:
  114|   174k|static void *UA_memoryManager_malloc(size_t size) {
  115|   174k|    if(totalMemorySize + size > memoryLimit)
  ------------------
  |  Branch (115:8): [True: 28, False: 174k]
  ------------------
  116|     28|        return NULL;
  117|   174k|    void *addr = malloc(size);
  118|   174k|    if(!addr)
  ------------------
  |  Branch (118:8): [True: 0, False: 174k]
  ------------------
  119|      0|        return NULL;
  120|   174k|    addToMap(size, addr);
  121|   174k|    return addr;
  122|   174k|}
custom_memory_manager.c:addToMap:
   52|   379k|static int addToMap(size_t size, void *addr) {
   53|   379k|    struct UA_mm_entry *newEntry = (struct UA_mm_entry*)malloc(sizeof(struct UA_mm_entry));
   54|   379k|    if(!newEntry) {
  ------------------
  |  Branch (54:8): [True: 0, False: 379k]
  ------------------
   55|       |        //printf("MemoryManager: Could not allocate memory");
   56|      0|        return 0;
   57|      0|    }
   58|   379k|    newEntry->size = size;
   59|   379k|    newEntry->address = addr;
   60|   379k|    newEntry->next = NULL;
   61|   379k|    pthread_mutex_lock(&mutex);
   62|   379k|    newEntry->prev = address_map_last;
   63|   379k|    if(address_map_last)
  ------------------
  |  Branch (63:8): [True: 379k, False: 291]
  ------------------
   64|   379k|        address_map_last->next = newEntry;
   65|   379k|    address_map_last = newEntry;
   66|   379k|    totalMemorySize += size;
   67|   379k|    if(address_map_first == NULL)
  ------------------
  |  Branch (67:8): [True: 291, False: 379k]
  ------------------
   68|    291|        address_map_first = newEntry;
   69|   379k|    pthread_mutex_unlock(&mutex);
   70|       |    //printf("Total size (malloc): %lld And new address: %p Entry %p\n", totalMemorySize, addr, (void*)newEntry);
   71|       |
   72|   379k|    return 1;
   73|   379k|}
custom_memory_manager.c:UA_memoryManager_free:
  146|   455k|static void UA_memoryManager_free(void* ptr) {
  147|   455k|    removeFromMap(ptr);
  148|   455k|    free(ptr);
  149|   455k|}
custom_memory_manager.c:removeFromMap:
   82|   455k|static int removeFromMap(void *addr) {
   83|   455k|    if(addr == NULL)
  ------------------
  |  Branch (83:8): [True: 76.0k, False: 379k]
  ------------------
   84|  76.0k|        return 1;
   85|       |
   86|   379k|    pthread_mutex_lock(&mutex);
   87|       |
   88|   379k|    struct UA_mm_entry *e = address_map_last;
   89|       |
   90|   966M|    while (e) {
  ------------------
  |  Branch (90:12): [True: 966M, False: 0]
  ------------------
   91|   966M|        if(e->address == addr) {
  ------------------
  |  Branch (91:12): [True: 379k, False: 966M]
  ------------------
   92|   379k|            if(e == address_map_first)
  ------------------
  |  Branch (92:16): [True: 320, False: 378k]
  ------------------
   93|    320|                address_map_first = e->next;
   94|   379k|            if(e == address_map_last)
  ------------------
  |  Branch (94:16): [True: 98.6k, False: 280k]
  ------------------
   95|  98.6k|                address_map_last = e->prev;
   96|   379k|            if(e->prev)
  ------------------
  |  Branch (96:16): [True: 378k, False: 320]
  ------------------
   97|   378k|                e->prev->next = e->next;
   98|   379k|            if(e->next)
  ------------------
  |  Branch (98:16): [True: 280k, False: 98.6k]
  ------------------
   99|   280k|                e->next->prev = e->prev;
  100|   379k|            totalMemorySize -= e->size;
  101|       |
  102|       |            //printf("Total size (free): %lld after addr %p and deleting %p\n", totalMemorySize, addr, (void*)e);
  103|   379k|            free(e);
  104|   379k|            pthread_mutex_unlock(&mutex);
  105|   379k|            return 1;
  106|   379k|        }
  107|   966M|        e = e->prev;
  108|   966M|    }
  109|      0|    pthread_mutex_unlock(&mutex);
  110|       |    //printf("MemoryManager: Entry with address %p not found", addr);
  111|      0|    return 0;
  112|   379k|}
custom_memory_manager.c:UA_memoryManager_calloc:
  124|   204k|static void *UA_memoryManager_calloc(size_t num, size_t size) {
  125|   204k|    if(totalMemorySize + (size * num) > memoryLimit)
  ------------------
  |  Branch (125:8): [True: 30, False: 204k]
  ------------------
  126|     30|        return NULL;
  127|   204k|    void *addr = calloc(num, size);
  128|   204k|    if(!addr)
  ------------------
  |  Branch (128:8): [True: 0, False: 204k]
  ------------------
  129|      0|        return NULL;
  130|   204k|    addToMap(size*num, addr);
  131|   204k|    return addr;
  132|   204k|}

LLVMFuzzerTestOneInput:
   13|  7.40k|LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
   14|  7.40k|    if(size < 4)
  ------------------
  |  Branch (14:8): [True: 2, False: 7.39k]
  ------------------
   15|      2|        return 0;
   16|       |
   17|       |    /* Set memory limit from last 4 bytes to test OOM handling */
   18|  7.39k|    if(!UA_memoryManager_setLimitFromLast4Bytes(data, size))
  ------------------
  |  Branch (18:8): [True: 0, False: 7.39k]
  ------------------
   19|      0|        return 0;
   20|  7.39k|    size -= 4;
   21|       |
   22|       |    /* Create ByteString from fuzz input */
   23|  7.39k|    UA_ByteString buf;
   24|  7.39k|    buf.data = (UA_Byte*)(void*)data;
   25|  7.39k|    buf.length = size;
   26|       |
   27|       |    /* Decode the NetworkMessage from JSON */
   28|  7.39k|    UA_NetworkMessage nm;
   29|  7.39k|    memset(&nm, 0, sizeof(UA_NetworkMessage));
   30|       |
   31|  7.39k|    UA_StatusCode rv = UA_NetworkMessage_decodeJson(&buf, &nm, NULL, NULL);
   32|  7.39k|    if(rv == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  7.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (32:8): [True: 10, False: 7.38k]
  ------------------
   33|     10|        UA_NetworkMessage_clear(&nm);
   34|     10|    }
   35|       |
   36|  7.39k|    return 0;
   37|  7.39k|}

ua_types.c:UA_ByteString_init:
  239|  35.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  239|  95.4k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  239|    377|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  239|    485|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_clear:
  239|      1|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  239|  57.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  239|   104k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  239|    380|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  239|   104k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  239|  45.7k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  239|  6.10k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  239|    194|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  239|    224|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_clear:
  239|  69.2k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_DataValue_clear:
  239|  69.2k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_ByteString_clear:
  239|  6.68k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_String_clear:
  239|  6.68k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

