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

cj5_parse:
  305|  8.15k|          cj5_options *options) {
  306|  8.15k|    cj5_result r;
  307|  8.15k|    cj5__parser parser;
  308|  8.15k|    memset(&parser, 0x0, sizeof(parser));
  309|  8.15k|    parser.curr_tok_idx = 0;
  310|  8.15k|    parser.json5 = json5;
  311|  8.15k|    parser.len = len;
  312|  8.15k|    parser.tokens = tokens;
  313|  8.15k|    parser.max_tokens = max_tokens;
  314|       |
  315|  8.15k|    if(options)
  ------------------
  |  Branch (315:8): [True: 8.15k, False: 0]
  ------------------
  316|  8.15k|        parser.stop_early = options->stop_early;
  317|       |
  318|  8.15k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  8.15k|    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|  8.15k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  8.15k|    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|  8.15k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  8.15k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  9.68k| start_parsing:
  333|  80.8M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 80.8M, False: 7.75k]
  ------------------
  334|  80.8M|        char c = json5[parser.pos];
  335|  80.8M|        switch(c) {
  336|   534k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 534k, False: 80.3M]
  ------------------
  337|  1.66M|        case '\r':
  ------------------
  |  Branch (337:9): [True: 1.13M, False: 79.7M]
  ------------------
  338|  3.78M|        case '\t':
  ------------------
  |  Branch (338:9): [True: 2.11M, False: 78.7M]
  ------------------
  339|  4.01M|        case ' ':
  ------------------
  |  Branch (339:9): [True: 232k, False: 80.6M]
  ------------------
  340|  4.01M|            break;
  341|       |
  342|  6.04k|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 6.04k, False: 80.8M]
  ------------------
  343|  10.1k|        case '/':
  ------------------
  |  Branch (343:9): [True: 4.14k, False: 80.8M]
  ------------------
  344|  10.1k|            cj5__skip_comment(&parser);
  345|  10.1k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 3.27k, False: 6.91k]
  ------------------
  346|  3.27k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 150, False: 3.12k]
  ------------------
  347|    150|                goto finish;
  348|  10.0k|            break;
  349|       |
  350|   158k|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 158k, False: 80.7M]
  ------------------
  351|   248k|        case '[':
  ------------------
  |  Branch (351:9): [True: 90.6k, False: 80.7M]
  ------------------
  352|       |            // Check the nesting depth
  353|   248k|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|   248k|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 3, False: 248k]
  ------------------
  354|      3|                parser.error = CJ5_ERROR_INVALID;
  355|      3|                goto finish;
  356|      3|            }
  357|       |
  358|       |            // Correct next?
  359|   248k|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 27, False: 248k]
  ------------------
  360|     27|                parser.error = CJ5_ERROR_INVALID;
  361|     27|                goto finish;
  362|     27|            }
  363|       |
  364|   248k|            depth++; // Increase the nesting depth
  365|   248k|            nesting[depth] = c; // Set the nesting type
  366|   248k|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 158k, False: 90.6k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|   248k|            token = cj5__alloc_token(&parser);
  370|   248k|            if(token) {
  ------------------
  |  Branch (370:16): [True: 155k, False: 93.3k]
  ------------------
  371|   155k|                token->parent_id = parser.curr_tok_idx;
  372|   155k|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 103k, False: 51.6k]
  ------------------
  373|   155k|                token->start = parser.pos;
  374|   155k|                token->size = 0;
  375|   155k|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|   155k|            }
  378|   248k|            break;
  379|       |
  380|   155k|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 155k, False: 80.7M]
  ------------------
  381|   245k|        case ']':
  ------------------
  |  Branch (381:9): [True: 89.3k, False: 80.7M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|   245k|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 19, False: 245k]
  ------------------
  385|     19|                parser.error = CJ5_ERROR_INVALID;
  386|     19|                goto finish;
  387|     19|            }
  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|   245k|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 7, False: 245k]
  ------------------
  393|   245k|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 155k, False: 89.3k]
  |  Branch (393:29): [True: 125k, False: 30.0k]
  |  Branch (393:51): [True: 6, False: 125k]
  ------------------
  394|     13|                parser.error = CJ5_ERROR_INVALID;
  395|     13|                goto finish;
  396|     13|            }
  397|       |
  398|   245k|            if(token) {
  ------------------
  |  Branch (398:16): [True: 149k, False: 95.3k]
  ------------------
  399|       |                // Finalize the current token
  400|   149k|                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|   149k|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 143k, False: 5.93k]
  ------------------
  406|   143k|                    parser.curr_tok_idx = token->parent_id;
  407|   143k|                    token = &tokens[token->parent_id];
  408|   143k|                    token->size++;
  409|   143k|                }
  410|   149k|            }
  411|       |
  412|       |            // Step one level up
  413|   245k|            depth--;
  414|   245k|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 6.37k, False: 238k]
  ------------------
  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|   245k|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 6.37k, False: 238k]
  |  Branch (420:30): [True: 0, False: 6.37k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|   245k|            break;
  424|       |
  425|  4.86M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 4.86M, False: 76.0M]
  ------------------
  426|  4.86M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 1.17k, False: 4.86M]
  ------------------
  427|  1.17k|                parser.error = CJ5_ERROR_INVALID;
  428|  1.17k|                goto finish;
  429|  1.17k|            }
  430|  4.86M|            next[depth] = 'v';
  431|  4.86M|            break;
  432|       |
  433|  33.3M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 33.3M, False: 47.5M]
  ------------------
  434|  33.3M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 19, False: 33.3M]
  ------------------
  435|     19|                parser.error = CJ5_ERROR_INVALID;
  436|     19|                goto finish;
  437|     19|            }
  438|  33.3M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 4.73M, False: 28.6M]
  ------------------
  439|  33.3M|            break;
  440|       |
  441|  38.1M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 38.1M, False: 42.7M]
  ------------------
  442|  38.1M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 33.2M, False: 4.86M]
  ------------------
  443|  33.2M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  33.2M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 33.2M, False: 1.54k]
  ------------------
  445|       |                    // Parent is object or array
  446|  33.2M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 30.6M, False: 2.60M]
  ------------------
  447|  30.6M|                        token->size++;
  448|  33.2M|                    next[depth] = ',';
  449|  33.2M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|  1.54k|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|  1.54k|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 1.54k]
  ------------------
  457|      0|                        goto finish;
  458|  1.54k|                }
  459|  33.2M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 4.86M, False: 231]
  ------------------
  460|  4.86M|                cj5__parse_key(&parser);
  461|  4.86M|                if(token)
  ------------------
  |  Branch (461:20): [True: 4.55M, False: 308k]
  ------------------
  462|  4.55M|                    token->size++; // Keys count towards the length
  463|  4.86M|                next[depth] = ':';
  464|  4.86M|            } else {
  465|    231|                parser.error = CJ5_ERROR_INVALID;
  466|    231|            }
  467|       |
  468|  38.1M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 19.8M, False: 18.2M]
  |  Branch (468:32): [True: 526, False: 19.8M]
  ------------------
  469|    526|                goto finish;
  470|       |
  471|  38.1M|            break;
  472|  80.8M|        }
  473|  80.8M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  7.75k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 200, False: 7.55k]
  ------------------
  477|    200|        parser.error = CJ5_ERROR_INCOMPLETE;
  478|    200|        goto finish;
  479|    200|    }
  480|       |
  481|       |    // Close the virtual root object if there is one
  482|  7.55k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 1.08k, False: 6.46k]
  |  Branch (482:29): [True: 1.05k, False: 33]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|  1.05k|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 1.04k, False: 8]
  |  Branch (484:30): [True: 87, False: 960]
  ------------------
  485|     87|            parser.error = CJ5_ERROR_INVALID;
  486|  1.05k|        tokens[0].end = parser.pos - 1;
  487|  1.05k|    }
  488|       |
  489|  9.68k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  9.68k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 2.83k, False: 6.84k]
  ------------------
  493|  2.83k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 2.22k, False: 617]
  ------------------
  494|  2.22k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 1.93k, False: 288]
  |  Branch (494:22): [True: 1.52k, False: 405]
  ------------------
  495|  1.52k|        parser.token_count = 0;
  496|  1.52k|        token = cj5__alloc_token(&parser);
  497|  1.52k|        if(token) {
  ------------------
  |  Branch (497:12): [True: 1.52k, False: 0]
  ------------------
  498|  1.52k|            token->parent_id = 0;
  499|  1.52k|            token->type = CJ5_TOKEN_OBJECT;
  500|  1.52k|            token->start = 0;
  501|  1.52k|            token->size = 0;
  502|       |
  503|  1.52k|            nesting[0] = '{';
  504|  1.52k|            next[0] = 'k';
  505|       |
  506|  1.52k|            parser.curr_tok_idx = 0;
  507|  1.52k|            parser.pos = 0;
  508|  1.52k|            parser.error = CJ5_ERROR_NONE;
  509|  1.52k|            goto start_parsing;
  510|  1.52k|        }
  511|  1.52k|    }
  512|       |
  513|  8.15k|    memset(&r, 0x0, sizeof(r));
  514|  8.15k|    r.error = parser.error;
  515|  8.15k|    r.error_pos = parser.pos;
  516|  8.15k|    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|  8.15k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 29, False: 8.12k]
  ------------------
  521|     29|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  8.15k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 6.81k, False: 1.33k]
  ------------------
  525|  6.81k|        r.tokens = tokens;
  526|  6.81k|        r.json5 = json5;
  527|  6.81k|    }
  528|       |
  529|  8.15k|    return r;
  530|  9.68k|}
cj5_get_str:
  628|  69.6k|            char *buf, unsigned int *buflen) {
  629|  69.6k|    const cj5_token *token = &r->tokens[tok_index];
  630|  69.6k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (630:8): [True: 0, False: 69.6k]
  ------------------
  631|      0|        buf[0] = 0;
  632|      0|        if(buflen)
  ------------------
  |  Branch (632:12): [True: 0, False: 0]
  ------------------
  633|      0|            *buflen = 0;
  634|      0|        return CJ5_ERROR_INVALID;
  635|      0|    }
  636|       |
  637|  69.6k|    const char *pos = &r->json5[token->start];
  638|  69.6k|    const char *end = &r->json5[token->end + 1];
  639|  69.6k|    unsigned int outpos = 0;
  640|  69.6k|    cj5_error_code error = CJ5_ERROR_NONE;
  641|  17.6M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (641:11): [True: 17.5M, False: 69.4k]
  ------------------
  642|  17.5M|        uint8_t c = (uint8_t)*pos;
  643|       |        // Unprintable ascii characters must be escaped
  644|  17.5M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (644:12): [True: 40, False: 17.5M]
  |  Branch (644:23): [True: 3, False: 17.5M]
  ------------------
  645|     43|            error = CJ5_ERROR_INVALID;
  646|     43|            goto done;
  647|     43|        }
  648|       |
  649|       |        // Unescaped Ascii character or utf8 byte
  650|  17.5M|        if(c != '\\') {
  ------------------
  |  Branch (650:12): [True: 17.5M, False: 12.1k]
  ------------------
  651|  17.5M|            buf[outpos++] = (char)c;
  652|  17.5M|            continue;
  653|  17.5M|        }
  654|       |
  655|       |        // End of input before the escaped character
  656|  12.1k|        if(pos + 1 >= end) {
  ------------------
  |  Branch (656:12): [True: 0, False: 12.1k]
  ------------------
  657|      0|            error = CJ5_ERROR_INCOMPLETE;
  658|      0|            goto done;
  659|      0|        }
  660|       |
  661|       |        // Process escaped character
  662|  12.1k|        pos++;
  663|  12.1k|        c = (uint8_t)*pos;
  664|  12.1k|        switch(c) {
  665|    238|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (665:9): [True: 238, False: 11.9k]
  ------------------
  666|    496|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (666:9): [True: 496, False: 11.6k]
  ------------------
  667|    203|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (667:9): [True: 203, False: 11.9k]
  ------------------
  668|    486|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (668:9): [True: 486, False: 11.6k]
  ------------------
  669|  1.13k|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (669:9): [True: 1.13k, False: 11.0k]
  ------------------
  670|  5.33k|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (670:9): [True: 5.33k, False: 6.81k]
  ------------------
  671|  4.26k|        case 'u': {
  ------------------
  |  Branch (671:9): [True: 4.26k, False: 7.88k]
  ------------------
  672|       |            // Parse a unicode code point
  673|  4.26k|            if(pos + 4 >= end) {
  ------------------
  |  Branch (673:16): [True: 4, False: 4.25k]
  ------------------
  674|      4|                error = CJ5_ERROR_INCOMPLETE;
  675|      4|                goto done;
  676|      4|            }
  677|  4.25k|            pos++;
  678|  4.25k|            uint32_t utf;
  679|  4.25k|            error = parse_codepoint(pos, &utf);
  680|  4.25k|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (680:16): [True: 21, False: 4.23k]
  ------------------
  681|     21|                goto done;
  682|  4.23k|            pos += 3;
  683|       |
  684|       |            // Parse a surrogate pair
  685|  4.23k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (685:16): [True: 2.13k, False: 2.10k]
  |  Branch (685:33): [True: 1.63k, False: 494]
  ------------------
  686|  1.63k|                if(pos + 6 >= end) {
  ------------------
  |  Branch (686:20): [True: 10, False: 1.62k]
  ------------------
  687|     10|                    error = CJ5_ERROR_INVALID;
  688|     10|                    goto done;
  689|     10|                }
  690|  1.62k|                if(pos[1] != '\\' && pos[2] != 'u') {
  ------------------
  |  Branch (690:20): [True: 538, False: 1.09k]
  |  Branch (690:38): [True: 12, False: 526]
  ------------------
  691|     12|                    error = CJ5_ERROR_INVALID;
  692|     12|                    goto done;
  693|     12|                }
  694|  1.61k|                pos += 3;
  695|  1.61k|                uint32_t utf2;
  696|  1.61k|                error = parse_codepoint(pos, &utf2);
  697|  1.61k|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (697:20): [True: 20, False: 1.59k]
  ------------------
  698|     20|                    goto done;
  699|  1.59k|                pos += 3;
  700|       |                // High or low surrogate pair
  701|  1.59k|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (701:23): [True: 1.21k, False: 383]
  ------------------
  702|  1.21k|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  703|  1.59k|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  704|  1.59k|            }
  705|       |
  706|       |            // Write the utf8 bytes of the code point
  707|  4.19k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  708|  4.19k|            if(len == 0) {
  ------------------
  |  Branch (708:16): [True: 39, False: 4.15k]
  ------------------
  709|     39|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  710|     39|                goto done;
  711|     39|            }
  712|  4.15k|            outpos += len;
  713|  4.15k|            break;
  714|  4.19k|        }
  715|  12.1k|        }
  716|  12.1k|    }
  717|       |
  718|  69.6k| done:
  719|       |    // Always leave buf as a valid, NUL-terminated string, even when decoding
  720|       |    // fails midway. Callers still must check the returned error code.
  721|  69.6k|    buf[outpos] = 0;
  722|       |
  723|       |    // Set the output length
  724|  69.6k|    if(buflen)
  ------------------
  |  Branch (724:8): [True: 69.6k, False: 0]
  ------------------
  725|  69.6k|        *buflen = outpos;
  726|  69.6k|    return error;
  727|  69.6k|}
cj5.c:cj5__skip_comment:
  260|  10.1k|cj5__skip_comment(cj5__parser* parser) {
  261|  10.1k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  10.1k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 6.04k, False: 4.14k]
  ------------------
  265|  6.43k|    skip_line:
  266|  3.66M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 3.66M, False: 54]
  ------------------
  267|  3.66M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 6.37k, False: 3.65M]
  ------------------
  268|  6.37k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  6.37k|                return;
  270|  6.37k|            }
  271|  3.65M|            parser->pos++;
  272|  3.65M|        }
  273|     54|        return;
  274|  6.43k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  4.14k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 36, False: 4.10k]
  ------------------
  278|     36|        parser->error = CJ5_ERROR_INVALID;
  279|     36|        return;
  280|     36|    }
  281|  4.10k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  4.10k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 387, False: 3.71k]
  ------------------
  285|    387|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|  3.71k|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 3.69k, False: 29]
  ------------------
  289|  3.69k|        parser->pos++;
  290|  1.48M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 1.48M, False: 85]
  ------------------
  291|  1.48M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 8.90k, False: 1.47M]
  |  Branch (291:45): [True: 3.60k, False: 5.30k]
  ------------------
  292|  3.60k|                parser->pos++;
  293|  3.60k|                return;
  294|  3.60k|            }
  295|  1.48M|        }
  296|  3.69k|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|    114|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|    114|}
cj5.c:cj5__alloc_token:
   88|  38.3M|cj5__alloc_token(cj5__parser *parser) {
   89|  38.3M|    cj5_token* token = NULL;
   90|  38.3M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 18.3M, False: 19.9M]
  ------------------
   91|  18.3M|        token = &parser->tokens[parser->token_count];
   92|  18.3M|        memset(token, 0x0, sizeof(cj5_token));
   93|  19.9M|    } else {
   94|  19.9M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  19.9M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  38.3M|    parser->token_count++;
  100|  38.3M|    return token;
  101|  38.3M|}
cj5.c:cj5__parse_primitive:
  152|  33.2M|cj5__parse_primitive(cj5__parser* parser) {
  153|  33.2M|    const char* json5 = parser->json5;
  154|  33.2M|    unsigned int len = parser->len;
  155|  33.2M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  33.2M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 1.44M, False: 31.8M]
  ------------------
  159|  31.8M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 1.32k, False: 31.8M]
  ------------------
  160|  1.45M|        cj5__parse_string(parser);
  161|  1.45M|        return;
  162|  1.45M|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  31.8M|    uint32_t fourcc = 0;
  167|  31.8M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 31.8M, False: 650]
  ------------------
  168|  31.8M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  31.8M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  31.8M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  31.8M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  31.8M|    }
  173|       |    
  174|  31.8M|    cj5_token_type type;
  175|  31.8M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 6.77k, False: 31.8M]
  ------------------
  176|  6.77k|        type = CJ5_TOKEN_NULL;
  177|  6.77k|        parser->pos += 3;
  178|  31.8M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 487, False: 31.8M]
  ------------------
  179|    487|        type = CJ5_TOKEN_BOOL;
  180|    487|        parser->pos += 3;
  181|  31.8M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 283, False: 31.8M]
  ------------------
  182|       |        // "false" has five characters
  183|    283|        type = CJ5_TOKEN_BOOL;
  184|    283|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 1, False: 282]
  |  Branch (184:32): [True: 16, False: 266]
  ------------------
  185|     17|            parser->error = CJ5_ERROR_INVALID;
  186|     17|            return;
  187|     17|        }
  188|    266|        parser->pos += 4;
  189|  31.8M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  31.8M|        type = CJ5_TOKEN_NUMBER;
  193|  80.3M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 80.3M, False: 1.04k]
  ------------------
  194|  80.3M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|   160M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 42.7M, False: 37.6M]
  ------------------
  195|  42.7M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 42.7M, False: 1.20k]
  ------------------
  196|  42.7M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|   123M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 35.6M, False: 7.07M]
  ------------------
  197|  35.6M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|   116M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 32.3M, False: 3.30M]
  ------------------
  198|  32.3M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 32.3M, False: 1.26k]
  |  Branch (198:48): [True: 31.7M, False: 543k]
  ------------------
  199|  31.7M|                break;
  200|  31.7M|            }
  201|  80.3M|        }
  202|  31.8M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  31.8M|    }
  205|       |
  206|  31.8M|    cj5_token *token = cj5__alloc_token(parser);
  207|  31.8M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 15.0M, False: 16.8M]
  ------------------
  208|  15.0M|        token->type = type;
  209|  15.0M|        token->start = start;
  210|  15.0M|        token->end = parser->pos;
  211|  15.0M|        token->size = parser->pos - start + 1;
  212|  15.0M|        token->parent_id = parser->curr_tok_idx;
  213|  15.0M|    }
  214|  31.8M|}
cj5.c:cj5__parse_string:
  104|  3.44M|cj5__parse_string(cj5__parser *parser) {
  105|  3.44M|    const char *json5 = parser->json5;
  106|  3.44M|    unsigned int len = parser->len;
  107|  3.44M|    unsigned int start = parser->pos;
  108|  3.44M|    char str_open = json5[start];
  109|       |
  110|  3.44M|    parser->pos++;
  111|  65.8M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 65.8M, False: 152]
  ------------------
  112|  65.8M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  65.8M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 3.44M, False: 62.3M]
  ------------------
  116|  3.44M|            cj5_token *token = cj5__alloc_token(parser);
  117|  3.44M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 1.74M, False: 1.70M]
  ------------------
  118|  1.74M|                token->type = CJ5_TOKEN_STRING;
  119|  1.74M|                token->start = start + 1;
  120|  1.74M|                token->end = parser->pos - 1;
  121|  1.74M|                token->size = token->end - token->start + 1;
  122|  1.74M|                token->parent_id = parser->curr_tok_idx;
  123|  1.74M|            } 
  124|  3.44M|            return;
  125|  3.44M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  62.3M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 4, False: 62.3M]
  ------------------
  129|      4|            parser->error = CJ5_ERROR_INVALID;
  130|      4|            return;
  131|      4|        }
  132|       |
  133|       |        // Skip escape character
  134|  62.3M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 406k, False: 61.9M]
  ------------------
  135|   406k|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 3, False: 406k]
  ------------------
  136|      3|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      3|                return;
  138|      3|            }
  139|   406k|            parser->pos++;
  140|   406k|        }
  141|  62.3M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|    152|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|    152|}
cj5.c:cj5__isrange:
   79|   178M|cj5__isrange(char ch, char from, char to) {
   80|   178M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|   178M|}
cj5.c:cj5__parse_key:
  217|  4.86M|cj5__parse_key(cj5__parser* parser) {
  218|  4.86M|    const char* json5 = parser->json5;
  219|  4.86M|    unsigned int start = parser->pos;
  220|  4.86M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  4.86M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 1.99M, False: 2.87M]
  |  Branch (223:32): [True: 2.61k, False: 2.86M]
  ------------------
  224|  1.99M|        cj5__parse_string(parser);
  225|  1.99M|        return;
  226|  1.99M|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|  2.86M|    unsigned int len = parser->len;
  230|  9.51M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 9.51M, False: 95]
  ------------------
  231|  9.51M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  19.0M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 2.49M, False: 7.02M]
  |  |  ------------------
  ------------------
  232|  7.02M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  16.5M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 3.84M, False: 3.17M]
  |  |  ------------------
  ------------------
  233|  3.17M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 998, False: 3.17M]
  |  Branch (233:41): [True: 4.63k, False: 3.16M]
  ------------------
  234|  6.34M|            continue;
  235|  3.16M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|  6.33M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 302k, False: 2.86M]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 302k, False: 9]
  ------------------
  236|   302k|            continue;
  237|  2.86M|        break;
  238|  3.16M|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|  2.86M|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 119, False: 2.86M]
  ------------------
  242|    119|        parser->error = CJ5_ERROR_INVALID;
  243|    119|        return;
  244|    119|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|  2.86M|    parser->pos--;
  248|       |
  249|  2.86M|    token = cj5__alloc_token(parser);
  250|  2.86M|    if(token) {
  ------------------
  |  Branch (250:8): [True: 1.49M, False: 1.37M]
  ------------------
  251|  1.49M|        token->type = CJ5_TOKEN_STRING;
  252|  1.49M|        token->start = start;
  253|  1.49M|        token->end = parser->pos;
  254|  1.49M|        token->size = parser->pos - start + 1;
  255|  1.49M|        token->parent_id = parser->curr_tok_idx;
  256|  1.49M|    }
  257|  2.86M|}
cj5.c:parse_codepoint:
  607|  5.87k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|  5.87k|    uint32_t utf = 0;
  609|  29.2k|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 23.4k, False: 5.83k]
  ------------------
  610|  23.4k|        char byte = pos[i];
  611|  23.4k|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  23.4k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 6.86k, False: 16.5k]
  |  |  ------------------
  ------------------
  612|  6.86k|            byte = (char)(byte - '0');
  613|  16.5k|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 11.8k, False: 4.72k]
  ------------------
  614|  11.8k|            byte = (char)(byte - ('a' - 10));
  615|  11.8k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 4.68k, False: 41]
  ------------------
  616|  4.68k|            byte = (char)(byte - ('A' - 10));
  617|  4.68k|        } else {
  618|     41|            return CJ5_ERROR_INVALID;
  619|     41|        }
  620|  23.3k|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  23.3k|    }
  622|  5.83k|    *out_utf = utf;
  623|  5.83k|    return CJ5_ERROR_NONE;
  624|  5.87k|}

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

parseUInt64:
   30|  6.75M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  6.75M|    size_t i = 0;
   32|  6.75M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  6.75M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 320k, False: 6.43M]
  |  Branch (35:20): [True: 311k, False: 9.82k]
  |  Branch (35:37): [True: 19.4k, False: 291k]
  ------------------
   36|  19.4k|        i = 2;
   37|   817k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 798k, False: 18.9k]
  ------------------
   38|   798k|            uint8_t c = (uint8_t)str[i] | 32;
   39|   798k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 798k, False: 209]
  |  Branch (39:28): [True: 786k, False: 11.4k]
  ------------------
   40|   786k|                c = (uint8_t)(c - '0');
   41|  11.6k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 11.4k, False: 214]
  |  Branch (41:33): [True: 11.1k, False: 300]
  ------------------
   42|  11.1k|                c = (uint8_t)(c - 'a' + 10);
   43|    514|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 301, False: 213]
  |  Branch (43:33): [True: 0, False: 301]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    514|            else
   46|    514|                break;
   47|   797k|            n = (n << 4) | (c & 0xF);
   48|   797k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 3, False: 797k]
  ------------------
   49|      3|                return 0;
   50|   797k|            prev = n;
   51|   797k|        }
   52|  19.4k|        *result = n;
   53|  19.4k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 19.3k, False: 33]
  ------------------
   54|  19.4k|    }
   55|       |
   56|       |    /* Decimal */
   57|  18.7M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 12.0M, False: 6.72M]
  ------------------
   58|  12.0M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 7.88k, False: 12.0M]
  |  Branch (58:28): [True: 2.05k, False: 12.0M]
  ------------------
   59|  9.94k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  12.0M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  12.0M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 10, False: 12.0M]
  ------------------
   63|     10|            return 0;
   64|  12.0M|        prev = n;
   65|  12.0M|    }
   66|  6.73M|    *result = n;
   67|  6.73M|    return i;
   68|  6.73M|}
parseInt64:
   71|  1.73M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.73M|    size_t i = 0;
   74|  1.73M|    bool neg = false;
   75|  1.73M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 816, False: 1.73M]
  |  Branch (75:23): [True: 303, False: 1.73M]
  ------------------
   76|  1.11k|        neg = (*str == '-');
   77|  1.11k|        i++;
   78|  1.11k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.73M|    uint64_t n = 0;
   82|  1.73M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.73M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 102, False: 1.73M]
  ------------------
   84|    102|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.73M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 1.73M, False: 807]
  ------------------
   88|  1.73M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 63, False: 1.73M]
  ------------------
   89|     63|            return 0;
   90|  1.73M|        *result = (int64_t)n;
   91|  1.73M|    } else {
   92|       |        /* n is unsigned, so 9223372036854775808UL == 2^63 fits without
   93|       |         * overflow. (int64_t)n would also fit for n in [0, 2^63], but
   94|       |         * the negation -(int64_t)(2^63) is undefined because the result
   95|       |         * (which is +2^63) cannot be represented. Use the unsigned
   96|       |         * representation and reinterpret as int64_t instead. */
   97|    807|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 1, False: 806]
  ------------------
   98|      1|            return 0;
   99|    806|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 1, False: 805]
  ------------------
  100|    806|            ? (int64_t)(-9223372036854775807LL - 1)
  101|    806|            : -(int64_t)n;
  102|    806|    }
  103|  1.73M|    return len + i;
  104|  1.73M|}
parseDouble:
  106|   525k|size_t parseDouble(const char *str, size_t size, double *result) {
  107|   525k|    char buf[2000];
  108|   525k|    if(size >= 2000)
  ------------------
  |  Branch (108:8): [True: 1, False: 525k]
  ------------------
  109|      1|        return 0;
  110|   525k|    memcpy(buf, str, size);
  111|   525k|    buf[size] = 0;
  112|   525k|    errno = 0;
  113|   525k|    char *endptr;
  114|   525k|    *result = strtod(buf, &endptr);
  115|   525k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (115:8): [True: 197, False: 525k]
  |  Branch (115:22): [True: 0, False: 197]
  ------------------
  116|      0|        return 0;
  117|   525k|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|   525k|}

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

findEncodingMetaData:
  277|  4.72k|                     UA_UInt16 dsWriterId) {
  278|  4.72k|    if(!eo)
  ------------------
  |  Branch (278:8): [True: 0, False: 4.72k]
  ------------------
  279|      0|        return NULL;
  280|  4.72k|    for(size_t i = 0; i < eo->metaDataSize; i++) {
  ------------------
  |  Branch (280:23): [True: 0, False: 4.72k]
  ------------------
  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.72k|    return NULL;
  285|  4.72k|}
UA_NetworkMessage_clear:
 1052|  6.81k|UA_NetworkMessage_clear(UA_NetworkMessage* p) {
 1053|  6.81k|    if(p->promotedFieldsEnabled) {
  ------------------
  |  Branch (1053:8): [True: 0, False: 6.81k]
  ------------------
 1054|      0|        UA_Array_delete(p->promotedFields, p->promotedFieldsSize,
 1055|      0|                        &UA_TYPES[UA_TYPES_VARIANT]);
  ------------------
  |  |  803|      0|#define UA_TYPES_VARIANT 23
  ------------------
 1056|      0|    }
 1057|       |
 1058|  6.81k|    if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) {
  ------------------
  |  Branch (1058:8): [True: 6.81k, False: 0]
  ------------------
 1059|  6.81k|        if(p->payload.dataSetMessages) {
  ------------------
  |  Branch (1059:12): [True: 6.34k, False: 473]
  ------------------
 1060|  12.8k|            for(size_t i = 0; i < p->messageCount; i++)
  ------------------
  |  Branch (1060:31): [True: 6.47k, False: 6.34k]
  ------------------
 1061|  6.47k|                UA_DataSetMessage_clear(&p->payload.dataSetMessages[i]);
 1062|  6.34k|            UA_free(p->payload.dataSetMessages);
  ------------------
  |  |   19|  6.34k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1063|  6.34k|        }
 1064|  6.81k|    }
 1065|       |
 1066|  6.81k|    UA_ByteString_clear(&p->securityFooter);
 1067|  6.81k|    UA_String_clear(&p->messageId);
 1068|       |
 1069|  6.81k|    if(p->publisherIdEnabled &&
  ------------------
  |  Branch (1069:8): [True: 4, False: 6.81k]
  ------------------
 1070|      4|       p->publisherId.idType == UA_PUBLISHERIDTYPE_STRING)
  ------------------
  |  Branch (1070:8): [True: 1, False: 3]
  ------------------
 1071|      1|       UA_String_clear(&p->publisherId.id.string);
 1072|       |
 1073|  6.81k|    memset(p, 0, sizeof(UA_NetworkMessage));
 1074|  6.81k|}
UA_DataSetMessage_clear:
 1875|  6.47k|UA_DataSetMessage_clear(UA_DataSetMessage* p) {
 1876|  6.47k|    if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) {
  ------------------
  |  Branch (1876:8): [True: 6.47k, False: 0]
  ------------------
 1877|  6.47k|        if(p->data.keyFrameFields)
  ------------------
  |  Branch (1877:12): [True: 4.72k, False: 1.74k]
  ------------------
 1878|  4.72k|            UA_Array_delete(p->data.keyFrameFields, p->fieldCount,
 1879|  4.72k|                            &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  769|  4.72k|#define UA_TYPES_DATAVALUE 22
  ------------------
 1880|  6.47k|    } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) {
  ------------------
  |  Branch (1880:15): [True: 0, False: 0]
  ------------------
 1881|      0|        if(p->data.deltaFrameFields) {
  ------------------
  |  Branch (1881:12): [True: 0, False: 0]
  ------------------
 1882|      0|            for(UA_UInt16 i = 0; i < p->fieldCount; i++)
  ------------------
  |  Branch (1882:34): [True: 0, False: 0]
  ------------------
 1883|      0|                UA_DataValue_clear(&p->data.deltaFrameFields[i].value);
 1884|      0|            UA_free(p->data.deltaFrameFields);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1885|      0|        }
 1886|      0|    }
 1887|       |
 1888|  6.47k|    memset(p, 0, sizeof(UA_DataSetMessage));
 1889|  6.47k|}

UA_NetworkMessage_decodeJson:
  543|  7.55k|                             const UA_DecodeJsonOptions *jo) {
  544|       |    /* Set up the context */
  545|  7.55k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
  546|  7.55k|    PubSubDecodeJsonCtx ctx;
  547|  7.55k|    memset(&ctx, 0, sizeof(PubSubDecodeJsonCtx));
  548|  7.55k|    ctx.ctx.tokens = tokens;
  549|  7.55k|    if(eo)
  ------------------
  |  Branch (549:8): [True: 0, False: 7.55k]
  ------------------
  550|      0|        ctx.eo = *eo;
  551|  7.55k|    if(jo) {
  ------------------
  |  Branch (551:8): [True: 0, False: 7.55k]
  ------------------
  552|      0|        ctx.ctx.namespaceMapping = jo->namespaceMapping;
  553|      0|        ctx.ctx.serverUrisSize = jo->serverUrisSize;
  554|      0|        ctx.ctx.serverUris = jo->serverUris;
  555|      0|        ctx.ctx.customTypes = jo->customTypes;
  556|      0|    }
  557|       |
  558|  7.55k|    status ret = tokenize(&ctx.ctx, src, UA_JSON_MAXTOKENCOUNT, NULL);
  ------------------
  |  |   20|  7.55k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
  559|  7.55k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  7.55k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (559:8): [True: 732, False: 6.81k]
  ------------------
  560|    732|        goto cleanup;
  561|       |
  562|  6.81k|    ret = NetworkMessage_decodeJsonInternal(&ctx, dst);
  563|  6.81k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.81k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (563:8): [True: 6.80k, False: 11]
  ------------------
  564|  6.80k|        UA_NetworkMessage_clear(dst);
  565|       |
  566|  7.55k| cleanup:
  567|       |    /* Free token array on the heap */
  568|  7.55k|    if(ctx.ctx.tokens != tokens)
  ------------------
  |  Branch (568:8): [True: 617, False: 6.93k]
  ------------------
  569|    617|        UA_free((void*)(uintptr_t)ctx.ctx.tokens);
  ------------------
  |  |   19|    617|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  570|  7.55k|    return ret;
  571|  6.81k|}
ua_pubsub_networkmessage_json.c:NetworkMessage_decodeJsonInternal:
  461|  6.81k|                                  UA_NetworkMessage *dst) {
  462|  6.81k|    memset(dst, 0, sizeof(UA_NetworkMessage));
  463|  6.81k|    dst->chunkMessage = false;
  464|  6.81k|    dst->groupHeaderEnabled = false;
  465|  6.81k|    dst->payloadHeaderEnabled = false;
  466|  6.81k|    dst->picosecondsEnabled = false;
  467|  6.81k|    dst->promotedFieldsEnabled = false;
  468|       |
  469|       |    /* The NetworkMessage must be a JSON object */
  470|  6.81k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (470:8): [True: 97, False: 6.72k]
  ------------------
  471|     97|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     97|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  472|       |
  473|       |    /* Is Messages an Array? How big? */
  474|  6.72k|    size_t searchResultMessages = 0;
  475|  6.72k|    status found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGES, &searchResultMessages);
  476|  6.72k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.72k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (476:8): [True: 142, False: 6.58k]
  ------------------
  477|    142|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|    142|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  478|  6.58k|    const cj5_token *bodyToken = &ctx->ctx.tokens[searchResultMessages];
  479|  6.58k|    size_t messageCount = 1;
  480|  6.58k|    if(bodyToken->type == CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (480:8): [True: 2.51k, False: 4.06k]
  ------------------
  481|  2.51k|        messageCount = (size_t)bodyToken->size;
  482|       |
  483|       |    /* Too many DataSetMessages */
  484|  6.58k|    if(messageCount > UA_NETWORKMESSAGE_MAXMESSAGECOUNT)
  ------------------
  |  |  136|  6.58k|#define UA_NETWORKMESSAGE_MAXMESSAGECOUNT 32
  ------------------
  |  Branch (484:8): [True: 2, False: 6.57k]
  ------------------
  485|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  486|       |
  487|       |    /* MessageType */
  488|  6.57k|    UA_Boolean isUaData = true;
  489|  6.57k|    size_t searchResultMessageType = 0;
  490|  6.57k|    found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGETYPE, &searchResultMessageType);
  491|  6.57k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.57k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (491:8): [True: 46, False: 6.53k]
  ------------------
  492|     46|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     46|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  493|  6.53k|    size_t size = getTokenLength(&ctx->ctx.tokens[searchResultMessageType]);
  494|  6.53k|    const char* msgType = &ctx->ctx.json5[ctx->ctx.tokens[searchResultMessageType].start];
  495|  6.53k|    if(size == 7) { //ua-data
  ------------------
  |  Branch (495:8): [True: 6.41k, False: 113]
  ------------------
  496|  6.41k|        if(strncmp(msgType, "ua-data", size) != 0)
  ------------------
  |  Branch (496:12): [True: 61, False: 6.35k]
  ------------------
  497|     61|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     61|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  498|  6.35k|        isUaData = true;
  499|  6.35k|    } else if(size == 11) { //ua-metadata
  ------------------
  |  Branch (499:15): [True: 79, False: 34]
  ------------------
  500|     79|        if(strncmp(msgType, "ua-metadata", size) != 0)
  ------------------
  |  Branch (500:12): [True: 78, False: 1]
  ------------------
  501|     78|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     78|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  502|      1|        isUaData = false;
  503|     34|    } else {
  504|     34|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     34|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  505|     34|    }
  506|       |
  507|       |    //TODO: MetaData
  508|  6.35k|    if(!isUaData)
  ------------------
  |  Branch (508:8): [True: 1, False: 6.35k]
  ------------------
  509|      1|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|      1|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  510|       |
  511|  6.35k|    dst->payload.dataSetMessages = (UA_DataSetMessage*)
  512|  6.35k|        UA_calloc(messageCount, sizeof(UA_DataSetMessage));
  ------------------
  |  |   20|  6.35k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  513|  6.35k|    if(!dst->payload.dataSetMessages)
  ------------------
  |  Branch (513:8): [True: 12, False: 6.34k]
  ------------------
  514|     12|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     12|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  515|  6.34k|    dst->messageCount = (UA_Byte)messageCount;
  516|       |
  517|       |    /* Network Message */
  518|  6.34k|    UA_String messageType;
  519|  6.34k|    DecodeEntry entries[5] = {
  520|  6.34k|        {UA_DECODEKEY_MESSAGEID, &dst->messageId, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  6.34k|#define UA_TYPES_STRING 11
  ------------------
  521|  6.34k|        {UA_DECODEKEY_MESSAGETYPE, &messageType, NULL, false, NULL},
  522|  6.34k|        {UA_DECODEKEY_PUBLISHERID, &dst->publisherId, decodePublisherIdJsonInternal, false, NULL},
  523|  6.34k|        {UA_DECODEKEY_DATASETCLASSID, &dst->dataSetClassId, NULL, false, &UA_TYPES[UA_TYPES_GUID]},
  ------------------
  |  |  463|  6.34k|#define UA_TYPES_GUID 13
  ------------------
  524|  6.34k|        {UA_DECODEKEY_MESSAGES, dst, DatasetMessage_Array_decodeJsonInternal, false, NULL}
  525|  6.34k|    };
  526|       |
  527|  6.34k|    status ret = decodeFields(&ctx->ctx, entries, 5);
  528|  6.34k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.34k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (528:8): [True: 6.33k, False: 11]
  ------------------
  529|  6.33k|        return ret;
  530|       |
  531|     11|    dst->messageIdEnabled = entries[0].found;
  532|     11|    dst->publisherIdEnabled = entries[2].found;
  533|     11|    dst->dataSetClassIdEnabled = entries[3].found;
  534|     11|    dst->payloadHeaderEnabled = true;
  535|       |
  536|     11|    return ret;
  537|  6.34k|}
ua_pubsub_networkmessage_json.c:decodePublisherIdJsonInternal:
  444|    204|                              const UA_DataType *type) {
  445|    204|    UA_PublisherId *p = (UA_PublisherId*)dst;
  446|    204|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER) {
  ------------------
  |  Branch (446:8): [True: 171, False: 33]
  ------------------
  447|       |        /* Store in biggest possible integer. The problem is that with a UInt64
  448|       |         * is that a string is expected for it in JSON. Therefore, the maximum
  449|       |         * value is set to UInt32. */
  450|    171|        p->idType = UA_PUBLISHERIDTYPE_UINT32;
  451|    171|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32](ctx, &p->id.uint32, NULL);
  452|    171|    } else if(currentTokenType(ctx) == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (452:15): [True: 30, False: 3]
  ------------------
  453|     30|        p->idType = UA_PUBLISHERIDTYPE_STRING;
  454|     30|        return decodeJsonJumpTable[UA_DATATYPEKIND_STRING](ctx, &p->id.string, NULL);
  455|     30|    }
  456|      3|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  457|    204|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Array_decodeJsonInternal:
  413|  5.98k|                                        const UA_DataType *_) {
  414|  5.98k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  415|       |
  416|       |    /* Array or object */
  417|  5.98k|    size_t length = 1;
  418|  5.98k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_ARRAY) {
  ------------------
  |  Branch (418:8): [True: 2.49k, False: 3.49k]
  ------------------
  419|  2.49k|        length = (size_t)ctx->ctx.tokens[ctx->ctx.index].size;
  420|       |
  421|       |        /* Go to the first array member */
  422|  2.49k|        ctx->ctx.index++;
  423|       |
  424|       |        /* Return early for empty arrays */
  425|  2.49k|        if(length == 0)
  ------------------
  |  Branch (425:12): [True: 13, False: 2.47k]
  ------------------
  426|     13|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     13|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  427|  3.49k|    } else if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (427:15): [True: 279, False: 3.21k]
  ------------------
  428|    279|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    279|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  429|    279|    }
  430|       |
  431|       |    /* Decode array members */
  432|  5.68k|    UA_NetworkMessage *nm = (UA_NetworkMessage*)dst;
  433|  5.68k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (433:23): [True: 5.68k, False: 1]
  ------------------
  434|  5.68k|        status ret = DatasetMessage_Payload_decodeJsonInternal(ctx, nm, i);
  435|  5.68k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (435:12): [True: 5.68k, False: 1]
  ------------------
  436|  5.68k|            return ret;
  437|  5.68k|    }
  438|       |
  439|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  440|  5.68k|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Payload_decodeJsonInternal:
  372|  5.68k|                                          size_t dsmIndex) {
  373|  5.68k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[dsmIndex];
  374|  5.68k|    UA_ConfigurationVersionDataType cvd;
  375|  5.68k|    struct PayloadData pd;
  376|  5.68k|    pd.nm = nm;
  377|  5.68k|    pd.dsmIndex = dsmIndex;
  378|       |
  379|  5.68k|    DecodeEntry entries[7] = {
  380|  5.68k|        {UA_DECODEKEY_DATASETWRITERID, &nm->dataSetWriterIds[dsmIndex], NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.68k|#define UA_TYPES_UINT16 4
  ------------------
  381|  5.68k|        {UA_DECODEKEY_SEQUENCENUMBER, &dsm->header.dataSetMessageSequenceNr, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.68k|#define UA_TYPES_UINT16 4
  ------------------
  382|  5.68k|        {UA_DECODEKEY_METADATAVERSION, &cvd, &MetaDataVersion_decodeJsonInternal, false, NULL},
  383|  5.68k|        {UA_DECODEKEY_TIMESTAMP, &dsm->header.timestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  5.68k|#define UA_TYPES_DATETIME 12
  ------------------
  384|  5.68k|        {UA_DECODEKEY_DSM_STATUS, &dsm->header.status, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.68k|#define UA_TYPES_UINT16 4
  ------------------
  385|  5.68k|        {UA_DECODEKEY_MESSAGETYPE, NULL, NULL, false, NULL},
  386|  5.68k|        {UA_DECODEKEY_PAYLOAD, &pd, DataSetPayload_decodeJsonInternal, false, NULL}
  387|  5.68k|    };
  388|  5.68k|    status ret = decodeFields(&ctx->ctx, entries, 7);
  389|       |
  390|       |    /* Error or no DatasetWriterId found or no payload found */
  391|  5.68k|    if(ret != UA_STATUSCODE_GOOD || !entries[0].found || !entries[6].found)
  ------------------
  |  |   17|  11.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (391:8): [True: 3.64k, False: 2.04k]
  |  Branch (391:37): [True: 2.03k, False: 6]
  |  Branch (391:58): [True: 5, False: 1]
  ------------------
  392|  5.68k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  5.68k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  393|       |
  394|       |    /* TODO: Check FieldEncoding1 and FieldEncoding2 to determine the field encoding */
  395|      1|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  396|      1|    dsm->header.dataSetMessageSequenceNrEnabled = entries[1].found;
  397|      1|    dsm->header.configVersionMajorVersion = cvd.majorVersion;
  398|      1|    dsm->header.configVersionMinorVersion = cvd.minorVersion;
  399|      1|    dsm->header.configVersionMajorVersionEnabled = entries[2].found;
  400|      1|    dsm->header.configVersionMinorVersionEnabled = entries[2].found;
  401|      1|    dsm->header.timestampEnabled = entries[3].found;
  402|      1|    dsm->header.statusEnabled = entries[4].found;
  403|       |
  404|      1|    dsm->header.dataSetMessageType = UA_DATASETMESSAGE_DATAKEYFRAME;
  405|      1|    dsm->header.picoSecondsIncluded = false;
  406|      1|    dsm->header.dataSetMessageValid = true;
  407|      1|    dsm->header.fieldEncoding = UA_FIELDENCODING_VARIANT;
  408|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  409|  5.68k|}
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.73k|DataSetPayload_decodeJsonInternal(ParseCtx *ctx_, void *data, const UA_DataType *_) {
  313|  4.73k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  314|  4.73k|    struct PayloadData *pd = (struct PayloadData*)data;
  315|  4.73k|    UA_NetworkMessage *nm = pd->nm;
  316|  4.73k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[pd->dsmIndex];
  317|       |
  318|  4.73k|    dsm->header.dataSetMessageValid = true;
  319|       |
  320|  4.73k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (320:8): [True: 1, False: 4.73k]
  ------------------
  321|      1|        ctx->ctx.index++;
  322|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  323|      1|    }
  324|       |
  325|  4.73k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (325:8): [True: 6, False: 4.72k]
  ------------------
  326|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  327|       |
  328|       |    /* The number of key-value pairs */
  329|  4.72k|    UA_assert(ctx->ctx.tokens[ctx->ctx.index].size % 2 == 0);
  ------------------
  |  |  399|  4.72k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (329:5): [True: 4.72k, False: 0]
  ------------------
  330|  4.72k|    size_t length = (size_t)(ctx->ctx.tokens[ctx->ctx.index].size) / 2;
  331|       |
  332|  4.72k|    if(length > UA_UINT16_MAX)
  ------------------
  |  |   91|  4.72k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (332:8): [True: 1, False: 4.72k]
  ------------------
  333|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  334|       |
  335|  4.72k|    dsm->data.keyFrameFields = (UA_DataValue *)
  336|  4.72k|        UA_Array_new(length, &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  769|  4.72k|#define UA_TYPES_DATAVALUE 22
  ------------------
  337|  4.72k|    if(!dsm->data.keyFrameFields)
  ------------------
  |  Branch (337:8): [True: 1, False: 4.72k]
  ------------------
  338|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  339|  4.72k|    dsm->fieldCount = (UA_UInt16)length;
  340|       |
  341|  4.72k|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  342|       |
  343|  4.72k|    const UA_DataSetMessage_EncodingMetaData *emd =
  344|  4.72k|            findEncodingMetaData(&ctx->eo, nm->dataSetWriterIds[pd->dsmIndex]);
  345|       |
  346|       |    /* Iterate over the key/value pairs in the object. Keys are stored in fieldnames. */
  347|  4.72k|    ctx->ctx.index++; /* Go to the first key */
  348|  4.72k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.72k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  349|  25.6k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (349:23): [True: 23.9k, False: 1.67k]
  ------------------
  350|  23.9k|        UA_assert(currentTokenType(&ctx->ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  23.9k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (350:9): [True: 23.9k, False: 0]
  ------------------
  351|  23.9k|        UA_String fieldName = UA_STRING_NULL;
  352|  23.9k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_STRING](&ctx->ctx, &fieldName, NULL);
  353|  23.9k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  23.9k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  23.9k|    do {                                                                                 \
  |  |  |  |  173|  23.9k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  579|  23.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (579:25): [True: 1, False: 23.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|      1|        }                                                                                \
  |  |  |  |  176|  23.9k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 23.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  354|       |
  355|  23.9k|        size_t index = decodingFieldIndex(emd, fieldName, i);
  356|  23.9k|        if(index >= length) {
  ------------------
  |  Branch (356:12): [True: 0, False: 23.9k]
  ------------------
  357|      0|            UA_String_clear(&fieldName);
  358|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  359|      0|        }
  360|  23.9k|        UA_DataValue_clear(&dsm->data.keyFrameFields[index]);
  361|  23.9k|        UA_String_clear(&fieldName);
  362|  23.9k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_DATAVALUE]
  363|  23.9k|            (&ctx->ctx, &dsm->data.keyFrameFields[index], NULL);
  364|  23.9k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  23.9k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  23.9k|    do {                                                                                 \
  |  |  |  |  173|  23.9k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  579|  23.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (579:25): [True: 3.05k, False: 20.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|  3.05k|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|  3.05k|        }                                                                                \
  |  |  |  |  176|  23.9k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 20.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  365|  23.9k|    }
  366|       |
  367|  1.67k|    return ret;
  368|  4.72k|}
ua_pubsub_networkmessage_json.c:decodingFieldIndex:
  296|  23.9k|                   UA_String name, size_t origIndex) {
  297|  23.9k|    if(!emd)
  ------------------
  |  Branch (297:8): [True: 23.9k, False: 0]
  ------------------
  298|  23.9k|        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:
   65|  22.3k|                          const UA_DataTypeArray *customTypes) {
   66|       |    /* Always look in built-in types first (may contain data types from all
   67|       |     * namespaces).
   68|       |     *
   69|       |     * TODO: The standard-defined types are ordered. See if binary search is
   70|       |     * more efficient. */
   71|  4.67M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  4.67M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (71:23): [True: 4.66M, False: 11.5k]
  ------------------
   72|  4.66M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (72:12): [True: 10.8k, False: 4.65M]
  ------------------
   73|  10.8k|            return &UA_TYPES[i];
   74|  4.66M|    }
   75|       |
   76|       |    /* Search in the customTypes */
   77|  11.5k|    while(customTypes) {
  ------------------
  |  Branch (77:11): [True: 0, False: 11.5k]
  ------------------
   78|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (78:27): [True: 0, False: 0]
  ------------------
   79|      0|            if(nodeIdOrder(&customTypes->types[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (79:16): [True: 0, False: 0]
  ------------------
   80|      0|                return &customTypes->types[i];
   81|      0|        }
   82|      0|        customTypes = customTypes->next;
   83|      0|    }
   84|       |
   85|  11.5k|    return NULL;
   86|  11.5k|}
UA_ByteString_allocBuffer:
  756|  9.42k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  757|  9.42k|    UA_ByteString_init(bs);
  758|  9.42k|    if(length == 0) {
  ------------------
  |  Branch (758:8): [True: 424, False: 9.00k]
  ------------------
  759|    424|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    424|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  760|    424|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    424|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  761|    424|    }
  762|  9.00k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  9.00k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  763|  9.00k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  579|  9.00k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 1, False: 9.00k]
  |  |  ------------------
  ------------------
  764|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  765|  9.00k|    bs->length = length;
  766|  9.00k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.00k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  767|  9.00k|}
UA_new:
 1918|  29.1k|UA_new(const UA_DataType *type) {
 1919|  29.1k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  29.1k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1920|  29.1k|    return p;
 1921|  29.1k|}
UA_copy:
 2094|  29.9k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2095|  29.9k|    memset(dst, 0, type->memSize); /* init */
 2096|  29.9k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2097|  29.9k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  29.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2097:8): [True: 6, False: 29.9k]
  ------------------
 2098|      6|        UA_clear(dst, type);
 2099|  29.9k|    return retval;
 2100|  29.9k|}
UA_clear:
 2197|  1.38M|UA_clear(void *p, const UA_DataType *type) {
 2198|  1.38M|    clearJumpTable[type->typeKind](p, type);
 2199|  1.38M|    memset(p, 0, type->memSize); /* init */
 2200|  1.38M|}
UA_delete:
 2203|  7.40k|UA_delete(void *p, const UA_DataType *type) {
 2204|  7.40k|    clearJumpTable[type->typeKind](p, type);
 2205|  7.40k|    UA_free(p);
  ------------------
  |  |   19|  7.40k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2206|  7.40k|}
UA_Array_new:
 2684|  4.72k|UA_Array_new(size_t size, const UA_DataType *type) {
 2685|  4.72k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|  4.72k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2685:8): [True: 0, False: 4.72k]
  ------------------
 2686|      0|        return NULL;
 2687|  4.72k|    if(size == 0)
  ------------------
  |  Branch (2687:8): [True: 3, False: 4.72k]
  ------------------
 2688|      3|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      3|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2689|  4.72k|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  4.72k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2690|  4.72k|}
UA_Array_copy:
 2694|  29.9k|              void **dst, const UA_DataType *type) {
 2695|  29.9k|    if(size == 0) {
  ------------------
  |  Branch (2695:8): [True: 4.19k, False: 25.7k]
  ------------------
 2696|  4.19k|        if(src == NULL)
  ------------------
  |  Branch (2696:12): [True: 0, False: 4.19k]
  ------------------
 2697|      0|            *dst = NULL;
 2698|  4.19k|        else
 2699|  4.19k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  4.19k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2700|  4.19k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.19k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2701|  4.19k|    }
 2702|       |
 2703|       |    /* Check the array consistency -- defensive programming in case the user
 2704|       |     * manually created an inconsistent array */
 2705|  25.7k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  579|  51.5k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 25.7k]
  |  |  |  Branch (579:43): [True: 0, False: 25.7k]
  |  |  |  Branch (579:43): [True: 0, False: 25.7k]
  |  |  ------------------
  ------------------
 2706|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2707|       |
 2708|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2709|  25.7k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  25.7k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2710|  25.7k|    if(!*dst)
  ------------------
  |  Branch (2710:8): [True: 6, False: 25.7k]
  ------------------
 2711|      6|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      6|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2712|       |
 2713|  25.7k|    if(type->pointerFree) {
  ------------------
  |  Branch (2713:8): [True: 25.7k, False: 0]
  ------------------
 2714|  25.7k|        memcpy(*dst, src, type->memSize * size);
 2715|  25.7k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  25.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2716|  25.7k|    }
 2717|       |
 2718|      0|    uintptr_t ptrs = (uintptr_t)src;
 2719|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2720|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2721|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2721:23): [True: 0, False: 0]
  ------------------
 2722|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2723|      0|        ptrs += type->memSize;
 2724|      0|        ptrd += type->memSize;
 2725|      0|    }
 2726|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2726:8): [True: 0, False: 0]
  ------------------
 2727|      0|        UA_Array_delete(*dst, size, type);
 2728|       |        *dst = NULL;
 2729|      0|    }
 2730|      0|    return retval;
 2731|  25.7k|}
UA_Array_delete:
 2822|   176k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2823|   176k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2823:8): [True: 24.4k, False: 152k]
  ------------------
 2824|  24.4k|        uintptr_t ptr = (uintptr_t)p;
 2825|  1.28M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2825:27): [True: 1.26M, False: 24.4k]
  ------------------
 2826|  1.26M|            UA_clear((void*)ptr, type);
 2827|  1.26M|            ptr += type->memSize;
 2828|  1.26M|        }
 2829|  24.4k|    }
 2830|   176k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|   176k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2831|   176k|}
ua_types.c:Variant_clear:
 1376|  1.23M|Variant_clear(void *p, const UA_DataType *_) {
 1377|  1.23M|    UA_Variant *v = (UA_Variant *)p;
 1378|       |
 1379|       |    /* The content is "borrowed" */
 1380|  1.23M|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1380:8): [True: 0, False: 1.23M]
  ------------------
 1381|      0|        return;
 1382|       |
 1383|       |    /* Delete the value */
 1384|  1.23M|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  34.5k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1384:8): [True: 34.5k, False: 1.19M]
  |  Branch (1384:19): [True: 27.1k, False: 7.37k]
  ------------------
 1385|  27.1k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1385:12): [True: 21.7k, False: 5.45k]
  ------------------
 1386|  21.7k|            v->arrayLength = 1;
 1387|  27.1k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1388|  27.1k|        v->data = NULL;
 1389|  27.1k|    }
 1390|       |
 1391|       |    /* Delete the array dimensions */
 1392|  1.23M|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|  1.23M|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1392:8): [True: 5.80k, False: 1.22M]
  ------------------
 1393|  5.80k|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|  5.80k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1394|  1.23M|}
ua_types.c:DataValue_clear:
 1848|  1.22M|DataValue_clear(void *p, const UA_DataType *_) {
 1849|  1.22M|    UA_DataValue *dv = (UA_DataValue *)p;
 1850|       |    Variant_clear(&dv->value, NULL);
 1851|  1.22M|}
ua_types.c:String_copy:
  280|  29.9k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  281|  29.9k|    const UA_String *srcS = (const UA_String*)src;
  282|  29.9k|    UA_String *dstS = (UA_String *)dst;
  283|  29.9k|    UA_StatusCode res =
  284|  29.9k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  285|  29.9k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  29.9k|#define UA_TYPES_BYTE 2
  ------------------
  286|  29.9k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  29.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (286:8): [True: 29.9k, False: 6]
  ------------------
  287|  29.9k|        dstS->length = srcS->length;
  288|  29.9k|    return res;
  289|  29.9k|}
ua_types.c:nopClear:
 2159|  8.30k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  292|   142k|String_clear(void *p, const UA_DataType *_) {
  293|   142k|    UA_String *s = (UA_String*)p;
  294|   142k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|   142k|#define UA_TYPES_BYTE 2
  ------------------
  295|   142k|}
ua_types.c:NodeId_clear:
  771|  31.9k|NodeId_clear(void *p, const UA_DataType *_) {
  772|  31.9k|    UA_NodeId *id = (UA_NodeId*)p;
  773|  31.9k|    switch(id->identifierType) {
  774|  9.87k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (774:5): [True: 9.87k, False: 22.0k]
  ------------------
  775|  10.9k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (775:5): [True: 1.11k, False: 30.7k]
  ------------------
  776|  10.9k|        String_clear(&id->identifier.string, NULL);
  777|  10.9k|        break;
  778|  20.9k|    default: break;
  ------------------
  |  Branch (778:5): [True: 20.9k, False: 10.9k]
  ------------------
  779|  31.9k|    }
  780|  31.9k|}
ua_types.c:ExpandedNodeId_clear:
 1072|  4.36k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1073|  4.36k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1074|  4.36k|    NodeId_clear(&id->nodeId, NULL);
 1075|       |    String_clear(&id->namespaceUri, NULL);
 1076|  4.36k|}
ua_types.c:QualifiedName_clear:
  396|  19.5k|QualifiedName_clear(void *p, const UA_DataType *_) {
  397|  19.5k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  398|       |    String_clear(&qn->name, NULL);
  399|  19.5k|}
ua_types.c:LocalizedText_clear:
 1831|  1.49k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1832|  1.49k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1833|  1.49k|    String_clear(&lt->locale, NULL);
 1834|       |    String_clear(&lt->text, NULL);
 1835|  1.49k|}
ua_types.c:ExtensionObject_clear:
 1245|  21.2k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1246|  21.2k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1247|  21.2k|    switch(eo->encoding) {
 1248|  3.11k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1248:5): [True: 3.11k, False: 18.0k]
  ------------------
 1249|  12.9k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1249:5): [True: 9.80k, False: 11.3k]
  ------------------
 1250|  13.7k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1250:5): [True: 879, False: 20.3k]
  ------------------
 1251|  13.7k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1252|  13.7k|        String_clear(&eo->content.encoded.body, NULL);
 1253|  13.7k|        break;
 1254|  7.40k|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1254:5): [True: 7.40k, False: 13.7k]
  ------------------
 1255|  7.40k|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1255:12): [True: 7.40k, False: 0]
  ------------------
 1256|  7.40k|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1257|  7.40k|        break;
 1258|      0|    default:
  ------------------
  |  Branch (1258:5): [True: 0, False: 21.2k]
  ------------------
 1259|      0|        break;
 1260|  21.2k|    }
 1261|  21.2k|}
ua_types.c:DiagnosticInfo_clear:
 1878|    979|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1879|    979|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1880|       |
 1881|    979|    String_clear(&di->additionalInfo, NULL);
 1882|    979|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1882:8): [True: 2, False: 977]
  |  Branch (1882:38): [True: 1, False: 1]
  ------------------
 1883|      1|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1884|      1|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      1|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1885|      1|    }
 1886|    979|}
ua_types.c:clearStructure:
 2103|  1.15k|clearStructure(void *p, const UA_DataType *type) {
 2104|  1.15k|    uintptr_t ptr = (uintptr_t)p;
 2105|  6.12k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2105:23): [True: 4.97k, False: 1.15k]
  ------------------
 2106|  4.97k|        const UA_DataTypeMember *m = &type->members[i];
 2107|  4.97k|        const UA_DataType *mt = m->memberType;
 2108|  4.97k|        ptr += m->padding;
 2109|  4.97k|        if(!m->isOptional) {
  ------------------
  |  Branch (2109:12): [True: 4.97k, False: 0]
  ------------------
 2110|  4.97k|            if(!m->isArray) {
  ------------------
  |  Branch (2110:16): [True: 3.92k, False: 1.05k]
  ------------------
 2111|  3.92k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2112|  3.92k|                ptr += mt->memSize;
 2113|  3.92k|            } else {
 2114|  1.05k|                size_t length = *(size_t*)ptr;
 2115|  1.05k|                ptr += sizeof(size_t);
 2116|  1.05k|                UA_Array_delete(*(void**)ptr, length, mt);
 2117|  1.05k|                ptr += sizeof(void*);
 2118|  1.05k|            }
 2119|  4.97k|        } else { /* field is optional */
 2120|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2120:16): [True: 0, False: 0]
  ------------------
 2121|       |                /* optional scalar field is contained */
 2122|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2122:20): [True: 0, False: 0]
  ------------------
 2123|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2124|      0|                ptr += sizeof(void *);
 2125|      0|            } else {
 2126|       |                /* optional array field is contained */
 2127|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2127:20): [True: 0, False: 0]
  ------------------
 2128|      0|                    size_t length = *(size_t *)ptr;
 2129|      0|                    ptr += sizeof(size_t);
 2130|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2131|      0|                    ptr += sizeof(void *);
 2132|      0|                } else { /* optional array field not contained */
 2133|      0|                    ptr += sizeof(size_t);
 2134|      0|                    ptr += sizeof(void *);
 2135|      0|                }
 2136|      0|            }
 2137|      0|        }
 2138|  4.97k|    }
 2139|  1.15k|}
ua_types.c:nodeIdOrder:
 2289|  4.66M|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2290|  4.66M|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2291|  4.66M|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2292|       |    /* Compare namespaceIndex */
 2293|  4.66M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2293:8): [True: 261k, False: 4.40M]
  ------------------
 2294|   261k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2294:16): [True: 261k, False: 0]
  ------------------
 2295|       |
 2296|       |    /* Compare identifierType */
 2297|  4.40M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2297:8): [True: 2.66M, False: 1.73M]
  ------------------
 2298|  2.66M|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2298:16): [True: 2.66M, False: 0]
  ------------------
 2299|       |
 2300|       |    /* Compare the identifier */
 2301|  1.73M|    switch(p1->identifierType) {
 2302|  1.73M|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2302:5): [True: 1.73M, False: 0]
  ------------------
 2303|  1.73M|    default:
  ------------------
  |  Branch (2303:5): [True: 0, False: 1.73M]
  ------------------
 2304|  1.73M|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2304:12): [True: 1.72M, False: 10.8k]
  ------------------
 2305|  1.72M|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2305:20): [True: 166k, False: 1.55M]
  ------------------
 2306|  1.55M|                UA_ORDER_LESS : UA_ORDER_MORE;
 2307|  10.8k|        return UA_ORDER_EQ;
 2308|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2308:5): [True: 0, False: 1.73M]
  ------------------
 2309|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2310|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2310:5): [True: 0, False: 1.73M]
  ------------------
 2311|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2311:5): [True: 0, False: 1.73M]
  ------------------
 2312|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2313|  1.73M|    }
 2314|  1.73M|}

lookAheadForKey:
 1437|   195k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1438|       |    /* The current index must point to the beginning of an object.
 1439|       |     * This has to be ensured by the caller. */
 1440|   195k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|   195k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1440:5): [True: 195k, False: 0]
  ------------------
 1441|       |
 1442|   195k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  233|   195k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1443|   195k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1444|   195k|    unsigned int end = ctx->tokens[ctx->index].end;
 1445|   195k|    ctx->index++; /* Move to the first key */
 1446|  2.40M|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1446:11): [True: 2.39M, False: 4.82k]
  ------------------
 1447|  2.39M|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1447:11): [True: 2.34M, False: 57.3k]
  ------------------
 1448|       |        /* Key must be a string */
 1449|  2.34M|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  2.34M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1449:9): [True: 2.34M, False: 0]
  ------------------
 1450|       |
 1451|       |        /* Move index to the value */
 1452|  2.34M|        ctx->index++;
 1453|       |
 1454|       |        /* Value for the key must exist */
 1455|  2.34M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  2.34M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1455:9): [True: 2.34M, False: 0]
  ------------------
 1456|       |
 1457|       |        /* Compare the key (previous index) */
 1458|  2.34M|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1458:12): [True: 133k, False: 2.20M]
  ------------------
 1459|   133k|            *resultIndex = ctx->index; /* Point result to the current index */
 1460|   133k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   133k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1461|   133k|            break;
 1462|   133k|        }
 1463|       |
 1464|  2.20M|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1465|  2.20M|    }
 1466|   195k|    ctx->index = oldIndex; /* Restore the old index */
 1467|   195k|    return ret;
 1468|   195k|}
DiagnosticInfoInner_decodeJson:
 2245|      2|DiagnosticInfoInner_decodeJson(ParseCtx* ctx, void* dst, const UA_DataType* type) {
 2246|      2|    UA_DiagnosticInfo *inner = (UA_DiagnosticInfo*)
 2247|      2|        UA_calloc(1, sizeof(UA_DiagnosticInfo));
  ------------------
  |  |   20|      2|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2248|      2|    if(!inner)
  ------------------
  |  Branch (2248:8): [True: 1, False: 1]
  ------------------
 2249|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2250|      1|    UA_DiagnosticInfo **dst2 = (UA_DiagnosticInfo**)dst;
 2251|      1|    *dst2 = inner;  /* Copy new Pointer do dest */
 2252|      1|    return DiagnosticInfo_decodeJson(ctx, inner, type);
 2253|      2|}
decodeFields:
 2256|  44.3k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2257|  44.3k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  44.3k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  44.3k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 44.3k]
  |  |  ------------------
  |  | 1034|  44.3k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  44.3k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 44.3k]
  |  |  ------------------
  ------------------
 2258|  44.3k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1057|  44.3k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  44.3k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 332, False: 44.0k]
  |  |  ------------------
  |  | 1059|    332|        ctx->index++;                                \
  |  | 1060|    332|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    332|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  44.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 44.0k]
  |  |  ------------------
  ------------------
 2259|       |
 2260|  44.0k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  44.0k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2260:8): [True: 0, False: 44.0k]
  ------------------
 2261|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2262|       |
 2263|       |    /* Keys and values are counted separately */
 2264|  44.0k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  44.0k|#define CHECK_OBJECT do {                                \
  |  | 1053|  44.0k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 20, False: 43.9k]
  |  |  ------------------
  |  | 1054|     20|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  43.9k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 43.9k]
  |  |  ------------------
  ------------------
 2265|  43.9k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  399|  43.9k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2265:5): [True: 43.9k, False: 0]
  ------------------
 2266|  43.9k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2267|       |
 2268|  43.9k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2269|  43.9k|    ctx->depth++;
 2270|       |
 2271|  43.9k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  43.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2272|   108k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2272:25): [True: 74.7k, False: 33.8k]
  ------------------
 2273|       |        /* Key must be a string */
 2274|  74.7k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  74.7k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2274:9): [True: 74.7k, False: 0]
  ------------------
 2275|  74.7k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  74.7k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2275:9): [True: 74.7k, False: 0]
  ------------------
 2276|       |
 2277|       |        /* Search for the decoding entry matching the key. Start at the key
 2278|       |         * index to speed-up the case where they key-order is the same as the
 2279|       |         * entry-order. */
 2280|  74.7k|        DecodeEntry *entry = NULL;
 2281|   197k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2281:29): [True: 197k, False: 355]
  ------------------
 2282|   197k|            size_t ii = i;
 2283|   205k|            while(ii >= entryCount)
  ------------------
  |  Branch (2283:19): [True: 8.19k, False: 197k]
  ------------------
 2284|  8.19k|                ii -= entryCount;
 2285|       |
 2286|       |            /* Compare the key */
 2287|   197k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2287:16): [True: 122k, False: 74.4k]
  ------------------
 2288|   197k|                      entries[ii].fieldName) != 0)
 2289|   122k|                continue;
 2290|       |
 2291|       |            /* Key was already used -> duplicate, abort */
 2292|  74.4k|            if(entries[ii].found) {
  ------------------
  |  Branch (2292:16): [True: 2, False: 74.4k]
  ------------------
 2293|      2|                ctx->depth--;
 2294|      2|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2295|      2|            }
 2296|       |
 2297|       |            /* Found the key */
 2298|  74.4k|            entries[ii].found = true;
 2299|  74.4k|            entry = &entries[ii];
 2300|  74.4k|            break;
 2301|  74.4k|        }
 2302|       |
 2303|       |        /* The key is unknown */
 2304|  74.7k|        if(!entry) {
  ------------------
  |  Branch (2304:12): [True: 355, False: 74.4k]
  ------------------
 2305|    355|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    355|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2306|    355|            break;
 2307|    355|        }
 2308|       |
 2309|       |        /* Go from key to value */
 2310|  74.4k|        ctx->index++;
 2311|  74.4k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  74.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2311:9): [True: 74.4k, False: 0]
  ------------------
 2312|       |
 2313|       |        /* An entry that was expected but shall not be decoded.
 2314|       |         * Jump over the value. */
 2315|  74.4k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2315:12): [True: 63.4k, False: 10.9k]
  |  Branch (2315:32): [True: 61.7k, False: 1.73k]
  ------------------
 2316|  61.7k|            skipObject(ctx);
 2317|  61.7k|            continue;
 2318|  61.7k|        }
 2319|       |
 2320|       |        /* A null-value, skip the decoding (the value is already initialized) */
 2321|  12.6k|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2321:12): [True: 199, False: 12.4k]
  |  Branch (2321:55): [True: 196, False: 3]
  ------------------
 2322|    196|            ctx->index++; /* skip null value */
 2323|    196|            continue;
 2324|    196|        }
 2325|       |
 2326|       |        /* Decode. This also moves to the next key or right after the object for
 2327|       |         * the last value. */
 2328|  12.4k|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2328:42): [True: 10.9k, False: 1.53k]
  ------------------
 2329|  10.9k|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2330|  12.4k|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2331|  12.4k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  12.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2331:12): [True: 9.81k, False: 2.65k]
  ------------------
 2332|  9.81k|            break;
 2333|  12.4k|    }
 2334|       |
 2335|  43.9k|    ctx->depth--;
 2336|  43.9k|    return ret;
 2337|  43.9k|}
tokenize:
 2470|  8.15k|         size_t *decodedLength) {
 2471|       |    /* Tokenize */
 2472|  8.15k|    cj5_options options;
 2473|  8.15k|    options.stop_early = (decodedLength != NULL);
 2474|  8.15k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2475|  8.15k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2476|       |
 2477|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2478|       |     * have needed */
 2479|  8.15k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2479:8): [True: 617, False: 7.54k]
  ------------------
 2480|    617|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2480:8): [True: 617, False: 0]
  ------------------
 2481|    617|        ctx->tokens = (cj5_token*)
 2482|    617|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    617|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2483|    617|        if(!ctx->tokens)
  ------------------
  |  Branch (2483:12): [True: 10, False: 607]
  ------------------
 2484|     10|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     10|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2485|    607|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2486|    617|    }
 2487|       |
 2488|       |    /* Cannot recover from other errors */
 2489|  7.54k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2489:8): [True: 722, False: 6.81k]
  ------------------
 2490|    722|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    722|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2491|       |
 2492|  6.81k|    if(decodedLength)
  ------------------
  |  Branch (2492:8): [True: 0, False: 6.81k]
  ------------------
 2493|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2494|       |
 2495|       |    /* Set up the context */
 2496|  6.81k|    ctx->json5 = (char*)src->data;
 2497|  6.81k|    ctx->depth = 0;
 2498|  6.81k|    ctx->tokensSize = r.num_tokens;
 2499|  6.81k|    ctx->index = 0;
 2500|  6.81k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.81k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2501|  7.54k|}
ua_types_encoding_json.c:jsoneq:
 1088|  2.53M|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1089|       |    /* TODO: necessary?
 1090|       |       if(json == NULL
 1091|       |            || tok == NULL
 1092|       |            || searchKey == NULL) {
 1093|       |        return -1;
 1094|       |    } */
 1095|       |
 1096|  2.53M|    size_t len = getTokenLength(tok);
 1097|  2.53M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1097:8): [True: 2.53M, False: 0]
  ------------------
 1098|  2.53M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1098:8): [True: 222k, False: 2.31M]
  ------------------
 1099|   222k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1099:8): [True: 207k, False: 15.2k]
  ------------------
 1100|   207k|        return 0;
 1101|       |
 1102|  2.33M|    return -1;
 1103|  2.53M|}
ua_types_encoding_json.c:skipObject:
 1072|  2.33M|skipObject(ParseCtx *ctx) {
 1073|  2.33M|    unsigned int end = ctx->tokens[ctx->index].end;
 1074|  66.3M|    do {
 1075|  66.3M|        ctx->index++;
 1076|  66.3M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1076:13): [True: 66.3M, False: 10.8k]
  ------------------
 1077|  66.3M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1077:13): [True: 64.0M, False: 2.32M]
  ------------------
 1078|  2.33M|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2211|    651|DECODE_JSON(DiagnosticInfo) {
 2212|    651|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2213|    651|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1057|    651|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|    651|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 223, False: 428]
  |  |  ------------------
  |  | 1059|    223|        ctx->index++;                                \
  |  | 1060|    223|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    223|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|    428|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 428]
  |  |  ------------------
  ------------------
 2214|    428|    CHECK_OBJECT;
  ------------------
  |  | 1052|    428|#define CHECK_OBJECT do {                                \
  |  | 1053|    428|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 19, False: 409]
  |  |  ------------------
  |  | 1054|     19|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|    409|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 409]
  |  |  ------------------
  ------------------
 2215|       |
 2216|    409|    DecodeEntry entries[7] = {
 2217|    409|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2218|    409|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    409|#define UA_TYPES_INT32 5
  ------------------
 2219|    409|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2220|    409|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    409|#define UA_TYPES_INT32 5
  ------------------
 2221|    409|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2222|    409|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    409|#define UA_TYPES_INT32 5
  ------------------
 2223|    409|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2224|    409|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    409|#define UA_TYPES_INT32 5
  ------------------
 2225|    409|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2226|    409|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|    409|#define UA_TYPES_STRING 11
  ------------------
 2227|    409|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2228|    409|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|    409|#define UA_TYPES_STATUSCODE 18
  ------------------
 2229|    409|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2230|    409|         DiagnosticInfoInner_decodeJson, false, NULL}
 2231|    409|    };
 2232|    409|    status ret = decodeFields(ctx, entries, 7);
 2233|       |
 2234|    409|    dst->hasSymbolicId = entries[0].found;
 2235|    409|    dst->hasNamespaceUri = entries[1].found;
 2236|    409|    dst->hasLocalizedText = entries[2].found;
 2237|    409|    dst->hasLocale = entries[3].found;
 2238|    409|    dst->hasAdditionalInfo = entries[4].found;
 2239|    409|    dst->hasInnerStatusCode = entries[5].found;
 2240|    409|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2241|    409|    return ret;
 2242|    428|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1105|    209|DECODE_JSON(Boolean) {
 1106|    209|    UA_Boolean *dst = (UA_Boolean*)p;
 1107|    209|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|    209|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|    209|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 209]
  |  |  ------------------
  |  | 1034|    209|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|    209|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 209]
  |  |  ------------------
  ------------------
 1108|    209|    CHECK_BOOL;
  ------------------
  |  | 1042|    209|#define CHECK_BOOL do {                                \
  |  | 1043|    209|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 69, False: 140]
  |  |  ------------------
  |  | 1044|     69|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   44|     69|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|    140|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 140]
  |  |  ------------------
  ------------------
 1109|    140|    GET_TOKEN;
  ------------------
  |  | 1028|    140|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|    140|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|    140|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 140]
  |  |  ------------------
  ------------------
 1110|       |
 1111|    140|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1111:8): [True: 74, False: 66]
  ------------------
 1112|     74|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1112:8): [True: 74, False: 0]
  |  Branch (1112:38): [True: 74, False: 0]
  ------------------
 1113|     74|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1113:8): [True: 74, False: 0]
  |  Branch (1113:38): [True: 74, False: 0]
  ------------------
 1114|     74|        *dst = true;
 1115|     74|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1115:15): [True: 66, False: 0]
  ------------------
 1116|     66|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1116:15): [True: 66, False: 0]
  |  Branch (1116:45): [True: 66, False: 0]
  ------------------
 1117|     66|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1117:15): [True: 66, False: 0]
  |  Branch (1117:45): [True: 66, False: 0]
  ------------------
 1118|     66|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1118:15): [True: 66, False: 0]
  ------------------
 1119|     66|        *dst = false;
 1120|     66|    } else {
 1121|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1122|      0|    }
 1123|       |
 1124|    140|    ctx->index++;
 1125|    140|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    140|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1126|    140|}
ua_types_encoding_json.c:SByte_decodeJson:
 1213|   569k|DECODE_JSON(SByte) {
 1214|   569k|    UA_SByte *dst = (UA_SByte*)p;
 1215|   569k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   569k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   569k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 569k]
  |  |  ------------------
  |  | 1034|   569k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   569k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 569k]
  |  |  ------------------
  ------------------
 1216|   569k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   569k|#define CHECK_NUMBER do {                                \
  |  | 1038|   569k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 27, False: 569k]
  |  |  ------------------
  |  | 1039|     27|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     27|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   569k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 569k]
  |  |  ------------------
  ------------------
 1217|   569k|    GET_TOKEN;
  ------------------
  |  | 1028|   569k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   569k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   569k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 569k]
  |  |  ------------------
  ------------------
 1218|   569k|    UA_Int64 out = 0;
 1219|   569k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1220|   569k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|  1.13M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|  1.13M|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   569k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1220:8): [True: 88, False: 569k]
  |  Branch (1220:35): [True: 126, False: 569k]
  |  Branch (1220:57): [True: 59, False: 569k]
  ------------------
 1221|    273|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    273|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1222|   569k|    *dst = (UA_SByte)out;
 1223|   569k|    ctx->index++;
 1224|   569k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   569k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1225|   569k|}
ua_types_encoding_json.c:parseSignedInteger:
 1145|  1.73M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1146|  1.73M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1147|  1.73M|    if(len == 0)
  ------------------
  |  Branch (1147:8): [True: 128, False: 1.73M]
  ------------------
 1148|    128|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    128|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1149|       |
 1150|       |    /* There must only be whitespace between the end of the parsed number and
 1151|       |     * the end of the token */
 1152|  2.41M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1152:25): [True: 677k, False: 1.73M]
  ------------------
 1153|   677k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1153:12): [True: 395k, False: 281k]
  |  Branch (1153:35): [True: 94, False: 394k]
  ------------------
 1154|     94|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     94|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1155|   677k|    }
 1156|       |
 1157|  1.73M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.73M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1158|  1.73M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1160|   525k|DECODE_JSON(Byte) {
 1161|   525k|    UA_Byte *dst = (UA_Byte*)p;
 1162|   525k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   525k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   525k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 525k]
  |  |  ------------------
  |  | 1034|   525k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   525k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1163|   525k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   525k|#define CHECK_NUMBER do {                                \
  |  | 1038|   525k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 16, False: 525k]
  |  |  ------------------
  |  | 1039|     16|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   525k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1164|   525k|    GET_TOKEN;
  ------------------
  |  | 1028|   525k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   525k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   525k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1165|   525k|    UA_UInt64 out = 0;
 1166|   525k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1167|   525k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   17|  1.05M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|   525k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1167:8): [True: 38, False: 525k]
  |  Branch (1167:35): [True: 110, False: 525k]
  ------------------
 1168|    148|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    148|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1169|   525k|    *dst = (UA_Byte)out;
 1170|   525k|    ctx->index++;
 1171|   525k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   525k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1172|   525k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1129|  4.98M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1130|  4.98M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1131|  4.98M|    if(len == 0)
  ------------------
  |  Branch (1131:8): [True: 86, False: 4.98M]
  ------------------
 1132|     86|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     86|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1133|       |
 1134|       |    /* There must only be whitespace between the end of the parsed number and
 1135|       |     * the end of the token */
 1136|  5.41M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1136:25): [True: 430k, False: 4.98M]
  ------------------
 1137|   430k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1137:12): [True: 29.6k, False: 400k]
  |  Branch (1137:35): [True: 134, False: 29.5k]
  ------------------
 1138|    134|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    134|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1139|   430k|    }
 1140|       |
 1141|  4.98M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.98M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1142|  4.98M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1227|  23.4k|DECODE_JSON(Int16) {
 1228|  23.4k|    UA_Int16 *dst = (UA_Int16*)p;
 1229|  23.4k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  23.4k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  23.4k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 23.4k]
  |  |  ------------------
  |  | 1034|  23.4k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  23.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 23.4k]
  |  |  ------------------
  ------------------
 1230|  23.4k|    CHECK_NUMBER;
  ------------------
  |  | 1037|  23.4k|#define CHECK_NUMBER do {                                \
  |  | 1038|  23.4k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 13, False: 23.4k]
  |  |  ------------------
  |  | 1039|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  23.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 23.4k]
  |  |  ------------------
  ------------------
 1231|  23.4k|    GET_TOKEN;
  ------------------
  |  | 1028|  23.4k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  23.4k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  23.4k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 23.4k]
  |  |  ------------------
  ------------------
 1232|  23.4k|    UA_Int64 out = 0;
 1233|  23.4k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1234|  23.4k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|  46.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|  46.8k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|  23.3k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1234:8): [True: 31, False: 23.4k]
  |  Branch (1234:35): [True: 83, False: 23.3k]
  |  Branch (1234:57): [True: 39, False: 23.2k]
  ------------------
 1235|    153|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    153|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1236|  23.2k|    *dst = (UA_Int16)out;
 1237|  23.2k|    ctx->index++;
 1238|  23.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  23.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1239|  23.4k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1174|  1.02M|DECODE_JSON(UInt16) {
 1175|  1.02M|    UA_UInt16 *dst = (UA_UInt16*)p;
 1176|  1.02M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  1.02M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  1.02M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 1.02M]
  |  |  ------------------
  |  | 1034|  1.02M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  1.02M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 1.02M]
  |  |  ------------------
  ------------------
 1177|  1.02M|    CHECK_NUMBER;
  ------------------
  |  | 1037|  1.02M|#define CHECK_NUMBER do {                                \
  |  | 1038|  1.02M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 20, False: 1.02M]
  |  |  ------------------
  |  | 1039|     20|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  1.02M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 1.02M]
  |  |  ------------------
  ------------------
 1178|  1.02M|    GET_TOKEN;
  ------------------
  |  | 1028|  1.02M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  1.02M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  1.02M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 1.02M]
  |  |  ------------------
  ------------------
 1179|  1.02M|    UA_UInt64 out = 0;
 1180|  1.02M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1181|  1.02M|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   17|  2.05M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|  1.02M|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1181:8): [True: 63, False: 1.02M]
  |  Branch (1181:35): [True: 223, False: 1.02M]
  ------------------
 1182|    286|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    286|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1183|  1.02M|    *dst = (UA_UInt16)out;
 1184|  1.02M|    ctx->index++;
 1185|  1.02M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.02M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1186|  1.02M|}
ua_types_encoding_json.c:Int32_decodeJson:
 1241|   531k|DECODE_JSON(Int32) {
 1242|   531k|    UA_Int32 *dst = (UA_Int32*)p;
 1243|   531k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   531k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   531k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 531k]
  |  |  ------------------
  |  | 1034|   531k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   531k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 531k]
  |  |  ------------------
  ------------------
 1244|   531k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   531k|#define CHECK_NUMBER do {                                \
  |  | 1038|   531k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 40, False: 531k]
  |  |  ------------------
  |  | 1039|     40|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     40|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   531k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 531k]
  |  |  ------------------
  ------------------
 1245|   531k|    GET_TOKEN;
  ------------------
  |  | 1028|   531k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   531k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   531k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 531k]
  |  |  ------------------
  ------------------
 1246|   531k|    UA_Int64 out = 0;
 1247|   531k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1248|   531k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|  1.06M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|  1.06M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|   531k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1248:8): [True: 40, False: 531k]
  |  Branch (1248:35): [True: 59, False: 531k]
  |  Branch (1248:57): [True: 9, False: 531k]
  ------------------
 1249|    108|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    108|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1250|   531k|    *dst = (UA_Int32)out;
 1251|   531k|    ctx->index++;
 1252|   531k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   531k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1253|   531k|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1188|  2.90M|DECODE_JSON(UInt32) {
 1189|  2.90M|    UA_UInt32 *dst = (UA_UInt32*)p;
 1190|  2.90M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  2.90M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  2.90M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 2.90M]
  |  |  ------------------
  |  | 1034|  2.90M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  2.90M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 2.90M]
  |  |  ------------------
  ------------------
 1191|  2.90M|    CHECK_NUMBER;
  ------------------
  |  | 1037|  2.90M|#define CHECK_NUMBER do {                                \
  |  | 1038|  2.90M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 36, False: 2.90M]
  |  |  ------------------
  |  | 1039|     36|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     36|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  2.90M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 2.90M]
  |  |  ------------------
  ------------------
 1192|  2.90M|    GET_TOKEN;
  ------------------
  |  | 1028|  2.90M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  2.90M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  2.90M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 2.90M]
  |  |  ------------------
  ------------------
 1193|  2.90M|    UA_UInt64 out = 0;
 1194|  2.90M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1195|  2.90M|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|  5.80M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|  2.90M|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1195:8): [True: 73, False: 2.90M]
  |  Branch (1195:35): [True: 79, False: 2.90M]
  ------------------
 1196|    152|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    152|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1197|  2.90M|    *dst = (UA_UInt32)out;
 1198|  2.90M|    ctx->index++;
 1199|  2.90M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.90M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1200|  2.90M|}
ua_types_encoding_json.c:Int64_decodeJson:
 1255|   613k|DECODE_JSON(Int64) {
 1256|   613k|    UA_Int64 *dst = (UA_Int64*)p;
 1257|   613k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   613k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   613k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 613k]
  |  |  ------------------
  |  | 1034|   613k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   613k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 613k]
  |  |  ------------------
  ------------------
 1258|   613k|    GET_TOKEN;
  ------------------
  |  | 1028|   613k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   613k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   613k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 613k]
  |  |  ------------------
  ------------------
 1259|   613k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1260|   613k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   613k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1260:8): [True: 63, False: 613k]
  ------------------
 1261|     63|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     63|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1262|   613k|    ctx->index++;
 1263|   613k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   613k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1264|   613k|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1202|   525k|DECODE_JSON(UInt64) {
 1203|   525k|    UA_UInt64 *dst = (UA_UInt64*)p;
 1204|   525k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   525k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   525k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 525k]
  |  |  ------------------
  |  | 1034|   525k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   525k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1205|   525k|    GET_TOKEN;
  ------------------
  |  | 1028|   525k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   525k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   525k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1206|   525k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1207|   525k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   525k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1207:8): [True: 46, False: 525k]
  ------------------
 1208|     46|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     46|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1209|   525k|    ctx->index++;
 1210|   525k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   525k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1211|   525k|}
ua_types_encoding_json.c:Float_decodeJson:
 1327|   513k|DECODE_JSON(Float) {
 1328|   513k|    UA_Float *dst = (UA_Float*)p;
 1329|   513k|    UA_Double v = 0.0;
 1330|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1331|   513k|    *dst = (UA_Float)v;
 1332|   513k|    return res;
 1333|   513k|}
ua_types_encoding_json.c:Double_decodeJson:
 1267|   526k|DECODE_JSON(Double) {
 1268|   526k|    UA_Double *dst = (UA_Double*)p;
 1269|   526k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   526k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   526k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 526k]
  |  |  ------------------
  |  | 1034|   526k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   526k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 526k]
  |  |  ------------------
  ------------------
 1270|   526k|    GET_TOKEN;
  ------------------
  |  | 1028|   526k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   526k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   526k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 526k]
  |  |  ------------------
  ------------------
 1271|       |
 1272|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1273|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1274|       |     * Sanity check.
 1275|       |     */
 1276|   526k|    if(tokenSize > 2000)
  ------------------
  |  Branch (1276:8): [True: 2, False: 526k]
  ------------------
 1277|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1278|       |
 1279|   526k|    cj5_token_type tokenType = currentTokenType(ctx);
 1280|       |
 1281|       |    /* It could be a String with Nan, Infinity */
 1282|   526k|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1282:8): [True: 1.00k, False: 525k]
  ------------------
 1283|  1.00k|        ctx->index++;
 1284|       |
 1285|  1.00k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1285:12): [True: 223, False: 778]
  |  Branch (1285:30): [True: 197, False: 26]
  ------------------
 1286|    197|            *dst = INFINITY;
 1287|    197|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1288|    197|        }
 1289|       |
 1290|    804|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1290:12): [True: 291, False: 513]
  |  Branch (1290:30): [True: 262, False: 29]
  ------------------
 1291|       |            /* workaround an MSVC 2013 issue */
 1292|    262|            *dst = -INFINITY;
 1293|    262|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    262|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1294|    262|        }
 1295|       |
 1296|    542|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1296:12): [True: 218, False: 324]
  |  Branch (1296:30): [True: 197, False: 21]
  ------------------
 1297|    197|            *dst = NAN;
 1298|    197|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1299|    197|        }
 1300|       |
 1301|    345|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1301:12): [True: 229, False: 116]
  |  Branch (1301:30): [True: 209, False: 20]
  ------------------
 1302|    209|            *dst = NAN;
 1303|    209|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    209|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1304|    209|        }
 1305|       |
 1306|    136|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    136|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1307|    345|    }
 1308|       |
 1309|   525k|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1309:8): [True: 7, False: 525k]
  ------------------
 1310|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1311|       |
 1312|   525k|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1313|   525k|    if(len == 0)
  ------------------
  |  Branch (1313:8): [True: 3, False: 525k]
  ------------------
 1314|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1315|       |
 1316|       |    /* There must only be whitespace between the end of the parsed number and
 1317|       |     * the end of the token */
 1318|   525k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1318:25): [True: 8, False: 525k]
  ------------------
 1319|      8|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1319:12): [True: 8, False: 0]
  |  Branch (1319:35): [True: 8, False: 0]
  ------------------
 1320|      8|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1321|      8|    }
 1322|       |
 1323|   525k|    ctx->index++;
 1324|   525k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   525k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1325|   525k|}
ua_types_encoding_json.c:String_decodeJson:
 1345|  70.7k|DECODE_JSON(String) {
 1346|  70.7k|    UA_String *dst = (UA_String*)p;
 1347|  70.7k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  70.7k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  70.7k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 70.7k]
  |  |  ------------------
  |  | 1034|  70.7k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  70.7k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 70.7k]
  |  |  ------------------
  ------------------
 1348|  70.7k|    CHECK_STRING;
  ------------------
  |  | 1047|  70.7k|#define CHECK_STRING do {                                \
  |  | 1048|  70.7k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 48, False: 70.7k]
  |  |  ------------------
  |  | 1049|     48|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|  70.7k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 70.7k]
  |  |  ------------------
  ------------------
 1349|  70.7k|    GET_TOKEN;
  ------------------
  |  | 1028|  70.7k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  70.7k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  70.7k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 70.7k]
  |  |  ------------------
  ------------------
 1350|  70.7k|    (void)tokenData;
 1351|       |
 1352|       |    /* Empty string? */
 1353|  70.7k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1353:8): [True: 1.09k, False: 69.6k]
  ------------------
 1354|  1.09k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.09k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1355|  1.09k|        dst->length = 0;
 1356|  1.09k|        ctx->index++;
 1357|  1.09k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.09k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1358|  1.09k|    }
 1359|       |
 1360|       |    /* The decoded utf8 is at most of the same length as the source string */
 1361|  69.6k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|  69.6k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1362|  69.6k|    if(!outBuf)
  ------------------
  |  Branch (1362:8): [True: 5, False: 69.6k]
  ------------------
 1363|      5|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1364|       |
 1365|       |    /* Decode the string */
 1366|  69.6k|    cj5_result r;
 1367|  69.6k|    r.tokens = ctx->tokens;
 1368|  69.6k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1369|  69.6k|    r.json5 = ctx->json5;
 1370|  69.6k|    unsigned int len = 0;
 1371|  69.6k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1372|  69.6k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1372:8): [True: 149, False: 69.4k]
  ------------------
 1373|    149|        UA_free(outBuf);
  ------------------
  |  |   19|    149|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1374|    149|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    149|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1375|    149|    }
 1376|       |
 1377|       |    /* Set the output */
 1378|  69.4k|    dst->length = len;
 1379|  69.4k|    if(dst->length > 0) {
  ------------------
  |  Branch (1379:8): [True: 69.4k, False: 0]
  ------------------
 1380|  69.4k|        dst->data = (UA_Byte*)outBuf;
 1381|  69.4k|    } else {
 1382|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1383|      0|        UA_free(outBuf);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1384|      0|    }
 1385|       |
 1386|  69.4k|    ctx->index++;
 1387|  69.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  69.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1388|  69.6k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1493|    558|DECODE_JSON(DateTime) {
 1494|    558|    UA_DateTime *dst = (UA_DateTime*)p;
 1495|    558|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|    558|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|    558|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 558]
  |  |  ------------------
  |  | 1034|    558|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|    558|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 558]
  |  |  ------------------
  ------------------
 1496|    558|    CHECK_STRING;
  ------------------
  |  | 1047|    558|#define CHECK_STRING do {                                \
  |  | 1048|    558|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 18, False: 540]
  |  |  ------------------
  |  | 1049|     18|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|    540|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 540]
  |  |  ------------------
  ------------------
 1497|    540|    GET_TOKEN;
  ------------------
  |  | 1028|    540|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|    540|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|    540|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 540]
  |  |  ------------------
  ------------------
 1498|       |
 1499|       |    /* The last character has to be 'Z'. We can omit some length checks later on
 1500|       |     * because we know the atoi functions stop before the 'Z'. */
 1501|    540|    if(tokenSize == 0 || tokenData[tokenSize-1] != 'Z')
  ------------------
  |  Branch (1501:8): [True: 2, False: 538]
  |  Branch (1501:26): [True: 22, False: 516]
  ------------------
 1502|     24|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     24|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1503|       |
 1504|    516|    struct musl_tm dts;
 1505|    516|    memset(&dts, 0, sizeof(dts));
 1506|       |
 1507|    516|    size_t pos = 0;
 1508|    516|    size_t len;
 1509|       |
 1510|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
 1511|       |     * to five with an optional plus or minus in front due to the range of the
 1512|       |     * DateTime 64bit integer. But in that case we require the year and the
 1513|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
 1514|       |     * starts. */
 1515|    516|    if(tokenData[0] == '-' || tokenData[0] == '+')
  ------------------
  |  Branch (1515:8): [True: 35, False: 481]
  |  Branch (1515:31): [True: 6, False: 475]
  ------------------
 1516|     41|        pos++;
 1517|    516|    UA_Int64 year = 0;
 1518|    516|    len = parseInt64(&tokenData[pos], 5, &year);
 1519|    516|    pos += len;
 1520|    516|    if(len != 4 && tokenData[pos] != '-')
  ------------------
  |  Branch (1520:8): [True: 363, False: 153]
  |  Branch (1520:20): [True: 71, False: 292]
  ------------------
 1521|     71|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     71|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1522|    445|    if(tokenData[0] == '-')
  ------------------
  |  Branch (1522:8): [True: 26, False: 419]
  ------------------
 1523|     26|        year = -year;
 1524|    445|    dts.tm_year = (UA_Int16)year - 1900;
 1525|    445|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1525:8): [True: 426, False: 19]
  ------------------
 1526|    426|        pos++;
 1527|       |
 1528|       |    /* Parse the month */
 1529|    445|    UA_UInt64 month = 0;
 1530|    445|    len = parseUInt64(&tokenData[pos], 2, &month);
 1531|    445|    pos += len;
 1532|    445|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    445|    do {                                                                                 \
  |  |  173|    445|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    445|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 28, False: 417]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     28|            EVAL_ON_ERROR;                                                               \
  |  |  175|     28|        }                                                                                \
  |  |  176|    445|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 417]
  |  |  ------------------
  ------------------
 1533|    417|    dts.tm_mon = (UA_UInt16)month - 1;
 1534|    417|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1534:8): [True: 1, False: 416]
  ------------------
 1535|      1|        pos++;
 1536|       |
 1537|       |    /* Parse the day and check the T between date and time */
 1538|    417|    UA_UInt64 day = 0;
 1539|    417|    len = parseUInt64(&tokenData[pos], 2, &day);
 1540|    417|    pos += len;
 1541|    417|    UA_CHECK(len == 2 || tokenData[pos] != 'T',
  ------------------
  |  |  172|    417|    do {                                                                                 \
  |  |  173|    417|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    771|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 1, False: 416]
  |  |  |  |  |  Branch (579:43): [True: 63, False: 354]
  |  |  |  |  |  Branch (579:43): [True: 353, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  175|      1|        }                                                                                \
  |  |  176|    417|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 416]
  |  |  ------------------
  ------------------
 1542|    417|             return UA_STATUSCODE_BADDECODINGERROR);
 1543|    416|    dts.tm_mday = (UA_UInt16)day;
 1544|    416|    pos++;
 1545|       |
 1546|       |    /* Parse the hour */
 1547|    416|    UA_UInt64 hour = 0;
 1548|    416|    len = parseUInt64(&tokenData[pos], 2, &hour);
 1549|    416|    pos += len;
 1550|    416|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    416|    do {                                                                                 \
  |  |  173|    416|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    416|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 16, False: 400]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     16|            EVAL_ON_ERROR;                                                               \
  |  |  175|     16|        }                                                                                \
  |  |  176|    416|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 400]
  |  |  ------------------
  ------------------
 1551|    400|    dts.tm_hour = (UA_UInt16)hour;
 1552|    400|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1552:8): [True: 1, False: 399]
  ------------------
 1553|      1|        pos++;
 1554|       |
 1555|       |    /* Parse the minute */
 1556|    400|    UA_UInt64 min = 0;
 1557|    400|    len = parseUInt64(&tokenData[pos], 2, &min);
 1558|    400|    pos += len;
 1559|    400|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    400|    do {                                                                                 \
  |  |  173|    400|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    400|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 10, False: 390]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     10|            EVAL_ON_ERROR;                                                               \
  |  |  175|     10|        }                                                                                \
  |  |  176|    400|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 390]
  |  |  ------------------
  ------------------
 1560|    390|    dts.tm_min = (UA_UInt16)min;
 1561|    390|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1561:8): [True: 1, False: 389]
  ------------------
 1562|      1|        pos++;
 1563|       |
 1564|       |    /* Parse the second */
 1565|    390|    UA_UInt64 sec = 0;
 1566|    390|    len = parseUInt64(&tokenData[pos], 2, &sec);
 1567|    390|    pos += len;
 1568|    390|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    390|    do {                                                                                 \
  |  |  173|    390|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    390|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 9, False: 381]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      9|            EVAL_ON_ERROR;                                                               \
  |  |  175|      9|        }                                                                                \
  |  |  176|    390|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 381]
  |  |  ------------------
  ------------------
 1569|    381|    dts.tm_sec = (UA_UInt16)sec;
 1570|       |
 1571|       |    /* Compute the seconds since the Unix epoch */
 1572|    381|    long long sinceunix = musl_tm_to_secs(&dts);
 1573|       |
 1574|       |    /* Are we within the range that can be represented? */
 1575|    381|    long long sinceunix_min =
 1576|    381|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|    381|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|    381|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|    381|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    381|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    381|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1577|    381|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|    381|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    381|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    381|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    381|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|    381|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    381|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    381|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1578|    381|        (long long)1; /* manual correction due to rounding */
 1579|    381|    long long sinceunix_max = (long long)
 1580|    381|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|    381|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|    381|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    381|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    381|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    381|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|    381|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    381|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    381|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1581|    381|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (1581:8): [True: 39, False: 342]
  |  Branch (1581:37): [True: 5, False: 337]
  ------------------
 1582|     44|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     44|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1583|       |
 1584|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
 1585|       |     * underflow/overflow. This is reverted once the fractional part has been
 1586|       |     * added. */
 1587|    337|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (1587:18): [True: 125, False: 212]
  ------------------
 1588|    337|    UA_DateTime dt = (UA_DateTime)
 1589|    337|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|    337|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    337|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    337|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    337|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|    337|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    337|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    337|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|    337|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    337|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    337|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1590|       |
 1591|       |    /* Parse the fraction of the second if defined */
 1592|    337|    if(tokenData[pos] == ',' || tokenData[pos] == '.') {
  ------------------
  |  Branch (1592:8): [True: 35, False: 302]
  |  Branch (1592:33): [True: 22, False: 280]
  ------------------
 1593|     57|        pos++;
 1594|     57|        double frac = 0.0;
 1595|     57|        double denom = 0.1;
 1596|  54.2k|        while(pos < tokenSize &&
  ------------------
  |  Branch (1596:15): [True: 54.2k, False: 0]
  ------------------
 1597|  54.2k|              tokenData[pos] >= '0' && tokenData[pos] <= '9') {
  ------------------
  |  Branch (1597:15): [True: 54.1k, False: 20]
  |  Branch (1597:40): [True: 54.1k, False: 37]
  ------------------
 1598|  54.1k|            frac += denom * (tokenData[pos] - '0');
 1599|  54.1k|            denom *= 0.1;
 1600|  54.1k|            pos++;
 1601|  54.1k|        }
 1602|     57|        frac += 0.00000005; /* Correct rounding when converting to integer */
 1603|     57|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|     57|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|     57|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|     57|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|     57|    }
 1605|       |
 1606|       |    /* Remove the underflow/overflow protection (see above) */
 1607|    337|    if(sinceunix > 0) {
  ------------------
  |  Branch (1607:8): [True: 126, False: 211]
  ------------------
 1608|    126|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|    126|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|    126|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    126|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    126|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1608:12): [True: 0, False: 126]
  ------------------
 1609|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1610|    126|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|    126|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    126|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    126|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1611|    211|    } else {
 1612|    211|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|    211|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|    211|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|    211|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    211|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    211|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1612:12): [True: 1, False: 210]
  ------------------
 1613|      1|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1614|    210|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|    210|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    210|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    210|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|    210|    }
 1616|       |
 1617|       |    /* We must be at the end of the string (ending with 'Z' as checked above) */
 1618|    336|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1618:8): [True: 50, False: 286]
  ------------------
 1619|     50|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     50|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1620|       |
 1621|    286|    *dst = dt;
 1622|       |
 1623|    286|    ctx->index++;
 1624|    286|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    286|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1625|    336|}
ua_types_encoding_json.c:Guid_decodeJson:
 1335|     79|DECODE_JSON(Guid) {
 1336|     79|    UA_Guid *dst = (UA_Guid*)p;
 1337|     79|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|     79|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|     79|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 79]
  |  |  ------------------
  |  | 1034|     79|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|     79|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 79]
  |  |  ------------------
  ------------------
 1338|     79|    CHECK_STRING;
  ------------------
  |  | 1047|     79|#define CHECK_STRING do {                                \
  |  | 1048|     79|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 11, False: 68]
  |  |  ------------------
  |  | 1049|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|     68|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 68]
  |  |  ------------------
  ------------------
 1339|     68|    GET_TOKEN;
  ------------------
  |  | 1028|     68|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|     68|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|     68|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 68]
  |  |  ------------------
  ------------------
 1340|     68|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1341|     68|    ctx->index++;
 1342|     68|    return UA_Guid_parse(dst, str);
 1343|     79|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1390|  6.92k|DECODE_JSON(ByteString) {
 1391|  6.92k|    UA_ByteString *dst = (UA_ByteString*)p;
 1392|  6.92k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  6.92k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  6.92k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 6.92k]
  |  |  ------------------
  |  | 1034|  6.92k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  6.92k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 6.92k]
  |  |  ------------------
  ------------------
 1393|  6.92k|    CHECK_STRING;
  ------------------
  |  | 1047|  6.92k|#define CHECK_STRING do {                                \
  |  | 1048|  6.92k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 14, False: 6.90k]
  |  |  ------------------
  |  | 1049|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|  6.90k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 6.90k]
  |  |  ------------------
  ------------------
 1394|  6.90k|    GET_TOKEN;
  ------------------
  |  | 1028|  6.90k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  6.90k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  6.90k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 6.90k]
  |  |  ------------------
  ------------------
 1395|       |
 1396|       |    /* Empty bytestring? */
 1397|  6.90k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1397:8): [True: 1.61k, False: 5.28k]
  ------------------
 1398|  1.61k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.61k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1399|  1.61k|        dst->length = 0;
 1400|  5.28k|    } else {
 1401|  5.28k|        size_t flen = 0;
 1402|  5.28k|        unsigned char* unB64 =
 1403|  5.28k|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1404|  5.28k|        if(unB64 == 0)
  ------------------
  |  Branch (1404:12): [True: 47, False: 5.24k]
  ------------------
 1405|     47|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     47|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1406|  5.24k|        dst->data = (u8*)unB64;
 1407|  5.24k|        dst->length = flen;
 1408|  5.24k|    }
 1409|       |
 1410|  6.86k|    ctx->index++;
 1411|  6.86k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.86k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1412|  6.90k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1470|  23.6k|DECODE_JSON(NodeId) {
 1471|  23.6k|    UA_NodeId *dst = (UA_NodeId*)p;
 1472|  23.6k|    UA_String str;
 1473|  23.6k|    UA_String_init(&str);
 1474|  23.6k|    status res = String_decodeJson(ctx, &str, NULL);
 1475|  23.6k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  23.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1475:8): [True: 23.5k, False: 63]
  ------------------
 1476|  23.5k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1477|  23.6k|    UA_String_clear(&str);
 1478|  23.6k|    return res;
 1479|  23.6k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1481|  3.68k|DECODE_JSON(ExpandedNodeId) {
 1482|  3.68k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1483|  3.68k|    UA_String str;
 1484|  3.68k|    UA_String_init(&str);
 1485|  3.68k|    status res = String_decodeJson(ctx, &str, NULL);
 1486|  3.68k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1486:8): [True: 3.67k, False: 10]
  ------------------
 1487|  3.67k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1488|  3.67k|                                        ctx->serverUrisSize, ctx->serverUris);
 1489|  3.68k|    UA_String_clear(&str);
 1490|  3.68k|    return res;
 1491|  3.68k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1627|    262|DECODE_JSON(StatusCode) {
 1628|    262|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1629|    262|    CHECK_OBJECT;
  ------------------
  |  | 1052|    262|#define CHECK_OBJECT do {                                \
  |  | 1053|    262|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 9, False: 253]
  |  |  ------------------
  |  | 1054|      9|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|    253|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 253]
  |  |  ------------------
  ------------------
 1630|    253|    DecodeEntry entries[2] = {
 1631|    253|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|    253|#define UA_TYPES_UINT32 6
  ------------------
 1632|    253|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1633|    253|    };
 1634|    253|    return decodeFields(ctx, entries, 2);
 1635|    262|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1424|  19.2k|DECODE_JSON(QualifiedName) {
 1425|  19.2k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1426|  19.2k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1057|  19.2k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  19.2k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 66, False: 19.1k]
  |  |  ------------------
  |  | 1059|     66|        ctx->index++;                                \
  |  | 1060|     66|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|     66|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  19.1k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 19.1k]
  |  |  ------------------
  ------------------
 1427|  19.1k|    UA_String str;
 1428|  19.1k|    UA_String_init(&str);
 1429|  19.1k|    status res = String_decodeJson(ctx, &str, NULL);
 1430|  19.1k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  19.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1430:8): [True: 19.1k, False: 13]
  ------------------
 1431|  19.1k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1432|  19.1k|    UA_String_clear(&str);
 1433|  19.1k|    return res;
 1434|  19.2k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1414|    829|DECODE_JSON(LocalizedText) {
 1415|    829|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1416|    829|    CHECK_OBJECT;
  ------------------
  |  | 1052|    829|#define CHECK_OBJECT do {                                \
  |  | 1053|    829|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 13, False: 816]
  |  |  ------------------
  |  | 1054|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|    816|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 816]
  |  |  ------------------
  ------------------
 1417|    816|    DecodeEntry entries[2] = {
 1418|    816|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|    816|#define UA_TYPES_STRING 11
  ------------------
 1419|    816|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|    816|#define UA_TYPES_STRING 11
  ------------------
 1420|    816|    };
 1421|    816|    return decodeFields(ctx, entries, 2);
 1422|    829|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2028|  20.0k|DECODE_JSON(ExtensionObject) {
 2029|  20.0k|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2030|  20.0k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1057|  20.0k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  20.0k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 0, False: 20.0k]
  |  |  ------------------
  |  | 1059|      0|        ctx->index++;                                \
  |  | 1060|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  20.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 20.0k]
  |  |  ------------------
  ------------------
 2031|  20.0k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  20.0k|#define CHECK_OBJECT do {                                \
  |  | 1053|  20.0k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 39, False: 20.0k]
  |  |  ------------------
  |  | 1054|     39|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  20.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 20.0k]
  |  |  ------------------
  ------------------
 2032|       |
 2033|       |    /* Empty object -> Null ExtensionObject */
 2034|  20.0k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2034:8): [True: 1.52k, False: 18.5k]
  ------------------
 2035|  1.52k|        ctx->index++; /* Skip the empty ExtensionObject */
 2036|  1.52k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.52k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2037|  1.52k|    }
 2038|       |
 2039|       |    /* Store the index where the ExtensionObject begins */
 2040|  18.5k|    size_t beginIndex = ctx->index;
 2041|       |
 2042|       |    /* Search for non-JSON encoding */
 2043|  18.5k|    UA_UInt64 encoding = 0;
 2044|  18.5k|    size_t encIndex = 0;
 2045|  18.5k|    status ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2046|  18.5k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  18.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2046:8): [True: 2.89k, False: 15.6k]
  ------------------
 2047|  2.89k|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2048|  2.89k|        size_t len = parseUInt64(extObjEncoding,
 2049|  2.89k|                                 getTokenLength(&ctx->tokens[encIndex]),
 2050|  2.89k|                                 &encoding);
 2051|  2.89k|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2051:12): [True: 2, False: 2.89k]
  |  Branch (2051:24): [True: 117, False: 2.78k]
  ------------------
 2052|    119|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    119|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2053|  2.89k|    }
 2054|       |
 2055|       |    /* Get the type NodeId index */
 2056|  18.4k|    size_t typeIdIndex = 0;
 2057|  18.4k|    ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2058|  18.4k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  18.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2058:8): [True: 58, False: 18.3k]
  ------------------
 2059|     58|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     58|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2060|       |
 2061|       |    /* Decode the type NodeId */
 2062|  18.3k|    UA_NodeId typeId;
 2063|  18.3k|    UA_NodeId_init(&typeId);
 2064|  18.3k|    ctx->index = (UA_UInt16)typeIdIndex;
 2065|  18.3k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|  18.3k|#define UA_TYPES_NODEID 16
  ------------------
 2066|  18.3k|    ctx->index = beginIndex;
 2067|  18.3k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  18.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2067:8): [True: 182, False: 18.1k]
  ------------------
 2068|    182|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2069|    182|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    182|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2070|    182|    }
 2071|       |
 2072|       |    /* Lookup the type */
 2073|  18.1k|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2074|       |
 2075|       |    /* Unknown body type */
 2076|  18.1k|    if(!type) {
  ------------------
  |  Branch (2076:8): [True: 10.6k, False: 7.47k]
  ------------------
 2077|       |        /* FIXME: We need UA_EXTENSIONOBJECT_ENCODED_JSON when we parse an
 2078|       |         * unknown type in JSON. But it is not defined in the standard. */
 2079|  10.6k|        dst->encoding = (encoding != 2) ?
  ------------------
  |  Branch (2079:25): [True: 9.80k, False: 879]
  ------------------
 2080|  9.80k|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2081|  10.6k|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2082|  10.6k|        dst->content.encoded.typeId = typeId;
 2083|       |
 2084|       |        /* Get the body field index */
 2085|  10.6k|        size_t bodyIndex = 0;
 2086|  10.6k|        ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex);
 2087|  10.6k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  10.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2087:12): [True: 6.60k, False: 4.07k]
  ------------------
 2088|       |            /* Only JSON structures can be encoded in-situ */
 2089|  6.60k|            if(encoding != 0)
  ------------------
  |  Branch (2089:16): [True: 6, False: 6.60k]
  ------------------
 2090|      6|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2091|       |
 2092|       |            /* Extract the entire ExtensionObject object as the body */
 2093|  6.60k|            size_t parentIndex = ctx->index;
 2094|  6.60k|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2095|  6.60k|            if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.60k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2095:16): [True: 1, False: 6.60k]
  ------------------
 2096|      1|                return ret;
 2097|       |
 2098|       |            /* Remove the UaEncoding and UaTypeId field from the encoding.
 2099|       |             * Remove the later field first. */
 2100|  6.60k|            if(encIndex != 0 && encIndex > typeIdIndex)
  ------------------
  |  Branch (2100:16): [True: 1.11k, False: 5.48k]
  |  Branch (2100:33): [True: 376, False: 742]
  ------------------
 2101|    376|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2102|    376|                                        parentIndex, encIndex);
 2103|       |
 2104|  6.60k|            removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2105|  6.60k|                                    parentIndex, typeIdIndex);
 2106|       |
 2107|  6.60k|            if(encIndex != 0 && encIndex < typeIdIndex)
  ------------------
  |  Branch (2107:16): [True: 1.11k, False: 5.48k]
  |  Branch (2107:33): [True: 742, False: 376]
  ------------------
 2108|    742|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2109|    742|                                        parentIndex, encIndex);
 2110|       |
 2111|  6.60k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.60k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2112|  6.60k|        }
 2113|       |
 2114|  4.07k|        ctx->index = bodyIndex;
 2115|  4.07k|        if(encoding != 0) {
  ------------------
  |  Branch (2115:12): [True: 1.25k, False: 2.82k]
  ------------------
 2116|       |            /* Decode the body as a ByteString */
 2117|  1.25k|            ret = ByteString_decodeJson(ctx, &dst->content.encoded.body, NULL);
 2118|  2.82k|        } else {
 2119|       |            /* Use the JSON encoding directly */
 2120|  2.82k|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2121|  2.82k|        }
 2122|  4.07k|        ctx->index = beginIndex;
 2123|  4.07k|        skipObject(ctx);
 2124|  4.07k|        return ret;
 2125|  10.6k|    }
 2126|       |
 2127|       |    /* No need to keep the TypeId */
 2128|  7.47k|    UA_NodeId_clear(&typeId);
 2129|       |
 2130|       |    /* Disallow directly nested ExtensionObjects */
 2131|  7.47k|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  7.47k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2131:8): [True: 2, False: 7.47k]
  ------------------
 2132|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2133|       |
 2134|       |    /* Allocate memory for the decoded data */
 2135|  7.47k|    dst->content.decoded.data = UA_new(type);
 2136|  7.47k|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2136:8): [True: 1, False: 7.47k]
  ------------------
 2137|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2138|  7.47k|    dst->content.decoded.type = type;
 2139|  7.47k|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2140|       |
 2141|       |    /* Get the body field index */
 2142|  7.47k|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2143|  7.47k|    size_t bodyIndex = ctx->index;
 2144|  7.47k|    ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex); /* Can fail */
 2145|  7.47k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  7.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2145:8): [True: 7.05k, False: 422]
  ------------------
 2146|  7.05k|        ctx->index = bodyIndex;
 2147|  7.05k|        ret = decodeType(ctx, dst->content.decoded.data, type);
 2148|  7.05k|        ctx->index = beginIndex;
 2149|  7.05k|        skipObject(ctx);
 2150|  7.05k|        return ret;
 2151|  7.05k|    }
 2152|       |
 2153|    422|    return decodeType(ctx, dst->content.decoded.data, type);
 2154|  7.47k|}
ua_types_encoding_json.c:tokenToByteString:
 1961|  9.42k|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 1962|  9.42k|    GET_TOKEN;
  ------------------
  |  | 1028|  9.42k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  9.42k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  9.42k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 9.42k]
  |  |  ------------------
  ------------------
 1963|  9.42k|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 1964|  9.42k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  9.42k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1964:8): [True: 1, False: 9.42k]
  ------------------
 1965|      1|        return res;
 1966|  9.42k|    memcpy(p->data, tokenData, tokenSize);
 1967|  9.42k|    skipObject(ctx);
 1968|  9.42k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.42k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1969|  9.42k|}
ua_types_encoding_json.c:removeFieldFromEncoding:
 1977|  7.72k|                        size_t parentIndex, size_t tokenIndex) {
 1978|       |    /* Which part of the encoding to cut out */
 1979|  7.72k|    unsigned objStart = ctx->tokens[parentIndex].start;
 1980|  7.72k|    unsigned objEnd = ctx->tokens[parentIndex].end;
 1981|  7.72k|    unsigned start = ctx->tokens[tokenIndex-1].start;
 1982|  7.72k|    unsigned end = ctx->tokens[tokenIndex].end + 1; /* One char after */
 1983|       |
 1984|  7.72k|    UA_Boolean haveBefore = (parentIndex < tokenIndex - 2);
 1985|  7.72k|    if(haveBefore) {
  ------------------
  |  Branch (1985:8): [True: 3.06k, False: 4.65k]
  ------------------
 1986|       |        /* Find where the previous token ended. This also removes the comma
 1987|       |         * between the previous and the current element. */
 1988|  2.57M|        for(size_t i = parentIndex + 2; i < tokenIndex - 1; i++) {
  ------------------
  |  Branch (1988:41): [True: 2.57M, False: 3.06k]
  ------------------
 1989|  2.57M|            if(ctx->tokens[i].end + 1 > start)
  ------------------
  |  Branch (1989:16): [True: 0, False: 2.57M]
  ------------------
 1990|      0|                start = ctx->tokens[i].end + 1;
 1991|  2.57M|        }
 1992|  3.06k|        if(ctx->json5[start] == '"' || ctx->json5[start] == '\'')
  ------------------
  |  Branch (1992:12): [True: 0, False: 3.06k]
  |  Branch (1992:40): [True: 0, False: 3.06k]
  ------------------
 1993|      0|            start++;
 1994|  4.65k|    } else {
 1995|       |        /* No previous element. Remove the quoation marks of the field name. */
 1996|  4.65k|        start = ctx->tokens[tokenIndex-1].start;
 1997|  4.65k|        if(start > 0 && (ctx->json5[start-1] == '"' || ctx->json5[start-1] == '\''))
  ------------------
  |  Branch (1997:12): [True: 4.65k, False: 0]
  |  Branch (1997:26): [True: 0, False: 4.65k]
  |  Branch (1997:56): [True: 306, False: 4.34k]
  ------------------
 1998|    306|            start--;
 1999|       |
 2000|       |        /* Find the beginning of the next field in the object.
 2001|       |         * This removes the comma after the current field. */
 2002|  4.65k|        size_t oldIndex = ctx->index;
 2003|  4.65k|        ctx->index = tokenIndex;
 2004|  4.65k|        skipObject(ctx);
 2005|  4.65k|        if(ctx->index < ctx->tokensSize && ctx->tokens[ctx->index].start < objEnd) {
  ------------------
  |  Branch (2005:12): [True: 4.65k, False: 0]
  |  Branch (2005:44): [True: 1.28k, False: 3.36k]
  ------------------
 2006|  1.28k|            end = ctx->tokens[ctx->index].start;
 2007|  1.28k|            if(ctx->json5[end-1] == '"' || ctx->json5[end-1] == '\'')
  ------------------
  |  Branch (2007:16): [True: 206, False: 1.08k]
  |  Branch (2007:44): [True: 200, False: 881]
  ------------------
 2008|    406|                end--;
 2009|  1.28k|        }
 2010|  4.65k|        ctx->index = oldIndex;
 2011|  4.65k|    }
 2012|       |
 2013|  7.72k|    UA_assert(end > start);
  ------------------
  |  |  399|  7.72k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2013:5): [True: 7.72k, False: 0]
  ------------------
 2014|  7.72k|    UA_assert(start > objStart);
  ------------------
  |  |  399|  7.72k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2014:5): [True: 7.72k, False: 0]
  ------------------
 2015|       |
 2016|       |    /* Move the offset from ctx->json5 to encoding->data */
 2017|  7.72k|    start -= objStart;
 2018|  7.72k|    end -= objStart;
 2019|       |
 2020|  7.72k|    UA_assert(end <= encoding->length);
  ------------------
  |  |  399|  7.72k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2020:5): [True: 7.72k, False: 0]
  ------------------
 2021|       |
 2022|       |    /* Cut out the field we want to remove */
 2023|  7.72k|    size_t after_len = encoding->length - end;
 2024|  7.72k|    memmove(encoding->data + start, encoding->data + end, after_len);
 2025|  7.72k|    encoding->length -= (end - start);
 2026|  7.72k|}
ua_types_encoding_json.c:DataValue_decodeJson:
 1921|  33.4k|DECODE_JSON(DataValue) {
 1922|  33.4k|    UA_DataValue *dst = (UA_DataValue*)p;
 1923|  33.4k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1057|  33.4k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  33.4k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 334, False: 33.1k]
  |  |  ------------------
  |  | 1059|    334|        ctx->index++;                                \
  |  | 1060|    334|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    334|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  33.1k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 33.1k]
  |  |  ------------------
  ------------------
 1924|  33.1k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  33.1k|#define CHECK_OBJECT do {                                \
  |  | 1053|  33.1k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 68, False: 33.0k]
  |  |  ------------------
  |  | 1054|     68|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  33.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 33.0k]
  |  |  ------------------
  ------------------
 1925|       |
 1926|       |    /* Decode the Variant in-situ */
 1927|  33.0k|    size_t beginIndex = ctx->index;
 1928|  33.0k|    status ret = decodeJSONVariant(ctx, &dst->value);
 1929|  33.0k|    ctx->index = beginIndex;
 1930|  33.0k|    dst->hasValue = (dst->value.type != NULL);
 1931|  33.0k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  33.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1931:8): [True: 3.11k, False: 29.9k]
  ------------------
 1932|  3.11k|        return ret;
 1933|       |
 1934|       |    /* Decode the other members (skip the Variant members) */
 1935|  29.9k|    DecodeEntry entries[8] = {
 1936|  29.9k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 1937|  29.9k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 1938|  29.9k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 1939|  29.9k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|  29.9k|#define UA_TYPES_STATUSCODE 18
  ------------------
 1940|  29.9k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 1941|  29.9k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  29.9k|#define UA_TYPES_DATETIME 12
  ------------------
 1942|  29.9k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 1943|  29.9k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  29.9k|#define UA_TYPES_UINT16 4
  ------------------
 1944|  29.9k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 1945|  29.9k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  29.9k|#define UA_TYPES_DATETIME 12
  ------------------
 1946|  29.9k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 1947|  29.9k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|  29.9k|#define UA_TYPES_UINT16 4
  ------------------
 1948|  29.9k|    };
 1949|       |
 1950|  29.9k|    ret = decodeFields(ctx, entries, 8);
 1951|  29.9k|    dst->hasStatus = entries[3].found;
 1952|  29.9k|    dst->hasSourceTimestamp = entries[4].found;
 1953|  29.9k|    dst->hasSourcePicoseconds = entries[5].found;
 1954|  29.9k|    dst->hasServerTimestamp = entries[6].found;
 1955|  29.9k|    dst->hasServerPicoseconds = entries[7].found;
 1956|  29.9k|    return ret;
 1957|  33.0k|}
ua_types_encoding_json.c:decodeJSONVariant:
 1791|  40.1k|decodeJSONVariant(ParseCtx *ctx, UA_Variant *dst) {
 1792|       |    /* Empty variant == null */
 1793|  40.1k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (1793:8): [True: 5.17k, False: 34.9k]
  ------------------
 1794|  5.17k|        ctx->index++;
 1795|  5.17k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.17k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1796|  5.17k|    }
 1797|       |
 1798|       |    /* Search the value field */
 1799|  34.9k|    size_t valueIndex = 0;
 1800|  34.9k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 1801|       |
 1802|       |    /* Search for the dimensions field */
 1803|  34.9k|    size_t dimIndex = 0;
 1804|  34.9k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 1805|       |
 1806|       |    /* Parse the type kind */
 1807|  34.9k|    size_t typeIndex = 0;
 1808|  34.9k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 1809|  34.9k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1809:8): [True: 61, False: 34.9k]
  |  Branch (1809:26): [True: 4, False: 34.9k]
  ------------------
 1810|     65|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     65|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1811|  34.9k|    UA_UInt64 typeKind = 0;
 1812|  34.9k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 1813|  34.9k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 1814|  34.9k|    if(len == 0)
  ------------------
  |  Branch (1814:8): [True: 5, False: 34.9k]
  ------------------
 1815|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1816|       |
 1817|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 1818|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 1819|  34.9k|    typeKind--;
 1820|  34.9k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (1820:8): [True: 135, False: 34.7k]
  ------------------
 1821|    135|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    135|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1822|  34.7k|    const UA_DataType *type = &UA_TYPES[typeKind];
 1823|       |
 1824|       |    /* Value is an array? */
 1825|  34.7k|    UA_Boolean isArray =
 1826|  34.7k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (1826:10): [True: 32.0k, False: 2.72k]
  |  Branch (1826:28): [True: 12.8k, False: 19.2k]
  ------------------
 1827|       |
 1828|       |    /* Adjust the depth and set the value index as current */
 1829|  34.7k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  34.7k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1829:8): [True: 0, False: 34.7k]
  ------------------
 1830|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1831|  34.7k|    size_t beginIndex = ctx->index;
 1832|  34.7k|    ctx->index = valueIndex;
 1833|  34.7k|    ctx->depth++;
 1834|       |
 1835|       |    /* Decode the value */
 1836|  34.7k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  34.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1837|  34.7k|    if(!isArray) {
  ------------------
  |  Branch (1837:8): [True: 21.9k, False: 12.8k]
  ------------------
 1838|       |        /* Scalar with dimensions -> error */
 1839|  21.9k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1839:12): [True: 23, False: 21.9k]
  ------------------
 1840|     23|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     23|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1841|     23|            goto out;
 1842|     23|        }
 1843|       |
 1844|       |        /* A variant cannot contain a variant. But it can contain an array of
 1845|       |         * variants */
 1846|  21.9k|        if(type->typeKind == UA_DATATYPEKIND_VARIANT) {
  ------------------
  |  Branch (1846:12): [True: 1, False: 21.9k]
  ------------------
 1847|      1|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1848|      1|            goto out;
 1849|      1|        }
 1850|       |
 1851|       |        /* Decode a value wrapped in an ExtensionObject */
 1852|  21.9k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (1852:12): [True: 19.2k, False: 2.69k]
  |  Branch (1852:30): [True: 884, False: 18.3k]
  ------------------
 1853|    884|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 1854|    884|            goto out;
 1855|    884|        }
 1856|       |
 1857|       |        /* Allocate memory for the value */
 1858|  21.0k|        dst->data = UA_new(type);
 1859|  21.0k|        if(!dst->data) {
  ------------------
  |  Branch (1859:12): [True: 2, False: 21.0k]
  ------------------
 1860|      2|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      2|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1861|      2|            goto out;
 1862|      2|        }
 1863|  21.0k|        dst->type = type;
 1864|       |
 1865|       |        /* Decode the value */
 1866|  21.0k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (1866:12): [True: 18.3k, False: 2.69k]
  |  Branch (1866:30): [True: 18.1k, False: 205]
  ------------------
 1867|  18.1k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 1868|  21.0k|    } else {
 1869|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 1870|       |         * members must all have the same type. */
 1871|  12.8k|        const UA_DataType *unwrapType = NULL;
 1872|  12.8k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  12.8k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1872:12): [True: 8.14k, False: 4.68k]
  ------------------
 1873|  8.14k|            unwrapType = getArrayUnwrapType(ctx);
 1874|  12.8k|        if(unwrapType) {
  ------------------
  |  Branch (1874:12): [True: 275, False: 12.5k]
  ------------------
 1875|    275|            dst->type = unwrapType;
 1876|    275|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 1877|  12.5k|        } else {
 1878|  12.5k|            dst->type = type;
 1879|  12.5k|            res = Array_decodeJson(ctx, &dst->data, type);
 1880|  12.5k|        }
 1881|       |
 1882|       |        /* Decode array dimensions */
 1883|  12.8k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1883:12): [True: 6.39k, False: 6.43k]
  ------------------
 1884|  6.39k|            ctx->index = dimIndex;
 1885|  6.39k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 1886|  6.39k|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  6.39k|#define UA_TYPES_UINT32 6
  ------------------
 1887|       |
 1888|       |            /* Help clang-analyzer */
 1889|  6.39k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  399|  6.39k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1889:13): [True: 258, False: 6.13k]
  |  Branch (1889:13): [True: 6.13k, False: 0]
  ------------------
 1890|       |
 1891|       |            /* Validate the dimensions */
 1892|  6.39k|            size_t total = 1;
 1893|  2.84M|            for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1893:31): [True: 2.83M, False: 6.39k]
  ------------------
 1894|  2.83M|                total *= dst->arrayDimensions[i];
 1895|  6.39k|            if(total != dst->arrayLength)
  ------------------
  |  Branch (1895:16): [True: 179, False: 6.21k]
  ------------------
 1896|    179|                res |= UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    179|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1897|       |
 1898|       |            /* Only keep >= 2 dimensions */
 1899|  6.39k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (1899:16): [True: 330, False: 6.06k]
  ------------------
 1900|    330|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|    330|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1901|    330|                dst->arrayDimensions = NULL;
 1902|    330|                dst->arrayDimensionsSize = 0;
 1903|    330|            }
 1904|  6.39k|        }
 1905|  12.8k|    }
 1906|       |
 1907|  34.7k| out:
 1908|  34.7k|    ctx->index = beginIndex;
 1909|  34.7k|    skipObject(ctx);
 1910|  34.7k|    ctx->depth--;
 1911|  34.7k|    return res;
 1912|  34.7k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2158|    884|                                        const UA_DataType *type) {
 2159|    884|    (void) type;
 2160|    884|    UA_Variant *dst = (UA_Variant*)p;
 2161|       |
 2162|       |    /* ExtensionObject with null body */
 2163|    884|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2163:8): [True: 194, False: 690]
  ------------------
 2164|    194|        dst->data = UA_ExtensionObject_new();
 2165|    194|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    194|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2166|    194|        ctx->index++;
 2167|    194|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    194|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2168|    194|    }
 2169|       |
 2170|       |    /* Decode the ExtensionObject */
 2171|    690|    UA_ExtensionObject eo;
 2172|    690|    UA_ExtensionObject_init(&eo);
 2173|    690|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2174|    690|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    690|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2174:8): [True: 217, False: 473]
  ------------------
 2175|    217|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2176|    217|        return ret;
 2177|    217|    }
 2178|       |
 2179|       |    /* The content is still encoded, cannot unwrap */
 2180|    473|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2180:8): [True: 324, False: 149]
  ------------------
 2181|    324|        goto use_eo;
 2182|       |
 2183|       |    /* The content is a builtin type that could have been directly encoded in
 2184|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2185|       |     * means for us, that somebody made an extra effort to explicitly get an
 2186|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2187|       |     * the same JSON again when encoding again. */
 2188|    149|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2188:8): [True: 82, False: 67]
  ------------------
 2189|     82|        goto use_eo;
 2190|       |
 2191|       |    /* Unwrap the ExtensionObject */
 2192|     67|    dst->data = eo.content.decoded.data;
 2193|     67|    dst->type = eo.content.decoded.type;
 2194|     67|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     67|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2195|       |
 2196|    406| use_eo:
 2197|       |    /* Don't unwrap */
 2198|    406|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|    406|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2199|    406|    if(!dst->data) {
  ------------------
  |  Branch (2199:8): [True: 1, False: 405]
  ------------------
 2200|      1|        UA_ExtensionObject_clear(&eo);
 2201|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2202|      1|    }
 2203|    405|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    405|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2204|    405|    *(UA_ExtensionObject*)dst->data = eo;
 2205|    405|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    405|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2206|    406|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1672|  8.14k|getArrayUnwrapType(ParseCtx *ctx) {
 1673|  8.14k|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|  8.14k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1673:5): [True: 8.14k, False: 0]
  ------------------
 1674|       |
 1675|       |    /* Return early for empty arrays */
 1676|  8.14k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1677|  8.14k|    if(length == 0)
  ------------------
  |  Branch (1677:8): [True: 3.03k, False: 5.10k]
  ------------------
 1678|  3.03k|        return NULL;
 1679|       |
 1680|       |    /* Save the original index and go to the first array member */
 1681|  5.10k|    size_t oldIndex = ctx->index;
 1682|  5.10k|    ctx->index++;
 1683|       |
 1684|       |    /* Lookup the type for the first array member */
 1685|  5.10k|    UA_NodeId typeId;
 1686|  5.10k|    UA_NodeId_init(&typeId);
 1687|  5.10k|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1688|  5.10k|    if(!typeOfBody) {
  ------------------
  |  Branch (1688:8): [True: 1.75k, False: 3.35k]
  ------------------
 1689|  1.75k|        ctx->index = oldIndex; /* Restore the index */
 1690|  1.75k|        return NULL;
 1691|  1.75k|    }
 1692|       |
 1693|       |    /* Get the TypeId encoding for faster comparison below.
 1694|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 1695|  3.35k|    size_t typeIdIndex = 0;
 1696|  3.35k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1697|  3.35k|    (void)ret;
 1698|  3.35k|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  399|  3.35k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1698:5): [True: 3.35k, False: 0]
  ------------------
 1699|  3.35k|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 1700|  3.35k|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 1701|       |
 1702|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 1703|       |     * the first member. We still haven't checked the encoding type. */
 1704|  7.25k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1704:23): [True: 6.97k, False: 275]
  ------------------
 1705|       |        /* Array element must be an object */
 1706|  6.97k|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (1706:12): [True: 14, False: 6.96k]
  ------------------
 1707|     14|            ctx->index = oldIndex; /* Restore the index */
 1708|     14|            return NULL;
 1709|     14|        }
 1710|       |
 1711|       |        /* Check for non-JSON encoding */
 1712|  6.96k|        size_t encIndex = 0;
 1713|  6.96k|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 1714|  6.96k|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  6.96k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1714:12): [True: 219, False: 6.74k]
  ------------------
 1715|    219|            ctx->index = oldIndex; /* Restore the index */
 1716|    219|            return NULL;
 1717|    219|        }
 1718|       |
 1719|       |        /* Get the type NodeId index */
 1720|  6.74k|        size_t memberTypeIdIndex = 0;
 1721|  6.74k|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 1722|  6.74k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  6.74k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1722:12): [True: 451, False: 6.29k]
  ------------------
 1723|    451|            ctx->index = oldIndex; /* Restore the index */
 1724|    451|            return NULL;
 1725|    451|        }
 1726|       |
 1727|       |        /* Is it the same type? Compare raw NodeId string */
 1728|  6.29k|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 1729|  6.29k|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 1730|  6.29k|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (1730:12): [True: 1.20k, False: 5.09k]
  ------------------
 1731|  5.09k|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (1731:12): [True: 1.19k, False: 3.89k]
  ------------------
 1732|  2.39k|            ctx->index = oldIndex; /* Restore the index */
 1733|  2.39k|            return NULL;
 1734|  2.39k|        }
 1735|       |
 1736|       |        /* Skip to the next array member */
 1737|  3.89k|        skipObject(ctx);
 1738|  3.89k|    }
 1739|       |
 1740|    275|    ctx->index = oldIndex; /* Restore the index */
 1741|    275|    return typeOfBody;
 1742|  3.35k|}
ua_types_encoding_json.c:getExtensionObjectType:
 1640|  5.10k|getExtensionObjectType(ParseCtx *ctx) {
 1641|  5.10k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1641:8): [True: 228, False: 4.88k]
  ------------------
 1642|    228|        return NULL;
 1643|       |
 1644|       |    /* Get the type NodeId index */
 1645|  4.88k|    size_t typeIdIndex = 0;
 1646|  4.88k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1647|  4.88k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  4.88k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1647:8): [True: 575, False: 4.30k]
  ------------------
 1648|    575|        return NULL;
 1649|       |
 1650|  4.30k|    size_t oldIndex = ctx->index;
 1651|  4.30k|    ctx->index = (UA_UInt16)typeIdIndex;
 1652|       |
 1653|       |    /* Decode the type NodeId */
 1654|  4.30k|    UA_NodeId typeId;
 1655|  4.30k|    UA_NodeId_init(&typeId);
 1656|  4.30k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|  4.30k|#define UA_TYPES_NODEID 16
  ------------------
 1657|  4.30k|    ctx->index = oldIndex;
 1658|  4.30k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  4.30k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1658:8): [True: 132, False: 4.17k]
  ------------------
 1659|    132|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1660|    132|        return NULL;
 1661|    132|    }
 1662|       |
 1663|       |    /* Lookup an return */
 1664|  4.17k|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1665|  4.17k|    UA_NodeId_clear(&typeId);
 1666|  4.17k|    return type;
 1667|  4.30k|}
ua_types_encoding_json.c:Array_decodeJsonUnwrapExtensionObject:
 1746|    275|                                      const UA_DataType *type) {
 1747|    275|    size_t *size_ptr = (size_t*) dst - 1; /* Save the length pointer of the array */
 1748|    275|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1749|       |
 1750|       |    /* Known from the previous unwrapping-check */
 1751|    275|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|    275|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1751:5): [True: 275, False: 0]
  ------------------
 1752|    275|    UA_assert(length > 0);
  ------------------
  |  |  399|    275|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1752:5): [True: 275, False: 0]
  ------------------
 1753|       |
 1754|    275|    ctx->index++; /* Go to first array member */
 1755|       |
 1756|       |    /* Allocate memory */
 1757|    275|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|    275|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1758|    275|    if(*dst == NULL)
  ------------------
  |  Branch (1758:8): [True: 1, False: 274]
  ------------------
 1759|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1760|       |
 1761|       |    /* Decode array members */
 1762|    274|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    274|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1763|    274|    uintptr_t ptr = (uintptr_t)*dst;
 1764|    689|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1764:23): [True: 455, False: 234]
  ------------------
 1765|    455|        UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|    455|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1765:9): [True: 455, False: 0]
  ------------------
 1766|    455|        if(type->typeKind == UA_DATATYPEKIND_STRUCTURE) {
  ------------------
  |  Branch (1766:12): [True: 9, False: 446]
  ------------------
 1767|       |            /* Decode structure in-situ in the ExtensionObject */
 1768|      9|            ret = decodeJsonStructure(ctx, (void*)ptr, type);
 1769|    446|        } else {
 1770|       |            /* Get the body field and decode it */
 1771|    446|            DecodeEntry entries[3] = {
 1772|    446|                {UA_JSONKEY_TYPEID, NULL, NULL, false, NULL},
 1773|    446|                {UA_JSONKEY_BODY, (void*)ptr, NULL, false, type},
 1774|    446|                {UA_JSONKEY_ENCODING, NULL, NULL, false, NULL}
 1775|    446|            };
 1776|    446|            ret = decodeFields(ctx, entries, 3);
 1777|    446|        }
 1778|    455|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    455|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1778:12): [True: 40, False: 415]
  ------------------
 1779|     40|            UA_Array_delete(*dst, i+1, type);
 1780|     40|            *dst = NULL;
 1781|     40|            return ret;
 1782|     40|        }
 1783|    415|        ptr += type->memSize;
 1784|    415|    }
 1785|       |
 1786|    234|    *size_ptr = length; /* All good, set the size */
 1787|    234|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    234|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1788|    274|}
ua_types_encoding_json.c:Array_decodeJson:
 2340|  18.9k|Array_decodeJson(ParseCtx *ctx, void *dst_, const UA_DataType *type) {
 2341|  18.9k|    void **dst = (void**)dst_;
 2342|       |
 2343|       |    /* Save the length of the array */
 2344|  18.9k|    size_t *size_ptr = (size_t*) dst - 1;
 2345|       |
 2346|  18.9k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2346:8): [True: 15, False: 18.9k]
  ------------------
 2347|     15|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2348|       |
 2349|  18.9k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2350|       |
 2351|  18.9k|    ctx->index++; /* Go to first array member or to the first element after
 2352|       |                   * the array (if empty) */
 2353|       |
 2354|       |    /* Return early for empty arrays */
 2355|  18.9k|    if(length == 0) {
  ------------------
  |  Branch (2355:8): [True: 6.53k, False: 12.4k]
  ------------------
 2356|  6.53k|        *size_ptr = length;
 2357|  6.53k|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  6.53k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2358|  6.53k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.53k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2359|  6.53k|    }
 2360|       |
 2361|       |    /* Allocate memory */
 2362|  12.4k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  12.4k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2363|  12.4k|    if(*dst == NULL)
  ------------------
  |  Branch (2363:8): [True: 8, False: 12.3k]
  ------------------
 2364|      8|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      8|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2365|       |
 2366|       |    /* Decode array members */
 2367|  12.3k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2368|  12.3k|    uintptr_t ptr = (uintptr_t)*dst;
 2369|  7.29M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2369:23): [True: 7.28M, False: 11.3k]
  ------------------
 2370|  7.28M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2370:12): [True: 807, False: 7.28M]
  ------------------
 2371|    807|            ptr += type->memSize;
 2372|    807|            ctx->index++;
 2373|    807|            continue;
 2374|    807|        }
 2375|       |
 2376|  7.28M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2377|  7.28M|        ptr += type->memSize;
 2378|  7.28M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  7.28M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2378:12): [True: 1.03k, False: 7.28M]
  ------------------
 2379|  1.03k|            UA_Array_delete(*dst, i+1, type);
 2380|  1.03k|            *dst = NULL;
 2381|  1.03k|            return ret;
 2382|  1.03k|        }
 2383|  7.28M|    }
 2384|       |
 2385|  11.3k|    *size_ptr = length; /* All good, set the size */
 2386|  11.3k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  11.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2387|  12.3k|}
ua_types_encoding_json.c:Variant_decodeJson:
 1914|  7.37k|DECODE_JSON(Variant) {
 1915|  7.37k|    UA_Variant *dst = (UA_Variant*)p;
 1916|  7.37k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1057|  7.37k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  7.37k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 232, False: 7.14k]
  |  |  ------------------
  |  | 1059|    232|        ctx->index++;                                \
  |  | 1060|    232|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    232|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  7.14k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 7.14k]
  |  |  ------------------
  ------------------
 1917|  7.14k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  7.14k|#define CHECK_OBJECT do {                                \
  |  | 1053|  7.14k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 15, False: 7.12k]
  |  |  ------------------
  |  | 1054|     15|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  7.12k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 7.12k]
  |  |  ------------------
  ------------------
 1918|  7.12k|    return decodeJSONVariant(ctx, dst);
 1919|  7.14k|}
ua_types_encoding_json.c:decodeJsonStructure:
 2390|    460|decodeJsonStructure(ParseCtx *ctx, void *dst, const UA_DataType *type) {
 2391|       |    /* Check the recursion limit */
 2392|    460|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|    460|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2392:8): [True: 0, False: 460]
  ------------------
 2393|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2394|    460|    ctx->depth++;
 2395|       |
 2396|    460|    uintptr_t ptr = (uintptr_t)dst;
 2397|    460|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    460|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2398|    460|    u8 membersSize = type->membersSize;
 2399|    460|    UA_STACKARRAY(DecodeEntry, entries, membersSize);
  ------------------
  |  |  375|    460|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 2400|  2.66k|    for(size_t i = 0; i < membersSize; ++i) {
  ------------------
  |  Branch (2400:23): [True: 2.20k, False: 460]
  ------------------
 2401|  2.20k|        const UA_DataTypeMember *m = &type->members[i];
 2402|  2.20k|        const UA_DataType *mt = m->memberType;
 2403|  2.20k|        entries[i].type = mt;
 2404|  2.20k|        entries[i].fieldName = m->memberName;
 2405|  2.20k|        entries[i].found = false;
 2406|  2.20k|        if(!m->isArray) {
  ------------------
  |  Branch (2406:12): [True: 1.45k, False: 745]
  ------------------
 2407|  1.45k|            ptr += m->padding;
 2408|  1.45k|            entries[i].fieldPointer = (void*)ptr;
 2409|  1.45k|            entries[i].function = NULL;
 2410|  1.45k|            ptr += mt->memSize;
 2411|  1.45k|        } else {
 2412|    745|            ptr += m->padding;
 2413|    745|            ptr += sizeof(size_t);
 2414|    745|            entries[i].fieldPointer = (void*)ptr;
 2415|    745|            entries[i].function = Array_decodeJson;
 2416|    745|            ptr += sizeof(void*);
 2417|    745|        }
 2418|  2.20k|    }
 2419|       |
 2420|    460|    ret = decodeFields(ctx, entries, membersSize);
 2421|       |
 2422|    460|    if(ctx->depth == 0)
  ------------------
  |  Branch (2422:8): [True: 0, False: 460]
  ------------------
 2423|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2424|    460|    ctx->depth--;
 2425|    460|    return ret;
 2426|    460|}

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

UA_Guid_parse:
   86|     68|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|     68|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|     68|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     68|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 61, False: 7]
  ------------------
   89|     61|        *guid = UA_GUID_NULL;
   90|     68|    return res;
   91|     68|}
UA_NodeId_parseEx:
  323|  23.5k|                  const UA_NamespaceMapping *nsMapping) {
  324|  23.5k|    UA_StatusCode res =
  325|  23.5k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  23.5k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  23.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 406, False: 23.1k]
  ------------------
  327|    406|        UA_NodeId_clear(id);
  328|  23.5k|    return res;
  329|  23.5k|}
UA_ExpandedNodeId_parseEx:
  671|  3.67k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  3.67k|    UA_StatusCode res =
  673|  3.67k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  3.67k|                             nsMapping, serverUrisSize, serverUris);
  675|  3.67k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.67k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 490, False: 3.18k]
  ------------------
  676|    490|        UA_ExpandedNodeId_clear(id);
  677|  3.67k|    return res;
  678|  3.67k|}
UA_QualifiedName_parseEx:
  831|  19.1k|                         const UA_NamespaceMapping *nsMapping) {
  832|  19.1k|    const u8 *pos = str.data;
  833|  19.1k|    const u8 *end = str.data + str.length;
  834|  19.1k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  835|  19.1k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  19.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 1, False: 19.1k]
  ------------------
  836|      1|        UA_QualifiedName_clear(qn);
  837|  19.1k|    return res;
  838|  19.1k|}
ua_types_lex.c:parse_guid:
   50|     95|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|     95|    size_t len = (size_t)(e - s);
   52|     95|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 31, False: 64]
  |  Branch (52:21): [True: 12, False: 52]
  |  Branch (52:36): [True: 3, False: 49]
  |  Branch (52:52): [True: 3, False: 46]
  ------------------
   53|     49|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     49|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|     46|    UA_UInt32 tmp;
   56|     46|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 11, False: 35]
  ------------------
   57|     11|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|     35|    guid->data1 = tmp;
   59|       |
   60|     35|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 7, False: 28]
  ------------------
   61|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|     28|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|     28|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 4, False: 24]
  ------------------
   65|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|     24|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|     24|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 3, False: 21]
  ------------------
   69|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#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: 3, False: 18]
  ------------------
   73|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|     18|    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: 79, False: 9]
  ------------------
   77|     79|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 9, False: 70]
  ------------------
   78|      9|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|     70|        guid->data4[pos] = (UA_Byte)tmp;
   80|     70|    }
   81|       |
   82|      9|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      9|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|     18|}
ua_types_lex.c:parse_nodeid:
  148|  23.5k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  23.5k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  23.5k|    LexContext context;
  151|  23.5k|    memset(&context, 0, sizeof(LexContext));
  152|  23.5k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  23.5k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  23.5k|{
  157|  23.5k|	u8 yych;
  158|  23.5k|	yych = YYPEEK();
  ------------------
  |  |   33|  23.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  23.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  23.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 23.5k, False: 10]
  |  |  ------------------
  ------------------
  159|  23.5k|	switch (yych) {
  160|    427|		case 'b':
  ------------------
  |  Branch (160:3): [True: 427, False: 23.1k]
  ------------------
  161|    458|		case 'g':
  ------------------
  |  Branch (161:3): [True: 31, False: 23.5k]
  ------------------
  162|  15.2k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 14.8k, False: 8.73k]
  ------------------
  163|  21.1k|		case 's':
  ------------------
  |  Branch (163:3): [True: 5.86k, False: 17.7k]
  ------------------
  164|  21.1k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  21.1k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  21.1k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  21.1k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  21.1k|			goto yy3;
  167|  2.34k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 2.34k, False: 21.2k]
  ------------------
  168|     72|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 72, False: 23.4k]
  ------------------
  169|  23.5k|	}
  170|     72|yy1:
  171|     72|	YYSKIP();
  ------------------
  |  |   35|     72|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     72|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|    318|yy2:
  173|    318|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    318|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  21.1k|yy3:
  175|  21.1k|	YYSKIP();
  ------------------
  |  |   35|  21.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  21.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  21.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  21.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  21.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  21.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 21.1k, False: 12]
  |  |  ------------------
  ------------------
  177|  21.1k|	switch (yych) {
  178|  21.1k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 21.1k, False: 26]
  ------------------
  179|     26|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 26, False: 21.1k]
  ------------------
  180|  21.1k|	}
  181|  2.34k|yy4:
  182|  2.34k|	YYSKIP();
  ------------------
  |  |   35|  2.34k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.34k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  2.34k|	YYBACKUP();
  ------------------
  |  |   36|  2.34k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  2.34k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.34k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  2.34k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.34k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.34k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.34k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.34k, False: 3]
  |  |  ------------------
  ------------------
  185|  2.34k|	switch (yych) {
  186|  2.32k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 2.32k, False: 16]
  ------------------
  187|     16|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 16, False: 2.32k]
  ------------------
  188|  2.34k|	}
  189|  23.2k|yy5:
  190|  23.2k|	YYSKIP();
  ------------------
  |  |   35|  23.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  23.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  23.2k|	nsu = context.yyt2;
  192|  23.2k|	ns = context.yyt1;
  193|  23.2k|	YYSTAGP(body);
  ------------------
  |  |   38|  23.2k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  23.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  23.2k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  23.2k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  23.2k|	{ goto match; }
  196|  2.32k|yy6:
  197|  2.32k|	YYSKIP();
  ------------------
  |  |   35|  2.32k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.32k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  2.32k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.32k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.32k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.32k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.32k, False: 5]
  |  |  ------------------
  ------------------
  199|  2.32k|	switch (yych) {
  200|  1.16k|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 1.16k, False: 1.16k]
  ------------------
  201|  1.15k|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 1.15k, False: 1.16k]
  ------------------
  202|      6|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 6, False: 2.32k]
  ------------------
  203|  2.32k|	}
  204|    204|yy7:
  205|    204|	YYRESTORE();
  ------------------
  |  |   37|    204|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    204|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    204|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    204|	goto yy2;
  207|  1.16k|yy8:
  208|  1.16k|	YYSKIP();
  ------------------
  |  |   35|  1.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|  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.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.15k, False: 5]
  |  |  ------------------
  ------------------
  210|  1.16k|	switch (yych) {
  211|    348|		case '0':
  ------------------
  |  Branch (211:3): [True: 348, False: 814]
  ------------------
  212|    713|		case '1':
  ------------------
  |  Branch (212:3): [True: 365, False: 797]
  ------------------
  213|    856|		case '2':
  ------------------
  |  Branch (213:3): [True: 143, False: 1.01k]
  ------------------
  214|    883|		case '3':
  ------------------
  |  Branch (214:3): [True: 27, False: 1.13k]
  ------------------
  215|    950|		case '4':
  ------------------
  |  Branch (215:3): [True: 67, False: 1.09k]
  ------------------
  216|  1.03k|		case '5':
  ------------------
  |  Branch (216:3): [True: 81, False: 1.08k]
  ------------------
  217|  1.07k|		case '6':
  ------------------
  |  Branch (217:3): [True: 43, False: 1.11k]
  ------------------
  218|  1.09k|		case '7':
  ------------------
  |  Branch (218:3): [True: 21, False: 1.14k]
  ------------------
  219|  1.12k|		case '8':
  ------------------
  |  Branch (219:3): [True: 31, False: 1.13k]
  ------------------
  220|  1.14k|		case '9':
  ------------------
  |  Branch (220:3): [True: 18, False: 1.14k]
  ------------------
  221|  1.14k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  1.14k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|  1.14k|			goto yy10;
  223|     18|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 18, False: 1.14k]
  ------------------
  224|  1.16k|	}
  225|  1.15k|yy9:
  226|  1.15k|	YYSKIP();
  ------------------
  |  |   35|  1.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|  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: 3]
  |  |  ------------------
  ------------------
  228|  1.15k|	switch (yych) {
  229|  1.14k|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 1.14k, False: 12]
  ------------------
  230|     12|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 12, False: 1.14k]
  ------------------
  231|  1.15k|	}
  232|  4.48k|yy10:
  233|  4.48k|	YYSKIP();
  ------------------
  |  |   35|  4.48k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.48k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  4.48k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.48k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.38k, False: 105]
  |  |  ------------------
  ------------------
  235|  4.48k|	switch (yych) {
  236|    667|		case '0':
  ------------------
  |  Branch (236:3): [True: 667, False: 3.82k]
  ------------------
  237|    979|		case '1':
  ------------------
  |  Branch (237:3): [True: 312, False: 4.17k]
  ------------------
  238|  1.24k|		case '2':
  ------------------
  |  Branch (238:3): [True: 267, False: 4.22k]
  ------------------
  239|  1.56k|		case '3':
  ------------------
  |  Branch (239:3): [True: 317, False: 4.17k]
  ------------------
  240|  1.82k|		case '4':
  ------------------
  |  Branch (240:3): [True: 263, False: 4.22k]
  ------------------
  241|  2.05k|		case '5':
  ------------------
  |  Branch (241:3): [True: 231, False: 4.25k]
  ------------------
  242|  2.32k|		case '6':
  ------------------
  |  Branch (242:3): [True: 269, False: 4.22k]
  ------------------
  243|  2.60k|		case '7':
  ------------------
  |  Branch (243:3): [True: 280, False: 4.20k]
  ------------------
  244|  2.98k|		case '8':
  ------------------
  |  Branch (244:3): [True: 377, False: 4.11k]
  ------------------
  245|  3.34k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 362, False: 4.12k]
  ------------------
  246|  1.03k|		case ';':
  ------------------
  |  Branch (246:3): [True: 1.03k, False: 3.45k]
  ------------------
  247|  1.03k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.03k|#define YYSTAGN(t) t = NULL
  ------------------
  248|  1.03k|			goto yy12;
  249|    105|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 105, False: 4.38k]
  ------------------
  250|  4.48k|	}
  251|  1.14k|yy11:
  252|  1.14k|	YYSKIP();
  ------------------
  |  |   35|  1.14k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|  1.14k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.14k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.14k, False: 4]
  |  |  ------------------
  ------------------
  254|  1.14k|	switch (yych) {
  255|      4|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 4, False: 1.14k]
  ------------------
  256|    546|		case ';':
  ------------------
  |  Branch (256:3): [True: 546, False: 601]
  ------------------
  257|    546|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    546|#define YYSTAGN(t) t = NULL
  ------------------
  258|    546|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    546|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    546|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|    546|			goto yy12;
  260|    597|		default:
  ------------------
  |  Branch (260:3): [True: 597, False: 550]
  ------------------
  261|    597|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    597|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    597|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    597|			goto yy13;
  263|  1.14k|	}
  264|  2.16k|yy12:
  265|  2.16k|	YYSKIP();
  ------------------
  |  |   35|  2.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  2.16k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.16k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.15k, False: 15]
  |  |  ------------------
  ------------------
  267|  2.16k|	switch (yych) {
  268|    197|		case 'b':
  ------------------
  |  Branch (268:3): [True: 197, False: 1.97k]
  ------------------
  269|    391|		case 'g':
  ------------------
  |  Branch (269:3): [True: 194, False: 1.97k]
  ------------------
  270|    724|		case 'i':
  ------------------
  |  Branch (270:3): [True: 333, False: 1.83k]
  ------------------
  271|  2.15k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 1.42k, False: 741]
  ------------------
  272|     17|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 17, False: 2.15k]
  ------------------
  273|  2.16k|	}
  274|  2.83k|yy13:
  275|  2.83k|	YYSKIP();
  ------------------
  |  |   35|  2.83k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.83k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|  2.83k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.83k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.83k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.81k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.81k, False: 13]
  |  |  ------------------
  ------------------
  277|  2.83k|	switch (yych) {
  278|     13|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 13, False: 2.81k]
  ------------------
  279|    584|		case ';':
  ------------------
  |  Branch (279:3): [True: 584, False: 2.24k]
  ------------------
  280|    584|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    584|#define YYSTAGN(t) t = NULL
  ------------------
  281|    584|			goto yy12;
  282|  2.23k|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 2.23k, False: 597]
  ------------------
  283|  2.83k|	}
  284|  2.15k|yy14:
  285|  2.15k|	YYSKIP();
  ------------------
  |  |   35|  2.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  2.15k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.15k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.12k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.12k, False: 28]
  |  |  ------------------
  ------------------
  287|  2.15k|	switch (yych) {
  288|  2.12k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 2.12k, False: 29]
  ------------------
  289|     29|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 29, False: 2.12k]
  ------------------
  290|  2.15k|	}
  291|  2.15k|}
  292|       |
  293|       |
  294|  23.2k| match:
  295|  23.2k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 1.09k, False: 22.1k]
  ------------------
  296|       |        /* NamespaceUri */
  297|  1.09k|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|  1.09k|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|  1.09k|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  1.09k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 1.09k, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|  1.09k|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|  1.09k|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|  1.09k|            return UA_String_copy(&total, &id->identifier.string);
  304|  1.09k|        }
  305|  22.1k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 1.02k, False: 21.1k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|  1.02k|        UA_UInt32 tmp;
  308|  1.02k|        size_t len = (size_t)(body - 1 - ns);
  309|  1.02k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 1.02k]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|  1.02k|        id->namespaceIndex = (UA_UInt16)tmp;
  312|  1.02k|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 1.02k]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|  1.02k|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  22.1k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  23.2k|}
ua_types_lex.c:escapedUri2Index:
   95|  2.00k|                 const UA_NamespaceMapping *nsMapping) {
   96|  2.00k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 2.00k, False: 0]
  ------------------
   97|  2.00k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  2.00k|#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)
  ------------------
  |  |   17|      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|  24.3k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  24.3k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  24.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  24.3k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  24.3k|    switch(*body) {
  113|  15.4k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 15.4k, False: 8.94k]
  ------------------
  114|  15.4k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  15.4k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 54, False: 15.3k]
  ------------------
  116|     54|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     54|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  15.4k|        break;
  118|  7.80k|    case 's':
  ------------------
  |  Branch (118:5): [True: 7.80k, False: 16.5k]
  ------------------
  119|  7.80k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  7.80k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  7.80k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  7.80k|        break;
  123|     27|    case 'g':
  ------------------
  |  Branch (123:5): [True: 27, False: 24.3k]
  ------------------
  124|     27|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     27|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     27|        break;
  127|  1.11k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 1.11k, False: 23.2k]
  ------------------
  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.11k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  1.11k|        id->identifier.byteString.data =
  133|  1.11k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  1.11k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 20, False: 1.09k]
  ------------------
  135|     20|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  399|     20|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 20, False: 0]
  ------------------
  136|     20|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     20|        }
  138|  1.11k|        break;
  139|  1.11k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 24.3k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  24.3k|    }
  143|  24.3k|    return res;
  144|  24.3k|}
ua_types_lex.c:parse_expandednodeid:
  339|  3.67k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  3.67k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  3.67k|    LexContext context;
  342|  3.67k|    memset(&context, 0, sizeof(LexContext));
  343|  3.67k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  3.67k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  3.67k|{
  348|  3.67k|	u8 yych;
  349|  3.67k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.67k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.67k, False: 5]
  |  |  ------------------
  ------------------
  350|  3.67k|	switch (yych) {
  351|    332|		case 'b':
  ------------------
  |  Branch (351:3): [True: 332, False: 3.34k]
  ------------------
  352|    338|		case 'g':
  ------------------
  |  Branch (352:3): [True: 6, False: 3.67k]
  ------------------
  353|    554|		case 'i':
  ------------------
  |  Branch (353:3): [True: 216, False: 3.46k]
  ------------------
  354|    554|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    554|#define YYSTAGN(t) t = NULL
  ------------------
  355|    554|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    554|#define YYSTAGN(t) t = NULL
  ------------------
  356|    554|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    554|#define YYSTAGN(t) t = NULL
  ------------------
  357|    554|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    554|#define YYSTAGN(t) t = NULL
  ------------------
  358|    554|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    554|#define YYSTAGN(t) t = NULL
  ------------------
  359|    554|			goto yy18;
  360|  1.14k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 1.14k, False: 2.53k]
  ------------------
  361|  1.14k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.14k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  1.14k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.14k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  1.14k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.14k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  1.14k|			goto yy19;
  365|  1.97k|		case 's':
  ------------------
  |  Branch (365:3): [True: 1.97k, False: 1.70k]
  ------------------
  366|  1.97k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.97k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  1.97k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.97k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  1.97k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.97k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  1.97k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.97k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  1.97k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.97k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  1.97k|			goto yy20;
  372|      6|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 6, False: 3.67k]
  ------------------
  373|  3.67k|	}
  374|      6|yy16:
  375|      6|	YYSKIP();
  ------------------
  |  |   35|      6|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    474|yy17:
  377|    474|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    474|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|    554|yy18:
  379|    554|	YYSKIP();
  ------------------
  |  |   35|    554|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    554|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|    554|	yych = YYPEEK();
  ------------------
  |  |   33|    554|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    554|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    543|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 543, False: 11]
  |  |  ------------------
  ------------------
  381|    554|	switch (yych) {
  382|    529|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 529, False: 25]
  ------------------
  383|     25|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 25, False: 529]
  ------------------
  384|    554|	}
  385|  1.14k|yy19:
  386|  1.14k|	YYSKIP();
  ------------------
  |  |   35|  1.14k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  1.14k|	YYBACKUP();
  ------------------
  |  |   36|  1.14k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.14k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  1.14k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.14k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.13k, False: 1]
  |  |  ------------------
  ------------------
  389|  1.14k|	switch (yych) {
  390|  1.12k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 1.12k, False: 15]
  ------------------
  391|     15|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 15, False: 1.12k]
  ------------------
  392|  1.14k|	}
  393|  1.97k|yy20:
  394|  1.97k|	YYSKIP();
  ------------------
  |  |   35|  1.97k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.97k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  1.97k|	YYBACKUP();
  ------------------
  |  |   36|  1.97k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.97k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.97k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  1.97k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.97k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.97k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.97k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.97k, False: 1]
  |  |  ------------------
  ------------------
  397|  1.97k|	switch (yych) {
  398|    202|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 202, False: 1.77k]
  ------------------
  399|  1.77k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.77k, False: 207]
  ------------------
  400|      5|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 5, False: 1.97k]
  ------------------
  401|  1.97k|	}
  402|  3.20k|yy21:
  403|  3.20k|	YYSKIP();
  ------------------
  |  |   35|  3.20k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  3.20k|	svr = context.yyt5;
  405|  3.20k|	svu = context.yyt1;
  406|  3.20k|	sve = context.yyt2;
  407|  3.20k|	ns = context.yyt3;
  408|  3.20k|	nsu = context.yyt4;
  409|  3.20k|	YYSTAGP(body);
  ------------------
  |  |   38|  3.20k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  3.20k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  3.20k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  3.20k|	{ goto match; }
  412|  1.59k|yy22:
  413|  1.59k|	YYSKIP();
  ------------------
  |  |   35|  1.59k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.59k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  1.59k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.59k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.58k, False: 7]
  |  |  ------------------
  ------------------
  415|  1.59k|	switch (yych) {
  416|    371|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 371, False: 1.21k]
  ------------------
  417|  1.20k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 1.20k, False: 383]
  ------------------
  418|     12|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 12, False: 1.57k]
  ------------------
  419|  1.59k|	}
  420|    423|yy23:
  421|    423|	YYRESTORE();
  ------------------
  |  |   37|    423|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    423|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    423|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    423|	goto yy17;
  423|  1.77k|yy24:
  424|  1.77k|	YYSKIP();
  ------------------
  |  |   35|  1.77k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.77k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.77k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.76k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.76k, False: 1]
  |  |  ------------------
  ------------------
  426|  1.77k|	switch (yych) {
  427|    703|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 703, False: 1.06k]
  ------------------
  428|  1.06k|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 1.06k, False: 706]
  ------------------
  429|      3|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 3, False: 1.76k]
  ------------------
  430|  1.77k|	}
  431|    371|yy25:
  432|    371|	YYSKIP();
  ------------------
  |  |   35|    371|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    371|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|    371|	yych = YYPEEK();
  ------------------
  |  |   33|    371|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    371|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    370|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 370, False: 1]
  |  |  ------------------
  ------------------
  434|    371|	switch (yych) {
  435|    176|		case '0':
  ------------------
  |  Branch (435:3): [True: 176, False: 195]
  ------------------
  436|    201|		case '1':
  ------------------
  |  Branch (436:3): [True: 25, False: 346]
  ------------------
  437|    216|		case '2':
  ------------------
  |  Branch (437:3): [True: 15, False: 356]
  ------------------
  438|    245|		case '3':
  ------------------
  |  Branch (438:3): [True: 29, False: 342]
  ------------------
  439|    260|		case '4':
  ------------------
  |  Branch (439:3): [True: 15, False: 356]
  ------------------
  440|    269|		case '5':
  ------------------
  |  Branch (440:3): [True: 9, False: 362]
  ------------------
  441|    341|		case '6':
  ------------------
  |  Branch (441:3): [True: 72, False: 299]
  ------------------
  442|    348|		case '7':
  ------------------
  |  Branch (442:3): [True: 7, False: 364]
  ------------------
  443|    361|		case '8':
  ------------------
  |  Branch (443:3): [True: 13, False: 358]
  ------------------
  444|    366|		case '9':
  ------------------
  |  Branch (444:3): [True: 5, False: 366]
  ------------------
  445|    366|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    366|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    366|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    366|			goto yy29;
  447|      5|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 5, False: 366]
  ------------------
  448|    371|	}
  449|  1.20k|yy26:
  450|  1.20k|	YYSKIP();
  ------------------
  |  |   35|  1.20k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  1.20k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.20k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.20k, False: 1]
  |  |  ------------------
  ------------------
  452|  1.20k|	switch (yych) {
  453|  1.20k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 1.20k, False: 4]
  ------------------
  454|      4|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 4, False: 1.20k]
  ------------------
  455|  1.20k|	}
  456|    703|yy27:
  457|    703|	YYSKIP();
  ------------------
  |  |   35|    703|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    703|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|    703|	yych = YYPEEK();
  ------------------
  |  |   33|    703|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    703|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    702|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 702, False: 1]
  |  |  ------------------
  ------------------
  459|    703|	switch (yych) {
  460|    686|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 686, False: 17]
  ------------------
  461|     17|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 17, False: 686]
  ------------------
  462|    703|	}
  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: 2]
  |  |  ------------------
  ------------------
  466|  1.06k|	switch (yych) {
  467|  1.04k|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 1.04k, False: 15]
  ------------------
  468|     15|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 15, False: 1.04k]
  ------------------
  469|  1.06k|	}
  470|  8.71k|yy29:
  471|  8.71k|	YYSKIP();
  ------------------
  |  |   35|  8.71k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  8.71k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.71k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.62k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.62k, False: 85]
  |  |  ------------------
  ------------------
  473|  8.71k|	switch (yych) {
  474|  5.51k|		case '0':
  ------------------
  |  Branch (474:3): [True: 5.51k, False: 3.19k]
  ------------------
  475|  5.77k|		case '1':
  ------------------
  |  Branch (475:3): [True: 257, False: 8.45k]
  ------------------
  476|  6.05k|		case '2':
  ------------------
  |  Branch (476:3): [True: 284, False: 8.42k]
  ------------------
  477|  6.38k|		case '3':
  ------------------
  |  Branch (477:3): [True: 321, False: 8.39k]
  ------------------
  478|  6.66k|		case '4':
  ------------------
  |  Branch (478:3): [True: 284, False: 8.42k]
  ------------------
  479|  6.91k|		case '5':
  ------------------
  |  Branch (479:3): [True: 250, False: 8.46k]
  ------------------
  480|  7.24k|		case '6':
  ------------------
  |  Branch (480:3): [True: 329, False: 8.38k]
  ------------------
  481|  7.52k|		case '7':
  ------------------
  |  Branch (481:3): [True: 277, False: 8.43k]
  ------------------
  482|  7.80k|		case '8':
  ------------------
  |  Branch (482:3): [True: 288, False: 8.42k]
  ------------------
  483|  8.34k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 538, False: 8.17k]
  ------------------
  484|    267|		case ';':
  ------------------
  |  Branch (484:3): [True: 267, False: 8.44k]
  ------------------
  485|    267|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    267|#define YYSTAGN(t) t = NULL
  ------------------
  486|    267|			goto yy33;
  487|     99|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 99, False: 8.61k]
  ------------------
  488|  8.71k|	}
  489|  1.20k|yy30:
  490|  1.20k|	YYSKIP();
  ------------------
  |  |   35|  1.20k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  1.20k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.20k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.20k, False: 2]
  |  |  ------------------
  ------------------
  492|  1.20k|	switch (yych) {
  493|      2|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 2, False: 1.20k]
  ------------------
  494|    443|		case ';':
  ------------------
  |  Branch (494:3): [True: 443, False: 760]
  ------------------
  495|    443|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    443|#define YYSTAGN(t) t = NULL
  ------------------
  496|    443|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    443|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    443|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    443|			goto yy33;
  498|    758|		default:
  ------------------
  |  Branch (498:3): [True: 758, False: 445]
  ------------------
  499|    758|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    758|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    758|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    758|			goto yy34;
  501|  1.20k|	}
  502|    686|yy31:
  503|    686|	YYSKIP();
  ------------------
  |  |   35|    686|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    686|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|    686|	yych = YYPEEK();
  ------------------
  |  |   33|    686|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    686|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    685|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 685, False: 1]
  |  |  ------------------
  ------------------
  505|    686|	switch (yych) {
  506|    384|		case '0':
  ------------------
  |  Branch (506:3): [True: 384, False: 302]
  ------------------
  507|    430|		case '1':
  ------------------
  |  Branch (507:3): [True: 46, False: 640]
  ------------------
  508|    469|		case '2':
  ------------------
  |  Branch (508:3): [True: 39, False: 647]
  ------------------
  509|    500|		case '3':
  ------------------
  |  Branch (509:3): [True: 31, False: 655]
  ------------------
  510|    517|		case '4':
  ------------------
  |  Branch (510:3): [True: 17, False: 669]
  ------------------
  511|    611|		case '5':
  ------------------
  |  Branch (511:3): [True: 94, False: 592]
  ------------------
  512|    626|		case '6':
  ------------------
  |  Branch (512:3): [True: 15, False: 671]
  ------------------
  513|    651|		case '7':
  ------------------
  |  Branch (513:3): [True: 25, False: 661]
  ------------------
  514|    663|		case '8':
  ------------------
  |  Branch (514:3): [True: 12, False: 674]
  ------------------
  515|    669|		case '9':
  ------------------
  |  Branch (515:3): [True: 6, False: 680]
  ------------------
  516|    669|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|    669|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    669|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|    669|			goto yy35;
  518|     17|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 17, False: 669]
  ------------------
  519|    686|	}
  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|    500|		case ';':
  ------------------
  |  Branch (525:3): [True: 500, False: 549]
  ------------------
  526|    500|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    500|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    500|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|    500|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    500|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    500|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    500|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    500|#define YYSTAGN(t) t = NULL
  ------------------
  529|    500|			goto yy37;
  530|    548|		default:
  ------------------
  |  Branch (530:3): [True: 548, False: 501]
  ------------------
  531|    548|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    548|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    548|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    548|			goto yy36;
  533|  1.04k|	}
  534|  1.45k|yy33:
  535|  1.45k|	YYSKIP();
  ------------------
  |  |   35|  1.45k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.45k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  1.45k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.45k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.45k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.44k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.44k, False: 11]
  |  |  ------------------
  ------------------
  537|  1.45k|	switch (yych) {
  538|    238|		case 'b':
  ------------------
  |  Branch (538:3): [True: 238, False: 1.22k]
  ------------------
  539|    449|		case 'g':
  ------------------
  |  Branch (539:3): [True: 211, False: 1.24k]
  ------------------
  540|    846|		case 'i':
  ------------------
  |  Branch (540:3): [True: 397, False: 1.06k]
  ------------------
  541|  1.44k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 599, False: 860]
  ------------------
  542|     14|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 14, False: 1.44k]
  ------------------
  543|  1.45k|	}
  544|  3.68k|yy34:
  545|  3.68k|	YYSKIP();
  ------------------
  |  |   35|  3.68k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.68k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|  3.68k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.68k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.68k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.67k, False: 9]
  |  |  ------------------
  ------------------
  547|  3.68k|	switch (yych) {
  548|      9|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 9, False: 3.67k]
  ------------------
  549|    749|		case ';':
  ------------------
  |  Branch (549:3): [True: 749, False: 2.93k]
  ------------------
  550|    749|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    749|#define YYSTAGN(t) t = NULL
  ------------------
  551|    749|			goto yy33;
  552|  2.92k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 2.92k, False: 758]
  ------------------
  553|  3.68k|	}
  554|  68.5k|yy35:
  555|  68.5k|	YYSKIP();
  ------------------
  |  |   35|  68.5k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  68.5k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  68.5k|	yych = YYPEEK();
  ------------------
  |  |   33|  68.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  68.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  68.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 68.4k, False: 84]
  |  |  ------------------
  ------------------
  557|  68.5k|	switch (yych) {
  558|  62.8k|		case '0':
  ------------------
  |  Branch (558:3): [True: 62.8k, False: 5.68k]
  ------------------
  559|  63.2k|		case '1':
  ------------------
  |  Branch (559:3): [True: 470, False: 68.0k]
  ------------------
  560|  63.5k|		case '2':
  ------------------
  |  Branch (560:3): [True: 294, False: 68.2k]
  ------------------
  561|  64.1k|		case '3':
  ------------------
  |  Branch (561:3): [True: 568, False: 67.9k]
  ------------------
  562|  64.9k|		case '4':
  ------------------
  |  Branch (562:3): [True: 827, False: 67.6k]
  ------------------
  563|  65.6k|		case '5':
  ------------------
  |  Branch (563:3): [True: 701, False: 67.8k]
  ------------------
  564|  66.1k|		case '6':
  ------------------
  |  Branch (564:3): [True: 436, False: 68.0k]
  ------------------
  565|  66.9k|		case '7':
  ------------------
  |  Branch (565:3): [True: 853, False: 67.6k]
  ------------------
  566|  67.4k|		case '8':
  ------------------
  |  Branch (566:3): [True: 459, False: 68.0k]
  ------------------
  567|  67.8k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 409, False: 68.1k]
  ------------------
  568|    547|		case ';':
  ------------------
  |  Branch (568:3): [True: 547, False: 67.9k]
  ------------------
  569|    547|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    547|#define YYSTAGN(t) t = NULL
  ------------------
  570|    547|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    547|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    547|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|    547|			goto yy37;
  572|    122|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 122, False: 68.3k]
  ------------------
  573|  68.5k|	}
  574|  3.06M|yy36:
  575|  3.06M|	YYSKIP();
  ------------------
  |  |   35|  3.06M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.06M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  3.06M|	yych = YYPEEK();
  ------------------
  |  |   33|  3.06M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.06M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.06M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.06M, False: 25]
  |  |  ------------------
  ------------------
  577|  3.06M|	switch (yych) {
  578|     25|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 25, False: 3.06M]
  ------------------
  579|    523|		case ';':
  ------------------
  |  Branch (579:3): [True: 523, False: 3.06M]
  ------------------
  580|    523|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    523|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    523|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    523|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    523|#define YYSTAGN(t) t = NULL
  ------------------
  582|    523|			goto yy37;
  583|  3.06M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 3.06M, False: 548]
  ------------------
  584|  3.06M|	}
  585|  1.57k|yy37:
  586|  1.57k|	YYSKIP();
  ------------------
  |  |   35|  1.57k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.57k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.57k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.57k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.57k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.56k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.56k, False: 10]
  |  |  ------------------
  ------------------
  588|  1.57k|	switch (yych) {
  589|    196|		case 'b':
  ------------------
  |  Branch (589:3): [True: 196, False: 1.37k]
  ------------------
  590|    412|		case 'g':
  ------------------
  |  Branch (590:3): [True: 216, False: 1.35k]
  ------------------
  591|    616|		case 'i':
  ------------------
  |  Branch (591:3): [True: 204, False: 1.36k]
  ------------------
  592|  1.08k|		case 's':
  ------------------
  |  Branch (592:3): [True: 464, False: 1.10k]
  ------------------
  593|  1.08k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.08k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.08k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.08k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.08k|			goto yy38;
  596|    477|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 477, False: 1.09k]
  ------------------
  597|     13|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 13, False: 1.55k]
  ------------------
  598|  1.57k|	}
  599|  2.52k|yy38:
  600|  2.52k|	YYSKIP();
  ------------------
  |  |   35|  2.52k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.52k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  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.49k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.49k, False: 34]
  |  |  ------------------
  ------------------
  602|  2.52k|	switch (yych) {
  603|  2.47k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 2.47k, False: 53]
  ------------------
  604|     53|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 53, False: 2.47k]
  ------------------
  605|  2.52k|	}
  606|    477|yy39:
  607|    477|	YYSKIP();
  ------------------
  |  |   35|    477|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    477|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|    477|	yych = YYPEEK();
  ------------------
  |  |   33|    477|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    477|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    476|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 476, False: 1]
  |  |  ------------------
  ------------------
  609|    477|	switch (yych) {
  610|    465|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 465, False: 12]
  ------------------
  611|     12|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 12, False: 465]
  ------------------
  612|    477|	}
  613|    477|}
  614|       |
  615|       |
  616|  3.20k| match:
  617|  3.20k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 974, False: 2.22k]
  ------------------
  618|       |        /* ServerUri */
  619|    974|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|    974|        size_t i = 0;
  621|    974|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 974]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|    974|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 974, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|    974|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|    974|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|    974|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|    974|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  2.22k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 534, False: 1.69k]
  ------------------
  634|       |        /* ServerIndex */
  635|    534|        size_t len = (size_t)(sve - svr);
  636|    534|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 534]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|    534|    }
  639|       |
  640|  2.22k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 961, False: 1.26k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    961|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    961|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    961|#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|    961|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 708, False: 253]
  ------------------
  647|    708|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    961|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    961|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 961, False: 0]
  ------------------
  649|    961|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    961|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    961|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 1, False: 960]
  ------------------
  651|      1|            return res;
  652|  1.26k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 256, False: 1.01k]
  ------------------
  653|       |        /* NamespaceIndex */
  654|    256|        UA_UInt32 tmp;
  655|    256|        size_t len = (size_t)(body - 1 - ns);
  656|    256|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 256]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|    256|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|    256|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 256]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|    256|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  2.22k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  2.22k|}
ua_types_lex.c:parse_qn:
  707|  19.1k|         UA_UInt16 defaultNamespaceIndex) {
  708|  19.1k|    size_t len;
  709|  19.1k|    UA_UInt32 tmp;
  710|  19.1k|    UA_String str;
  711|  19.1k|    UA_StatusCode res;
  712|       |
  713|  19.1k|    LexContext context;
  714|  19.1k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  19.1k|    const u8 *begin = pos;
  717|  19.1k|    UA_QualifiedName_init(qn);
  718|  19.1k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  19.1k|{
  722|  19.1k|	u8 yych;
  723|  19.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  19.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  19.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 18.0k, False: 1.05k]
  |  |  ------------------
  ------------------
  724|  19.1k|	switch (yych) {
  725|  1.05k|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 1.05k, False: 18.0k]
  ------------------
  726|  1.30k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 251, False: 18.8k]
  ------------------
  727|    478|		case '0':
  ------------------
  |  Branch (727:3): [True: 478, False: 18.6k]
  ------------------
  728|  1.13k|		case '1':
  ------------------
  |  Branch (728:3): [True: 659, False: 18.4k]
  ------------------
  729|  2.41k|		case '2':
  ------------------
  |  Branch (729:3): [True: 1.27k, False: 17.8k]
  ------------------
  730|  2.72k|		case '3':
  ------------------
  |  Branch (730:3): [True: 313, False: 18.8k]
  ------------------
  731|  5.75k|		case '4':
  ------------------
  |  Branch (731:3): [True: 3.02k, False: 16.0k]
  ------------------
  732|  6.64k|		case '5':
  ------------------
  |  Branch (732:3): [True: 896, False: 18.2k]
  ------------------
  733|  12.6k|		case '6':
  ------------------
  |  Branch (733:3): [True: 6.01k, False: 13.1k]
  ------------------
  734|  13.2k|		case '7':
  ------------------
  |  Branch (734:3): [True: 540, False: 18.5k]
  ------------------
  735|  14.8k|		case '8':
  ------------------
  |  Branch (735:3): [True: 1.64k, False: 17.4k]
  ------------------
  736|  15.9k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 1.07k, False: 18.0k]
  ------------------
  737|  1.89k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 1.89k, False: 17.2k]
  ------------------
  738|  19.1k|	}
  739|  1.30k|yy41:
  740|  1.30k|	YYSKIP();
  ------------------
  |  |   35|  1.30k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  18.6k|yy42:
  742|  18.6k|	{ pos = begin; goto match_name; }
  743|  1.89k|yy43:
  744|  1.89k|	YYSKIP();
  ------------------
  |  |   35|  1.89k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.89k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  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
  |  |  ------------------
  ------------------
  746|  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.37k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.37k, False: 516]
  |  |  ------------------
  ------------------
  747|  1.89k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 516, False: 1.37k]
  ------------------
  748|  1.37k|	goto yy46;
  749|  15.9k|yy44:
  750|  15.9k|	YYSKIP();
  ------------------
  |  |   35|  15.9k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  15.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  15.9k|	YYBACKUP();
  ------------------
  |  |   36|  15.9k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  15.9k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  15.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  15.9k|	yych = YYPEEK();
  ------------------
  |  |   33|  15.9k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  15.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.28k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.28k, False: 12.6k]
  |  |  ------------------
  ------------------
  753|  15.9k|	switch (yych) {
  754|    802|		case '0':
  ------------------
  |  Branch (754:3): [True: 802, False: 15.1k]
  ------------------
  755|    895|		case '1':
  ------------------
  |  Branch (755:3): [True: 93, False: 15.8k]
  ------------------
  756|    952|		case '2':
  ------------------
  |  Branch (756:3): [True: 57, False: 15.8k]
  ------------------
  757|    988|		case '3':
  ------------------
  |  Branch (757:3): [True: 36, False: 15.8k]
  ------------------
  758|  1.21k|		case '4':
  ------------------
  |  Branch (758:3): [True: 224, False: 15.6k]
  ------------------
  759|  1.32k|		case '5':
  ------------------
  |  Branch (759:3): [True: 116, False: 15.8k]
  ------------------
  760|  1.40k|		case '6':
  ------------------
  |  Branch (760:3): [True: 81, False: 15.8k]
  ------------------
  761|  1.50k|		case '7':
  ------------------
  |  Branch (761:3): [True: 100, False: 15.8k]
  ------------------
  762|  1.88k|		case '8':
  ------------------
  |  Branch (762:3): [True: 371, False: 15.5k]
  ------------------
  763|  1.93k|		case '9':
  ------------------
  |  Branch (763:3): [True: 58, False: 15.8k]
  ------------------
  764|  2.18k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 243, False: 15.6k]
  ------------------
  765|  13.7k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 13.7k, False: 2.18k]
  ------------------
  766|  15.9k|	}
  767|  18.5k|yy45:
  768|  18.5k|	YYSKIP();
  ------------------
  |  |   35|  18.5k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  18.5k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  18.5k|	yych = YYPEEK();
  ------------------
  |  |   33|  18.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  17.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 17.3k, False: 1.18k]
  |  |  ------------------
  ------------------
  770|  19.8k|yy46:
  771|  19.8k|	switch (yych) {
  772|  1.18k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 1.18k, False: 18.7k]
  ------------------
  773|    196|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 196, False: 19.6k]
  ------------------
  774|  18.5k|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 18.5k, False: 1.37k]
  ------------------
  775|  19.8k|	}
  776|  3.07k|yy47:
  777|  3.07k|	YYRESTORE();
  ------------------
  |  |   37|  3.07k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  3.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  3.07k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  3.07k|	goto yy42;
  779|    196|yy48:
  780|    196|	YYSKIP();
  ------------------
  |  |   35|    196|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    196|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    196|	{ goto match_uri; }
  782|  94.2k|yy49:
  783|  94.2k|	YYSKIP();
  ------------------
  |  |   35|  94.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  94.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|  94.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  94.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  94.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  92.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 92.7k, False: 1.54k]
  |  |  ------------------
  ------------------
  785|  96.4k|yy50:
  786|  96.4k|	switch (yych) {
  787|  71.4k|		case '0':
  ------------------
  |  Branch (787:3): [True: 71.4k, False: 25.0k]
  ------------------
  788|  71.9k|		case '1':
  ------------------
  |  Branch (788:3): [True: 454, False: 96.0k]
  ------------------
  789|  86.2k|		case '2':
  ------------------
  |  Branch (789:3): [True: 14.3k, False: 82.1k]
  ------------------
  790|  86.6k|		case '3':
  ------------------
  |  Branch (790:3): [True: 354, False: 96.1k]
  ------------------
  791|  87.5k|		case '4':
  ------------------
  |  Branch (791:3): [True: 932, False: 95.5k]
  ------------------
  792|  91.0k|		case '5':
  ------------------
  |  Branch (792:3): [True: 3.42k, False: 93.0k]
  ------------------
  793|  91.6k|		case '6':
  ------------------
  |  Branch (793:3): [True: 655, False: 95.8k]
  ------------------
  794|  92.3k|		case '7':
  ------------------
  |  Branch (794:3): [True: 663, False: 95.8k]
  ------------------
  795|  93.9k|		case '8':
  ------------------
  |  Branch (795:3): [True: 1.58k, False: 94.8k]
  ------------------
  796|  94.2k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 381, False: 96.0k]
  ------------------
  797|    293|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 293, False: 96.1k]
  ------------------
  798|  1.88k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 1.88k, False: 94.5k]
  ------------------
  799|  96.4k|	}
  800|    293|yy51:
  801|    293|	YYSKIP();
  ------------------
  |  |   35|    293|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    293|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    293|	{ goto match_index; }
  803|  96.4k|}
  804|       |
  805|       |
  806|    293| match_index:
  807|    293|    len = (size_t)(pos - 1 - begin);
  808|    293|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 293]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    293|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    293|    goto match_name;
  812|       |
  813|    196| match_uri:
  814|    196|    str.length = (size_t)(pos - 1 - begin);
  815|    196|    str.data = (UA_Byte*)(uintptr_t)begin;
  816|    196|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  817|    196|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    196|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (817:8): [True: 196, False: 0]
  ------------------
  818|    196|        pos = begin; /* Use the entire string for the name */
  819|       |
  820|  19.1k| match_name:
  821|  19.1k|    str.length = (size_t)(end - pos);
  822|  19.1k|    str.data = (UA_Byte*)(uintptr_t)pos;
  823|  19.1k|    res = UA_String_copy(&str, &qn->name);
  824|  19.1k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  578|  19.1k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (578:23): [True: 19.1k, False: 1]
  |  |  ------------------
  ------------------
  825|  19.1k|        res = UA_String_unescape(&qn->name, false, escName);
  826|  19.1k|    return res;
  827|    196|}

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

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

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

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

ua_types.c:UA_ByteString_init:
  243|  9.42k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  243|  29.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  243|    406|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  243|    490|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_clear:
  243|      1|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  243|  19.1k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  243|  46.4k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  243|    690|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  243|  46.4k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  243|  27.7k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  243|  11.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  243|    194|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  243|    218|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_clear:
  243|  23.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_DataValue_clear:
  243|  23.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_ByteString_clear:
  243|  6.81k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_String_clear:
  243|  6.82k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

