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

cj5_parse:
  306|  8.08k|          cj5_options *options) {
  307|  8.08k|    cj5_result r;
  308|  8.08k|    cj5__parser parser;
  309|  8.08k|    memset(&parser, 0x0, sizeof(parser));
  310|  8.08k|    parser.curr_tok_idx = 0;
  311|  8.08k|    parser.json5 = json5;
  312|  8.08k|    parser.len = len;
  313|  8.08k|    parser.tokens = tokens;
  314|  8.08k|    parser.max_tokens = max_tokens;
  315|       |
  316|  8.08k|    if(options)
  ------------------
  |  Branch (316:8): [True: 8.08k, False: 0]
  ------------------
  317|  8.08k|        parser.stop_early = options->stop_early;
  318|       |
  319|  8.08k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  320|  8.08k|    char nesting[CJ5_MAX_NESTING]; // Contains either '\0', '{' or '[' for the
  321|       |                                   // type of nesting at each depth. '\0'
  322|       |                                   // indicates we are out of the root object.
  323|  8.08k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  324|       |                                   // (value) or ',' (comma).
  325|  8.08k|    next[0] = 'v';  // The root is a "value" (object, array or primitive). If we
  326|       |                    // detect a colon after the first value then everything is
  327|       |                    // wrapped into a "virtual root object" and the parsing is
  328|       |                    // restarted.
  329|  8.08k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  330|       |
  331|  8.08k|    cj5_token *token = NULL; // The current token
  332|       |
  333|  9.38k| start_parsing:
  334|  71.3M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (334:11): [True: 71.3M, False: 7.66k]
  ------------------
  335|  71.3M|        char c = json5[parser.pos];
  336|  71.3M|        switch(c) {
  337|   989k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (337:9): [True: 989k, False: 70.3M]
  ------------------
  338|  2.09M|        case '\r':
  ------------------
  |  Branch (338:9): [True: 1.10M, False: 70.2M]
  ------------------
  339|  2.19M|        case '\t':
  ------------------
  |  Branch (339:9): [True: 96.9k, False: 71.2M]
  ------------------
  340|  2.39M|        case ' ':
  ------------------
  |  Branch (340:9): [True: 207k, False: 71.1M]
  ------------------
  341|  2.39M|            break;
  342|       |
  343|  20.2k|        case '#': // Skip comment
  ------------------
  |  Branch (343:9): [True: 20.2k, False: 71.3M]
  ------------------
  344|  23.8k|        case '/':
  ------------------
  |  Branch (344:9): [True: 3.63k, False: 71.3M]
  ------------------
  345|  23.8k|            cj5__skip_comment(&parser);
  346|  23.8k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (346:16): [True: 9.61k, False: 14.2k]
  ------------------
  347|  9.61k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (347:16): [True: 160, False: 9.45k]
  ------------------
  348|    160|                goto finish;
  349|  23.7k|            break;
  350|       |
  351|   174k|        case '{': // Open an object or array
  ------------------
  |  Branch (351:9): [True: 174k, False: 71.1M]
  ------------------
  352|   236k|        case '[':
  ------------------
  |  Branch (352:9): [True: 61.3k, False: 71.2M]
  ------------------
  353|       |            // Check the nesting depth
  354|   236k|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   53|   236k|#define CJ5_MAX_NESTING 256
  ------------------
  |  Branch (354:16): [True: 2, False: 236k]
  ------------------
  355|      2|                parser.error = CJ5_ERROR_INVALID;
  356|      2|                goto finish;
  357|      2|            }
  358|       |
  359|       |            // Correct next?
  360|   236k|            if(next[depth] != 'v') {
  ------------------
  |  Branch (360:16): [True: 28, False: 235k]
  ------------------
  361|     28|                parser.error = CJ5_ERROR_INVALID;
  362|     28|                goto finish;
  363|     28|            }
  364|       |
  365|   235k|            depth++; // Increase the nesting depth
  366|   235k|            nesting[depth] = c; // Set the nesting type
  367|   235k|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (367:27): [True: 174k, False: 61.2k]
  ------------------
  368|       |
  369|       |            // Create a token for the object or array
  370|   235k|            token = cj5__alloc_token(&parser);
  371|   235k|            if(token) {
  ------------------
  |  Branch (371:16): [True: 163k, False: 72.8k]
  ------------------
  372|   163k|                token->parent_id = parser.curr_tok_idx;
  373|   163k|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (373:31): [True: 115k, False: 47.9k]
  ------------------
  374|   163k|                token->start = parser.pos;
  375|   163k|                token->size = 0;
  376|   163k|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  377|       |                                                              // is for this token
  378|   163k|            }
  379|   235k|            break;
  380|       |
  381|   172k|        case '}': // Close an object or array
  ------------------
  |  Branch (381:9): [True: 172k, False: 71.1M]
  ------------------
  382|   211k|        case ']':
  ------------------
  |  Branch (382:9): [True: 39.0k, False: 71.3M]
  ------------------
  383|       |            // Check the nesting depth. Note that a "virtual root object" at
  384|       |            // depth zero must not be closed.
  385|   211k|            if(depth == 0) {
  ------------------
  |  Branch (385:16): [True: 18, False: 211k]
  ------------------
  386|     18|                parser.error = CJ5_ERROR_INVALID;
  387|     18|                goto finish;
  388|     18|            }
  389|       |
  390|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  391|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  392|       |            // when a key or a comma is expected.
  393|   211k|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (393:16): [True: 12, False: 211k]
  ------------------
  394|   211k|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (394:17): [True: 172k, False: 39.0k]
  |  Branch (394:29): [True: 148k, False: 24.0k]
  |  Branch (394:51): [True: 5, False: 148k]
  ------------------
  395|     17|                parser.error = CJ5_ERROR_INVALID;
  396|     17|                goto finish;
  397|     17|            }
  398|       |
  399|   211k|            if(token) {
  ------------------
  |  Branch (399:16): [True: 135k, False: 75.6k]
  ------------------
  400|       |                // Finalize the current token
  401|   135k|                token->end = parser.pos;
  402|       |
  403|       |                // Move to the parent and increase the parent size. Omit this
  404|       |                // when we leave the root (parent the same as the current
  405|       |                // token).
  406|   135k|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (406:20): [True: 129k, False: 6.06k]
  ------------------
  407|   129k|                    parser.curr_tok_idx = token->parent_id;
  408|   129k|                    token = &tokens[token->parent_id];
  409|   129k|                    token->size++;
  410|   129k|                }
  411|   135k|            }
  412|       |
  413|       |            // Step one level up
  414|   211k|            depth--;
  415|   211k|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (415:27): [True: 6.46k, False: 204k]
  ------------------
  416|       |                                                  // object. then we do not look for
  417|       |                                                  // another element.
  418|       |
  419|       |            // The first element was successfully parsed. Stop early or try to
  420|       |            // parse the full input string?
  421|   211k|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (421:16): [True: 6.46k, False: 204k]
  |  Branch (421:30): [True: 0, False: 6.46k]
  ------------------
  422|      0|                goto finish;
  423|       |
  424|   211k|            break;
  425|       |
  426|  4.22M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (426:9): [True: 4.22M, False: 67.1M]
  ------------------
  427|  4.22M|            if(next[depth] != ':') {
  ------------------
  |  Branch (427:16): [True: 964, False: 4.22M]
  ------------------
  428|    964|                parser.error = CJ5_ERROR_INVALID;
  429|    964|                goto finish;
  430|    964|            }
  431|  4.22M|            next[depth] = 'v';
  432|  4.22M|            break;
  433|       |
  434|  30.0M|        case ',': // Comma
  ------------------
  |  Branch (434:9): [True: 30.0M, False: 41.3M]
  ------------------
  435|  30.0M|            if(next[depth] != ',') {
  ------------------
  |  Branch (435:16): [True: 21, False: 30.0M]
  ------------------
  436|     21|                parser.error = CJ5_ERROR_INVALID;
  437|     21|                goto finish;
  438|     21|            }
  439|  30.0M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (439:27): [True: 4.06M, False: 25.9M]
  ------------------
  440|  30.0M|            break;
  441|       |
  442|  34.2M|        default: // Value or key
  ------------------
  |  Branch (442:9): [True: 34.2M, False: 37.1M]
  ------------------
  443|  34.2M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (443:16): [True: 30.0M, False: 4.22M]
  ------------------
  444|  30.0M|                cj5__parse_primitive(&parser); // Parse primitive value
  445|  30.0M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (445:20): [True: 30.0M, False: 1.30k]
  ------------------
  446|       |                    // Parent is object or array
  447|  30.0M|                    if(token)
  ------------------
  |  Branch (447:24): [True: 28.8M, False: 1.16M]
  ------------------
  448|  28.8M|                        token->size++;
  449|  30.0M|                    next[depth] = ',';
  450|  30.0M|                } else {
  451|       |                    // The current value was the root element. Don't look for
  452|       |                    // any next element.
  453|  1.30k|                    next[depth] = 0;
  454|       |
  455|       |                    // The first element was successfully parsed. Stop early or try to
  456|       |                    // parse the full input string?
  457|  1.30k|                    if(parser.stop_early)
  ------------------
  |  Branch (457:24): [True: 0, False: 1.30k]
  ------------------
  458|      0|                        goto finish;
  459|  1.30k|                }
  460|  30.0M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (460:23): [True: 4.22M, False: 224]
  ------------------
  461|  4.22M|                cj5__parse_key(&parser);
  462|  4.22M|                if(token)
  ------------------
  |  Branch (462:20): [True: 3.09M, False: 1.12M]
  ------------------
  463|  3.09M|                    token->size++; // Keys count towards the length
  464|  4.22M|                next[depth] = ':';
  465|  4.22M|            } else {
  466|    224|                parser.error = CJ5_ERROR_INVALID;
  467|    224|            }
  468|       |
  469|  34.2M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (469:16): [True: 17.6M, False: 16.6M]
  |  Branch (469:32): [True: 515, False: 17.6M]
  ------------------
  470|    515|                goto finish;
  471|       |
  472|  34.2M|            break;
  473|  71.3M|        }
  474|  71.3M|    }
  475|       |
  476|       |    // Are we back to the initial nesting depth?
  477|  7.66k|    if(depth != 0) {
  ------------------
  |  Branch (477:8): [True: 201, False: 7.46k]
  ------------------
  478|    201|        parser.error = CJ5_ERROR_INCOMPLETE;
  479|    201|        goto finish;
  480|    201|    }
  481|       |
  482|       |    // Close the virtual root object if there is one
  483|  7.46k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (483:8): [True: 902, False: 6.55k]
  |  Branch (483:29): [True: 877, False: 25]
  ------------------
  484|       |        // Check the we end after a complete key-value pair (or dangling comma)
  485|    877|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (485:12): [True: 868, False: 9]
  |  Branch (485:30): [True: 68, False: 800]
  ------------------
  486|     68|            parser.error = CJ5_ERROR_INVALID;
  487|    877|        tokens[0].end = parser.pos - 1;
  488|    877|    }
  489|       |
  490|  9.38k| finish:
  491|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  492|       |    // and restart parsing.
  493|  9.38k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (493:8): [True: 2.50k, False: 6.88k]
  ------------------
  494|  2.50k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (494:8): [True: 1.99k, False: 507]
  ------------------
  495|  1.99k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (495:8): [True: 1.67k, False: 315]
  |  Branch (495:22): [True: 1.29k, False: 381]
  ------------------
  496|  1.29k|        parser.token_count = 0;
  497|  1.29k|        token = cj5__alloc_token(&parser);
  498|  1.29k|        if(token) {
  ------------------
  |  Branch (498:12): [True: 1.29k, False: 0]
  ------------------
  499|  1.29k|            token->parent_id = 0;
  500|  1.29k|            token->type = CJ5_TOKEN_OBJECT;
  501|  1.29k|            token->start = 0;
  502|  1.29k|            token->size = 0;
  503|       |
  504|  1.29k|            nesting[0] = '{';
  505|  1.29k|            next[0] = 'k';
  506|       |
  507|  1.29k|            parser.curr_tok_idx = 0;
  508|  1.29k|            parser.pos = 0;
  509|  1.29k|            parser.error = CJ5_ERROR_NONE;
  510|  1.29k|            goto start_parsing;
  511|  1.29k|        }
  512|  1.29k|    }
  513|       |
  514|  8.08k|    memset(&r, 0x0, sizeof(r));
  515|  8.08k|    r.error = parser.error;
  516|  8.08k|    r.error_pos = parser.pos;
  517|  8.08k|    r.num_tokens = parser.token_count; // How many tokens (would) have been
  518|       |                                       // consumed by the parser?
  519|       |
  520|       |    // Not a single token was parsed -> return an error
  521|  8.08k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (521:8): [True: 27, False: 8.06k]
  ------------------
  522|     27|        r.error = CJ5_ERROR_INCOMPLETE;
  523|       |
  524|       |    // Set the tokens and original string only if successfully parsed
  525|  8.08k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (525:8): [True: 6.85k, False: 1.23k]
  ------------------
  526|  6.85k|        r.tokens = tokens;
  527|  6.85k|        r.json5 = json5;
  528|  6.85k|    }
  529|       |
  530|  8.08k|    return r;
  531|  9.38k|}
cj5_get_str:
  629|  65.7k|            char *buf, unsigned int *buflen) {
  630|  65.7k|    const cj5_token *token = &r->tokens[tok_index];
  631|  65.7k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (631:8): [True: 0, False: 65.7k]
  ------------------
  632|      0|        buf[0] = 0;
  633|      0|        if(buflen)
  ------------------
  |  Branch (633:12): [True: 0, False: 0]
  ------------------
  634|      0|            *buflen = 0;
  635|      0|        return CJ5_ERROR_INVALID;
  636|      0|    }
  637|       |
  638|  65.7k|    const char *pos = &r->json5[token->start];
  639|  65.7k|    const char *end = &r->json5[token->end + 1];
  640|  65.7k|    unsigned int outpos = 0;
  641|  65.7k|    cj5_error_code error = CJ5_ERROR_NONE;
  642|  20.6M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (642:11): [True: 20.5M, False: 65.5k]
  ------------------
  643|  20.5M|        uint8_t c = (uint8_t)*pos;
  644|       |        // Unprintable ascii characters must be escaped
  645|  20.5M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (645:12): [True: 70, False: 20.5M]
  |  Branch (645:23): [True: 3, False: 20.5M]
  ------------------
  646|     73|            error = CJ5_ERROR_INVALID;
  647|     73|            goto done;
  648|     73|        }
  649|       |
  650|       |        // Unescaped Ascii character or utf8 byte
  651|  20.5M|        if(c != '\\') {
  ------------------
  |  Branch (651:12): [True: 20.5M, False: 5.87k]
  ------------------
  652|  20.5M|            buf[outpos++] = (char)c;
  653|  20.5M|            continue;
  654|  20.5M|        }
  655|       |
  656|       |        // End of input before the escaped character
  657|  5.87k|        if(pos + 1 >= end) {
  ------------------
  |  Branch (657:12): [True: 0, False: 5.87k]
  ------------------
  658|      0|            error = CJ5_ERROR_INCOMPLETE;
  659|      0|            goto done;
  660|      0|        }
  661|       |
  662|       |        // Process escaped character
  663|  5.87k|        pos++;
  664|  5.87k|        c = (uint8_t)*pos;
  665|  5.87k|        switch(c) {
  666|    230|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (666:9): [True: 230, False: 5.64k]
  ------------------
  667|    278|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (667:9): [True: 278, False: 5.60k]
  ------------------
  668|    201|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (668:9): [True: 201, False: 5.67k]
  ------------------
  669|    307|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (669:9): [True: 307, False: 5.57k]
  ------------------
  670|    253|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (670:9): [True: 253, False: 5.62k]
  ------------------
  671|  2.59k|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (671:9): [True: 2.59k, False: 3.28k]
  ------------------
  672|  2.02k|        case 'u': {
  ------------------
  |  Branch (672:9): [True: 2.02k, False: 3.85k]
  ------------------
  673|       |            // Parse a unicode code point
  674|  2.02k|            if(pos + 4 >= end) {
  ------------------
  |  Branch (674:16): [True: 3, False: 2.01k]
  ------------------
  675|      3|                error = CJ5_ERROR_INCOMPLETE;
  676|      3|                goto done;
  677|      3|            }
  678|  2.01k|            pos++;
  679|  2.01k|            uint32_t utf;
  680|  2.01k|            error = parse_codepoint(pos, &utf);
  681|  2.01k|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (681:16): [True: 24, False: 1.99k]
  ------------------
  682|     24|                goto done;
  683|  1.99k|            pos += 3;
  684|       |
  685|       |            // Parse a surrogate pair
  686|  1.99k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (686:16): [True: 1.29k, False: 702]
  |  Branch (686:33): [True: 996, False: 295]
  ------------------
  687|    996|                if(pos + 6 >= end) {
  ------------------
  |  Branch (687:20): [True: 14, False: 982]
  ------------------
  688|     14|                    error = CJ5_ERROR_INVALID;
  689|     14|                    goto done;
  690|     14|                }
  691|    982|                if(pos[1] != '\\' && pos[2] != 'u') {
  ------------------
  |  Branch (691:20): [True: 314, False: 668]
  |  Branch (691:38): [True: 12, False: 302]
  ------------------
  692|     12|                    error = CJ5_ERROR_INVALID;
  693|     12|                    goto done;
  694|     12|                }
  695|    970|                pos += 3;
  696|    970|                uint32_t utf2;
  697|    970|                error = parse_codepoint(pos, &utf2);
  698|    970|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (698:20): [True: 16, False: 954]
  ------------------
  699|     16|                    goto done;
  700|    954|                pos += 3;
  701|       |                // High or low surrogate pair
  702|    954|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (702:23): [True: 601, False: 353]
  ------------------
  703|    601|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  704|    954|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  705|    954|            }
  706|       |
  707|       |            // Write the utf8 bytes of the code point
  708|  1.95k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  709|  1.95k|            if(len == 0) {
  ------------------
  |  Branch (709:16): [True: 29, False: 1.92k]
  ------------------
  710|     29|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  711|     29|                goto done;
  712|     29|            }
  713|  1.92k|            outpos += len;
  714|  1.92k|            break;
  715|  1.95k|        }
  716|  5.87k|        }
  717|  5.87k|    }
  718|       |
  719|  65.7k| done:
  720|       |    // Always leave buf as a valid, NUL-terminated string, even when decoding
  721|       |    // fails midway. Callers still must check the returned error code.
  722|  65.7k|    buf[outpos] = 0;
  723|       |
  724|       |    // Set the output length
  725|  65.7k|    if(buflen)
  ------------------
  |  Branch (725:8): [True: 65.7k, False: 0]
  ------------------
  726|  65.7k|        *buflen = outpos;
  727|  65.7k|    return error;
  728|  65.7k|}
cj5.c:cj5__skip_comment:
  261|  23.8k|cj5__skip_comment(cj5__parser* parser) {
  262|  23.8k|    const char* json5 = parser->json5;
  263|       |
  264|       |    // Single-line comment
  265|  23.8k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (265:8): [True: 20.2k, False: 3.63k]
  ------------------
  266|  20.6k|    skip_line:
  267|  5.98M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (267:15): [True: 5.98M, False: 72]
  ------------------
  268|  5.98M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (268:16): [True: 20.5k, False: 5.96M]
  ------------------
  269|  20.5k|                parser->pos--; // Reparse the newline in the main parse loop
  270|  20.5k|                return;
  271|  20.5k|            }
  272|  5.96M|            parser->pos++;
  273|  5.96M|        }
  274|     72|        return;
  275|  20.6k|    }
  276|       |
  277|       |    // Comment begins with '/' but not enough space for another character
  278|  3.63k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (278:8): [True: 31, False: 3.60k]
  ------------------
  279|     31|        parser->error = CJ5_ERROR_INVALID;
  280|     31|        return;
  281|     31|    }
  282|  3.60k|    parser->pos++;
  283|       |
  284|       |    // Comment begins with '//' -> single-line comment
  285|  3.60k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (285:8): [True: 368, False: 3.24k]
  ------------------
  286|    368|        goto skip_line;
  287|       |
  288|       |    // Multi-line comments begin with '/*' and end with '*/'
  289|  3.24k|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (289:8): [True: 3.20k, False: 32]
  ------------------
  290|  3.20k|        parser->pos++;
  291|  1.44M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (291:15): [True: 1.44M, False: 97]
  ------------------
  292|  1.44M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (292:16): [True: 7.70k, False: 1.43M]
  |  Branch (292:45): [True: 3.11k, False: 4.59k]
  ------------------
  293|  3.11k|                parser->pos++;
  294|  3.11k|                return;
  295|  3.11k|            }
  296|  1.44M|        }
  297|  3.20k|    }
  298|       |
  299|       |    // Unknown comment type or the multi-line comment is not terminated
  300|    129|    parser->error = CJ5_ERROR_INCOMPLETE;
  301|    129|}
cj5.c:cj5__alloc_token:
   89|  34.4M|cj5__alloc_token(cj5__parser *parser) {
   90|  34.4M|    cj5_token* token = NULL;
   91|  34.4M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (91:8): [True: 16.7M, False: 17.6M]
  ------------------
   92|  16.7M|        token = &parser->tokens[parser->token_count];
   93|  16.7M|        memset(token, 0x0, sizeof(cj5_token));
   94|  17.6M|    } else {
   95|  17.6M|        parser->error = CJ5_ERROR_OVERFLOW;
   96|  17.6M|    }
   97|       |
   98|       |    // Always increase the index. So we know eventually how many token would be
   99|       |    // required (if there are not enough).
  100|  34.4M|    parser->token_count++;
  101|  34.4M|    return token;
  102|  34.4M|}
cj5.c:cj5__parse_primitive:
  153|  30.0M|cj5__parse_primitive(cj5__parser* parser) {
  154|  30.0M|    const char* json5 = parser->json5;
  155|  30.0M|    unsigned int len = parser->len;
  156|  30.0M|    unsigned int start = parser->pos;
  157|       |
  158|       |    // String value
  159|  30.0M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (159:8): [True: 1.29M, False: 28.7M]
  ------------------
  160|  28.7M|       json5[start] == '\'') {
  ------------------
  |  Branch (160:8): [True: 891, False: 28.7M]
  ------------------
  161|  1.29M|        cj5__parse_string(parser);
  162|  1.29M|        return;
  163|  1.29M|    }
  164|       |
  165|       |    // Fast comparison of bool, and null.
  166|       |    // Make the comparison case-insensitive.
  167|  28.7M|    uint32_t fourcc = 0;
  168|  28.7M|    if(start + 3 < len) {
  ------------------
  |  Branch (168:8): [True: 28.7M, False: 606]
  ------------------
  169|  28.7M|        fourcc += (unsigned char)json5[start] | 32U;
  170|  28.7M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  171|  28.7M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  172|  28.7M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  173|  28.7M|    }
  174|       |    
  175|  28.7M|    cj5_token_type type;
  176|  28.7M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (176:8): [True: 5.44k, False: 28.7M]
  ------------------
  177|  5.44k|        type = CJ5_TOKEN_NULL;
  178|  5.44k|        parser->pos += 3;
  179|  28.7M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (179:15): [True: 302, False: 28.7M]
  ------------------
  180|    302|        type = CJ5_TOKEN_BOOL;
  181|    302|        parser->pos += 3;
  182|  28.7M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (182:15): [True: 513, False: 28.7M]
  ------------------
  183|       |        // "false" has five characters
  184|    513|        type = CJ5_TOKEN_BOOL;
  185|    513|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (185:12): [True: 1, False: 512]
  |  Branch (185:32): [True: 21, False: 491]
  ------------------
  186|     22|            parser->error = CJ5_ERROR_INVALID;
  187|     22|            return;
  188|     22|        }
  189|    491|        parser->pos += 4;
  190|  28.7M|    } else {
  191|       |        // Numbers are checked for basic compatibility.
  192|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  193|  28.7M|        type = CJ5_TOKEN_NUMBER;
  194|  68.8M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (194:15): [True: 68.8M, False: 875]
  ------------------
  195|  68.8M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   86|   137M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (195:16): [True: 36.4M, False: 32.4M]
  ------------------
  196|  36.4M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (196:16): [True: 36.4M, False: 1.80k]
  ------------------
  197|  36.4M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   85|   105M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (197:16): [True: 32.0M, False: 4.32M]
  ------------------
  198|  32.0M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   84|   100M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (198:16): [True: 29.0M, False: 2.98M]
  ------------------
  199|  29.0M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (199:16): [True: 29.0M, False: 2.46k]
  |  Branch (199:48): [True: 28.7M, False: 389k]
  ------------------
  200|  28.7M|                break;
  201|  28.7M|            }
  202|  68.8M|        }
  203|  28.7M|        parser->pos--; // Point to the last character that is still inside the
  204|       |                       // primitive value
  205|  28.7M|    }
  206|       |
  207|  28.7M|    cj5_token *token = cj5__alloc_token(parser);
  208|  28.7M|    if(token) {
  ------------------
  |  Branch (208:8): [True: 13.8M, False: 14.8M]
  ------------------
  209|  13.8M|        token->type = type;
  210|  13.8M|        token->start = start;
  211|  13.8M|        token->end = parser->pos;
  212|  13.8M|        token->size = parser->pos - start + 1;
  213|  13.8M|        token->parent_id = parser->curr_tok_idx;
  214|  13.8M|    }
  215|  28.7M|}
cj5.c:cj5__parse_string:
  105|  3.04M|cj5__parse_string(cj5__parser *parser) {
  106|  3.04M|    const char *json5 = parser->json5;
  107|  3.04M|    unsigned int len = parser->len;
  108|  3.04M|    unsigned int start = parser->pos;
  109|  3.04M|    char str_open = json5[start];
  110|       |
  111|  3.04M|    parser->pos++;
  112|  58.4M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (112:11): [True: 58.4M, False: 145]
  ------------------
  113|  58.4M|        char c = json5[parser->pos];
  114|       |
  115|       |        // End of string
  116|  58.4M|        if(str_open == c) {
  ------------------
  |  Branch (116:12): [True: 3.04M, False: 55.3M]
  ------------------
  117|  3.04M|            cj5_token *token = cj5__alloc_token(parser);
  118|  3.04M|            if(token) {
  ------------------
  |  Branch (118:16): [True: 1.50M, False: 1.53M]
  ------------------
  119|  1.50M|                token->type = CJ5_TOKEN_STRING;
  120|  1.50M|                token->start = start + 1;
  121|  1.50M|                token->end = parser->pos - 1;
  122|  1.50M|                token->size = token->end - token->start + 1;
  123|  1.50M|                token->parent_id = parser->curr_tok_idx;
  124|  1.50M|            } 
  125|  3.04M|            return;
  126|  3.04M|        }
  127|       |
  128|       |        // Unescaped newlines are forbidden
  129|  55.3M|        if(c == '\n') {
  ------------------
  |  Branch (129:12): [True: 4, False: 55.3M]
  ------------------
  130|      4|            parser->error = CJ5_ERROR_INVALID;
  131|      4|            return;
  132|      4|        }
  133|       |
  134|       |        // Skip escape character
  135|  55.3M|        if(c == '\\') {
  ------------------
  |  Branch (135:12): [True: 265k, False: 55.1M]
  ------------------
  136|   265k|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (136:16): [True: 3, False: 265k]
  ------------------
  137|      3|                parser->error = CJ5_ERROR_INCOMPLETE;
  138|      3|                return;
  139|      3|            }
  140|   265k|            parser->pos++;
  141|   265k|        }
  142|  55.3M|    }
  143|       |
  144|       |    // The file has ended before the string terminates
  145|    145|    parser->error = CJ5_ERROR_INCOMPLETE;
  146|    145|}
cj5.c:cj5__isrange:
   80|   155M|cj5__isrange(char ch, char from, char to) {
   81|   155M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   82|   155M|}
cj5.c:cj5__parse_key:
  218|  4.22M|cj5__parse_key(cj5__parser* parser) {
  219|  4.22M|    const char* json5 = parser->json5;
  220|  4.22M|    unsigned int start = parser->pos;
  221|  4.22M|    cj5_token* token;
  222|       |
  223|       |    // Key is a a normal string
  224|  4.22M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (224:8): [True: 1.74M, False: 2.47M]
  |  Branch (224:32): [True: 2.29k, False: 2.47M]
  ------------------
  225|  1.74M|        cj5__parse_string(parser);
  226|  1.74M|        return;
  227|  1.74M|    }
  228|       |
  229|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  230|  2.47M|    unsigned int len = parser->len;
  231|  8.47M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (231:11): [True: 8.47M, False: 69]
  ------------------
  232|  8.47M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   85|  16.9M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 2.18M, False: 6.28M]
  |  |  ------------------
  ------------------
  233|  6.28M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  14.7M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 3.15M, False: 3.13M]
  |  |  ------------------
  ------------------
  234|  3.13M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (234:12): [True: 1.19k, False: 3.13M]
  |  Branch (234:41): [True: 1.89k, False: 3.13M]
  ------------------
  235|  5.34M|            continue;
  236|  3.13M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   86|  6.26M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 659k, False: 2.47M]
  |  |  ------------------
  ------------------
  |  Branch (236:46): [True: 659k, False: 10]
  ------------------
  237|   659k|            continue;
  238|  2.47M|        break;
  239|  3.13M|    }
  240|       |
  241|       |    // An empty key is not allowed
  242|  2.47M|    if(parser->pos <= start) {
  ------------------
  |  Branch (242:8): [True: 117, False: 2.47M]
  ------------------
  243|    117|        parser->error = CJ5_ERROR_INVALID;
  244|    117|        return;
  245|    117|    }
  246|       |
  247|       |    // Move pos to the last character within the unquoted key
  248|  2.47M|    parser->pos--;
  249|       |
  250|  2.47M|    token = cj5__alloc_token(parser);
  251|  2.47M|    if(token) {
  ------------------
  |  Branch (251:8): [True: 1.26M, False: 1.20M]
  ------------------
  252|  1.26M|        token->type = CJ5_TOKEN_STRING;
  253|  1.26M|        token->start = start;
  254|  1.26M|        token->end = parser->pos;
  255|  1.26M|        token->size = parser->pos - start + 1;
  256|  1.26M|        token->parent_id = parser->curr_tok_idx;
  257|  1.26M|    }
  258|  2.47M|}
cj5.c:parse_codepoint:
  608|  2.98k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  609|  2.98k|    uint32_t utf = 0;
  610|  14.8k|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (610:29): [True: 11.8k, False: 2.94k]
  ------------------
  611|  11.8k|        char byte = pos[i];
  612|  11.8k|        if(cj5__isnum(byte)) {
  ------------------
  |  |   86|  11.8k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 3.21k, False: 8.67k]
  |  |  ------------------
  ------------------
  613|  3.21k|            byte = (char)(byte - '0');
  614|  8.67k|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (614:19): [True: 6.48k, False: 2.19k]
  ------------------
  615|  6.48k|            byte = (char)(byte - ('a' - 10));
  616|  6.48k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (616:19): [True: 2.15k, False: 40]
  ------------------
  617|  2.15k|            byte = (char)(byte - ('A' - 10));
  618|  2.15k|        } else {
  619|     40|            return CJ5_ERROR_INVALID;
  620|     40|        }
  621|  11.8k|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  622|  11.8k|    }
  623|  2.94k|    *out_utf = utf;
  624|  2.94k|    return CJ5_ERROR_NONE;
  625|  2.98k|}

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

parseUInt64:
   30|  2.91M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  2.91M|    size_t i = 0;
   32|  2.91M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  2.91M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 15.9k, False: 2.89M]
  |  Branch (35:20): [True: 6.54k, False: 9.36k]
  |  Branch (35:37): [True: 1.41k, False: 5.12k]
  ------------------
   36|  1.41k|        i = 2;
   37|   190k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 189k, False: 798]
  ------------------
   38|   189k|            uint8_t c = (uint8_t)str[i] | 32;
   39|   189k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 189k, False: 202]
  |  Branch (39:28): [True: 182k, False: 7.38k]
  ------------------
   40|   182k|                c = (uint8_t)(c - '0');
   41|  7.58k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 7.38k, False: 207]
  |  Branch (41:33): [True: 6.97k, False: 403]
  ------------------
   42|  6.97k|                c = (uint8_t)(c - 'a' + 10);
   43|    610|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 405, False: 205]
  |  Branch (43:33): [True: 0, False: 405]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    610|            else
   46|    610|                break;
   47|   189k|            n = (n << 4) | (c & 0xF);
   48|   189k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 5, False: 189k]
  ------------------
   49|      5|                return 0;
   50|   189k|            prev = n;
   51|   189k|        }
   52|  1.40k|        *result = n;
   53|  1.40k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 1.37k, False: 29]
  ------------------
   54|  1.41k|    }
   55|       |
   56|       |    /* Decimal */
   57|  8.14M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 5.25M, False: 2.89M]
  ------------------
   58|  5.25M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 9.32k, False: 5.24M]
  |  Branch (58:28): [True: 1.08k, False: 5.23M]
  ------------------
   59|  10.4k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  5.23M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  5.23M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 13, False: 5.23M]
  ------------------
   63|     13|            return 0;
   64|  5.23M|        prev = n;
   65|  5.23M|    }
   66|  2.91M|    *result = n;
   67|  2.91M|    return i;
   68|  2.91M|}
parseInt64:
   71|  1.56M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.56M|    size_t i = 0;
   74|  1.56M|    bool neg = false;
   75|  1.56M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 1.02k, False: 1.56M]
  |  Branch (75:23): [True: 334, False: 1.56M]
  ------------------
   76|  1.36k|        neg = (*str == '-');
   77|  1.36k|        i++;
   78|  1.36k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.56M|    uint64_t n = 0;
   82|  1.56M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.56M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 102, False: 1.56M]
  ------------------
   84|    102|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.56M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 1.56M, False: 1.01k]
  ------------------
   88|  1.56M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 46, False: 1.56M]
  ------------------
   89|     46|            return 0;
   90|  1.56M|        *result = (int64_t)n;
   91|  1.56M|    } 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|  1.01k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 1, False: 1.01k]
  ------------------
   98|      1|            return 0;
   99|  1.01k|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 194, False: 821]
  ------------------
  100|  1.01k|            ? (int64_t)(-9223372036854775807LL - 1)
  101|  1.01k|            : -(int64_t)n;
  102|  1.01k|    }
  103|  1.56M|    return len + i;
  104|  1.56M|}
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: 200, False: 524k]
  |  Branch (115:22): [True: 0, False: 200]
  ------------------
  116|      0|        return 0;
  117|   525k|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|   525k|}

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

findEncodingMetaData:
  313|  4.95k|                     UA_UInt16 dsWriterId) {
  314|  4.95k|    if(!eo)
  ------------------
  |  Branch (314:8): [True: 0, False: 4.95k]
  ------------------
  315|      0|        return NULL;
  316|  4.95k|    for(size_t i = 0; i < eo->metaDataSize; i++) {
  ------------------
  |  Branch (316:23): [True: 0, False: 4.95k]
  ------------------
  317|      0|        if(eo->metaData[i].dataSetWriterId == dsWriterId)
  ------------------
  |  Branch (317:12): [True: 0, False: 0]
  ------------------
  318|      0|            return &eo->metaData[i];
  319|      0|    }
  320|  4.95k|    return NULL;
  321|  4.95k|}
UA_NetworkMessage_clear:
 1097|  6.85k|UA_NetworkMessage_clear(UA_NetworkMessage* p) {
 1098|  6.85k|    if(p->promotedFieldsEnabled) {
  ------------------
  |  Branch (1098:8): [True: 0, False: 6.85k]
  ------------------
 1099|      0|        UA_Array_delete(p->promotedFields, p->promotedFieldsSize,
 1100|      0|                        &UA_TYPES[UA_TYPES_VARIANT]);
  ------------------
  |  |  810|      0|#define UA_TYPES_VARIANT 23
  ------------------
 1101|      0|    }
 1102|       |
 1103|  6.85k|    if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) {
  ------------------
  |  Branch (1103:8): [True: 6.85k, False: 0]
  ------------------
 1104|  6.85k|        if(p->payload.dataSetMessages) {
  ------------------
  |  Branch (1104:12): [True: 6.36k, False: 495]
  ------------------
 1105|  12.8k|            for(size_t i = 0; i < p->messageCount; i++)
  ------------------
  |  Branch (1105:31): [True: 6.51k, False: 6.36k]
  ------------------
 1106|  6.51k|                UA_DataSetMessage_clear(&p->payload.dataSetMessages[i]);
 1107|  6.36k|            UA_free(p->payload.dataSetMessages);
  ------------------
  |  |   19|  6.36k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1108|  6.36k|        }
 1109|  6.85k|    }
 1110|       |
 1111|  6.85k|    UA_ByteString_clear(&p->securityFooter);
 1112|  6.85k|    UA_String_clear(&p->messageId);
 1113|       |
 1114|  6.85k|    if(p->publisherIdEnabled &&
  ------------------
  |  Branch (1114:8): [True: 76, False: 6.78k]
  ------------------
 1115|     76|       p->publisherId.idType == UA_PUBLISHERIDTYPE_STRING)
  ------------------
  |  Branch (1115:8): [True: 32, False: 44]
  ------------------
 1116|     32|       UA_String_clear(&p->publisherId.id.string);
 1117|       |
 1118|  6.85k|    memset(p, 0, sizeof(UA_NetworkMessage));
 1119|  6.85k|}
UA_DataSetMessage_clear:
 2018|  6.51k|UA_DataSetMessage_clear(UA_DataSetMessage* p) {
 2019|  6.51k|    if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) {
  ------------------
  |  Branch (2019:8): [True: 6.51k, False: 0]
  ------------------
 2020|  6.51k|        if(p->data.keyFrameFields)
  ------------------
  |  Branch (2020:12): [True: 4.95k, False: 1.56k]
  ------------------
 2021|  4.95k|            UA_Array_delete(p->data.keyFrameFields, p->fieldCount,
 2022|  4.95k|                            &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  776|  4.95k|#define UA_TYPES_DATAVALUE 22
  ------------------
 2023|  6.51k|    } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) {
  ------------------
  |  Branch (2023:15): [True: 0, False: 0]
  ------------------
 2024|      0|        if(p->data.deltaFrameFields) {
  ------------------
  |  Branch (2024:12): [True: 0, False: 0]
  ------------------
 2025|      0|            for(UA_UInt16 i = 0; i < p->fieldCount; i++)
  ------------------
  |  Branch (2025:34): [True: 0, False: 0]
  ------------------
 2026|      0|                UA_DataValue_clear(&p->data.deltaFrameFields[i].value);
 2027|      0|            UA_free(p->data.deltaFrameFields);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2028|      0|        }
 2029|      0|    }
 2030|       |
 2031|  6.51k|    memset(p, 0, sizeof(UA_DataSetMessage));
 2032|  6.51k|}

UA_NetworkMessage_decodeJson:
  611|  7.58k|                             const UA_DecodeJsonOptions *jo) {
  612|       |    /* Set up the context */
  613|  7.58k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
  614|  7.58k|    PubSubDecodeJsonCtx ctx;
  615|  7.58k|    memset(&ctx, 0, sizeof(PubSubDecodeJsonCtx));
  616|  7.58k|    ctx.ctx.tokens = tokens;
  617|  7.58k|    if(eo)
  ------------------
  |  Branch (617:8): [True: 0, False: 7.58k]
  ------------------
  618|      0|        ctx.eo = *eo;
  619|  7.58k|    if(jo) {
  ------------------
  |  Branch (619:8): [True: 0, False: 7.58k]
  ------------------
  620|      0|        ctx.ctx.namespaceMapping = jo->namespaceMapping;
  621|      0|        ctx.ctx.serverUrisSize = jo->serverUrisSize;
  622|      0|        ctx.ctx.serverUris = jo->serverUris;
  623|      0|        ctx.ctx.customTypes = jo->customTypes;
  624|      0|    }
  625|       |
  626|  7.58k|    status ret = tokenize(&ctx.ctx, src, UA_JSON_MAXTOKENCOUNT, NULL);
  ------------------
  |  |   21|  7.58k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
  627|  7.58k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  7.58k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (627:8): [True: 725, False: 6.85k]
  ------------------
  628|    725|        goto cleanup;
  629|       |
  630|  6.85k|    ret = NetworkMessage_decodeJsonInternal(&ctx, dst);
  631|  6.85k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.85k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (631:8): [True: 6.84k, False: 10]
  ------------------
  632|  6.84k|        UA_NetworkMessage_clear(dst);
  633|       |
  634|  7.58k| cleanup:
  635|       |    /* Free token array on the heap */
  636|  7.58k|    if(ctx.ctx.tokens != tokens)
  ------------------
  |  Branch (636:8): [True: 507, False: 7.07k]
  ------------------
  637|    507|        UA_free((void*)(uintptr_t)ctx.ctx.tokens);
  ------------------
  |  |   19|    507|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  638|  7.58k|    return ret;
  639|  6.85k|}
ua_pubsub_networkmessage_json.c:NetworkMessage_decodeJsonInternal:
  523|  6.85k|                                  UA_NetworkMessage *dst) {
  524|  6.85k|    memset(dst, 0, sizeof(UA_NetworkMessage));
  525|  6.85k|    dst->chunkMessage = false;
  526|  6.85k|    dst->groupHeaderEnabled = false;
  527|  6.85k|    dst->payloadHeaderEnabled = false;
  528|  6.85k|    dst->picosecondsEnabled = false;
  529|  6.85k|    dst->promotedFieldsEnabled = false;
  530|       |
  531|       |    /* The NetworkMessage must be a JSON object */
  532|  6.85k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (532:8): [True: 99, False: 6.76k]
  ------------------
  533|     99|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     99|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  534|       |
  535|       |    /* Determine the number of DataSetMessages from Messages and remember
  536|       |     * whether the sender used the single-object layout. */
  537|  6.76k|    size_t searchResultMessages = 0;
  538|  6.76k|    status found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGES, &searchResultMessages);
  539|  6.76k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.76k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (539:8): [True: 144, False: 6.61k]
  ------------------
  540|    144|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|    144|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  541|  6.61k|    const cj5_token *bodyToken = &ctx->ctx.tokens[searchResultMessages];
  542|  6.61k|    size_t messageCount = 1;
  543|  6.61k|    if(bodyToken->type == CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (543:8): [True: 2.35k, False: 4.26k]
  ------------------
  544|  2.35k|        messageCount = (size_t)bodyToken->size;
  545|  6.61k|    dst->jsonSingleDataSetMessage = (bodyToken->type == CJ5_TOKEN_OBJECT);
  546|       |
  547|       |    /* Too many DataSetMessages */
  548|  6.61k|    if(messageCount > UA_NETWORKMESSAGE_MAXMESSAGECOUNT)
  ------------------
  |  |  138|  6.61k|#define UA_NETWORKMESSAGE_MAXMESSAGECOUNT 32
  ------------------
  |  Branch (548:8): [True: 2, False: 6.61k]
  ------------------
  549|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  550|       |
  551|       |    /* MessageType */
  552|  6.61k|    UA_Boolean isUaData = true;
  553|  6.61k|    size_t searchResultMessageType = 0;
  554|  6.61k|    found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGETYPE, &searchResultMessageType);
  555|  6.61k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.61k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (555:8): [True: 53, False: 6.56k]
  ------------------
  556|     53|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     53|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  557|  6.56k|    size_t size = getTokenLength(&ctx->ctx.tokens[searchResultMessageType]);
  558|  6.56k|    const char* msgType = &ctx->ctx.json5[ctx->ctx.tokens[searchResultMessageType].start];
  559|  6.56k|    if(size == 7) { /* ua-data */
  ------------------
  |  Branch (559:8): [True: 6.44k, False: 117]
  ------------------
  560|  6.44k|        if(strncmp(msgType, "ua-data", size) != 0)
  ------------------
  |  Branch (560:12): [True: 60, False: 6.38k]
  ------------------
  561|     60|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     60|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  562|  6.38k|        isUaData = true;
  563|  6.38k|    } else if(size == 11) { /* ua-metadata */
  ------------------
  |  Branch (563:15): [True: 71, False: 46]
  ------------------
  564|     71|        if(strncmp(msgType, "ua-metadata", size) != 0)
  ------------------
  |  Branch (564:12): [True: 70, False: 1]
  ------------------
  565|     70|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     70|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  566|      1|        isUaData = false;
  567|     46|    } else {
  568|     46|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     46|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  569|     46|    }
  570|       |
  571|       |    /* Reject metadata messages until their payload decoder is implemented. */
  572|  6.38k|    if(!isUaData)
  ------------------
  |  Branch (572:8): [True: 1, False: 6.38k]
  ------------------
  573|      1|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|      1|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  574|       |
  575|  6.38k|    if(messageCount > 0) {
  ------------------
  |  Branch (575:8): [True: 6.37k, False: 12]
  ------------------
  576|  6.37k|        dst->payload.dataSetMessages = (UA_DataSetMessage*)
  577|  6.37k|            UA_calloc(messageCount, sizeof(UA_DataSetMessage));
  ------------------
  |  |   20|  6.37k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  578|  6.37k|        if(!dst->payload.dataSetMessages)
  ------------------
  |  Branch (578:12): [True: 8, False: 6.36k]
  ------------------
  579|      8|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      8|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  580|  6.37k|    }
  581|  6.37k|    dst->messageCount = (UA_Byte)messageCount;
  582|       |
  583|       |    /* Network Message */
  584|  6.37k|    UA_String messageType;
  585|  6.37k|    DecodeEntry entries[5] = {
  586|  6.37k|        {UA_DECODEKEY_MESSAGEID, &dst->messageId, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|  6.37k|#define UA_TYPES_STRING 11
  ------------------
  587|  6.37k|        {UA_DECODEKEY_MESSAGETYPE, &messageType, NULL, false, NULL},
  588|  6.37k|        {UA_DECODEKEY_PUBLISHERID, &dst->publisherId, decodePublisherIdJsonInternal, false, NULL},
  589|  6.37k|        {UA_DECODEKEY_DATASETCLASSID, &dst->dataSetClassId, NULL, false, &UA_TYPES[UA_TYPES_GUID]},
  ------------------
  |  |  470|  6.37k|#define UA_TYPES_GUID 13
  ------------------
  590|  6.37k|        {UA_DECODEKEY_MESSAGES, dst, DatasetMessage_Array_decodeJsonInternal, false, NULL}
  591|  6.37k|    };
  592|       |
  593|  6.37k|    status ret = decodeFieldsAllowUnknown(&ctx->ctx, entries, 5);
  594|       |    /* Ensure cleanup owns an allocated string PublisherId even if a later
  595|       |     * top-level member fails to decode. */
  596|  6.37k|    dst->publisherIdEnabled = entries[2].found;
  597|  6.37k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.37k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (597:8): [True: 6.36k, False: 10]
  ------------------
  598|  6.36k|        return ret;
  599|       |
  600|     10|    dst->messageIdEnabled = entries[0].found;
  601|     10|    dst->dataSetClassIdEnabled = entries[3].found;
  602|     10|    dst->payloadHeaderEnabled = true;
  603|       |
  604|     10|    return ret;
  605|  6.37k|}
ua_pubsub_networkmessage_json.c:decodePublisherIdJsonInternal:
  493|     76|                              const UA_DataType *type) {
  494|     76|    UA_PublisherId *p = (UA_PublisherId*)dst;
  495|     76|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER) {
  ------------------
  |  Branch (495:8): [True: 27, False: 49]
  ------------------
  496|       |        /* Store in biggest possible integer. The problem is that with a UInt64
  497|       |         * is that a string is expected for it in JSON. Therefore, the maximum
  498|       |         * value is set to UInt32. */
  499|     27|        p->idType = UA_PUBLISHERIDTYPE_UINT32;
  500|     27|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32](ctx, &p->id.uint32, NULL);
  501|     49|    } else if(currentTokenType(ctx) == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (501:15): [True: 47, False: 2]
  ------------------
  502|       |        /* Part 14 encodes both numeric and string PublisherIds as JSON
  503|       |         * strings. Recover numeric ids when the complete token is a UInt64;
  504|       |         * non-numeric strings remain string PublisherIds. */
  505|     47|        size_t index = ctx->index;
  506|     47|        UA_UInt64 numeric = 0;
  507|     47|        status res = decodeJsonJumpTable[UA_DATATYPEKIND_UINT64]
  508|     47|            (ctx, &numeric, &UA_TYPES[UA_TYPES_UINT64]);
  ------------------
  |  |  300|     47|#define UA_TYPES_UINT64 8
  ------------------
  509|     47|        if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     47|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (509:12): [True: 15, False: 32]
  ------------------
  510|     15|            p->idType = UA_PUBLISHERIDTYPE_UINT64;
  511|     15|            p->id.uint64 = numeric;
  512|     15|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     15|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  513|     15|        }
  514|     32|        ctx->index = index;
  515|     32|        p->idType = UA_PUBLISHERIDTYPE_STRING;
  516|     32|        return decodeJsonJumpTable[UA_DATATYPEKIND_STRING](ctx, &p->id.string, NULL);
  517|     47|    }
  518|      2|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  519|     76|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Array_decodeJsonInternal:
  462|  6.21k|                                        const UA_DataType *_) {
  463|  6.21k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  464|       |
  465|       |    /* Array or object */
  466|  6.21k|    size_t length = 1;
  467|  6.21k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_ARRAY) {
  ------------------
  |  Branch (467:8): [True: 2.32k, False: 3.88k]
  ------------------
  468|  2.32k|        length = (size_t)ctx->ctx.tokens[ctx->ctx.index].size;
  469|       |
  470|       |        /* Go to the first array member */
  471|  2.32k|        ctx->ctx.index++;
  472|       |
  473|       |        /* Return early for empty arrays */
  474|  2.32k|        if(length == 0)
  ------------------
  |  Branch (474:12): [True: 9, False: 2.31k]
  ------------------
  475|      9|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      9|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  476|  3.88k|    } else if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (476:15): [True: 340, False: 3.54k]
  ------------------
  477|    340|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    340|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  478|    340|    }
  479|       |
  480|       |    /* Decode array members */
  481|  5.86k|    UA_NetworkMessage *nm = (UA_NetworkMessage*)dst;
  482|  5.86k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (482:23): [True: 5.86k, False: 1]
  ------------------
  483|  5.86k|        status ret = DatasetMessage_Payload_decodeJsonInternal(ctx, nm, i);
  484|  5.86k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.86k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (484:12): [True: 5.86k, False: 1]
  ------------------
  485|  5.86k|            return ret;
  486|  5.86k|    }
  487|       |
  488|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  489|  5.86k|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Payload_decodeJsonInternal:
  407|  5.86k|                                          size_t dsmIndex) {
  408|  5.86k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[dsmIndex];
  409|  5.86k|    UA_ConfigurationVersionDataType cvd = {0};
  410|  5.86k|    UA_String messageType = UA_STRING_NULL;
  411|  5.86k|    struct PayloadData pd;
  412|  5.86k|    pd.nm = nm;
  413|  5.86k|    pd.dsmIndex = dsmIndex;
  414|       |
  415|       |    /* JSON uses UInt32 SequenceNumber and StatusCode. */
  416|  5.86k|    UA_UInt32 sequenceNumber = 0;
  417|  5.86k|    UA_StatusCode statusCode = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.86k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  418|  5.86k|    DecodeEntry entries[7] = {
  419|  5.86k|        {UA_DECODEKEY_DATASETWRITERID, &nm->dataSetWriterIds[dsmIndex], NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  164|  5.86k|#define UA_TYPES_UINT16 4
  ------------------
  420|  5.86k|        {UA_DECODEKEY_SEQUENCENUMBER, &sequenceNumber, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  232|  5.86k|#define UA_TYPES_UINT32 6
  ------------------
  421|  5.86k|        {UA_DECODEKEY_METADATAVERSION, &cvd, &MetaDataVersion_decodeJsonInternal, false, NULL},
  422|  5.86k|        {UA_DECODEKEY_TIMESTAMP, &dsm->header.timestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|  5.86k|#define UA_TYPES_DATETIME 12
  ------------------
  423|  5.86k|        {UA_DECODEKEY_DSM_STATUS, &statusCode,
  424|  5.86k|         &StatusCode_decodeJsonInternal, false, NULL},
  425|  5.86k|        {UA_DECODEKEY_MESSAGETYPE, &messageType, NULL, false,
  426|  5.86k|         &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|  5.86k|#define UA_TYPES_STRING 11
  ------------------
  427|  5.86k|        {UA_DECODEKEY_PAYLOAD, &pd, DataSetPayload_decodeJsonInternal, false, NULL}
  428|  5.86k|    };
  429|  5.86k|    status ret = decodeFieldsAllowUnknown(&ctx->ctx, entries, 7);
  430|       |
  431|  5.86k|    if(ret == UA_STATUSCODE_GOOD && entries[5].found) {
  ------------------
  |  |   17|  11.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (431:8): [True: 2.10k, False: 3.76k]
  |  Branch (431:37): [True: 129, False: 1.97k]
  ------------------
  432|    129|        UA_String keyFrame = UA_STRING("ua-keyframe");
  433|    129|        if(!UA_String_equal(&messageType, &keyFrame))
  ------------------
  |  Branch (433:12): [True: 128, False: 1]
  ------------------
  434|    128|            ret = UA_STATUSCODE_BADNOTSUPPORTED;
  ------------------
  |  |  230|    128|#define UA_STATUSCODE_BADNOTSUPPORTED ((UA_StatusCode) 0x803D0000)
  ------------------
  435|    129|    }
  436|  5.86k|    UA_String_clear(&messageType);
  437|       |
  438|       |    /* Error or no DatasetWriterId found or no payload found */
  439|  5.86k|    if(ret != UA_STATUSCODE_GOOD || !entries[0].found || !entries[6].found)
  ------------------
  |  |   17|  11.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (439:8): [True: 3.88k, False: 1.97k]
  |  Branch (439:37): [True: 1.96k, False: 16]
  |  Branch (439:58): [True: 15, False: 1]
  ------------------
  440|  5.86k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  5.86k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  441|       |
  442|      1|    dsm->header.dataSetMessageSequenceNr = sequenceNumber;
  443|      1|    dsm->header.status = statusCode;
  444|       |
  445|      1|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  446|      1|    dsm->header.dataSetMessageSequenceNrEnabled = entries[1].found;
  447|      1|    dsm->header.configVersionMajorVersion = cvd.majorVersion;
  448|      1|    dsm->header.configVersionMinorVersion = cvd.minorVersion;
  449|      1|    dsm->header.configVersionMajorVersionEnabled = entries[2].found;
  450|      1|    dsm->header.configVersionMinorVersionEnabled = entries[2].found;
  451|      1|    dsm->header.timestampEnabled = entries[3].found;
  452|      1|    dsm->header.statusEnabled = entries[4].found;
  453|       |
  454|      1|    dsm->header.dataSetMessageType = UA_DATASETMESSAGE_DATAKEYFRAME;
  455|      1|    dsm->header.picoSecondsIncluded = false;
  456|      1|    dsm->header.dataSetMessageValid = true;
  457|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  458|  5.86k|}
ua_pubsub_networkmessage_json.c:MetaDataVersion_decodeJsonInternal:
  315|      2|MetaDataVersion_decodeJsonInternal(ParseCtx *ctx, void* cvd, const UA_DataType *_) {
  316|      2|    return decodeJsonJumpTable[UA_DATATYPEKIND_STRUCTURE]
  317|      2|        (ctx, cvd, &UA_TYPES[UA_TYPES_CONFIGURATIONVERSIONDATATYPE]);
  ------------------
  |  | 2153|      2|#define UA_TYPES_CONFIGURATIONVERSIONDATATYPE 57
  ------------------
  318|      2|}
ua_pubsub_networkmessage_json.c:StatusCode_decodeJsonInternal:
  323|    300|                              const UA_DataType *_) {
  324|    300|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (324:8): [True: 295, False: 5]
  ------------------
  325|    295|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32]
  326|    295|            (ctx, statusCode, &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|    295|#define UA_TYPES_UINT32 6
  ------------------
  327|      5|    return decodeJsonJumpTable[UA_DATATYPEKIND_STATUSCODE]
  328|      5|        (ctx, statusCode, &UA_TYPES[UA_TYPES_STATUSCODE]);
  ------------------
  |  |  640|      5|#define UA_TYPES_STATUSCODE 18
  ------------------
  329|    300|}
ua_pubsub_networkmessage_json.c:DataSetPayload_decodeJsonInternal:
  349|  4.96k|DataSetPayload_decodeJsonInternal(ParseCtx *ctx_, void *data, const UA_DataType *_) {
  350|  4.96k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  351|  4.96k|    struct PayloadData *pd = (struct PayloadData*)data;
  352|  4.96k|    UA_NetworkMessage *nm = pd->nm;
  353|  4.96k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[pd->dsmIndex];
  354|       |
  355|  4.96k|    dsm->header.dataSetMessageValid = true;
  356|       |
  357|  4.96k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (357:8): [True: 1, False: 4.96k]
  ------------------
  358|      1|        ctx->ctx.index++;
  359|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  360|      1|    }
  361|       |
  362|  4.96k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (362:8): [True: 3, False: 4.95k]
  ------------------
  363|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  364|       |
  365|       |    /* The number of key-value pairs */
  366|  4.95k|    UA_assert(ctx->ctx.tokens[ctx->ctx.index].size % 2 == 0);
  ------------------
  |  |  399|  4.95k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (366:5): [True: 4.95k, False: 0]
  ------------------
  367|  4.95k|    size_t length = (size_t)(ctx->ctx.tokens[ctx->ctx.index].size) / 2;
  368|       |
  369|  4.95k|    if(length > UA_UINT16_MAX)
  ------------------
  |  |   92|  4.95k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (369:8): [True: 1, False: 4.95k]
  ------------------
  370|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  371|       |
  372|  4.95k|    dsm->data.keyFrameFields = (UA_DataValue *)
  373|  4.95k|        UA_Array_new(length, &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  776|  4.95k|#define UA_TYPES_DATAVALUE 22
  ------------------
  374|  4.95k|    if(!dsm->data.keyFrameFields)
  ------------------
  |  Branch (374:8): [True: 6, False: 4.95k]
  ------------------
  375|      6|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      6|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  376|  4.95k|    dsm->fieldCount = (UA_UInt16)length;
  377|       |
  378|  4.95k|    const UA_DataSetMessage_EncodingMetaData *emd =
  379|  4.95k|            findEncodingMetaData(&ctx->eo, nm->dataSetWriterIds[pd->dsmIndex]);
  380|       |
  381|       |    /* Iterate over the key/value pairs in the object. Keys are stored in fieldnames. */
  382|  4.95k|    ctx->ctx.index++; /* Go to the first key */
  383|  4.95k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.95k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  384|  27.5k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (384:23): [True: 25.8k, False: 1.64k]
  ------------------
  385|  25.8k|        UA_assert(currentTokenType(&ctx->ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  25.8k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (385:9): [True: 25.8k, False: 0]
  ------------------
  386|  25.8k|        UA_String fieldName = UA_STRING_NULL;
  387|  25.8k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_STRING](&ctx->ctx, &fieldName, NULL);
  388|  25.8k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  25.8k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  25.8k|    do {                                                                                 \
  |  |  |  |  173|  25.8k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  579|  25.8k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (579:25): [True: 3, False: 25.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|      3|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|      3|        }                                                                                \
  |  |  |  |  176|  25.8k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 25.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  389|       |
  390|  25.8k|        size_t index = decodingFieldIndex(emd, fieldName, i);
  391|  25.8k|        if(index >= length) {
  ------------------
  |  Branch (391:12): [True: 0, False: 25.8k]
  ------------------
  392|      0|            UA_String_clear(&fieldName);
  393|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  394|      0|        }
  395|  25.8k|        UA_DataValue_clear(&dsm->data.keyFrameFields[index]);
  396|  25.8k|        UA_String_clear(&fieldName);
  397|  25.8k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_DATAVALUE]
  398|  25.8k|            (&ctx->ctx, &dsm->data.keyFrameFields[index], NULL);
  399|  25.8k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  25.8k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  25.8k|    do {                                                                                 \
  |  |  |  |  173|  25.8k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  579|  25.8k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (579:25): [True: 3.30k, False: 22.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|  3.30k|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|  3.30k|        }                                                                                \
  |  |  |  |  176|  25.8k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 22.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|  25.8k|    }
  401|       |
  402|  1.64k|    return ret;
  403|  4.95k|}
ua_pubsub_networkmessage_json.c:decodingFieldIndex:
  333|  25.8k|                   UA_String name, size_t origIndex) {
  334|  25.8k|    if(!emd)
  ------------------
  |  Branch (334:8): [True: 25.8k, False: 0]
  ------------------
  335|  25.8k|        return origIndex;
  336|      0|    for(size_t i = 0; i < emd->fieldsSize; i++) {
  ------------------
  |  Branch (336:23): [True: 0, False: 0]
  ------------------
  337|      0|        if(UA_String_equal(&name, &emd->fields[i].name))
  ------------------
  |  Branch (337:12): [True: 0, False: 0]
  ------------------
  338|      0|            return i;
  339|      0|    }
  340|      0|    return origIndex;
  341|      0|}

UA_findDataTypeWithCustom:
   66|  22.3k|                          const UA_DataTypeArray *customTypes) {
   67|       |    /* Always look in built-in types first (may contain data types from all
   68|       |     * namespaces).
   69|       |     *
   70|       |     * TODO: The standard-defined types are ordered. See if binary search is
   71|       |     * more efficient. */
   72|  3.83M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  3.83M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (72:23): [True: 3.82M, False: 8.61k]
  ------------------
   73|  3.82M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (73:12): [True: 13.6k, False: 3.81M]
  ------------------
   74|  13.6k|            return &UA_TYPES[i];
   75|  3.82M|    }
   76|       |
   77|       |    /* Search in the customTypes */
   78|  8.61k|    while(customTypes) {
  ------------------
  |  Branch (78:11): [True: 0, False: 8.61k]
  ------------------
   79|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (79:27): [True: 0, False: 0]
  ------------------
   80|      0|            if(nodeIdOrder(&customTypes->types[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (80:16): [True: 0, False: 0]
  ------------------
   81|      0|                return &customTypes->types[i];
   82|      0|        }
   83|      0|        customTypes = customTypes->next;
   84|      0|    }
   85|       |
   86|  8.61k|    return NULL;
   87|  8.61k|}
UA_STRING:
  223|    129|UA_STRING(char *chars) {
  224|    129|    UA_String s = {0, NULL};
  225|    129|    if(!chars)
  ------------------
  |  Branch (225:8): [True: 0, False: 129]
  ------------------
  226|      0|        return s;
  227|    129|    s.length = strlen(chars);
  228|    129|    s.data = (UA_Byte*)chars;
  229|    129|    return s;
  230|    129|}
UA_DateTime_fromStruct:
  515|    104|UA_DateTime_fromStruct(UA_DateTimeStruct ts) {
  516|       |    /* Seconds since the Unix epoch */
  517|    104|    struct musl_tm tm;
  518|    104|    memset(&tm, 0, sizeof(struct musl_tm));
  519|    104|    tm.tm_year = ts.year - 1900;
  520|    104|    tm.tm_mon = ts.month - 1;
  521|    104|    tm.tm_mday = ts.day;
  522|    104|    tm.tm_hour = ts.hour;
  523|    104|    tm.tm_min = ts.min;
  524|    104|    tm.tm_sec = ts.sec;
  525|    104|    long long sec_epoch = musl_tm_to_secs(&tm);
  526|       |
  527|    104|    UA_DateTime t = UA_DATETIME_UNIX_EPOCH;
  ------------------
  |  |  328|    104|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|    104|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|    104|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|    104|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  528|    104|    t += sec_epoch * UA_DATETIME_SEC;
  ------------------
  |  |  286|    104|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|    104|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    104|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  529|    104|    t += ts.milliSec * UA_DATETIME_MSEC;
  ------------------
  |  |  285|    104|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    104|#define UA_DATETIME_USEC 10LL
  |  |  ------------------
  ------------------
  530|    104|    t += ts.microSec * UA_DATETIME_USEC;
  ------------------
  |  |  284|    104|#define UA_DATETIME_USEC 10LL
  ------------------
  531|    104|    t += ts.nanoSec / 100;
  532|    104|    return t;
  533|    104|}
UA_ByteString_allocBuffer:
  762|  8.34k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  763|  8.34k|    UA_ByteString_init(bs);
  764|  8.34k|    if(length == 0) {
  ------------------
  |  Branch (764:8): [True: 0, False: 8.34k]
  ------------------
  765|      0|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  766|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  767|      0|    }
  768|  8.34k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  8.34k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  769|  8.34k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  579|  8.34k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 4, False: 8.33k]
  |  |  ------------------
  ------------------
  770|      4|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      4|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  771|  8.33k|    bs->length = length;
  772|  8.33k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  773|  8.34k|}
UA_new:
 1928|  32.9k|UA_new(const UA_DataType *type) {
 1929|  32.9k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  32.9k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1930|  32.9k|    return p;
 1931|  32.9k|}
UA_copy:
 2104|  18.0k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2105|  18.0k|    memset(dst, 0, type->memSize); /* init */
 2106|  18.0k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2107|  18.0k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  18.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2107:8): [True: 5, False: 18.0k]
  ------------------
 2108|      5|        UA_clear(dst, type);
 2109|  18.0k|    return retval;
 2110|  18.0k|}
UA_clear:
 2207|   422k|UA_clear(void *p, const UA_DataType *type) {
 2208|   422k|    clearJumpTable[type->typeKind](p, type);
 2209|   422k|    memset(p, 0, type->memSize); /* init */
 2210|   422k|}
UA_delete:
 2213|  9.35k|UA_delete(void *p, const UA_DataType *type) {
 2214|  9.35k|    clearJumpTable[type->typeKind](p, type);
 2215|  9.35k|    UA_free(p);
  ------------------
  |  |   19|  9.35k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2216|  9.35k|}
UA_order:
 2681|    129|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2682|    129|    return orderJumpTable[type->typeKind](p1, p2, type);
 2683|    129|}
UA_Array_new:
 2695|  4.95k|UA_Array_new(size_t size, const UA_DataType *type) {
 2696|  4.95k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  101|  4.95k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2696:8): [True: 0, False: 4.95k]
  ------------------
 2697|      0|        return NULL;
 2698|  4.95k|    if(size == 0)
  ------------------
  |  Branch (2698:8): [True: 4, False: 4.95k]
  ------------------
 2699|      4|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      4|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2700|  4.95k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2700:8): [True: 0, False: 4.95k]
  ------------------
 2701|      0|        return NULL;
 2702|  4.95k|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  4.95k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2703|  4.95k|}
UA_Array_copy:
 2707|  18.0k|              void **dst, const UA_DataType *type) {
 2708|  18.0k|    if(size == 0) {
  ------------------
  |  Branch (2708:8): [True: 4.12k, False: 13.9k]
  ------------------
 2709|  4.12k|        if(src == NULL)
  ------------------
  |  Branch (2709:12): [True: 0, False: 4.12k]
  ------------------
 2710|      0|            *dst = NULL;
 2711|  4.12k|        else
 2712|  4.12k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  4.12k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2713|  4.12k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.12k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2714|  4.12k|    }
 2715|       |
 2716|       |    /* Check the array consistency -- defensive programming in case the user
 2717|       |     * manually created an inconsistent array */
 2718|  13.9k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  579|  27.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 13.9k]
  |  |  |  Branch (579:43): [True: 0, False: 13.9k]
  |  |  |  Branch (579:43): [True: 0, False: 13.9k]
  |  |  ------------------
  ------------------
 2719|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2720|       |
 2721|  13.9k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2721:8): [True: 0, False: 13.9k]
  ------------------
 2722|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2723|  13.9k|    size_t byteSize = size * type->memSize;
 2724|       |
 2725|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2726|  13.9k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  13.9k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2727|  13.9k|    if(!*dst)
  ------------------
  |  Branch (2727:8): [True: 5, False: 13.9k]
  ------------------
 2728|      5|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2729|       |
 2730|  13.9k|    if(type->pointerFree) {
  ------------------
  |  Branch (2730:8): [True: 13.9k, False: 0]
  ------------------
 2731|  13.9k|        memcpy(*dst, src, byteSize);
 2732|  13.9k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  13.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2733|  13.9k|    }
 2734|       |
 2735|      0|    uintptr_t ptrs = (uintptr_t)src;
 2736|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2737|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2738|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2738:23): [True: 0, False: 0]
  ------------------
 2739|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2740|      0|        ptrs += type->memSize;
 2741|      0|        ptrd += type->memSize;
 2742|      0|    }
 2743|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2743:8): [True: 0, False: 0]
  ------------------
 2744|      0|        UA_Array_delete(*dst, size, type);
 2745|       |        *dst = NULL;
 2746|      0|    }
 2747|      0|    return retval;
 2748|  13.9k|}
UA_Array_delete:
 2850|   227k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2851|   227k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2851:8): [True: 49.1k, False: 178k]
  ------------------
 2852|  49.1k|        uintptr_t ptr = (uintptr_t)p;
 2853|   339k|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2853:27): [True: 290k, False: 49.1k]
  ------------------
 2854|   290k|            UA_clear((void*)ptr, type);
 2855|   290k|            ptr += type->memSize;
 2856|   290k|        }
 2857|  49.1k|    }
 2858|   227k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|   227k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2859|   227k|}
ua_types.c:Variant_clear:
 1384|   258k|Variant_clear(void *p, const UA_DataType *_) {
 1385|   258k|    UA_Variant *v = (UA_Variant *)p;
 1386|       |
 1387|       |    /* The content is "borrowed" */
 1388|   258k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1388:8): [True: 0, False: 258k]
  ------------------
 1389|      0|        return;
 1390|       |
 1391|       |    /* Delete the value */
 1392|   258k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  756|  35.0k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1392:8): [True: 35.0k, False: 223k]
  |  Branch (1392:19): [True: 32.0k, False: 3.02k]
  ------------------
 1393|  32.0k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1393:12): [True: 23.5k, False: 8.53k]
  ------------------
 1394|  23.5k|            v->arrayLength = 1;
 1395|  32.0k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1396|  32.0k|        v->data = NULL;
 1397|  32.0k|    }
 1398|       |
 1399|       |    /* Delete the array dimensions */
 1400|   258k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  756|   258k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1400:8): [True: 86, False: 258k]
  ------------------
 1401|     86|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|     86|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1402|   258k|}
ua_types.c:DataValue_clear:
 1858|   246k|DataValue_clear(void *p, const UA_DataType *_) {
 1859|   246k|    UA_DataValue *dv = (UA_DataValue *)p;
 1860|       |    Variant_clear(&dv->value, NULL);
 1861|   246k|}
ua_types.c:String_copy:
  284|  18.0k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  285|  18.0k|    const UA_String *srcS = (const UA_String*)src;
  286|  18.0k|    UA_String *dstS = (UA_String *)dst;
  287|  18.0k|    UA_StatusCode res =
  288|  18.0k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  289|  18.0k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|  18.0k|#define UA_TYPES_BYTE 2
  ------------------
  290|  18.0k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  18.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (290:8): [True: 18.0k, False: 5]
  ------------------
  291|  18.0k|        dstS->length = srcS->length;
  292|  18.0k|    return res;
  293|  18.0k|}
ua_types.c:nopClear:
 2169|  37.7k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  296|   159k|String_clear(void *p, const UA_DataType *_) {
  297|   159k|    UA_String *s = (UA_String*)p;
  298|   159k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|   159k|#define UA_TYPES_BYTE 2
  ------------------
  299|   159k|}
ua_types.c:NodeId_clear:
  777|  51.1k|NodeId_clear(void *p, const UA_DataType *_) {
  778|  51.1k|    UA_NodeId *id = (UA_NodeId*)p;
  779|  51.1k|    switch(id->identifierType) {
  780|  8.55k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (780:5): [True: 8.55k, False: 42.5k]
  ------------------
  781|  9.63k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (781:5): [True: 1.08k, False: 50.0k]
  ------------------
  782|  9.63k|        String_clear(&id->identifier.string, NULL);
  783|  9.63k|        break;
  784|  41.5k|    default: break;
  ------------------
  |  Branch (784:5): [True: 41.5k, False: 9.63k]
  ------------------
  785|  51.1k|    }
  786|  51.1k|}
ua_types.c:ExpandedNodeId_clear:
 1078|  4.66k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1079|  4.66k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1080|  4.66k|    NodeId_clear(&id->nodeId, NULL);
 1081|       |    String_clear(&id->namespaceUri, NULL);
 1082|  4.66k|}
ua_types.c:QualifiedName_clear:
  402|  9.04k|QualifiedName_clear(void *p, const UA_DataType *_) {
  403|  9.04k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  404|       |    String_clear(&qn->name, NULL);
  405|  9.04k|}
ua_types.c:LocalizedText_clear:
 1841|  2.17k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1842|  2.17k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1843|  2.17k|    String_clear(&lt->locale, NULL);
 1844|       |    String_clear(&lt->text, NULL);
 1845|  2.17k|}
ua_types.c:ExtensionObject_clear:
 1251|  35.2k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1252|  35.2k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1253|  35.2k|    switch(eo->encoding) {
 1254|  14.1k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1254:5): [True: 14.1k, False: 21.1k]
  ------------------
 1255|  14.5k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1255:5): [True: 438, False: 34.7k]
  ------------------
 1256|  17.5k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1256:5): [True: 2.97k, False: 32.2k]
  ------------------
 1257|  25.8k|    case UA_EXTENSIONOBJECT_ENCODED_JSON:
  ------------------
  |  Branch (1257:5): [True: 8.34k, False: 26.8k]
  ------------------
 1258|  25.8k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1259|  25.8k|        String_clear(&eo->content.encoded.body, NULL);
 1260|  25.8k|        break;
 1261|  9.35k|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1261:5): [True: 9.35k, False: 25.8k]
  ------------------
 1262|  9.35k|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1262:12): [True: 9.35k, False: 0]
  ------------------
 1263|  9.35k|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1264|  9.35k|        break;
 1265|      0|    default:
  ------------------
  |  Branch (1265:5): [True: 0, False: 35.2k]
  ------------------
 1266|      0|        break;
 1267|  35.2k|    }
 1268|  35.2k|}
ua_types.c:DiagnosticInfo_clear:
 1888|  9.62k|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1889|  9.62k|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1890|       |
 1891|  9.62k|    String_clear(&di->additionalInfo, NULL);
 1892|  9.62k|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1892:8): [True: 1, False: 9.62k]
  |  Branch (1892:38): [True: 1, False: 0]
  ------------------
 1893|      1|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1894|      1|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      1|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1895|      1|    }
 1896|  9.62k|}
ua_types.c:clearStructure:
 2113|  19.8k|clearStructure(void *p, const UA_DataType *type) {
 2114|  19.8k|    uintptr_t ptr = (uintptr_t)p;
 2115|   109k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2115:23): [True: 90.1k, False: 19.8k]
  ------------------
 2116|  90.1k|        const UA_DataTypeMember *m = &type->members[i];
 2117|  90.1k|        const UA_DataType *mt = m->memberType;
 2118|  90.1k|        ptr += m->padding;
 2119|  90.1k|        if(!m->isOptional) {
  ------------------
  |  Branch (2119:12): [True: 90.1k, False: 0]
  ------------------
 2120|  90.1k|            if(!m->isArray) {
  ------------------
  |  Branch (2120:16): [True: 61.9k, False: 28.2k]
  ------------------
 2121|  61.9k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2122|  61.9k|                ptr += mt->memSize;
 2123|  61.9k|            } else {
 2124|  28.2k|                size_t length = *(size_t*)ptr;
 2125|  28.2k|                ptr += sizeof(size_t);
 2126|  28.2k|                UA_Array_delete(*(void**)ptr, length, mt);
 2127|  28.2k|                ptr += sizeof(void*);
 2128|  28.2k|            }
 2129|  90.1k|        } else { /* field is optional */
 2130|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2130:16): [True: 0, False: 0]
  ------------------
 2131|       |                /* optional scalar field is contained */
 2132|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2132:20): [True: 0, False: 0]
  ------------------
 2133|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2134|      0|                ptr += sizeof(void *);
 2135|      0|            } else {
 2136|       |                /* optional array field is contained */
 2137|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2137:20): [True: 0, False: 0]
  ------------------
 2138|      0|                    size_t length = *(size_t *)ptr;
 2139|      0|                    ptr += sizeof(size_t);
 2140|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2141|      0|                    ptr += sizeof(void *);
 2142|      0|                } else { /* optional array field not contained */
 2143|      0|                    ptr += sizeof(size_t);
 2144|      0|                    ptr += sizeof(void *);
 2145|      0|                }
 2146|      0|            }
 2147|      0|        }
 2148|  90.1k|    }
 2149|  19.8k|}
ua_types.c:nodeIdOrder:
 2299|  3.82M|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2300|  3.82M|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2301|  3.82M|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2302|       |    /* Compare namespaceIndex */
 2303|  3.82M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2303:8): [True: 89.2k, False: 3.73M]
  ------------------
 2304|  89.2k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2304:16): [True: 89.2k, False: 0]
  ------------------
 2305|       |
 2306|       |    /* Compare identifierType */
 2307|  3.73M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2307:8): [True: 993k, False: 2.74M]
  ------------------
 2308|   993k|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2308:16): [True: 993k, False: 0]
  ------------------
 2309|       |
 2310|       |    /* Compare the identifier */
 2311|  2.74M|    switch(p1->identifierType) {
 2312|  2.74M|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2312:5): [True: 2.74M, False: 0]
  ------------------
 2313|  2.74M|    default:
  ------------------
  |  Branch (2313:5): [True: 0, False: 2.74M]
  ------------------
 2314|  2.74M|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2314:12): [True: 2.73M, False: 13.6k]
  ------------------
 2315|  2.73M|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2315:20): [True: 305k, False: 2.42M]
  ------------------
 2316|  2.42M|                UA_ORDER_LESS : UA_ORDER_MORE;
 2317|  13.6k|        return UA_ORDER_EQ;
 2318|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2318:5): [True: 0, False: 2.74M]
  ------------------
 2319|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2320|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2320:5): [True: 0, False: 2.74M]
  ------------------
 2321|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2321:5): [True: 0, False: 2.74M]
  ------------------
 2322|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2323|  2.74M|    }
 2324|  2.74M|}
ua_types.c:stringOrder:
 2282|    129|stringOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2283|    129|    const UA_String *p1 = (const UA_String*)p1_;
 2284|    129|    const UA_String *p2 = (const UA_String*)p2_;
 2285|    129|    if(p1->length != p2->length)
  ------------------
  |  Branch (2285:8): [True: 42, False: 87]
  ------------------
 2286|     42|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2286:16): [True: 4, False: 38]
  ------------------
 2287|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2288|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2289|     87|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2289:8): [True: 0, False: 87]
  ------------------
 2290|     87|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2290:8): [True: 0, False: 87]
  ------------------
 2291|     87|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2291:8): [True: 0, False: 87]
  ------------------
 2292|     87|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2293|     87|    if(cmp != 0)
  ------------------
  |  Branch (2293:8): [True: 86, False: 1]
  ------------------
 2294|     86|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2294:16): [True: 34, False: 52]
  ------------------
 2295|      1|    return UA_ORDER_EQ;
 2296|     87|}

lookAheadForKey:
 1809|   165k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1810|       |    /* The current index must point to the beginning of an object.
 1811|       |     * This has to be ensured by the caller. */
 1812|   165k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|   165k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1812:5): [True: 165k, False: 0]
  ------------------
 1813|       |
 1814|   165k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  233|   165k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1815|   165k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1816|   165k|    unsigned int end = ctx->tokens[ctx->index].end;
 1817|   165k|    ctx->index++; /* Move to the first key */
 1818|   900k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1818:11): [True: 895k, False: 4.98k]
  ------------------
 1819|   895k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1819:11): [True: 844k, False: 50.4k]
  ------------------
 1820|       |        /* Key must be a string */
 1821|   844k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|   844k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1821:9): [True: 844k, False: 0]
  ------------------
 1822|       |
 1823|       |        /* Move index to the value */
 1824|   844k|        ctx->index++;
 1825|       |
 1826|       |        /* Value for the key must exist */
 1827|   844k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|   844k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1827:9): [True: 844k, False: 0]
  ------------------
 1828|       |
 1829|       |        /* Compare the key (previous index) */
 1830|   844k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1830:12): [True: 110k, False: 734k]
  ------------------
 1831|   110k|            *resultIndex = ctx->index; /* Point result to the current index */
 1832|   110k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   110k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1833|   110k|            break;
 1834|   110k|        }
 1835|       |
 1836|   734k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1837|   734k|    }
 1838|   165k|    ctx->index = oldIndex; /* Restore the old index */
 1839|   165k|    return ret;
 1840|   165k|}
DiagnosticInfoInner_decodeJson:
 2514|      1|DiagnosticInfoInner_decodeJson(ParseCtx* ctx, void* dst, const UA_DataType* type) {
 2515|      1|    UA_DiagnosticInfo *inner = (UA_DiagnosticInfo*)
 2516|      1|        UA_calloc(1, sizeof(UA_DiagnosticInfo));
  ------------------
  |  |   20|      1|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2517|      1|    if(!inner)
  ------------------
  |  Branch (2517:8): [True: 0, False: 1]
  ------------------
 2518|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2519|      1|    UA_DiagnosticInfo **dst2 = (UA_DiagnosticInfo**)dst;
 2520|      1|    *dst2 = inner;  /* Copy new Pointer do dest */
 2521|      1|    return DiagnosticInfo_decodeJson(ctx, inner, type);
 2522|      1|}
decodeFields:
 2619|  35.3k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2620|       |    return decodeFieldsInternal(ctx, entries, entryCount, false);
 2621|  35.3k|}
decodeFieldsAllowUnknown:
 2625|  12.2k|                         size_t entryCount) {
 2626|       |    return decodeFieldsInternal(ctx, entries, entryCount, true);
 2627|  12.2k|}
tokenize:
 2954|  8.08k|         size_t *decodedLength) {
 2955|       |    /* Tokenize */
 2956|  8.08k|    cj5_options options;
 2957|  8.08k|    options.stop_early = (decodedLength != NULL);
 2958|  8.08k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2959|  8.08k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2960|       |
 2961|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2962|       |     * have needed */
 2963|  8.08k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2963:8): [True: 507, False: 7.58k]
  ------------------
 2964|    507|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2964:8): [True: 507, False: 0]
  ------------------
 2965|       |#if SIZE_MAX <= UINT_MAX
 2966|       |        if((size_t)r.num_tokens > SIZE_MAX / sizeof(cj5_token))
 2967|       |            return UA_STATUSCODE_BADDECODINGERROR;
 2968|       |#endif
 2969|    507|        ctx->tokens = (cj5_token*)
 2970|    507|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    507|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2971|    507|        if(!ctx->tokens)
  ------------------
  |  Branch (2971:12): [True: 2, False: 505]
  ------------------
 2972|      2|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      2|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2973|    505|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2974|    507|    }
 2975|       |
 2976|       |    /* Cannot recover from other errors */
 2977|  7.58k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2977:8): [True: 723, False: 6.85k]
  ------------------
 2978|    723|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    723|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2979|       |
 2980|  6.85k|    if(decodedLength)
  ------------------
  |  Branch (2980:8): [True: 0, False: 6.85k]
  ------------------
 2981|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2982|       |
 2983|       |    /* Set up the context */
 2984|  6.85k|    ctx->json5 = (char*)src->data;
 2985|  6.85k|    ctx->depth = 0;
 2986|  6.85k|    ctx->tokensSize = r.num_tokens;
 2987|  6.85k|    ctx->index = 0;
 2988|  6.85k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.85k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2989|  7.58k|}
ua_types_encoding_json.c:isJsonNullable:
  252|  3.61k|isJsonNullable(const UA_DataType *type) {
  253|  3.61k|    return (type->typeKind >= UA_DATATYPEKIND_STRING &&
  ------------------
  |  Branch (253:13): [True: 3.55k, False: 55]
  ------------------
  254|  3.55k|            type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO &&
  ------------------
  |  Branch (254:13): [True: 3.55k, False: 2]
  ------------------
  255|  3.55k|            type->typeKind != UA_DATATYPEKIND_STATUSCODE);
  ------------------
  |  Branch (255:13): [True: 3.55k, False: 3]
  ------------------
  256|  3.61k|}
ua_types_encoding_json.c:variantDimensionsValid:
  799|  1.02k|                       const UA_UInt32 *dimensions) {
  800|  1.02k|    if(dimensionsSize == 0 || !dimensions)
  ------------------
  |  Branch (800:8): [True: 3, False: 1.02k]
  |  Branch (800:31): [True: 0, False: 1.02k]
  ------------------
  801|      3|        return false;
  802|       |
  803|  1.02k|    size_t total = 1;
  804|  2.21k|    for(size_t i = 0; i < dimensionsSize; i++) {
  ------------------
  |  Branch (804:23): [True: 1.20k, False: 1.01k]
  ------------------
  805|  1.20k|        UA_UInt32 dimension = dimensions[i];
  806|  1.20k|        if(dimension == 0 || total > SIZE_MAX / dimension)
  ------------------
  |  Branch (806:12): [True: 8, False: 1.19k]
  |  Branch (806:30): [True: 1, False: 1.19k]
  ------------------
  807|      9|            return false;
  808|  1.19k|        total *= dimension;
  809|  1.19k|    }
  810|  1.01k|    return total == arrayLength;
  811|  1.02k|}
ua_types_encoding_json.c:jsoneq:
 1353|  1.32M|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1354|       |    /* TODO: necessary?
 1355|       |       if(json == NULL
 1356|       |            || tok == NULL
 1357|       |            || searchKey == NULL) {
 1358|       |        return -1;
 1359|       |    } */
 1360|       |
 1361|  1.32M|    size_t len = getTokenLength(tok);
 1362|  1.32M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1362:8): [True: 1.32M, False: 0]
  ------------------
 1363|  1.32M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1363:8): [True: 226k, False: 1.10M]
  ------------------
 1364|   226k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1364:8): [True: 218k, False: 7.81k]
  ------------------
 1365|   218k|        return 0;
 1366|       |
 1367|  1.10M|    return -1;
 1368|  1.32M|}
ua_types_encoding_json.c:skipObject:
 1337|   940k|skipObject(ParseCtx *ctx) {
 1338|   940k|    unsigned int end = ctx->tokens[ctx->index].end;
 1339|  70.0M|    do {
 1340|  70.0M|        ctx->index++;
 1341|  70.0M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1341:13): [True: 70.0M, False: 11.2k]
  ------------------
 1342|  70.0M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1342:13): [True: 69.1M, False: 929k]
  ------------------
 1343|   940k|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2480|    541|DECODE_JSON(DiagnosticInfo) {
 2481|    541|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2482|    541|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1322|    541|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|    541|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 216, False: 325]
  |  |  ------------------
  |  | 1324|    216|        ctx->index++;                                \
  |  | 1325|    216|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    216|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|    325|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 325]
  |  |  ------------------
  ------------------
 2483|    325|    CHECK_OBJECT;
  ------------------
  |  | 1317|    325|#define CHECK_OBJECT do {                                \
  |  | 1318|    325|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 2, False: 323]
  |  |  ------------------
  |  | 1319|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|    323|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 323]
  |  |  ------------------
  ------------------
 2484|       |
 2485|    323|    DecodeEntry entries[7] = {
 2486|    323|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2487|    323|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|    323|#define UA_TYPES_INT32 5
  ------------------
 2488|    323|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2489|    323|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|    323|#define UA_TYPES_INT32 5
  ------------------
 2490|    323|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2491|    323|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|    323|#define UA_TYPES_INT32 5
  ------------------
 2492|    323|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2493|    323|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|    323|#define UA_TYPES_INT32 5
  ------------------
 2494|    323|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2495|    323|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|    323|#define UA_TYPES_STRING 11
  ------------------
 2496|    323|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2497|    323|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|    323|#define UA_TYPES_STATUSCODE 18
  ------------------
 2498|    323|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2499|    323|         DiagnosticInfoInner_decodeJson, false, NULL}
 2500|    323|    };
 2501|    323|    status ret = decodeFields(ctx, entries, 7);
 2502|       |
 2503|    323|    dst->hasSymbolicId = entries[0].found;
 2504|    323|    dst->hasNamespaceUri = entries[1].found;
 2505|    323|    dst->hasLocalizedText = entries[2].found;
 2506|    323|    dst->hasLocale = entries[3].found;
 2507|    323|    dst->hasAdditionalInfo = entries[4].found;
 2508|    323|    dst->hasInnerStatusCode = entries[5].found;
 2509|    323|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2510|    323|    return ret;
 2511|    325|}
ua_types_encoding_json.c:decodeFieldsInternal:
 2526|  47.6k|                     UA_Boolean allowUnknown) {
 2527|  47.6k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  47.6k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  47.6k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 47.6k]
  |  |  ------------------
  |  | 1299|  47.6k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  47.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 47.6k]
  |  |  ------------------
  ------------------
 2528|  47.6k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1322|  47.6k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  47.6k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 213, False: 47.4k]
  |  |  ------------------
  |  | 1324|    213|        ctx->index++;                                \
  |  | 1325|    213|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    213|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  47.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 47.4k]
  |  |  ------------------
  ------------------
 2529|       |
 2530|  47.4k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |   22|  47.4k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2530:8): [True: 1, False: 47.4k]
  ------------------
 2531|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2532|       |
 2533|       |    /* Keys and values are counted separately */
 2534|  47.4k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  47.4k|#define CHECK_OBJECT do {                                \
  |  | 1318|  47.4k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 21, False: 47.3k]
  |  |  ------------------
  |  | 1319|     21|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  47.3k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 47.3k]
  |  |  ------------------
  ------------------
 2535|  47.3k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  399|  47.3k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2535:5): [True: 47.3k, False: 0]
  ------------------
 2536|  47.3k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2537|       |
 2538|  47.3k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2539|  47.3k|    ctx->depth++;
 2540|       |
 2541|  47.3k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  47.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2542|   139k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2542:25): [True: 102k, False: 37.1k]
  ------------------
 2543|       |        /* Key must be a string */
 2544|   102k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|   102k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2544:9): [True: 102k, False: 0]
  ------------------
 2545|   102k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|   102k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2545:9): [True: 102k, False: 0]
  ------------------
 2546|       |
 2547|       |        /* Search for the decoding entry matching the key. Start at the key
 2548|       |         * index to speed-up the case where they key-order is the same as the
 2549|       |         * entry-order. */
 2550|   102k|        DecodeEntry *entry = NULL;
 2551|   385k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2551:29): [True: 353k, False: 31.9k]
  ------------------
 2552|   353k|            size_t ii = i;
 2553|   177M|            while(ii >= entryCount)
  ------------------
  |  Branch (2553:19): [True: 177M, False: 353k]
  ------------------
 2554|   177M|                ii -= entryCount;
 2555|       |
 2556|       |            /* Compare the key */
 2557|   353k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2557:16): [True: 282k, False: 70.4k]
  ------------------
 2558|   353k|                      entries[ii].fieldName) != 0)
 2559|   282k|                continue;
 2560|       |
 2561|       |            /* Key was already used -> duplicate, abort */
 2562|  70.4k|            if(entries[ii].found) {
  ------------------
  |  Branch (2562:16): [True: 3, False: 70.4k]
  ------------------
 2563|      3|                ctx->depth--;
 2564|      3|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2565|      3|            }
 2566|       |
 2567|       |            /* Found the key */
 2568|  70.4k|            entries[ii].found = true;
 2569|  70.4k|            entry = &entries[ii];
 2570|  70.4k|            break;
 2571|  70.4k|        }
 2572|       |
 2573|       |        /* The key is unknown */
 2574|   102k|        if(!entry) {
  ------------------
  |  Branch (2574:12): [True: 31.9k, False: 70.4k]
  ------------------
 2575|  31.9k|            if(allowUnknown) {
  ------------------
  |  Branch (2575:16): [True: 31.8k, False: 75]
  ------------------
 2576|  31.8k|                ctx->index++; /* key -> value */
 2577|  31.8k|                skipObject(ctx);
 2578|  31.8k|                continue;
 2579|  31.8k|            }
 2580|     75|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     75|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2581|     75|            break;
 2582|  31.9k|        }
 2583|       |
 2584|       |        /* Go from key to value */
 2585|  70.4k|        ctx->index++;
 2586|  70.4k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  70.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2586:9): [True: 70.4k, False: 0]
  ------------------
 2587|       |
 2588|       |        /* An entry that was expected but shall not be decoded.
 2589|       |         * Jump over the value. */
 2590|  70.4k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2590:12): [True: 58.7k, False: 11.7k]
  |  Branch (2590:32): [True: 57.4k, False: 1.27k]
  ------------------
 2591|  57.4k|            skipObject(ctx);
 2592|  57.4k|            continue;
 2593|  57.4k|        }
 2594|       |
 2595|       |        /* A null-value is only valid for nullable fields. */
 2596|  12.9k|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2596:12): [True: 172, False: 12.8k]
  |  Branch (2596:55): [True: 46, False: 126]
  ------------------
 2597|     46|            if(!entry->type || !isJsonNullable(entry->type)) {
  ------------------
  |  Branch (2597:16): [True: 0, False: 46]
  |  Branch (2597:32): [True: 8, False: 38]
  ------------------
 2598|      8|                ctx->depth--;
 2599|      8|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2600|      8|            }
 2601|     38|            ctx->index++; /* skip null value */
 2602|     38|            continue;
 2603|     46|        }
 2604|       |
 2605|       |        /* Decode. This also moves to the next key or right after the object for
 2606|       |         * the last value. */
 2607|  12.9k|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2607:42): [True: 11.7k, False: 1.23k]
  ------------------
 2608|  11.7k|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2609|  12.9k|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2610|  12.9k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  12.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2610:12): [True: 10.1k, False: 2.79k]
  ------------------
 2611|  10.1k|            break;
 2612|  12.9k|    }
 2613|       |
 2614|  47.3k|    ctx->depth--;
 2615|  47.3k|    return ret;
 2616|  47.3k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1426|    185|DECODE_JSON(Boolean) {
 1427|    185|    UA_Boolean *dst = (UA_Boolean*)p;
 1428|    185|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|    185|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|    185|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 185]
  |  |  ------------------
  |  | 1299|    185|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|    185|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 185]
  |  |  ------------------
  ------------------
 1429|    185|    CHECK_BOOL;
  ------------------
  |  | 1307|    185|#define CHECK_BOOL do {                                \
  |  | 1308|    185|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1308:8): [True: 45, False: 140]
  |  |  ------------------
  |  | 1309|     45|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   44|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1310|    140|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1310:14): [Folded, False: 140]
  |  |  ------------------
  ------------------
 1430|    140|    GET_TOKEN;
  ------------------
  |  | 1293|    140|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|    140|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|    140|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 140]
  |  |  ------------------
  ------------------
 1431|       |
 1432|    140|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1432:8): [True: 74, False: 66]
  ------------------
 1433|     74|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1433:8): [True: 74, False: 0]
  |  Branch (1433:38): [True: 74, False: 0]
  ------------------
 1434|     74|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1434:8): [True: 74, False: 0]
  |  Branch (1434:38): [True: 74, False: 0]
  ------------------
 1435|     74|        *dst = true;
 1436|     74|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1436:15): [True: 66, False: 0]
  ------------------
 1437|     66|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1437:15): [True: 66, False: 0]
  |  Branch (1437:45): [True: 66, False: 0]
  ------------------
 1438|     66|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1438:15): [True: 66, False: 0]
  |  Branch (1438:45): [True: 66, False: 0]
  ------------------
 1439|     66|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1439:15): [True: 66, False: 0]
  ------------------
 1440|     66|        *dst = false;
 1441|     66|    } else {
 1442|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1443|      0|    }
 1444|       |
 1445|    140|    ctx->index++;
 1446|    140|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    140|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1447|    140|}
ua_types_encoding_json.c:SByte_decodeJson:
 1534|   387k|DECODE_JSON(SByte) {
 1535|   387k|    UA_SByte *dst = (UA_SByte*)p;
 1536|   387k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   387k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   387k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 387k]
  |  |  ------------------
  |  | 1299|   387k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   387k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 387k]
  |  |  ------------------
  ------------------
 1537|   387k|    CHECK_NUMBER;
  ------------------
  |  | 1302|   387k|#define CHECK_NUMBER do {                                \
  |  | 1303|   387k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 21, False: 387k]
  |  |  ------------------
  |  | 1304|     21|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|   387k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 387k]
  |  |  ------------------
  ------------------
 1538|   387k|    GET_TOKEN;
  ------------------
  |  | 1293|   387k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   387k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   387k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 387k]
  |  |  ------------------
  ------------------
 1539|   387k|    UA_Int64 out = 0;
 1540|   387k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1541|   387k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|   775k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   774k|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   65|   387k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1541:8): [True: 58, False: 387k]
  |  Branch (1541:35): [True: 101, False: 387k]
  |  Branch (1541:57): [True: 39, False: 387k]
  ------------------
 1542|    198|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    198|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1543|   387k|    *dst = (UA_SByte)out;
 1544|   387k|    ctx->index++;
 1545|   387k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   387k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1546|   387k|}
ua_types_encoding_json.c:parseSignedInteger:
 1466|  1.56M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1467|  1.56M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1468|  1.56M|    if(len == 0)
  ------------------
  |  Branch (1468:8): [True: 120, False: 1.56M]
  ------------------
 1469|    120|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    120|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1470|       |
 1471|       |    /* There must only be whitespace between the end of the parsed number and
 1472|       |     * the end of the token */
 1473|  2.34M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1473:25): [True: 786k, False: 1.56M]
  ------------------
 1474|   786k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1474:12): [True: 499k, False: 287k]
  |  Branch (1474:35): [True: 122, False: 499k]
  ------------------
 1475|    122|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    122|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1476|   786k|    }
 1477|       |
 1478|  1.56M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.56M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1479|  1.56M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1481|   529k|DECODE_JSON(Byte) {
 1482|   529k|    UA_Byte *dst = (UA_Byte*)p;
 1483|   529k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   529k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   529k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 529k]
  |  |  ------------------
  |  | 1299|   529k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   529k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 529k]
  |  |  ------------------
  ------------------
 1484|   529k|    CHECK_NUMBER;
  ------------------
  |  | 1302|   529k|#define CHECK_NUMBER do {                                \
  |  | 1303|   529k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 11, False: 529k]
  |  |  ------------------
  |  | 1304|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|   529k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 529k]
  |  |  ------------------
  ------------------
 1485|   529k|    GET_TOKEN;
  ------------------
  |  | 1293|   529k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   529k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   529k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 529k]
  |  |  ------------------
  ------------------
 1486|   529k|    UA_UInt64 out = 0;
 1487|   529k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1488|   529k|    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)
  ------------------
  |  |   74|   529k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1488:8): [True: 34, False: 529k]
  |  Branch (1488:35): [True: 101, False: 529k]
  ------------------
 1489|    135|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    135|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1490|   529k|    *dst = (UA_Byte)out;
 1491|   529k|    ctx->index++;
 1492|   529k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   529k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1493|   529k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1450|  1.30M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1451|  1.30M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1452|  1.30M|    if(len == 0)
  ------------------
  |  Branch (1452:8): [True: 108, False: 1.30M]
  ------------------
 1453|    108|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    108|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1454|       |
 1455|       |    /* There must only be whitespace between the end of the parsed number and
 1456|       |     * the end of the token */
 1457|  1.77M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1457:25): [True: 465k, False: 1.30M]
  ------------------
 1458|   465k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1458:12): [True: 32.1k, False: 433k]
  |  Branch (1458:35): [True: 128, False: 32.0k]
  ------------------
 1459|    128|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    128|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1460|   465k|    }
 1461|       |
 1462|  1.30M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.30M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1463|  1.30M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1548|  4.70k|DECODE_JSON(Int16) {
 1549|  4.70k|    UA_Int16 *dst = (UA_Int16*)p;
 1550|  4.70k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  4.70k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  4.70k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 4.70k]
  |  |  ------------------
  |  | 1299|  4.70k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  4.70k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
 1551|  4.70k|    CHECK_NUMBER;
  ------------------
  |  | 1302|  4.70k|#define CHECK_NUMBER do {                                \
  |  | 1303|  4.70k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 9, False: 4.69k]
  |  |  ------------------
  |  | 1304|      9|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|  4.69k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 4.69k]
  |  |  ------------------
  ------------------
 1552|  4.69k|    GET_TOKEN;
  ------------------
  |  | 1293|  4.69k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  4.69k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  4.69k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 4.69k]
  |  |  ------------------
  ------------------
 1553|  4.69k|    UA_Int64 out = 0;
 1554|  4.69k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1555|  4.69k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|  9.38k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|  9.36k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   83|  4.57k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1555:8): [True: 26, False: 4.66k]
  |  Branch (1555:35): [True: 94, False: 4.57k]
  |  Branch (1555:57): [True: 39, False: 4.53k]
  ------------------
 1556|    159|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    159|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1557|  4.53k|    *dst = (UA_Int16)out;
 1558|  4.53k|    ctx->index++;
 1559|  4.53k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.53k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1560|  4.69k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1495|   555k|DECODE_JSON(UInt16) {
 1496|   555k|    UA_UInt16 *dst = (UA_UInt16*)p;
 1497|   555k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   555k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   555k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 555k]
  |  |  ------------------
  |  | 1299|   555k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   555k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 555k]
  |  |  ------------------
  ------------------
 1498|   555k|    CHECK_NUMBER;
  ------------------
  |  | 1302|   555k|#define CHECK_NUMBER do {                                \
  |  | 1303|   555k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 13, False: 555k]
  |  |  ------------------
  |  | 1304|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|   555k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 555k]
  |  |  ------------------
  ------------------
 1499|   555k|    GET_TOKEN;
  ------------------
  |  | 1293|   555k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   555k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   555k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 555k]
  |  |  ------------------
  ------------------
 1500|   555k|    UA_UInt64 out = 0;
 1501|   555k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1502|   555k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   17|  1.11M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   92|   555k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1502:8): [True: 28, False: 555k]
  |  Branch (1502:35): [True: 79, False: 555k]
  ------------------
 1503|    107|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    107|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1504|   555k|    *dst = (UA_UInt16)out;
 1505|   555k|    ctx->index++;
 1506|   555k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   555k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1507|   555k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1562|   318k|DECODE_JSON(Int32) {
 1563|   318k|    UA_Int32 *dst = (UA_Int32*)p;
 1564|   318k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   318k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   318k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 318k]
  |  |  ------------------
  |  | 1299|   318k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   318k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 318k]
  |  |  ------------------
  ------------------
 1565|   318k|    CHECK_NUMBER;
  ------------------
  |  | 1302|   318k|#define CHECK_NUMBER do {                                \
  |  | 1303|   318k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 12, False: 318k]
  |  |  ------------------
  |  | 1304|     12|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|   318k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 318k]
  |  |  ------------------
  ------------------
 1566|   318k|    GET_TOKEN;
  ------------------
  |  | 1293|   318k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   318k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   318k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 318k]
  |  |  ------------------
  ------------------
 1567|   318k|    UA_Int64 out = 0;
 1568|   318k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1569|   318k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|   636k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|   636k|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  101|   317k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1569:8): [True: 69, False: 318k]
  |  Branch (1569:35): [True: 136, False: 317k]
  |  Branch (1569:57): [True: 9, False: 317k]
  ------------------
 1570|    214|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    214|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1571|   317k|    *dst = (UA_Int32)out;
 1572|   317k|    ctx->index++;
 1573|   317k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   317k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1574|   318k|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1509|  38.3k|DECODE_JSON(UInt32) {
 1510|  38.3k|    UA_UInt32 *dst = (UA_UInt32*)p;
 1511|  38.3k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  38.3k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  38.3k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 38.3k]
  |  |  ------------------
  |  | 1299|  38.3k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  38.3k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 38.3k]
  |  |  ------------------
  ------------------
 1512|  38.3k|    CHECK_NUMBER;
  ------------------
  |  | 1302|  38.3k|#define CHECK_NUMBER do {                                \
  |  | 1303|  38.3k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 38, False: 38.2k]
  |  |  ------------------
  |  | 1304|     38|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     38|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|  38.2k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 38.2k]
  |  |  ------------------
  ------------------
 1513|  38.2k|    GET_TOKEN;
  ------------------
  |  | 1293|  38.2k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  38.2k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  38.2k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 38.2k]
  |  |  ------------------
  ------------------
 1514|  38.2k|    UA_UInt64 out = 0;
 1515|  38.2k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1516|  38.2k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|  76.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  110|  38.1k|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1516:8): [True: 102, False: 38.1k]
  |  Branch (1516:35): [True: 153, False: 38.0k]
  ------------------
 1517|    255|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    255|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1518|  38.0k|    *dst = (UA_UInt32)out;
 1519|  38.0k|    ctx->index++;
 1520|  38.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  38.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1521|  38.2k|}
ua_types_encoding_json.c:Int64_decodeJson:
 1576|   851k|DECODE_JSON(Int64) {
 1577|   851k|    UA_Int64 *dst = (UA_Int64*)p;
 1578|   851k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   851k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   851k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 851k]
  |  |  ------------------
  |  | 1299|   851k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   851k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 851k]
  |  |  ------------------
  ------------------
 1579|   851k|    GET_TOKEN;
  ------------------
  |  | 1293|   851k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   851k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   851k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 851k]
  |  |  ------------------
  ------------------
 1580|   851k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1581|   851k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   851k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1581:8): [True: 89, False: 851k]
  ------------------
 1582|     89|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     89|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1583|   851k|    ctx->index++;
 1584|   851k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   851k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1585|   851k|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1523|   184k|DECODE_JSON(UInt64) {
 1524|   184k|    UA_UInt64 *dst = (UA_UInt64*)p;
 1525|   184k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   184k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   184k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 184k]
  |  |  ------------------
  |  | 1299|   184k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   184k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 184k]
  |  |  ------------------
  ------------------
 1526|   184k|    GET_TOKEN;
  ------------------
  |  | 1293|   184k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   184k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   184k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 184k]
  |  |  ------------------
  ------------------
 1527|   184k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1528|   184k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   184k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1528:8): [True: 72, False: 184k]
  ------------------
 1529|     72|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     72|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1530|   184k|    ctx->index++;
 1531|   184k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   184k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1532|   184k|}
ua_types_encoding_json.c:Float_decodeJson:
 1648|   501k|DECODE_JSON(Float) {
 1649|   501k|    UA_Float *dst = (UA_Float*)p;
 1650|   501k|    UA_Double v = 0.0;
 1651|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1652|   501k|    *dst = (UA_Float)v;
 1653|   501k|    return res;
 1654|   501k|}
ua_types_encoding_json.c:Double_decodeJson:
 1588|   526k|DECODE_JSON(Double) {
 1589|   526k|    UA_Double *dst = (UA_Double*)p;
 1590|   526k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   526k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   526k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 526k]
  |  |  ------------------
  |  | 1299|   526k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   526k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 526k]
  |  |  ------------------
  ------------------
 1591|   526k|    GET_TOKEN;
  ------------------
  |  | 1293|   526k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   526k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   526k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 526k]
  |  |  ------------------
  ------------------
 1592|       |
 1593|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1594|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1595|       |     * Sanity check.
 1596|       |     */
 1597|   526k|    if(tokenSize > 2000)
  ------------------
  |  Branch (1597:8): [True: 3, False: 526k]
  ------------------
 1598|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1599|       |
 1600|   526k|    cj5_token_type tokenType = currentTokenType(ctx);
 1601|       |
 1602|       |    /* It could be a String with Nan, Infinity */
 1603|   526k|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1603:8): [True: 916, False: 525k]
  ------------------
 1604|    916|        ctx->index++;
 1605|       |
 1606|    916|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1606:12): [True: 206, False: 710]
  |  Branch (1606:30): [True: 196, False: 10]
  ------------------
 1607|    196|            *dst = INFINITY;
 1608|    196|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    196|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1609|    196|        }
 1610|       |
 1611|    720|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1611:12): [True: 224, False: 496]
  |  Branch (1611:30): [True: 211, False: 13]
  ------------------
 1612|       |            /* workaround an MSVC 2013 issue */
 1613|    211|            *dst = -INFINITY;
 1614|    211|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    211|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1615|    211|        }
 1616|       |
 1617|    509|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1617:12): [True: 227, False: 282]
  |  Branch (1617:30): [True: 210, False: 17]
  ------------------
 1618|    210|            *dst = NAN;
 1619|    210|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    210|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1620|    210|        }
 1621|       |
 1622|    299|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1622:12): [True: 219, False: 80]
  |  Branch (1622:30): [True: 213, False: 6]
  ------------------
 1623|    213|            *dst = NAN;
 1624|    213|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    213|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1625|    213|        }
 1626|       |
 1627|     86|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     86|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1628|    299|    }
 1629|       |
 1630|   525k|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1630:8): [True: 6, False: 525k]
  ------------------
 1631|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1632|       |
 1633|   525k|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1634|   525k|    if(len == 0)
  ------------------
  |  Branch (1634:8): [True: 4, False: 525k]
  ------------------
 1635|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1636|       |
 1637|       |    /* There must only be whitespace between the end of the parsed number and
 1638|       |     * the end of the token */
 1639|   525k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1639:25): [True: 26, False: 525k]
  ------------------
 1640|     26|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1640:12): [True: 26, False: 0]
  |  Branch (1640:35): [True: 26, False: 0]
  ------------------
 1641|     26|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1642|     26|    }
 1643|       |
 1644|   525k|    ctx->index++;
 1645|   525k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   525k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1646|   525k|}
ua_types_encoding_json.c:String_decodeJson:
 1666|  68.5k|DECODE_JSON(String) {
 1667|  68.5k|    UA_String *dst = (UA_String*)p;
 1668|  68.5k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  68.5k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  68.5k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 68.5k]
  |  |  ------------------
  |  | 1299|  68.5k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  68.5k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 68.5k]
  |  |  ------------------
  ------------------
 1669|  68.5k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1322|  68.5k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  68.5k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 196, False: 68.3k]
  |  |  ------------------
  |  | 1324|    196|        ctx->index++;                                \
  |  | 1325|    196|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    196|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  68.3k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
 1670|  68.3k|    CHECK_STRING;
  ------------------
  |  | 1312|  68.3k|#define CHECK_STRING do {                                \
  |  | 1313|  68.3k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1313:8): [True: 893, False: 67.4k]
  |  |  ------------------
  |  | 1314|    893|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|    893|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1315|  67.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1315:14): [Folded, False: 67.4k]
  |  |  ------------------
  ------------------
 1671|  67.4k|    GET_TOKEN;
  ------------------
  |  | 1293|  67.4k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  67.4k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  67.4k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 67.4k]
  |  |  ------------------
  ------------------
 1672|  67.4k|    (void)tokenData;
 1673|       |
 1674|       |    /* Empty string? */
 1675|  67.4k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1675:8): [True: 1.72k, False: 65.7k]
  ------------------
 1676|  1.72k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  1.72k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1677|  1.72k|        dst->length = 0;
 1678|  1.72k|        ctx->index++;
 1679|  1.72k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.72k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1680|  1.72k|    }
 1681|       |
 1682|       |    /* The decoded utf8 is at most of the same length as the source string */
 1683|  65.7k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|  65.7k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1684|  65.7k|    if(!outBuf)
  ------------------
  |  Branch (1684:8): [True: 9, False: 65.7k]
  ------------------
 1685|      9|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      9|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1686|       |
 1687|       |    /* Decode the string */
 1688|  65.7k|    cj5_result r;
 1689|  65.7k|    r.tokens = ctx->tokens;
 1690|  65.7k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1691|  65.7k|    r.json5 = ctx->json5;
 1692|  65.7k|    unsigned int len = 0;
 1693|  65.7k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1694|  65.7k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1694:8): [True: 171, False: 65.5k]
  ------------------
 1695|    171|        UA_free(outBuf);
  ------------------
  |  |   19|    171|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1696|    171|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    171|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1697|    171|    }
 1698|       |
 1699|       |    /* Set the output */
 1700|  65.5k|    dst->length = len;
 1701|  65.5k|    if(dst->length > 0) {
  ------------------
  |  Branch (1701:8): [True: 65.5k, False: 0]
  ------------------
 1702|  65.5k|        dst->data = (UA_Byte*)outBuf;
 1703|  65.5k|    } else {
 1704|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1705|      0|        UA_free(outBuf);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1706|      0|    }
 1707|       |
 1708|  65.5k|    ctx->index++;
 1709|  65.5k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  65.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1710|  65.7k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1865|    626|DECODE_JSON(DateTime) {
 1866|    626|    UA_DateTime *dst = (UA_DateTime*)p;
 1867|    626|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|    626|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|    626|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 626]
  |  |  ------------------
  |  | 1299|    626|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|    626|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 626]
  |  |  ------------------
  ------------------
 1868|    626|    CHECK_NULL_SKIP;
  ------------------
  |  | 1322|    626|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|    626|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 338, False: 288]
  |  |  ------------------
  |  | 1324|    338|        ctx->index++;                                \
  |  | 1325|    338|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    338|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|    338|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 288]
  |  |  ------------------
  ------------------
 1869|    288|    CHECK_STRING;
  ------------------
  |  | 1312|    288|#define CHECK_STRING do {                                \
  |  | 1313|    288|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1313:8): [True: 18, False: 270]
  |  |  ------------------
  |  | 1314|     18|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1315|    270|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1315:14): [Folded, False: 270]
  |  |  ------------------
  ------------------
 1870|    270|    GET_TOKEN;
  ------------------
  |  | 1293|    270|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|    270|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|    270|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 270]
  |  |  ------------------
  ------------------
 1871|       |
 1872|       |    /* YYYY-MM-DDTHH:MM:SS[.fffffff]Z */
 1873|    270|    if(tokenSize < 20 || tokenData[tokenSize-1] != 'Z' ||
  ------------------
  |  Branch (1873:8): [True: 13, False: 257]
  |  Branch (1873:26): [True: 10, False: 247]
  ------------------
 1874|    247|       tokenData[4] != '-' || tokenData[7] != '-' ||
  ------------------
  |  Branch (1874:8): [True: 11, False: 236]
  |  Branch (1874:31): [True: 10, False: 226]
  ------------------
 1875|    226|       tokenData[10] != 'T' || tokenData[13] != ':' ||
  ------------------
  |  Branch (1875:8): [True: 5, False: 221]
  |  Branch (1875:32): [True: 9, False: 212]
  ------------------
 1876|    212|       tokenData[16] != ':')
  ------------------
  |  Branch (1876:8): [True: 10, False: 202]
  ------------------
 1877|     68|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1878|       |
 1879|    202|    const size_t positions[6] = {0, 5, 8, 11, 14, 17};
 1880|    202|    UA_UInt16 values[6];
 1881|  1.34k|    for(size_t i = 0; i < 6; i++) {
  ------------------
  |  Branch (1881:23): [True: 1.15k, False: 190]
  ------------------
 1882|  1.15k|        UA_UInt64 value = 0;
 1883|  1.15k|        size_t digits = (i == 0) ? 4 : 2;
  ------------------
  |  Branch (1883:25): [True: 202, False: 956]
  ------------------
 1884|  1.15k|        if(parseUInt64(&tokenData[positions[i]], digits, &value) != digits)
  ------------------
  |  Branch (1884:12): [True: 12, False: 1.14k]
  ------------------
 1885|     12|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1886|  1.14k|        values[i] = (UA_UInt16)value;
 1887|  1.14k|    }
 1888|       |
 1889|    190|    UA_UInt16 daysInMonth = 31;
 1890|    190|    switch(values[1]) {
 1891|     50|    case 2:
  ------------------
  |  Branch (1891:5): [True: 50, False: 140]
  ------------------
 1892|     50|        daysInMonth = (UA_UInt16)
 1893|     50|            (((values[0] % 4 == 0 && values[0] % 100 != 0) ||
  ------------------
  |  Branch (1893:16): [True: 13, False: 37]
  |  Branch (1893:38): [True: 9, False: 4]
  ------------------
 1894|     41|              values[0] % 400 == 0) ? 29 : 28);
  ------------------
  |  Branch (1894:15): [True: 1, False: 40]
  ------------------
 1895|     50|        break;
 1896|     27|    case 4: case 6: case 9: case 11:
  ------------------
  |  Branch (1896:5): [True: 10, False: 180]
  |  Branch (1896:13): [True: 10, False: 180]
  |  Branch (1896:21): [True: 4, False: 186]
  |  Branch (1896:29): [True: 3, False: 187]
  ------------------
 1897|     27|        daysInMonth = 30;
 1898|     27|        break;
 1899|    113|    default:
  ------------------
  |  Branch (1899:5): [True: 113, False: 77]
  ------------------
 1900|    113|        break;
 1901|    190|    }
 1902|    190|    if(values[0] < 1 || values[1] < 1 || values[1] > 12 ||
  ------------------
  |  Branch (1902:8): [True: 1, False: 189]
  |  Branch (1902:25): [True: 1, False: 188]
  |  Branch (1902:42): [True: 3, False: 185]
  ------------------
 1903|    185|       values[2] < 1 || values[2] > daysInMonth || values[3] > 23 ||
  ------------------
  |  Branch (1903:8): [True: 1, False: 184]
  |  Branch (1903:25): [True: 3, False: 181]
  |  Branch (1903:52): [True: 1, False: 180]
  ------------------
 1904|    180|       values[4] > 59 || values[5] > 59)
  ------------------
  |  Branch (1904:8): [True: 1, False: 179]
  |  Branch (1904:26): [True: 2, False: 177]
  ------------------
 1905|     13|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1906|       |
 1907|    177|    size_t pos = 19;
 1908|    177|    UA_UInt32 fraction = 0;
 1909|    177|    size_t fractionDigits = 0;
 1910|    177|    if(pos < tokenSize - 1 &&
  ------------------
  |  Branch (1910:8): [True: 121, False: 56]
  ------------------
 1911|    121|       (tokenData[pos] == '.' || tokenData[pos] == ',')) {
  ------------------
  |  Branch (1911:9): [True: 31, False: 90]
  |  Branch (1911:34): [True: 74, False: 16]
  ------------------
 1912|    105|        pos++;
 1913|  3.08M|        while(pos < tokenSize - 1 && tokenData[pos] >= '0' &&
  ------------------
  |  Branch (1913:15): [True: 3.08M, False: 51]
  |  Branch (1913:38): [True: 3.08M, False: 35]
  ------------------
 1914|  3.08M|              tokenData[pos] <= '9') {
  ------------------
  |  Branch (1914:15): [True: 3.08M, False: 19]
  ------------------
 1915|  3.08M|            if(fractionDigits < 7)
  ------------------
  |  Branch (1915:16): [True: 553, False: 3.08M]
  ------------------
 1916|    553|                fraction = fraction * 10 + (UA_UInt32)(tokenData[pos] - '0');
 1917|  3.08M|            fractionDigits++;
 1918|  3.08M|            pos++;
 1919|  3.08M|        }
 1920|    105|        if(fractionDigits == 0)
  ------------------
  |  Branch (1920:12): [True: 12, False: 93]
  ------------------
 1921|     12|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1922|    191|        while(fractionDigits < 7) {
  ------------------
  |  Branch (1922:15): [True: 98, False: 93]
  ------------------
 1923|     98|            fraction *= 10;
 1924|     98|            fractionDigits++;
 1925|     98|        }
 1926|     93|    }
 1927|    165|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1927:8): [True: 60, False: 105]
  ------------------
 1928|     60|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     60|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1929|       |
 1930|       |    /* The minimum JSON DateTime is the null value. */
 1931|    105|    if(values[0] == 1 && values[1] == 1 && values[2] == 1 &&
  ------------------
  |  Branch (1931:8): [True: 40, False: 65]
  |  Branch (1931:26): [True: 38, False: 2]
  |  Branch (1931:44): [True: 34, False: 4]
  ------------------
 1932|     34|       values[3] == 0 && values[4] == 0 && values[5] == 0 && fraction == 0) {
  ------------------
  |  Branch (1932:8): [True: 30, False: 4]
  |  Branch (1932:26): [True: 26, False: 4]
  |  Branch (1932:44): [True: 22, False: 4]
  |  Branch (1932:62): [True: 1, False: 21]
  ------------------
 1933|      1|        *dst = 0;
 1934|    104|    } else {
 1935|    104|        UA_DateTimeStruct date;
 1936|    104|        memset(&date, 0, sizeof(date));
 1937|    104|        date.year = (UA_Int16)values[0];
 1938|    104|        date.month = values[1];
 1939|    104|        date.day = values[2];
 1940|    104|        date.hour = values[3];
 1941|    104|        date.min = values[4];
 1942|    104|        date.sec = values[5];
 1943|    104|        date.milliSec = (UA_UInt16)(fraction / 10000);
 1944|    104|        date.microSec = (UA_UInt16)((fraction % 10000) / 10);
 1945|    104|        date.nanoSec = (UA_UInt16)((fraction % 10) * 100);
 1946|    104|        *dst = UA_DateTime_fromStruct(date);
 1947|    104|    }
 1948|       |
 1949|    105|    ctx->index++;
 1950|    105|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    105|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1951|    165|}
ua_types_encoding_json.c:Guid_decodeJson:
 1656|     75|DECODE_JSON(Guid) {
 1657|     75|    UA_Guid *dst = (UA_Guid*)p;
 1658|     75|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|     75|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|     75|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 75]
  |  |  ------------------
  |  | 1299|     75|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|     75|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 75]
  |  |  ------------------
  ------------------
 1659|     75|    CHECK_STRING;
  ------------------
  |  | 1312|     75|#define CHECK_STRING do {                                \
  |  | 1313|     75|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1313:8): [True: 14, False: 61]
  |  |  ------------------
  |  | 1314|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1315|     61|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1315:14): [Folded, False: 61]
  |  |  ------------------
  ------------------
 1660|     61|    GET_TOKEN;
  ------------------
  |  | 1293|     61|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|     61|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|     61|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 61]
  |  |  ------------------
  ------------------
 1661|     61|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1662|     61|    ctx->index++;
 1663|     61|    return UA_Guid_parse(dst, str);
 1664|     75|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1761|  10.6k|DECODE_JSON(ByteString) {
 1762|  10.6k|    UA_ByteString *dst = (UA_ByteString*)p;
 1763|  10.6k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  10.6k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  10.6k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 10.6k]
  |  |  ------------------
  |  | 1299|  10.6k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  10.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 1764|  10.6k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1322|  10.6k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  10.6k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 197, False: 10.4k]
  |  |  ------------------
  |  | 1324|    197|        ctx->index++;                                \
  |  | 1325|    197|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  10.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 10.4k]
  |  |  ------------------
  ------------------
 1765|  10.4k|    CHECK_STRING;
  ------------------
  |  | 1312|  10.4k|#define CHECK_STRING do {                                \
  |  | 1313|  10.4k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1313:8): [True: 14, False: 10.4k]
  |  |  ------------------
  |  | 1314|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1315|  10.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1315:14): [Folded, False: 10.4k]
  |  |  ------------------
  ------------------
 1766|  10.4k|    GET_TOKEN;
  ------------------
  |  | 1293|  10.4k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  10.4k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  10.4k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 10.4k]
  |  |  ------------------
  ------------------
 1767|       |
 1768|       |    /* Empty bytestring? */
 1769|  10.4k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1769:8): [True: 3.76k, False: 6.67k]
  ------------------
 1770|  3.76k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  3.76k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1771|  3.76k|        dst->length = 0;
 1772|  6.67k|    } else {
 1773|  6.67k|        size_t flen = 0;
 1774|  6.67k|        unsigned char* unB64 =
 1775|  6.67k|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1776|  6.67k|        if(unB64 == 0)
  ------------------
  |  Branch (1776:12): [True: 59, False: 6.61k]
  ------------------
 1777|     59|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     59|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1778|  6.61k|        dst->data = (u8*)unB64;
 1779|  6.61k|        dst->length = flen;
 1780|  6.61k|    }
 1781|       |
 1782|  10.3k|    ctx->index++;
 1783|  10.3k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  10.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1784|  10.4k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1842|  29.2k|DECODE_JSON(NodeId) {
 1843|  29.2k|    UA_NodeId *dst = (UA_NodeId*)p;
 1844|  29.2k|    UA_String str;
 1845|  29.2k|    UA_String_init(&str);
 1846|  29.2k|    status res = String_decodeJson(ctx, &str, NULL);
 1847|  29.2k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  29.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1847:8): [True: 28.3k, False: 940]
  ------------------
 1848|  28.3k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1849|  29.2k|    UA_String_clear(&str);
 1850|  29.2k|    return res;
 1851|  29.2k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1853|  3.81k|DECODE_JSON(ExpandedNodeId) {
 1854|  3.81k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1855|  3.81k|    UA_String str;
 1856|  3.81k|    UA_String_init(&str);
 1857|  3.81k|    status res = String_decodeJson(ctx, &str, NULL);
 1858|  3.81k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.81k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1858:8): [True: 3.80k, False: 10]
  ------------------
 1859|  3.80k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1860|  3.80k|                                        ctx->serverUrisSize, ctx->serverUris);
 1861|  3.81k|    UA_String_clear(&str);
 1862|  3.81k|    return res;
 1863|  3.81k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1953|    281|DECODE_JSON(StatusCode) {
 1954|    281|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1955|    281|    CHECK_OBJECT;
  ------------------
  |  | 1317|    281|#define CHECK_OBJECT do {                                \
  |  | 1318|    281|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 11, False: 270]
  |  |  ------------------
  |  | 1319|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|    270|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 270]
  |  |  ------------------
  ------------------
 1956|    270|    DecodeEntry entries[2] = {
 1957|    270|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  232|    270|#define UA_TYPES_UINT32 6
  ------------------
 1958|    270|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1959|    270|    };
 1960|    270|    return decodeFields(ctx, entries, 2);
 1961|    281|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1796|  8.77k|DECODE_JSON(QualifiedName) {
 1797|  8.77k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1798|  8.77k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1322|  8.77k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  8.77k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 194, False: 8.58k]
  |  |  ------------------
  |  | 1324|    194|        ctx->index++;                                \
  |  | 1325|    194|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    194|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  8.58k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 8.58k]
  |  |  ------------------
  ------------------
 1799|  8.58k|    UA_String str;
 1800|  8.58k|    UA_String_init(&str);
 1801|  8.58k|    status res = String_decodeJson(ctx, &str, NULL);
 1802|  8.58k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  8.58k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1802:8): [True: 8.56k, False: 17]
  ------------------
 1803|  8.56k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1804|  8.58k|    UA_String_clear(&str);
 1805|  8.58k|    return res;
 1806|  8.77k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1786|  1.39k|DECODE_JSON(LocalizedText) {
 1787|  1.39k|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1788|  1.39k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  1.39k|#define CHECK_OBJECT do {                                \
  |  | 1318|  1.39k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 12, False: 1.38k]
  |  |  ------------------
  |  | 1319|     12|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  1.38k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
 1789|  1.38k|    DecodeEntry entries[2] = {
 1790|  1.38k|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|  1.38k|#define UA_TYPES_STRING 11
  ------------------
 1791|  1.38k|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  402|  1.38k|#define UA_TYPES_STRING 11
  ------------------
 1792|  1.38k|    };
 1793|  1.38k|    return decodeFields(ctx, entries, 2);
 1794|  1.39k|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2317|  24.2k|DECODE_JSON(ExtensionObject) {
 2318|  24.2k|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2319|  24.2k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1322|  24.2k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  24.2k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 0, False: 24.2k]
  |  |  ------------------
  |  | 1324|      0|        ctx->index++;                                \
  |  | 1325|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  24.2k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 24.2k]
  |  |  ------------------
  ------------------
 2320|  24.2k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  24.2k|#define CHECK_OBJECT do {                                \
  |  | 1318|  24.2k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 69, False: 24.2k]
  |  |  ------------------
  |  | 1319|     69|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     69|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  24.2k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 24.2k]
  |  |  ------------------
  ------------------
 2321|       |
 2322|       |    /* Empty object -> Null ExtensionObject */
 2323|  24.2k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2323:8): [True: 2.01k, False: 22.1k]
  ------------------
 2324|  2.01k|        ctx->index++; /* Skip the empty ExtensionObject */
 2325|  2.01k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.01k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2326|  2.01k|    }
 2327|       |
 2328|       |    /* Scan the object once for metadata and duplicate keys. */
 2329|  22.1k|    size_t beginIndex = ctx->index;
 2330|  22.1k|    JsonFieldIndex fields[3] = {
 2331|  22.1k|        {UA_JSONKEY_TYPEID, SIZE_MAX},
 2332|  22.1k|        {UA_JSONKEY_ENCODING, SIZE_MAX},
 2333|  22.1k|        {UA_JSONKEY_BODY, SIZE_MAX}
 2334|  22.1k|    };
 2335|  22.1k|    status ret = scanObjectFields(ctx, fields, 3);
 2336|  22.1k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  22.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2336:8): [True: 48, False: 22.1k]
  ------------------
 2337|     48|        return ret;
 2338|       |
 2339|       |    /* Decode the optional non-JSON encoding. */
 2340|  22.1k|    UA_UInt64 encoding = 0;
 2341|  22.1k|    size_t encIndex = fields[1].valueIndex;
 2342|  22.1k|    if(encIndex != SIZE_MAX) {
  ------------------
  |  Branch (2342:8): [True: 3.88k, False: 18.2k]
  ------------------
 2343|  3.88k|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2344|  3.88k|        size_t len = parseUInt64(extObjEncoding,
 2345|  3.88k|                                 getTokenLength(&ctx->tokens[encIndex]),
 2346|  3.88k|                                 &encoding);
 2347|  3.88k|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2347:12): [True: 5, False: 3.87k]
  |  Branch (2347:24): [True: 113, False: 3.76k]
  ------------------
 2348|    118|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    118|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2349|  3.88k|    }
 2350|       |
 2351|       |    /* Decode the type NodeId. */
 2352|  22.0k|    size_t typeIdIndex = fields[0].valueIndex;
 2353|  22.0k|    if(typeIdIndex == SIZE_MAX)
  ------------------
  |  Branch (2353:8): [True: 219, False: 21.8k]
  ------------------
 2354|    219|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    219|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2355|       |
 2356|  21.8k|    UA_NodeId typeId;
 2357|  21.8k|    UA_NodeId_init(&typeId);
 2358|  21.8k|    ParseCtx decodeCtx = *ctx;
 2359|  21.8k|    decodeCtx.index = typeIdIndex;
 2360|  21.8k|    ret = NodeId_decodeJson(&decodeCtx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|  21.8k|#define UA_TYPES_NODEID 16
  ------------------
 2361|  21.8k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  21.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2361:8): [True: 204, False: 21.5k]
  ------------------
 2362|    204|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2363|    204|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    204|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2364|    204|    }
 2365|       |
 2366|  21.5k|    size_t bodyIndex = fields[2].valueIndex;
 2367|       |
 2368|       |    /* Binary and XML bodies stay encoded even if the datatype is known. */
 2369|  21.5k|    if(encoding != 0) {
  ------------------
  |  Branch (2369:8): [True: 3.41k, False: 18.1k]
  ------------------
 2370|  3.41k|        dst->encoding = (encoding == 1) ?
  ------------------
  |  Branch (2370:25): [True: 438, False: 2.97k]
  ------------------
 2371|    438|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2372|  3.41k|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2373|  3.41k|        dst->content.encoded.typeId = typeId;
 2374|  3.41k|        if(bodyIndex == SIZE_MAX)
  ------------------
  |  Branch (2374:12): [True: 17, False: 3.39k]
  ------------------
 2375|     17|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2376|  3.39k|        decodeCtx.index = bodyIndex;
 2377|  3.39k|        return ByteString_decodeJson(&decodeCtx,
 2378|  3.39k|                                     &dst->content.encoded.body, NULL);
 2379|  3.41k|    }
 2380|       |
 2381|       |    /* Lookup the JSON datatype. */
 2382|  18.1k|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2383|  18.1k|    if(!type) {
  ------------------
  |  Branch (2383:8): [True: 8.34k, False: 9.84k]
  ------------------
 2384|  8.34k|        dst->encoding = UA_EXTENSIONOBJECT_ENCODED_JSON;
 2385|  8.34k|        dst->content.encoded.typeId = typeId;
 2386|  8.34k|        decodeCtx.index = beginIndex;
 2387|  8.34k|        return tokenToByteString(&decodeCtx, &dst->content.encoded.body);
 2388|  8.34k|    }
 2389|       |
 2390|       |    /* No need to keep the TypeId */
 2391|  9.84k|    UA_NodeId_clear(&typeId);
 2392|       |
 2393|       |    /* Disallow directly nested ExtensionObjects */
 2394|  9.84k|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|  9.84k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2394:8): [True: 2, False: 9.84k]
  ------------------
 2395|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2396|       |
 2397|       |    /* Allocate memory for the decoded data */
 2398|  9.84k|    dst->content.decoded.data = UA_new(type);
 2399|  9.84k|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2399:8): [True: 1, False: 9.84k]
  ------------------
 2400|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2401|  9.84k|    dst->content.decoded.type = type;
 2402|  9.84k|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2403|       |
 2404|  9.84k|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2405|  9.84k|    if(bodyIndex != SIZE_MAX) {
  ------------------
  |  Branch (2405:8): [True: 8.66k, False: 1.17k]
  ------------------
 2406|  8.66k|        decodeCtx.index = bodyIndex;
 2407|  8.66k|        return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2408|  8.66k|    }
 2409|       |
 2410|       |    /* Only JSON structures without an explicit encoding can be in-situ. */
 2411|  1.17k|    if(encoding != 0)
  ------------------
  |  Branch (2411:8): [True: 0, False: 1.17k]
  ------------------
 2412|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2413|       |
 2414|  1.17k|    decodeCtx.index = beginIndex;
 2415|  1.17k|    if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2415:8): [True: 797, False: 378]
  ------------------
 2416|    378|       type->typeKind == UA_DATATYPEKIND_OPTSTRUCT)
  ------------------
  |  Branch (2416:8): [True: 0, False: 378]
  ------------------
 2417|    797|        return decodeJsonStructureExtensionObject(
 2418|    797|            &decodeCtx, dst->content.decoded.data, type);
 2419|    378|    if(type->typeKind == UA_DATATYPEKIND_UNION)
  ------------------
  |  Branch (2419:8): [True: 0, False: 378]
  ------------------
 2420|      0|        return decodeJsonUnionExtensionObject(
 2421|      0|            &decodeCtx, dst->content.decoded.data, type);
 2422|    378|    return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2423|    378|}
ua_types_encoding_json.c:scanObjectFields:
 1386|  22.1k|scanObjectFields(ParseCtx *ctx, JsonFieldIndex *fields, size_t fieldsSize) {
 1387|  22.1k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|  22.1k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1387:5): [True: 22.1k, False: 0]
  ------------------
 1388|  22.1k|    size_t keyCount = (size_t)ctx->tokens[ctx->index].size / 2;
 1389|  22.1k|    if(keyCount > UA_JSON_MAX_EXTENSIONOBJECT_FIELDS)
  ------------------
  |  | 1381|  22.1k|#define UA_JSON_MAX_EXTENSIONOBJECT_FIELDS (UA_DATATYPE_MEMBERS_MAX + 3)
  |  |  ------------------
  |  |  |  | 1036|  22.1k|#define UA_DATATYPE_MEMBERS_MAX 511
  |  |  ------------------
  ------------------
  |  Branch (1389:8): [True: 11, False: 22.1k]
  ------------------
 1390|     11|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1391|       |
 1392|  22.1k|    size_t keys[UA_JSON_MAX_EXTENSIONOBJECT_FIELDS];
 1393|  22.1k|    ctx->index++;
 1394|       |
 1395|  81.3k|    for(size_t i = 0; i < keyCount; i++) {
  ------------------
  |  Branch (1395:23): [True: 59.2k, False: 22.1k]
  ------------------
 1396|  59.2k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  59.2k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1396:9): [True: 59.2k, False: 0]
  ------------------
 1397|  59.2k|        const cj5_token *key = &ctx->tokens[ctx->index];
 1398|  59.2k|        size_t keyLength = getTokenLength(key);
 1399|       |
 1400|       |        /* Duplicate names are invalid, including unknown in-situ Structure
 1401|       |         * fields of an ExtensionObject. */
 1402|   125k|        for(size_t j = 0; j < i; j++) {
  ------------------
  |  Branch (1402:27): [True: 66.5k, False: 59.1k]
  ------------------
 1403|  66.5k|            const cj5_token *previous = &ctx->tokens[keys[j]];
 1404|  66.5k|            if(keyLength == getTokenLength(previous) &&
  ------------------
  |  Branch (1404:16): [True: 5.14k, False: 61.4k]
  ------------------
 1405|  5.14k|               memcmp(&ctx->json5[key->start], &ctx->json5[previous->start],
  ------------------
  |  Branch (1405:16): [True: 37, False: 5.10k]
  ------------------
 1406|  5.14k|                      keyLength) == 0)
 1407|     37|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1408|  66.5k|        }
 1409|  59.1k|        keys[i] = ctx->index;
 1410|       |
 1411|       |        /* Record the value position of interesting fields. */
 1412|  59.1k|        ctx->index++;
 1413|  59.1k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  59.1k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1413:9): [True: 59.1k, False: 0]
  ------------------
 1414|   150k|        for(size_t j = 0; j < fieldsSize; j++) {
  ------------------
  |  Branch (1414:27): [True: 129k, False: 20.8k]
  ------------------
 1415|   129k|            if(jsoneq(ctx->json5, key, fields[j].fieldName) == 0) {
  ------------------
  |  Branch (1415:16): [True: 38.3k, False: 91.6k]
  ------------------
 1416|  38.3k|                fields[j].valueIndex = ctx->index;
 1417|  38.3k|                break;
 1418|  38.3k|            }
 1419|   129k|        }
 1420|       |
 1421|  59.1k|        skipObject(ctx);
 1422|  59.1k|    }
 1423|  22.1k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  22.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1424|  22.1k|}
ua_types_encoding_json.c:tokenToByteString:
 2307|  8.34k|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 2308|  8.34k|    GET_TOKEN;
  ------------------
  |  | 1293|  8.34k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  8.34k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  8.34k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 8.34k]
  |  |  ------------------
  ------------------
 2309|  8.34k|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 2310|  8.34k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  8.34k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2310:8): [True: 4, False: 8.33k]
  ------------------
 2311|      4|        return res;
 2312|  8.33k|    memcpy(p->data, tokenData, tokenSize);
 2313|  8.33k|    skipObject(ctx);
 2314|  8.33k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2315|  8.34k|}
ua_types_encoding_json.c:decodeJsonStructureExtensionObject:
 2817|  9.16k|                                   const UA_DataType *type) {
 2818|       |    return decodeJsonStructureInternal(ctx, dst, type, true);
 2819|  9.16k|}
ua_types_encoding_json.c:decodeJsonStructureInternal:
 2723|  9.92k|                            UA_Boolean extensionObject) {
 2724|  9.92k|    uintptr_t ptr = (uintptr_t)dst;
 2725|  9.92k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.92k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2726|  9.92k|    const UA_Boolean optional = (type->typeKind == UA_DATATYPEKIND_OPTSTRUCT);
 2727|  9.92k|    size_t offset = (extensionObject ? 1 : 0) + (optional ? 1 : 0);
  ------------------
  |  Branch (2727:22): [True: 9.16k, False: 763]
  |  Branch (2727:50): [True: 0, False: 9.92k]
  ------------------
 2728|  9.92k|    size_t membersSize = type->membersSize + offset;
 2729|  9.92k|    UA_STACKARRAY(DecodeEntry, entries, membersSize);
  ------------------
  |  |  375|  9.92k|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 2730|  9.92k|    memset(entries, 0, sizeof(DecodeEntry) * membersSize);
 2731|  9.92k|    size_t entryIndex = 0;
 2732|  9.92k|    if(extensionObject) {
  ------------------
  |  Branch (2732:8): [True: 9.16k, False: 763]
  ------------------
 2733|  9.16k|        entries[entryIndex++] =
 2734|  9.16k|            (DecodeEntry){UA_JSONKEY_TYPEID, NULL, NULL, false, NULL};
 2735|  9.16k|    }
 2736|  9.92k|    UA_UInt32 encodingMask = 0;
 2737|  9.92k|    size_t encodingMaskIndex = SIZE_MAX;
 2738|  9.92k|    if(optional) {
  ------------------
  |  Branch (2738:8): [True: 0, False: 9.92k]
  ------------------
 2739|      0|        encodingMaskIndex = entryIndex;
 2740|      0|        entries[entryIndex++] =
 2741|      0|            (DecodeEntry){UA_JSONKEY_ENCODINGMASK, &encodingMask, NULL, false,
 2742|      0|                          &UA_TYPES[UA_TYPES_UINT32]};
  ------------------
  |  |  232|      0|#define UA_TYPES_UINT32 6
  ------------------
 2743|      0|    }
 2744|  43.1k|    for(size_t i = 0; i < type->membersSize; ++i, ++entryIndex) {
  ------------------
  |  Branch (2744:23): [True: 33.2k, False: 9.92k]
  ------------------
 2745|  33.2k|        const UA_DataTypeMember *m = &type->members[i];
 2746|  33.2k|        const UA_DataType *mt = m->memberType;
 2747|  33.2k|        entries[entryIndex].type = mt;
 2748|  33.2k|        entries[entryIndex].fieldName = m->memberName;
 2749|  33.2k|        if(!m->isArray) {
  ------------------
  |  Branch (2749:12): [True: 14.2k, False: 18.9k]
  ------------------
 2750|  14.2k|            ptr += m->padding;
 2751|  14.2k|            entries[entryIndex].fieldPointer = (void*)ptr;
 2752|  14.2k|            if(m->isOptional)
  ------------------
  |  Branch (2752:16): [True: 0, False: 14.2k]
  ------------------
 2753|      0|                entries[entryIndex].function = OptionalScalar_decodeJson;
 2754|  14.2k|            ptr += m->isOptional ? sizeof(void*) : mt->memSize;
  ------------------
  |  Branch (2754:20): [True: 0, False: 14.2k]
  ------------------
 2755|  18.9k|        } else {
 2756|  18.9k|            ptr += m->padding;
 2757|  18.9k|            ptr += sizeof(size_t);
 2758|  18.9k|            entries[entryIndex].fieldPointer = (void*)ptr;
 2759|  18.9k|            entries[entryIndex].function = m->isOptional ?
  ------------------
  |  Branch (2759:44): [True: 0, False: 18.9k]
  ------------------
 2760|  18.9k|                OptionalArray_decodeJson : Array_decodeJson;
 2761|  18.9k|            ptr += sizeof(void*);
 2762|  18.9k|        }
 2763|  33.2k|    }
 2764|       |
 2765|  9.92k|    ret = decodeFields(ctx, entries, membersSize);
 2766|       |
 2767|       |    /* Compact JSON uses EncodingMask. Materialize optional fields whose bit is
 2768|       |     * set even when their default value was omitted from the object. */
 2769|  9.92k|    if(ret == UA_STATUSCODE_GOOD && optional &&
  ------------------
  |  |   17|  19.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2769:8): [True: 9.90k, False: 24]
  |  Branch (2769:37): [True: 0, False: 9.90k]
  ------------------
 2770|      0|       entries[encodingMaskIndex].found) {
  ------------------
  |  Branch (2770:8): [True: 0, False: 0]
  ------------------
 2771|      0|        size_t optionalIndex = 0;
 2772|      0|        entryIndex = offset;
 2773|      0|        for(size_t i = 0; i < type->membersSize; i++, entryIndex++) {
  ------------------
  |  Branch (2773:27): [True: 0, False: 0]
  ------------------
 2774|      0|            const UA_DataTypeMember *m = &type->members[i];
 2775|      0|            if(!m->isOptional)
  ------------------
  |  Branch (2775:16): [True: 0, False: 0]
  ------------------
 2776|      0|                continue;
 2777|      0|            if(optionalIndex >= 32) {
  ------------------
  |  Branch (2777:16): [True: 0, False: 0]
  ------------------
 2778|      0|                ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2779|      0|                break;
 2780|      0|            }
 2781|      0|            UA_Boolean inMask =
 2782|      0|                (encodingMask & ((UA_UInt32)1 << optionalIndex)) != 0;
 2783|      0|            if(entries[entryIndex].found != inMask) {
  ------------------
  |  Branch (2783:16): [True: 0, False: 0]
  ------------------
 2784|      0|                if(entries[entryIndex].found) {
  ------------------
  |  Branch (2784:20): [True: 0, False: 0]
  ------------------
 2785|      0|                    ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2786|      0|                    break;
 2787|      0|                }
 2788|      0|                if(m->isArray) {
  ------------------
  |  Branch (2788:20): [True: 0, False: 0]
  ------------------
 2789|      0|                    *(void**)entries[entryIndex].fieldPointer =
 2790|      0|                        UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2791|      0|                } else {
 2792|      0|                    void *value = UA_calloc(1, m->memberType->memSize);
  ------------------
  |  |   20|      0|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2793|      0|                    if(!value) {
  ------------------
  |  Branch (2793:24): [True: 0, False: 0]
  ------------------
 2794|      0|                        ret = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2795|      0|                        break;
 2796|      0|                    }
 2797|      0|                    *(void**)entries[entryIndex].fieldPointer = value;
 2798|      0|                }
 2799|      0|            }
 2800|      0|            optionalIndex++;
 2801|      0|        }
 2802|      0|        if(optionalIndex < 32 &&
  ------------------
  |  Branch (2802:12): [True: 0, False: 0]
  ------------------
 2803|      0|           (encodingMask >> optionalIndex) != 0)
  ------------------
  |  Branch (2803:12): [True: 0, False: 0]
  ------------------
 2804|      0|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2805|      0|    }
 2806|       |
 2807|  9.92k|    return ret;
 2808|  9.92k|}
ua_types_encoding_json.c:Array_decodeJson:
 2630|  12.2k|Array_decodeJson(ParseCtx *ctx, void *dst_, const UA_DataType *type) {
 2631|  12.2k|    void **dst = (void**)dst_;
 2632|       |
 2633|       |    /* Save the length of the array */
 2634|  12.2k|    size_t *size_ptr = (size_t*) dst - 1;
 2635|       |
 2636|       |    /* A null JSON array represents a null OPC UA array. */
 2637|  12.2k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2637:8): [True: 125, False: 12.1k]
  ------------------
 2638|    125|        *size_ptr = 0;
 2639|    125|        *dst = NULL;
 2640|    125|        ctx->index++;
 2641|    125|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    125|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2642|    125|    }
 2643|       |
 2644|  12.1k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2644:8): [True: 18, False: 12.1k]
  ------------------
 2645|     18|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2646|       |
 2647|  12.1k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2648|       |
 2649|  12.1k|    ctx->index++; /* Go to first array member or to the first element after
 2650|       |                   * the array (if empty) */
 2651|       |
 2652|       |    /* Return early for empty arrays */
 2653|  12.1k|    if(length == 0) {
  ------------------
  |  Branch (2653:8): [True: 499, False: 11.6k]
  ------------------
 2654|    499|        *size_ptr = length;
 2655|    499|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|    499|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2656|    499|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    499|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2657|    499|    }
 2658|       |
 2659|       |    /* Allocate memory */
 2660|  11.6k|    if(length > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2660:8): [True: 0, False: 11.6k]
  ------------------
 2661|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2662|  11.6k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  11.6k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2663|  11.6k|    if(*dst == NULL)
  ------------------
  |  Branch (2663:8): [True: 10, False: 11.6k]
  ------------------
 2664|     10|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     10|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2665|       |
 2666|       |    /* Decode array members */
 2667|  11.6k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2668|  11.6k|    uintptr_t ptr = (uintptr_t)*dst;
 2669|  3.43M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2669:23): [True: 3.42M, False: 9.13k]
  ------------------
 2670|  3.42M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2670:12): [True: 744, False: 3.42M]
  ------------------
 2671|    744|            if(!isJsonNullable(type)) {
  ------------------
  |  Branch (2671:16): [True: 8, False: 736]
  ------------------
 2672|      8|                UA_Array_delete(*dst, i, type);
 2673|      8|                *dst = NULL;
 2674|      8|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2675|      8|            }
 2676|    736|            ptr += type->memSize;
 2677|    736|            ctx->index++;
 2678|    736|            continue;
 2679|    744|        }
 2680|       |
 2681|  3.42M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2682|  3.42M|        ptr += type->memSize;
 2683|  3.42M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  3.42M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2683:12): [True: 2.49k, False: 3.42M]
  ------------------
 2684|  2.49k|            UA_Array_delete(*dst, i+1, type);
 2685|  2.49k|            *dst = NULL;
 2686|  2.49k|            return ret;
 2687|  2.49k|        }
 2688|  3.42M|    }
 2689|       |
 2690|  9.13k|    *size_ptr = length; /* All good, set the size */
 2691|  9.13k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.13k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2692|  11.6k|}
ua_types_encoding_json.c:DataValue_decodeJson:
 2267|  26.6k|DECODE_JSON(DataValue) {
 2268|  26.6k|    UA_DataValue *dst = (UA_DataValue*)p;
 2269|  26.6k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1322|  26.6k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  26.6k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 369, False: 26.3k]
  |  |  ------------------
  |  | 1324|    369|        ctx->index++;                                \
  |  | 1325|    369|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    369|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  26.3k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 26.3k]
  |  |  ------------------
  ------------------
 2270|  26.3k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  26.3k|#define CHECK_OBJECT do {                                \
  |  | 1318|  26.3k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 38, False: 26.2k]
  |  |  ------------------
  |  | 1319|     38|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     38|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  26.2k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 26.2k]
  |  |  ------------------
  ------------------
 2271|       |
 2272|       |    /* Decode the Variant in-situ */
 2273|  26.2k|    size_t beginIndex = ctx->index;
 2274|  26.2k|    status ret = decodeJSONVariant(ctx, &dst->value, true);
 2275|  26.2k|    ctx->index = beginIndex;
 2276|  26.2k|    dst->hasValue = (dst->value.type != NULL);
 2277|  26.2k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  26.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2277:8): [True: 3.60k, False: 22.6k]
  ------------------
 2278|  3.60k|        return ret;
 2279|       |
 2280|       |    /* Decode the other members (skip the Variant members) */
 2281|  22.6k|    DecodeEntry entries[8] = {
 2282|  22.6k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 2283|  22.6k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 2284|  22.6k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 2285|  22.6k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|  22.6k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2286|  22.6k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 2287|  22.6k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|  22.6k|#define UA_TYPES_DATETIME 12
  ------------------
 2288|  22.6k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 2289|  22.6k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  164|  22.6k|#define UA_TYPES_UINT16 4
  ------------------
 2290|  22.6k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 2291|  22.6k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|  22.6k|#define UA_TYPES_DATETIME 12
  ------------------
 2292|  22.6k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 2293|  22.6k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  164|  22.6k|#define UA_TYPES_UINT16 4
  ------------------
 2294|  22.6k|    };
 2295|       |
 2296|  22.6k|    ret = decodeFields(ctx, entries, 8);
 2297|  22.6k|    dst->hasStatus = entries[3].found;
 2298|  22.6k|    dst->hasSourceTimestamp = entries[4].found;
 2299|  22.6k|    dst->hasSourcePicoseconds = entries[5].found;
 2300|  22.6k|    dst->hasServerTimestamp = entries[6].found;
 2301|  22.6k|    dst->hasServerPicoseconds = entries[7].found;
 2302|  22.6k|    return ret;
 2303|  26.2k|}
ua_types_encoding_json.c:decodeJSONVariant:
 2124|  38.2k|                  UA_Boolean insideDataValue) {
 2125|       |    /* Empty variant == null */
 2126|  38.2k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2126:8): [True: 2.39k, False: 35.8k]
  ------------------
 2127|  2.39k|        ctx->index++;
 2128|  2.39k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2129|  2.39k|    }
 2130|       |
 2131|       |    /* Search the value field */
 2132|  35.8k|    size_t valueIndex = 0;
 2133|  35.8k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 2134|       |
 2135|       |    /* Search for the dimensions field */
 2136|  35.8k|    size_t dimIndex = 0;
 2137|  35.8k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 2138|       |
 2139|       |    /* Parse the type kind */
 2140|  35.8k|    size_t typeIndex = 0;
 2141|  35.8k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 2142|  35.8k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (2142:8): [True: 79, False: 35.7k]
  |  Branch (2142:26): [True: 1, False: 35.7k]
  ------------------
 2143|     80|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     80|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2144|  35.7k|    UA_UInt64 typeKind = 0;
 2145|  35.7k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 2146|  35.7k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 2147|  35.7k|    if(len == 0)
  ------------------
  |  Branch (2147:8): [True: 6, False: 35.7k]
  ------------------
 2148|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2149|       |
 2150|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 2151|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 2152|  35.7k|    typeKind--;
 2153|  35.7k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2153:8): [True: 132, False: 35.6k]
  ------------------
 2154|    132|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    132|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2155|  35.6k|    const UA_DataType *type = &UA_TYPES[typeKind];
 2156|       |
 2157|       |    /* These combinations are excluded by the Variant definition. */
 2158|  35.6k|    if(type->typeKind == UA_DATATYPEKIND_DIAGNOSTICINFO ||
  ------------------
  |  Branch (2158:8): [True: 2, False: 35.6k]
  ------------------
 2159|  35.6k|       (insideDataValue && type->typeKind == UA_DATATYPEKIND_DATAVALUE))
  ------------------
  |  Branch (2159:9): [True: 24.4k, False: 11.1k]
  |  Branch (2159:28): [True: 1, False: 24.4k]
  ------------------
 2160|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2161|       |
 2162|       |    /* Value is an array? */
 2163|  35.6k|    UA_Boolean isArray =
 2164|  35.6k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (2164:10): [True: 33.1k, False: 2.54k]
  |  Branch (2164:28): [True: 11.5k, False: 21.5k]
  ------------------
 2165|  35.6k|    if(type->typeKind == UA_DATATYPEKIND_VARIANT && !isArray)
  ------------------
  |  Branch (2165:8): [True: 1.77k, False: 33.8k]
  |  Branch (2165:53): [True: 1, False: 1.77k]
  ------------------
 2166|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2167|       |
 2168|       |    /* Adjust the depth and set the value index as current */
 2169|  35.6k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |   22|  35.6k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2169:8): [True: 1, False: 35.6k]
  ------------------
 2170|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2171|  35.6k|    size_t beginIndex = ctx->index;
 2172|  35.6k|    ctx->index = valueIndex;
 2173|  35.6k|    ctx->depth++;
 2174|       |
 2175|       |    /* Decode the value */
 2176|  35.6k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  35.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2177|  35.6k|    if(!isArray) {
  ------------------
  |  Branch (2177:8): [True: 24.1k, False: 11.5k]
  ------------------
 2178|       |        /* Scalar with dimensions -> error */
 2179|  24.1k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2179:12): [True: 3, False: 24.1k]
  ------------------
 2180|      3|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2181|      3|            goto out;
 2182|      3|        }
 2183|       |
 2184|       |        /* Missing values are only valid for nullable types. */
 2185|  24.1k|        if(valueIndex == 0 && !isJsonNullable(type)) {
  ------------------
  |  Branch (2185:12): [True: 2.53k, False: 21.5k]
  |  Branch (2185:31): [True: 43, False: 2.49k]
  ------------------
 2186|     43|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     43|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2187|     43|            goto out;
 2188|     43|        }
 2189|       |
 2190|       |        /* JSON null is only valid for nullable types. */
 2191|  24.0k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_NULL &&
  ------------------
  |  Branch (2191:12): [True: 21.5k, False: 2.49k]
  |  Branch (2191:30): [True: 282, False: 21.2k]
  ------------------
 2192|    282|           !isJsonNullable(type)) {
  ------------------
  |  Branch (2192:12): [True: 1, False: 281]
  ------------------
 2193|      1|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2194|      1|            goto out;
 2195|      1|        }
 2196|       |
 2197|       |        /* Decode a value wrapped in an ExtensionObject */
 2198|  24.0k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (2198:12): [True: 21.5k, False: 2.49k]
  |  Branch (2198:30): [True: 1.72k, False: 19.8k]
  ------------------
 2199|  1.72k|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 2200|  1.72k|            goto out;
 2201|  1.72k|        }
 2202|       |
 2203|       |        /* Allocate memory for the value */
 2204|  22.3k|        dst->data = UA_new(type);
 2205|  22.3k|        if(!dst->data) {
  ------------------
  |  Branch (2205:12): [True: 5, False: 22.3k]
  ------------------
 2206|      5|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2207|      5|            goto out;
 2208|      5|        }
 2209|  22.3k|        dst->type = type;
 2210|       |
 2211|       |        /* Decode the value */
 2212|  22.3k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (2212:12): [True: 19.8k, False: 2.49k]
  |  Branch (2212:30): [True: 19.6k, False: 196]
  ------------------
 2213|  19.6k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 2214|  22.3k|    } else {
 2215|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 2216|       |         * members must all have the same type. */
 2217|  11.5k|        const UA_DataType *unwrapType = NULL;
 2218|  11.5k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|  11.5k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2218:12): [True: 7.81k, False: 3.71k]
  ------------------
 2219|  7.81k|            unwrapType = getArrayUnwrapType(ctx);
 2220|  11.5k|        if(unwrapType) {
  ------------------
  |  Branch (2220:12): [True: 552, False: 10.9k]
  ------------------
 2221|    552|            dst->type = unwrapType;
 2222|    552|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 2223|  10.9k|        } else {
 2224|  10.9k|            dst->type = type;
 2225|  10.9k|            res = Array_decodeJson(ctx, &dst->data, type);
 2226|  10.9k|        }
 2227|       |
 2228|       |        /* Decode array dimensions */
 2229|  11.5k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2229:12): [True: 1.15k, False: 10.3k]
  ------------------
 2230|  1.15k|            ctx->index = dimIndex;
 2231|  1.15k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 2232|  1.15k|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|  1.15k|#define UA_TYPES_UINT32 6
  ------------------
 2233|       |
 2234|       |            /* Help clang-analyzer */
 2235|  1.15k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  399|  1.15k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2235:13): [True: 91, False: 1.06k]
  |  Branch (2235:13): [True: 1.06k, False: 0]
  ------------------
 2236|       |
 2237|       |            /* Validate the dimensions */
 2238|  1.15k|            if(res == UA_STATUSCODE_GOOD &&
  ------------------
  |  |   17|  2.30k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2238:16): [True: 1.02k, False: 129]
  ------------------
 2239|  1.02k|               !variantDimensionsValid(dst->arrayLength,
  ------------------
  |  Branch (2239:16): [True: 138, False: 887]
  ------------------
 2240|  1.02k|                                       dst->arrayDimensionsSize,
 2241|  1.02k|                                       dst->arrayDimensions))
 2242|    138|                res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    138|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2243|       |
 2244|       |            /* Only keep >= 2 dimensions */
 2245|  1.15k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (2245:16): [True: 977, False: 177]
  ------------------
 2246|    977|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|    977|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2247|    977|                dst->arrayDimensions = NULL;
 2248|    977|                dst->arrayDimensionsSize = 0;
 2249|    977|            }
 2250|  1.15k|        }
 2251|  11.5k|    }
 2252|       |
 2253|  35.6k| out:
 2254|  35.6k|    ctx->index = beginIndex;
 2255|  35.6k|    skipObject(ctx);
 2256|  35.6k|    ctx->depth--;
 2257|  35.6k|    return res;
 2258|  35.6k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2427|  1.72k|                                        const UA_DataType *type) {
 2428|  1.72k|    (void) type;
 2429|  1.72k|    UA_Variant *dst = (UA_Variant*)p;
 2430|       |
 2431|       |    /* ExtensionObject with null body */
 2432|  1.72k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2432:8): [True: 85, False: 1.63k]
  ------------------
 2433|     85|        dst->data = UA_ExtensionObject_new();
 2434|     85|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|     85|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2435|     85|        ctx->index++;
 2436|     85|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     85|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2437|     85|    }
 2438|       |
 2439|       |    /* Decode the ExtensionObject */
 2440|  1.63k|    UA_ExtensionObject eo;
 2441|  1.63k|    UA_ExtensionObject_init(&eo);
 2442|  1.63k|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2443|  1.63k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  1.63k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2443:8): [True: 498, False: 1.14k]
  ------------------
 2444|    498|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2445|    498|        return ret;
 2446|    498|    }
 2447|       |
 2448|       |    /* The content is still encoded, cannot unwrap */
 2449|  1.14k|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2449:8): [True: 298, False: 842]
  ------------------
 2450|    298|        goto use_eo;
 2451|       |
 2452|       |    /* The content is a builtin type that could have been directly encoded in
 2453|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2454|       |     * means for us, that somebody made an extra effort to explicitly get an
 2455|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2456|       |     * the same JSON again when encoding again. */
 2457|    842|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2457:8): [True: 352, False: 490]
  ------------------
 2458|    352|        goto use_eo;
 2459|       |
 2460|       |    /* Unwrap the ExtensionObject */
 2461|    490|    dst->data = eo.content.decoded.data;
 2462|    490|    dst->type = eo.content.decoded.type;
 2463|    490|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    490|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2464|       |
 2465|    650| use_eo:
 2466|       |    /* Don't unwrap */
 2467|    650|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  742|    650|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2468|    650|    if(!dst->data) {
  ------------------
  |  Branch (2468:8): [True: 1, False: 649]
  ------------------
 2469|      1|        UA_ExtensionObject_clear(&eo);
 2470|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2471|      1|    }
 2472|    649|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|    649|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2473|    649|    *(UA_ExtensionObject*)dst->data = eo;
 2474|    649|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    649|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2475|    650|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1998|  7.81k|getArrayUnwrapType(ParseCtx *ctx) {
 1999|  7.81k|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|  7.81k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1999:5): [True: 7.81k, False: 0]
  ------------------
 2000|       |
 2001|       |    /* Return early for empty arrays */
 2002|  7.81k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2003|  7.81k|    if(length == 0)
  ------------------
  |  Branch (2003:8): [True: 222, False: 7.59k]
  ------------------
 2004|    222|        return NULL;
 2005|       |
 2006|       |    /* Save the original index and go to the first array member */
 2007|  7.59k|    size_t oldIndex = ctx->index;
 2008|  7.59k|    ctx->index++;
 2009|       |
 2010|       |    /* Lookup the type for the first array member */
 2011|  7.59k|    UA_NodeId typeId;
 2012|  7.59k|    UA_NodeId_init(&typeId);
 2013|  7.59k|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 2014|  7.59k|    if(!typeOfBody) {
  ------------------
  |  Branch (2014:8): [True: 3.74k, False: 3.85k]
  ------------------
 2015|  3.74k|        ctx->index = oldIndex; /* Restore the index */
 2016|  3.74k|        return NULL;
 2017|  3.74k|    }
 2018|       |
 2019|       |    /* Get the TypeId encoding for faster comparison below.
 2020|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 2021|  3.85k|    size_t typeIdIndex = 0;
 2022|  3.85k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2023|  3.85k|    (void)ret;
 2024|  3.85k|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  399|  3.85k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2024:5): [True: 3.85k, False: 0]
  ------------------
 2025|  3.85k|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 2026|  3.85k|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 2027|       |
 2028|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 2029|       |     * the first member. We still haven't checked the encoding type. */
 2030|  17.2k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2030:23): [True: 16.7k, False: 552]
  ------------------
 2031|       |        /* Array element must be an object */
 2032|  16.7k|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (2032:12): [True: 40, False: 16.6k]
  ------------------
 2033|     40|            ctx->index = oldIndex; /* Restore the index */
 2034|     40|            return NULL;
 2035|     40|        }
 2036|       |
 2037|       |        /* Check for non-JSON encoding */
 2038|  16.6k|        size_t encIndex = 0;
 2039|  16.6k|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2040|  16.6k|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  16.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2040:12): [True: 68, False: 16.6k]
  ------------------
 2041|     68|            ctx->index = oldIndex; /* Restore the index */
 2042|     68|            return NULL;
 2043|     68|        }
 2044|       |
 2045|       |        /* Get the type NodeId index */
 2046|  16.6k|        size_t memberTypeIdIndex = 0;
 2047|  16.6k|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 2048|  16.6k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  16.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2048:12): [True: 264, False: 16.3k]
  ------------------
 2049|    264|            ctx->index = oldIndex; /* Restore the index */
 2050|    264|            return NULL;
 2051|    264|        }
 2052|       |
 2053|       |        /* Is it the same type? Compare raw NodeId string */
 2054|  16.3k|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 2055|  16.3k|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 2056|  16.3k|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (2056:12): [True: 2.64k, False: 13.7k]
  ------------------
 2057|  13.7k|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (2057:12): [True: 286, False: 13.4k]
  ------------------
 2058|  2.93k|            ctx->index = oldIndex; /* Restore the index */
 2059|  2.93k|            return NULL;
 2060|  2.93k|        }
 2061|       |
 2062|       |        /* Skip to the next array member */
 2063|  13.4k|        skipObject(ctx);
 2064|  13.4k|    }
 2065|       |
 2066|    552|    ctx->index = oldIndex; /* Restore the index */
 2067|    552|    return typeOfBody;
 2068|  3.85k|}
ua_types_encoding_json.c:getExtensionObjectType:
 1966|  7.59k|getExtensionObjectType(ParseCtx *ctx) {
 1967|  7.59k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1967:8): [True: 203, False: 7.39k]
  ------------------
 1968|    203|        return NULL;
 1969|       |
 1970|       |    /* Get the type NodeId index */
 1971|  7.39k|    size_t typeIdIndex = 0;
 1972|  7.39k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1973|  7.39k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  7.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1973:8): [True: 817, False: 6.57k]
  ------------------
 1974|    817|        return NULL;
 1975|       |
 1976|  6.57k|    size_t oldIndex = ctx->index;
 1977|  6.57k|    ctx->index = (UA_UInt16)typeIdIndex;
 1978|       |
 1979|       |    /* Decode the type NodeId */
 1980|  6.57k|    UA_NodeId typeId;
 1981|  6.57k|    UA_NodeId_init(&typeId);
 1982|  6.57k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|  6.57k|#define UA_TYPES_NODEID 16
  ------------------
 1983|  6.57k|    ctx->index = oldIndex;
 1984|  6.57k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  6.57k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1984:8): [True: 2.44k, False: 4.12k]
  ------------------
 1985|  2.44k|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1986|  2.44k|        return NULL;
 1987|  2.44k|    }
 1988|       |
 1989|       |    /* Lookup an return */
 1990|  4.12k|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1991|  4.12k|    UA_NodeId_clear(&typeId);
 1992|  4.12k|    return type;
 1993|  6.57k|}
ua_types_encoding_json.c:Array_decodeJsonUnwrapExtensionObject:
 2072|    552|                                      const UA_DataType *type) {
 2073|    552|    size_t *size_ptr = (size_t*) dst - 1; /* Save the length pointer of the array */
 2074|    552|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2075|       |
 2076|       |    /* Known from the previous unwrapping-check */
 2077|    552|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|    552|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2077:5): [True: 552, False: 0]
  ------------------
 2078|    552|    UA_assert(length > 0);
  ------------------
  |  |  399|    552|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2078:5): [True: 552, False: 0]
  ------------------
 2079|       |
 2080|    552|    ctx->index++; /* Go to first array member */
 2081|       |
 2082|       |    /* Allocate memory */
 2083|    552|    if(length > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2083:8): [True: 0, False: 552]
  ------------------
 2084|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2085|    552|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|    552|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2086|    552|    if(*dst == NULL)
  ------------------
  |  Branch (2086:8): [True: 1, False: 551]
  ------------------
 2087|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2088|       |
 2089|       |    /* Decode array members */
 2090|    551|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    551|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2091|    551|    uintptr_t ptr = (uintptr_t)*dst;
 2092|  9.65k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2092:23): [True: 9.17k, False: 485]
  ------------------
 2093|  9.17k|        UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|  9.17k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2093:9): [True: 9.17k, False: 0]
  ------------------
 2094|  9.17k|        if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2094:12): [True: 8.36k, False: 804]
  ------------------
 2095|  8.36k|           type->typeKind == UA_DATATYPEKIND_OPTSTRUCT) {
  ------------------
  |  Branch (2095:12): [True: 0, False: 804]
  ------------------
 2096|       |            /* Decode structure in-situ in the ExtensionObject */
 2097|  8.36k|            ret = decodeJsonStructureExtensionObject(ctx, (void*)ptr, type);
 2098|  8.36k|        } else if(type->typeKind == UA_DATATYPEKIND_UNION) {
  ------------------
  |  Branch (2098:19): [True: 0, False: 804]
  ------------------
 2099|       |            /* Decode union in-situ in the ExtensionObject */
 2100|      0|            ret = decodeJsonUnionExtensionObject(ctx, (void*)ptr, type);
 2101|    804|        } else {
 2102|       |            /* Get the body field and decode it */
 2103|    804|            DecodeEntry entries[3] = {
 2104|    804|                {UA_JSONKEY_TYPEID, NULL, NULL, false, NULL},
 2105|    804|                {UA_JSONKEY_BODY, (void*)ptr, NULL, false, type},
 2106|    804|                {UA_JSONKEY_ENCODING, NULL, NULL, false, NULL}
 2107|    804|            };
 2108|    804|            ret = decodeFields(ctx, entries, 3);
 2109|    804|        }
 2110|  9.17k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  9.17k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2110:12): [True: 66, False: 9.10k]
  ------------------
 2111|     66|            UA_Array_delete(*dst, i+1, type);
 2112|     66|            *dst = NULL;
 2113|     66|            return ret;
 2114|     66|        }
 2115|  9.10k|        ptr += type->memSize;
 2116|  9.10k|    }
 2117|       |
 2118|    485|    *size_ptr = length; /* All good, set the size */
 2119|    485|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    485|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2120|    551|}
ua_types_encoding_json.c:Variant_decodeJson:
 2260|  12.1k|DECODE_JSON(Variant) {
 2261|  12.1k|    UA_Variant *dst = (UA_Variant*)p;
 2262|  12.1k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1322|  12.1k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  12.1k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 195, False: 11.9k]
  |  |  ------------------
  |  | 1324|    195|        ctx->index++;                                \
  |  | 1325|    195|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    195|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  11.9k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
 2263|  11.9k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  11.9k|#define CHECK_OBJECT do {                                \
  |  | 1318|  11.9k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 11, False: 11.9k]
  |  |  ------------------
  |  | 1319|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  11.9k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
 2264|  11.9k|    return decodeJSONVariant(ctx, dst, false);
 2265|  11.9k|}
ua_types_encoding_json.c:Enum_decodeJson:
 1716|    622|DECODE_JSON(Enum) {
 1717|    622|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1717:8): [True: 399, False: 223]
  ------------------
 1718|    399|        return Int32_decodeJson(ctx, p, type);
 1719|    223|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (1719:8): [True: 6, False: 217]
  ------------------
 1720|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1721|       |
 1722|    217|    UA_String encoded = UA_STRING_NULL;
 1723|    217|    status ret = String_decodeJson(ctx, &encoded, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|    217|#define UA_TYPES_STRING 11
  ------------------
 1724|    217|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    217|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1724:8): [True: 6, False: 211]
  ------------------
 1725|      6|        return ret;
 1726|       |
 1727|       |    /* Use the suffix after the final underscore, if present. Enumeration
 1728|       |     * names can themselves contain underscores. */
 1729|    211|    size_t numberStart = 0;
 1730|  2.91M|    for(size_t i = encoded.length; i > 0; i--) {
  ------------------
  |  Branch (1730:36): [True: 2.91M, False: 179]
  ------------------
 1731|  2.91M|        if(encoded.data[i - 1] != '_')
  ------------------
  |  Branch (1731:12): [True: 2.91M, False: 32]
  ------------------
 1732|  2.91M|            continue;
 1733|     32|        if(i == 1 || i == encoded.length) {
  ------------------
  |  Branch (1733:12): [True: 1, False: 31]
  |  Branch (1733:22): [True: 1, False: 30]
  ------------------
 1734|      2|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1735|      2|            goto cleanup;
 1736|      2|        }
 1737|     30|        numberStart = i;
 1738|     30|        break;
 1739|     32|    }
 1740|       |
 1741|    209|    size_t numberLength = encoded.length - numberStart;
 1742|    209|    if(numberLength == 0) {
  ------------------
  |  Branch (1742:8): [True: 1, False: 208]
  ------------------
 1743|      1|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1744|      1|        goto cleanup;
 1745|      1|    }
 1746|       |
 1747|    208|    UA_Int64 value = 0;
 1748|    208|    size_t parsed = parseInt64((const char*)&encoded.data[numberStart],
 1749|    208|                               numberLength, &value);
 1750|    208|    if(parsed != numberLength || value < UA_INT32_MIN || value > UA_INT32_MAX) {
  ------------------
  |  |  100|    362|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(parsed != numberLength || value < UA_INT32_MIN || value > UA_INT32_MAX) {
  ------------------
  |  |  101|     94|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1750:8): [True: 54, False: 154]
  |  Branch (1750:34): [True: 60, False: 94]
  |  Branch (1750:58): [True: 1, False: 93]
  ------------------
 1751|    115|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    115|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1752|    115|        goto cleanup;
 1753|    115|    }
 1754|     93|    *(UA_Int32*)p = (UA_Int32)value;
 1755|       |
 1756|    211| cleanup:
 1757|    211|    UA_String_clear(&encoded);
 1758|    211|    return ret;
 1759|     93|}
ua_types_encoding_json.c:decodeJsonStructure:
 2811|    763|decodeJsonStructure(ParseCtx *ctx, void *dst, const UA_DataType *type) {
 2812|       |    return decodeJsonStructureInternal(ctx, dst, type, false);
 2813|    763|}

ua_types_encoding_json.c:currentTokenType:
  106|  4.01M|cj5_token_type currentTokenType(const ParseCtx *ctx) {
  107|  4.01M|    return ctx->tokens[ctx->index].type;
  108|  4.01M|}
ua_types_encoding_json.c:getTokenLength:
  111|  4.99M|size_t getTokenLength(const cj5_token *t) {
  112|  4.99M|    return (size_t)(1u + t->end - t->start);
  113|  4.99M|}
ua_pubsub_networkmessage_json.c:currentTokenType:
  106|  53.1k|cj5_token_type currentTokenType(const ParseCtx *ctx) {
  107|  53.1k|    return ctx->tokens[ctx->index].type;
  108|  53.1k|}
ua_pubsub_networkmessage_json.c:getTokenLength:
  111|  6.56k|size_t getTokenLength(const cj5_token *t) {
  112|  6.56k|    return (size_t)(1u + t->end - t->start);
  113|  6.56k|}

UA_Guid_parse:
   86|     61|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|     61|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|     61|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     61|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 55, False: 6]
  ------------------
   89|     55|        *guid = UA_GUID_NULL;
   90|     61|    return res;
   91|     61|}
UA_NodeId_parseEx:
  323|  28.3k|                  const UA_NamespaceMapping *nsMapping) {
  324|  28.3k|    UA_StatusCode res =
  325|  28.3k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  28.3k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  28.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 1.85k, False: 26.4k]
  ------------------
  327|  1.85k|        UA_NodeId_clear(id);
  328|  28.3k|    return res;
  329|  28.3k|}
UA_ExpandedNodeId_parseEx:
  671|  3.80k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  3.80k|    UA_StatusCode res =
  673|  3.80k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  3.80k|                             nsMapping, serverUrisSize, serverUris);
  675|  3.80k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.80k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 469, False: 3.33k]
  ------------------
  676|    469|        UA_ExpandedNodeId_clear(id);
  677|  3.80k|    return res;
  678|  3.80k|}
UA_QualifiedName_parseEx:
  834|  8.56k|                         const UA_NamespaceMapping *nsMapping) {
  835|  8.56k|    const u8 *pos = str.data;
  836|  8.56k|    const u8 *end = str.data + str.length;
  837|  8.56k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  838|  8.56k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  8.56k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (838:8): [True: 1, False: 8.56k]
  ------------------
  839|      1|        UA_QualifiedName_clear(qn);
  840|  8.56k|    return res;
  841|  8.56k|}
ua_types_lex.c:parse_guid:
   50|     92|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|     92|    size_t len = (size_t)(e - s);
   52|     92|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 28, False: 64]
  |  Branch (52:21): [True: 5, False: 59]
  |  Branch (52:36): [True: 3, False: 56]
  |  Branch (52:52): [True: 12, False: 44]
  ------------------
   53|     48|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|     44|    UA_UInt32 tmp;
   56|     44|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 10, False: 34]
  ------------------
   57|     10|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|     34|    guid->data1 = tmp;
   59|       |
   60|     34|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 3, False: 31]
  ------------------
   61|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|     31|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|     31|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 5, False: 26]
  ------------------
   65|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|     26|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|     26|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 4, False: 22]
  ------------------
   69|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|     22|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|     22|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 3, False: 19]
  ------------------
   73|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|     19|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|    100|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 90, False: 10]
  ------------------
   77|     90|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 9, False: 81]
  ------------------
   78|      9|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|     81|        guid->data4[pos] = (UA_Byte)tmp;
   80|     81|    }
   81|       |
   82|     10|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     10|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|     19|}
ua_types_lex.c:parse_nodeid:
  148|  28.3k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  28.3k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  28.3k|    LexContext context;
  151|  28.3k|    memset(&context, 0, sizeof(LexContext));
  152|  28.3k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  28.3k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  28.3k|{
  157|  28.3k|	u8 yych;
  158|  28.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  28.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  28.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  27.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 27.5k, False: 753]
  |  |  ------------------
  ------------------
  159|  28.3k|	switch (yych) {
  160|    519|		case 'b':
  ------------------
  |  Branch (160:3): [True: 519, False: 27.8k]
  ------------------
  161|    568|		case 'g':
  ------------------
  |  Branch (161:3): [True: 49, False: 28.2k]
  ------------------
  162|  20.1k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 19.5k, False: 8.77k]
  ------------------
  163|  25.1k|		case 's':
  ------------------
  |  Branch (163:3): [True: 5.01k, False: 23.3k]
  ------------------
  164|  25.1k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  25.1k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  25.1k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  25.1k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  25.1k|			goto yy3;
  167|  1.69k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 1.69k, False: 26.6k]
  ------------------
  168|  1.49k|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 1.49k, False: 26.8k]
  ------------------
  169|  28.3k|	}
  170|  1.49k|yy1:
  171|  1.49k|	YYSKIP();
  ------------------
  |  |   35|  1.49k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.49k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|  1.77k|yy2:
  173|  1.77k|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|  1.77k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  25.1k|yy3:
  175|  25.1k|	YYSKIP();
  ------------------
  |  |   35|  25.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  25.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  25.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  25.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  25.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  25.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 25.1k, False: 13]
  |  |  ------------------
  ------------------
  177|  25.1k|	switch (yych) {
  178|  25.1k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 25.1k, False: 46]
  ------------------
  179|     46|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 46, False: 25.1k]
  ------------------
  180|  25.1k|	}
  181|  1.69k|yy4:
  182|  1.69k|	YYSKIP();
  ------------------
  |  |   35|  1.69k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  1.69k|	YYBACKUP();
  ------------------
  |  |   36|  1.69k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.69k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  1.69k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.69k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.68k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.68k, False: 3]
  |  |  ------------------
  ------------------
  185|  1.69k|	switch (yych) {
  186|  1.67k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 1.67k, False: 16]
  ------------------
  187|     16|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 16, False: 1.67k]
  ------------------
  188|  1.69k|	}
  189|  26.5k|yy5:
  190|  26.5k|	YYSKIP();
  ------------------
  |  |   35|  26.5k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  26.5k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  26.5k|	nsu = context.yyt2;
  192|  26.5k|	ns = context.yyt1;
  193|  26.5k|	YYSTAGP(body);
  ------------------
  |  |   38|  26.5k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  26.5k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  26.5k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  26.5k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  26.5k|	{ goto match; }
  196|  1.67k|yy6:
  197|  1.67k|	YYSKIP();
  ------------------
  |  |   35|  1.67k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.67k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  1.67k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.67k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.67k, False: 4]
  |  |  ------------------
  ------------------
  199|  1.67k|	switch (yych) {
  200|    624|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 624, False: 1.05k]
  ------------------
  201|  1.04k|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 1.04k, False: 629]
  ------------------
  202|      5|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 5, False: 1.67k]
  ------------------
  203|  1.67k|	}
  204|    213|yy7:
  205|    213|	YYRESTORE();
  ------------------
  |  |   37|    213|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    213|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    213|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    213|	goto yy2;
  207|    624|yy8:
  208|    624|	YYSKIP();
  ------------------
  |  |   35|    624|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    624|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|    624|	yych = YYPEEK();
  ------------------
  |  |   33|    624|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    624|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    621|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 621, False: 3]
  |  |  ------------------
  ------------------
  210|    624|	switch (yych) {
  211|    256|		case '0':
  ------------------
  |  Branch (211:3): [True: 256, False: 368]
  ------------------
  212|    302|		case '1':
  ------------------
  |  Branch (212:3): [True: 46, False: 578]
  ------------------
  213|    346|		case '2':
  ------------------
  |  Branch (213:3): [True: 44, False: 580]
  ------------------
  214|    372|		case '3':
  ------------------
  |  Branch (214:3): [True: 26, False: 598]
  ------------------
  215|    400|		case '4':
  ------------------
  |  Branch (215:3): [True: 28, False: 596]
  ------------------
  216|    460|		case '5':
  ------------------
  |  Branch (216:3): [True: 60, False: 564]
  ------------------
  217|    542|		case '6':
  ------------------
  |  Branch (217:3): [True: 82, False: 542]
  ------------------
  218|    577|		case '7':
  ------------------
  |  Branch (218:3): [True: 35, False: 589]
  ------------------
  219|    609|		case '8':
  ------------------
  |  Branch (219:3): [True: 32, False: 592]
  ------------------
  220|    615|		case '9':
  ------------------
  |  Branch (220:3): [True: 6, False: 618]
  ------------------
  221|    615|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    615|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    615|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|    615|			goto yy10;
  223|      9|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 9, False: 615]
  ------------------
  224|    624|	}
  225|  1.04k|yy9:
  226|  1.04k|	YYSKIP();
  ------------------
  |  |   35|  1.04k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.04k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|  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: 4]
  |  |  ------------------
  ------------------
  228|  1.04k|	switch (yych) {
  229|  1.03k|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 1.03k, False: 13]
  ------------------
  230|     13|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 13, False: 1.03k]
  ------------------
  231|  1.04k|	}
  232|  3.52k|yy10:
  233|  3.52k|	YYSKIP();
  ------------------
  |  |   35|  3.52k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.52k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  3.52k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.52k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.52k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.42k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.42k, False: 105]
  |  |  ------------------
  ------------------
  235|  3.52k|	switch (yych) {
  236|    491|		case '0':
  ------------------
  |  Branch (236:3): [True: 491, False: 3.03k]
  ------------------
  237|    765|		case '1':
  ------------------
  |  Branch (237:3): [True: 274, False: 3.25k]
  ------------------
  238|  1.00k|		case '2':
  ------------------
  |  Branch (238:3): [True: 241, False: 3.28k]
  ------------------
  239|  1.29k|		case '3':
  ------------------
  |  Branch (239:3): [True: 292, False: 3.23k]
  ------------------
  240|  1.53k|		case '4':
  ------------------
  |  Branch (240:3): [True: 232, False: 3.29k]
  ------------------
  241|  1.75k|		case '5':
  ------------------
  |  Branch (241:3): [True: 223, False: 3.30k]
  ------------------
  242|  2.00k|		case '6':
  ------------------
  |  Branch (242:3): [True: 250, False: 3.27k]
  ------------------
  243|  2.25k|		case '7':
  ------------------
  |  Branch (243:3): [True: 252, False: 3.27k]
  ------------------
  244|  2.57k|		case '8':
  ------------------
  |  Branch (244:3): [True: 321, False: 3.20k]
  ------------------
  245|  2.91k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 338, False: 3.19k]
  ------------------
  246|    508|		case ';':
  ------------------
  |  Branch (246:3): [True: 508, False: 3.02k]
  ------------------
  247|    508|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    508|#define YYSTAGN(t) t = NULL
  ------------------
  248|    508|			goto yy12;
  249|    107|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 107, False: 3.42k]
  ------------------
  250|  3.52k|	}
  251|  1.03k|yy11:
  252|  1.03k|	YYSKIP();
  ------------------
  |  |   35|  1.03k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|  1.03k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.03k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.02k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.02k, False: 5]
  |  |  ------------------
  ------------------
  254|  1.03k|	switch (yych) {
  255|      5|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 5, False: 1.02k]
  ------------------
  256|    640|		case ';':
  ------------------
  |  Branch (256:3): [True: 640, False: 393]
  ------------------
  257|    640|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    640|#define YYSTAGN(t) t = NULL
  ------------------
  258|    640|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    640|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    640|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|    640|			goto yy12;
  260|    388|		default:
  ------------------
  |  Branch (260:3): [True: 388, False: 645]
  ------------------
  261|    388|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    388|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    388|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    388|			goto yy13;
  263|  1.03k|	}
  264|  1.52k|yy12:
  265|  1.52k|	YYSKIP();
  ------------------
  |  |   35|  1.52k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.52k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  1.52k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.52k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.52k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.50k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.50k, False: 15]
  |  |  ------------------
  ------------------
  267|  1.52k|	switch (yych) {
  268|    206|		case 'b':
  ------------------
  |  Branch (268:3): [True: 206, False: 1.31k]
  ------------------
  269|    408|		case 'g':
  ------------------
  |  Branch (269:3): [True: 202, False: 1.32k]
  ------------------
  270|    748|		case 'i':
  ------------------
  |  Branch (270:3): [True: 340, False: 1.18k]
  ------------------
  271|  1.50k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 759, False: 764]
  ------------------
  272|     16|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 16, False: 1.50k]
  ------------------
  273|  1.52k|	}
  274|  1.28k|yy13:
  275|  1.28k|	YYSKIP();
  ------------------
  |  |   35|  1.28k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.28k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|  1.28k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.28k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.28k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.26k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.26k, False: 13]
  |  |  ------------------
  ------------------
  277|  1.28k|	switch (yych) {
  278|     13|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 13, False: 1.26k]
  ------------------
  279|    375|		case ';':
  ------------------
  |  Branch (279:3): [True: 375, False: 906]
  ------------------
  280|    375|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    375|#define YYSTAGN(t) t = NULL
  ------------------
  281|    375|			goto yy12;
  282|    893|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 893, False: 388]
  ------------------
  283|  1.28k|	}
  284|  1.50k|yy14:
  285|  1.50k|	YYSKIP();
  ------------------
  |  |   35|  1.50k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.50k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  1.50k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.50k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.50k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.47k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.47k, False: 29]
  |  |  ------------------
  ------------------
  287|  1.50k|	switch (yych) {
  288|  1.46k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 1.46k, False: 45]
  ------------------
  289|     45|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 45, False: 1.46k]
  ------------------
  290|  1.50k|	}
  291|  1.50k|}
  292|       |
  293|       |
  294|  26.5k| match:
  295|  26.5k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 973, False: 25.6k]
  ------------------
  296|       |        /* NamespaceUri */
  297|    973|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|    973|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|    973|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    973|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 973, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|    973|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|    973|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|    973|            return UA_String_copy(&total, &id->identifier.string);
  304|    973|        }
  305|  25.6k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 489, False: 25.1k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|    489|        UA_UInt32 tmp;
  308|    489|        size_t len = (size_t)(body - 1 - ns);
  309|    489|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 489]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|    489|        id->namespaceIndex = (UA_UInt16)tmp;
  312|    489|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 489]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|    489|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  25.6k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  26.5k|}
ua_types_lex.c:escapedUri2Index:
   95|  1.89k|                 const UA_NamespaceMapping *nsMapping) {
   96|  1.89k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 1.89k, False: 0]
  ------------------
   97|  1.89k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  1.89k|#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|  27.8k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  27.8k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  27.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  27.8k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  27.8k|    switch(*body) {
  113|  20.2k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 20.2k, False: 7.58k]
  ------------------
  114|  20.2k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  20.2k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 37, False: 20.2k]
  ------------------
  116|     37|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  20.2k|        break;
  118|  6.47k|    case 's':
  ------------------
  |  Branch (118:5): [True: 6.47k, False: 21.3k]
  ------------------
  119|  6.47k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  6.47k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  6.47k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  6.47k|        break;
  123|     31|    case 'g':
  ------------------
  |  Branch (123:5): [True: 31, False: 27.8k]
  ------------------
  124|     31|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     31|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     31|        break;
  127|  1.08k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 1.08k, False: 26.7k]
  ------------------
  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.08k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  1.08k|        id->identifier.byteString.data =
  133|  1.08k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  1.08k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 26, False: 1.05k]
  ------------------
  135|     26|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  399|     26|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 26, False: 0]
  ------------------
  136|     26|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     26|        }
  138|  1.08k|        break;
  139|  1.08k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 27.8k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  27.8k|    }
  143|  27.8k|    return res;
  144|  27.8k|}
ua_types_lex.c:parse_expandednodeid:
  339|  3.80k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  3.80k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  3.80k|    LexContext context;
  342|  3.80k|    memset(&context, 0, sizeof(LexContext));
  343|  3.80k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  3.80k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  3.80k|{
  348|  3.80k|	u8 yych;
  349|  3.80k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.80k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.80k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.79k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.79k, False: 5]
  |  |  ------------------
  ------------------
  350|  3.80k|	switch (yych) {
  351|    225|		case 'b':
  ------------------
  |  Branch (351:3): [True: 225, False: 3.57k]
  ------------------
  352|    229|		case 'g':
  ------------------
  |  Branch (352:3): [True: 4, False: 3.79k]
  ------------------
  353|    442|		case 'i':
  ------------------
  |  Branch (353:3): [True: 213, False: 3.58k]
  ------------------
  354|    442|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    442|#define YYSTAGN(t) t = NULL
  ------------------
  355|    442|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    442|#define YYSTAGN(t) t = NULL
  ------------------
  356|    442|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    442|#define YYSTAGN(t) t = NULL
  ------------------
  357|    442|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    442|#define YYSTAGN(t) t = NULL
  ------------------
  358|    442|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    442|#define YYSTAGN(t) t = NULL
  ------------------
  359|    442|			goto yy18;
  360|  1.32k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 1.32k, False: 2.47k]
  ------------------
  361|  1.32k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.32k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  1.32k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.32k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  1.32k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.32k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  1.32k|			goto yy19;
  365|  2.03k|		case 's':
  ------------------
  |  Branch (365:3): [True: 2.03k, False: 1.77k]
  ------------------
  366|  2.03k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  2.03k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  2.03k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  2.03k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  2.03k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  2.03k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  2.03k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  2.03k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  2.03k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  2.03k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  2.03k|			goto yy20;
  372|      6|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 6, False: 3.79k]
  ------------------
  373|  3.80k|	}
  374|      6|yy16:
  375|      6|	YYSKIP();
  ------------------
  |  |   35|      6|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    456|yy17:
  377|    456|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    456|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|    442|yy18:
  379|    442|	YYSKIP();
  ------------------
  |  |   35|    442|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    442|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|    442|	yych = YYPEEK();
  ------------------
  |  |   33|    442|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    442|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    431|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 431, False: 11]
  |  |  ------------------
  ------------------
  381|    442|	switch (yych) {
  382|    415|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 415, False: 27]
  ------------------
  383|     27|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 27, False: 415]
  ------------------
  384|    442|	}
  385|  1.32k|yy19:
  386|  1.32k|	YYSKIP();
  ------------------
  |  |   35|  1.32k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.32k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  1.32k|	YYBACKUP();
  ------------------
  |  |   36|  1.32k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.32k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.32k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  1.32k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.32k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.32k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.32k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.32k, False: 1]
  |  |  ------------------
  ------------------
  389|  1.32k|	switch (yych) {
  390|  1.30k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 1.30k, False: 15]
  ------------------
  391|     15|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 15, False: 1.30k]
  ------------------
  392|  1.32k|	}
  393|  2.03k|yy20:
  394|  2.03k|	YYSKIP();
  ------------------
  |  |   35|  2.03k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  2.03k|	YYBACKUP();
  ------------------
  |  |   36|  2.03k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  2.03k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  2.03k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.03k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.02k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.02k, False: 3]
  |  |  ------------------
  ------------------
  397|  2.03k|	switch (yych) {
  398|    216|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 216, False: 1.81k]
  ------------------
  399|  1.81k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.81k, False: 219]
  ------------------
  400|      3|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 3, False: 2.02k]
  ------------------
  401|  2.03k|	}
  402|  3.34k|yy21:
  403|  3.34k|	YYSKIP();
  ------------------
  |  |   35|  3.34k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.34k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  3.34k|	svr = context.yyt5;
  405|  3.34k|	svu = context.yyt1;
  406|  3.34k|	sve = context.yyt2;
  407|  3.34k|	ns = context.yyt3;
  408|  3.34k|	nsu = context.yyt4;
  409|  3.34k|	YYSTAGP(body);
  ------------------
  |  |   38|  3.34k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.34k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  3.34k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  3.34k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  3.34k|	{ goto match; }
  412|  1.76k|yy22:
  413|  1.76k|	YYSKIP();
  ------------------
  |  |   35|  1.76k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.76k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  1.76k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.76k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.76k|#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: 8]
  |  |  ------------------
  ------------------
  415|  1.76k|	switch (yych) {
  416|    522|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 522, False: 1.24k]
  ------------------
  417|  1.23k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 1.23k, False: 534]
  ------------------
  418|     12|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 12, False: 1.75k]
  ------------------
  419|  1.76k|	}
  420|    405|yy23:
  421|    405|	YYRESTORE();
  ------------------
  |  |   37|    405|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    405|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    405|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    405|	goto yy17;
  423|  1.81k|yy24:
  424|  1.81k|	YYSKIP();
  ------------------
  |  |   35|  1.81k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.81k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.81k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.81k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.81k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.81k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.81k, False: 1]
  |  |  ------------------
  ------------------
  426|  1.81k|	switch (yych) {
  427|    621|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 621, False: 1.19k]
  ------------------
  428|  1.18k|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 1.18k, False: 625]
  ------------------
  429|      4|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 4, False: 1.80k]
  ------------------
  430|  1.81k|	}
  431|    522|yy25:
  432|    522|	YYSKIP();
  ------------------
  |  |   35|    522|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    522|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|    522|	yych = YYPEEK();
  ------------------
  |  |   33|    522|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    522|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    520|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 520, False: 2]
  |  |  ------------------
  ------------------
  434|    522|	switch (yych) {
  435|    159|		case '0':
  ------------------
  |  Branch (435:3): [True: 159, False: 363]
  ------------------
  436|    201|		case '1':
  ------------------
  |  Branch (436:3): [True: 42, False: 480]
  ------------------
  437|    220|		case '2':
  ------------------
  |  Branch (437:3): [True: 19, False: 503]
  ------------------
  438|    245|		case '3':
  ------------------
  |  Branch (438:3): [True: 25, False: 497]
  ------------------
  439|    256|		case '4':
  ------------------
  |  Branch (439:3): [True: 11, False: 511]
  ------------------
  440|    283|		case '5':
  ------------------
  |  Branch (440:3): [True: 27, False: 495]
  ------------------
  441|    501|		case '6':
  ------------------
  |  Branch (441:3): [True: 218, False: 304]
  ------------------
  442|    510|		case '7':
  ------------------
  |  Branch (442:3): [True: 9, False: 513]
  ------------------
  443|    518|		case '8':
  ------------------
  |  Branch (443:3): [True: 8, False: 514]
  ------------------
  444|    519|		case '9':
  ------------------
  |  Branch (444:3): [True: 1, False: 521]
  ------------------
  445|    519|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    519|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    519|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    519|			goto yy29;
  447|      3|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 3, False: 519]
  ------------------
  448|    522|	}
  449|  1.23k|yy26:
  450|  1.23k|	YYSKIP();
  ------------------
  |  |   35|  1.23k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  1.23k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.23k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.23k, False: 1]
  |  |  ------------------
  ------------------
  452|  1.23k|	switch (yych) {
  453|  1.22k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 1.22k, False: 15]
  ------------------
  454|     15|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 15, False: 1.22k]
  ------------------
  455|  1.23k|	}
  456|    621|yy27:
  457|    621|	YYSKIP();
  ------------------
  |  |   35|    621|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    621|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|    621|	yych = YYPEEK();
  ------------------
  |  |   33|    621|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    621|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    620|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 620, False: 1]
  |  |  ------------------
  ------------------
  459|    621|	switch (yych) {
  460|    608|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 608, False: 13]
  ------------------
  461|     13|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 13, False: 608]
  ------------------
  462|    621|	}
  463|  1.18k|yy28:
  464|  1.18k|	YYSKIP();
  ------------------
  |  |   35|  1.18k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.18k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|  1.18k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.18k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.18k, False: 2]
  |  |  ------------------
  ------------------
  466|  1.18k|	switch (yych) {
  467|  1.17k|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 1.17k, False: 15]
  ------------------
  468|     15|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 15, False: 1.17k]
  ------------------
  469|  1.18k|	}
  470|  3.47k|yy29:
  471|  3.47k|	YYSKIP();
  ------------------
  |  |   35|  3.47k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.47k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  3.47k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.47k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.47k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.38k, False: 84]
  |  |  ------------------
  ------------------
  473|  3.47k|	switch (yych) {
  474|    550|		case '0':
  ------------------
  |  Branch (474:3): [True: 550, False: 2.92k]
  ------------------
  475|    788|		case '1':
  ------------------
  |  Branch (475:3): [True: 238, False: 3.23k]
  ------------------
  476|  1.05k|		case '2':
  ------------------
  |  Branch (476:3): [True: 265, False: 3.20k]
  ------------------
  477|  1.34k|		case '3':
  ------------------
  |  Branch (477:3): [True: 287, False: 3.18k]
  ------------------
  478|  1.60k|		case '4':
  ------------------
  |  Branch (478:3): [True: 264, False: 3.20k]
  ------------------
  479|  1.83k|		case '5':
  ------------------
  |  Branch (479:3): [True: 227, False: 3.24k]
  ------------------
  480|  2.12k|		case '6':
  ------------------
  |  Branch (480:3): [True: 296, False: 3.17k]
  ------------------
  481|  2.38k|		case '7':
  ------------------
  |  Branch (481:3): [True: 262, False: 3.21k]
  ------------------
  482|  2.66k|		case '8':
  ------------------
  |  Branch (482:3): [True: 277, False: 3.19k]
  ------------------
  483|  2.95k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 287, False: 3.18k]
  ------------------
  484|    429|		case ';':
  ------------------
  |  Branch (484:3): [True: 429, False: 3.04k]
  ------------------
  485|    429|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    429|#define YYSTAGN(t) t = NULL
  ------------------
  486|    429|			goto yy33;
  487|     90|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 90, False: 3.38k]
  ------------------
  488|  3.47k|	}
  489|  1.22k|yy30:
  490|  1.22k|	YYSKIP();
  ------------------
  |  |   35|  1.22k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.22k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  1.22k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.22k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.22k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.21k, False: 1]
  |  |  ------------------
  ------------------
  492|  1.22k|	switch (yych) {
  493|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 1, False: 1.21k]
  ------------------
  494|    555|		case ';':
  ------------------
  |  Branch (494:3): [True: 555, False: 665]
  ------------------
  495|    555|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  496|    555|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    555|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    555|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    555|			goto yy33;
  498|    664|		default:
  ------------------
  |  Branch (498:3): [True: 664, False: 556]
  ------------------
  499|    664|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    664|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    664|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    664|			goto yy34;
  501|  1.22k|	}
  502|    608|yy31:
  503|    608|	YYSKIP();
  ------------------
  |  |   35|    608|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|    608|	yych = YYPEEK();
  ------------------
  |  |   33|    608|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    607|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 607, False: 1]
  |  |  ------------------
  ------------------
  505|    608|	switch (yych) {
  506|    221|		case '0':
  ------------------
  |  Branch (506:3): [True: 221, False: 387]
  ------------------
  507|    309|		case '1':
  ------------------
  |  Branch (507:3): [True: 88, False: 520]
  ------------------
  508|    331|		case '2':
  ------------------
  |  Branch (508:3): [True: 22, False: 586]
  ------------------
  509|    384|		case '3':
  ------------------
  |  Branch (509:3): [True: 53, False: 555]
  ------------------
  510|    411|		case '4':
  ------------------
  |  Branch (510:3): [True: 27, False: 581]
  ------------------
  511|    471|		case '5':
  ------------------
  |  Branch (511:3): [True: 60, False: 548]
  ------------------
  512|    516|		case '6':
  ------------------
  |  Branch (512:3): [True: 45, False: 563]
  ------------------
  513|    569|		case '7':
  ------------------
  |  Branch (513:3): [True: 53, False: 555]
  ------------------
  514|    593|		case '8':
  ------------------
  |  Branch (514:3): [True: 24, False: 584]
  ------------------
  515|    602|		case '9':
  ------------------
  |  Branch (515:3): [True: 9, False: 599]
  ------------------
  516|    602|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|    602|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    602|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|    602|			goto yy35;
  518|      6|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 6, False: 602]
  ------------------
  519|    608|	}
  520|  1.17k|yy32:
  521|  1.17k|	YYSKIP();
  ------------------
  |  |   35|  1.17k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.17k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|  1.17k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.17k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.17k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.17k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.17k, False: 2]
  |  |  ------------------
  ------------------
  523|  1.17k|	switch (yych) {
  524|      2|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 2, False: 1.17k]
  ------------------
  525|    805|		case ';':
  ------------------
  |  Branch (525:3): [True: 805, False: 367]
  ------------------
  526|    805|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    805|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    805|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|    805|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    805|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    805|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    805|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    805|#define YYSTAGN(t) t = NULL
  ------------------
  529|    805|			goto yy37;
  530|    365|		default:
  ------------------
  |  Branch (530:3): [True: 365, False: 807]
  ------------------
  531|    365|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    365|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    365|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    365|			goto yy36;
  533|  1.17k|	}
  534|  1.63k|yy33:
  535|  1.63k|	YYSKIP();
  ------------------
  |  |   35|  1.63k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.63k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  1.63k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.63k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.63k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.62k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.62k, False: 15]
  |  |  ------------------
  ------------------
  537|  1.63k|	switch (yych) {
  538|    219|		case 'b':
  ------------------
  |  Branch (538:3): [True: 219, False: 1.42k]
  ------------------
  539|    426|		case 'g':
  ------------------
  |  Branch (539:3): [True: 207, False: 1.43k]
  ------------------
  540|    906|		case 'i':
  ------------------
  |  Branch (540:3): [True: 480, False: 1.15k]
  ------------------
  541|  1.62k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 714, False: 925]
  ------------------
  542|     19|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 19, False: 1.62k]
  ------------------
  543|  1.63k|	}
  544|  1.69k|yy34:
  545|  1.69k|	YYSKIP();
  ------------------
  |  |   35|  1.69k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|  1.69k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.69k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.68k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.68k, False: 9]
  |  |  ------------------
  ------------------
  547|  1.69k|	switch (yych) {
  548|      9|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 9, False: 1.68k]
  ------------------
  549|    655|		case ';':
  ------------------
  |  Branch (549:3): [True: 655, False: 1.04k]
  ------------------
  550|    655|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    655|#define YYSTAGN(t) t = NULL
  ------------------
  551|    655|			goto yy33;
  552|  1.03k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 1.03k, False: 664]
  ------------------
  553|  1.69k|	}
  554|  77.1k|yy35:
  555|  77.1k|	YYSKIP();
  ------------------
  |  |   35|  77.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  77.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  77.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  77.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  77.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  77.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 77.1k, False: 81]
  |  |  ------------------
  ------------------
  557|  77.1k|	switch (yych) {
  558|  73.6k|		case '0':
  ------------------
  |  Branch (558:3): [True: 73.6k, False: 3.58k]
  ------------------
  559|  73.8k|		case '1':
  ------------------
  |  Branch (559:3): [True: 275, False: 76.9k]
  ------------------
  560|  74.1k|		case '2':
  ------------------
  |  Branch (560:3): [True: 307, False: 76.8k]
  ------------------
  561|  74.4k|		case '3':
  ------------------
  |  Branch (561:3): [True: 259, False: 76.9k]
  ------------------
  562|  74.7k|		case '4':
  ------------------
  |  Branch (562:3): [True: 282, False: 76.9k]
  ------------------
  563|  75.2k|		case '5':
  ------------------
  |  Branch (563:3): [True: 521, False: 76.6k]
  ------------------
  564|  75.4k|		case '6':
  ------------------
  |  Branch (564:3): [True: 247, False: 76.9k]
  ------------------
  565|  75.9k|		case '7':
  ------------------
  |  Branch (565:3): [True: 496, False: 76.6k]
  ------------------
  566|  76.2k|		case '8':
  ------------------
  |  Branch (566:3): [True: 264, False: 76.9k]
  ------------------
  567|  76.5k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 335, False: 76.8k]
  ------------------
  568|    481|		case ';':
  ------------------
  |  Branch (568:3): [True: 481, False: 76.7k]
  ------------------
  569|    481|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    481|#define YYSTAGN(t) t = NULL
  ------------------
  570|    481|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    481|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    481|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|    481|			goto yy37;
  572|    121|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 121, False: 77.0k]
  ------------------
  573|  77.1k|	}
  574|  2.33M|yy36:
  575|  2.33M|	YYSKIP();
  ------------------
  |  |   35|  2.33M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.33M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  2.33M|	yych = YYPEEK();
  ------------------
  |  |   33|  2.33M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.33M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.33M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.33M, False: 23]
  |  |  ------------------
  ------------------
  577|  2.33M|	switch (yych) {
  578|     23|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 23, False: 2.33M]
  ------------------
  579|    342|		case ';':
  ------------------
  |  Branch (579:3): [True: 342, False: 2.32M]
  ------------------
  580|    342|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    342|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    342|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    342|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    342|#define YYSTAGN(t) t = NULL
  ------------------
  582|    342|			goto yy37;
  583|  2.32M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 2.32M, False: 365]
  ------------------
  584|  2.33M|	}
  585|  1.62k|yy37:
  586|  1.62k|	YYSKIP();
  ------------------
  |  |   35|  1.62k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.62k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.62k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.62k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.62k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.61k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.61k, False: 10]
  |  |  ------------------
  ------------------
  588|  1.62k|	switch (yych) {
  589|    198|		case 'b':
  ------------------
  |  Branch (589:3): [True: 198, False: 1.43k]
  ------------------
  590|    592|		case 'g':
  ------------------
  |  Branch (590:3): [True: 394, False: 1.23k]
  ------------------
  591|    796|		case 'i':
  ------------------
  |  Branch (591:3): [True: 204, False: 1.42k]
  ------------------
  592|  1.14k|		case 's':
  ------------------
  |  Branch (592:3): [True: 350, False: 1.27k]
  ------------------
  593|  1.14k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.14k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.14k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.14k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.14k|			goto yy38;
  596|    469|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 469, False: 1.15k]
  ------------------
  597|     13|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 13, False: 1.61k]
  ------------------
  598|  1.62k|	}
  599|  2.76k|yy38:
  600|  2.76k|	YYSKIP();
  ------------------
  |  |   35|  2.76k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.76k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  2.76k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.76k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.76k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.72k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.72k, False: 40]
  |  |  ------------------
  ------------------
  602|  2.76k|	switch (yych) {
  603|  2.71k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 2.71k, False: 52]
  ------------------
  604|     52|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 52, False: 2.71k]
  ------------------
  605|  2.76k|	}
  606|    469|yy39:
  607|    469|	YYSKIP();
  ------------------
  |  |   35|    469|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    469|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|    469|	yych = YYPEEK();
  ------------------
  |  |   33|    469|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    469|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    468|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 468, False: 1]
  |  |  ------------------
  ------------------
  609|    469|	switch (yych) {
  610|    462|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 462, False: 7]
  ------------------
  611|      7|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 7, False: 462]
  ------------------
  612|    469|	}
  613|    469|}
  614|       |
  615|       |
  616|  3.34k| match:
  617|  3.34k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 1.10k, False: 2.23k]
  ------------------
  618|       |        /* ServerUri */
  619|  1.10k|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|  1.10k|        size_t i = 0;
  621|  1.10k|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 1.10k]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|  1.10k|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 1.10k, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|  1.10k|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|  1.10k|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|  1.10k|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|  1.10k|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  2.23k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 463, False: 1.77k]
  ------------------
  634|       |        /* ServerIndex */
  635|    463|        size_t len = (size_t)(sve - svr);
  636|    463|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 463]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|    463|    }
  639|       |
  640|  2.23k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 978, False: 1.26k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    978|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    978|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    978|#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|    978|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 727, False: 251]
  ------------------
  647|    727|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    978|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    978|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 978, False: 0]
  ------------------
  649|    978|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    978|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    978|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 1, False: 977]
  ------------------
  651|      1|            return res;
  652|  1.26k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 418, False: 843]
  ------------------
  653|       |        /* NamespaceIndex */
  654|    418|        UA_UInt32 tmp;
  655|    418|        size_t len = (size_t)(body - 1 - ns);
  656|    418|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 418]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|    418|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|    418|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 418]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|    418|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  2.23k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  2.23k|}
ua_types_lex.c:parse_qn:
  707|  8.56k|         UA_UInt16 defaultNamespaceIndex) {
  708|  8.56k|    size_t len;
  709|  8.56k|    UA_UInt32 tmp;
  710|  8.56k|    UA_String str;
  711|  8.56k|    UA_StatusCode res;
  712|       |
  713|  8.56k|    LexContext context;
  714|  8.56k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  8.56k|    const u8 *begin = pos;
  717|  8.56k|    UA_QualifiedName_init(qn);
  718|  8.56k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  8.56k|{
  722|  8.56k|	u8 yych;
  723|  8.56k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.56k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.56k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.78k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.78k, False: 778]
  |  |  ------------------
  ------------------
  724|  8.56k|	switch (yych) {
  725|    778|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 778, False: 7.78k]
  ------------------
  726|    980|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 202, False: 8.36k]
  ------------------
  727|    361|		case '0':
  ------------------
  |  Branch (727:3): [True: 361, False: 8.20k]
  ------------------
  728|    643|		case '1':
  ------------------
  |  Branch (728:3): [True: 282, False: 8.28k]
  ------------------
  729|  1.20k|		case '2':
  ------------------
  |  Branch (729:3): [True: 564, False: 8.00k]
  ------------------
  730|  1.46k|		case '3':
  ------------------
  |  Branch (730:3): [True: 260, False: 8.30k]
  ------------------
  731|  2.73k|		case '4':
  ------------------
  |  Branch (731:3): [True: 1.27k, False: 7.29k]
  ------------------
  732|  3.14k|		case '5':
  ------------------
  |  Branch (732:3): [True: 410, False: 8.15k]
  ------------------
  733|  5.17k|		case '6':
  ------------------
  |  Branch (733:3): [True: 2.03k, False: 6.53k]
  ------------------
  734|  5.54k|		case '7':
  ------------------
  |  Branch (734:3): [True: 365, False: 8.20k]
  ------------------
  735|  6.20k|		case '8':
  ------------------
  |  Branch (735:3): [True: 665, False: 7.90k]
  ------------------
  736|  6.47k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 262, False: 8.30k]
  ------------------
  737|  1.11k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 1.11k, False: 7.45k]
  ------------------
  738|  8.56k|	}
  739|    980|yy41:
  740|    980|	YYSKIP();
  ------------------
  |  |   35|    980|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    980|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  8.13k|yy42:
  742|  8.13k|	{ pos = begin; goto match_name; }
  743|  1.11k|yy43:
  744|  1.11k|	YYSKIP();
  ------------------
  |  |   35|  1.11k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.11k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  1.11k|	YYBACKUP();
  ------------------
  |  |   36|  1.11k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.11k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.11k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  1.11k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.11k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.11k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    719|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 719, False: 396]
  |  |  ------------------
  ------------------
  747|  1.11k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 396, False: 719]
  ------------------
  748|    719|	goto yy46;
  749|  6.47k|yy44:
  750|  6.47k|	YYSKIP();
  ------------------
  |  |   35|  6.47k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.47k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  6.47k|	YYBACKUP();
  ------------------
  |  |   36|  6.47k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  6.47k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  6.47k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  6.47k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.47k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.47k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.33k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.33k, False: 5.13k]
  |  |  ------------------
  ------------------
  753|  6.47k|	switch (yych) {
  754|    137|		case '0':
  ------------------
  |  Branch (754:3): [True: 137, False: 6.33k]
  ------------------
  755|    194|		case '1':
  ------------------
  |  Branch (755:3): [True: 57, False: 6.41k]
  ------------------
  756|    243|		case '2':
  ------------------
  |  Branch (756:3): [True: 49, False: 6.42k]
  ------------------
  757|    262|		case '3':
  ------------------
  |  Branch (757:3): [True: 19, False: 6.45k]
  ------------------
  758|    333|		case '4':
  ------------------
  |  Branch (758:3): [True: 71, False: 6.40k]
  ------------------
  759|    387|		case '5':
  ------------------
  |  Branch (759:3): [True: 54, False: 6.41k]
  ------------------
  760|    453|		case '6':
  ------------------
  |  Branch (760:3): [True: 66, False: 6.40k]
  ------------------
  761|    514|		case '7':
  ------------------
  |  Branch (761:3): [True: 61, False: 6.41k]
  ------------------
  762|    674|		case '8':
  ------------------
  |  Branch (762:3): [True: 160, False: 6.31k]
  ------------------
  763|    721|		case '9':
  ------------------
  |  Branch (763:3): [True: 47, False: 6.42k]
  ------------------
  764|    940|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 219, False: 6.25k]
  ------------------
  765|  5.53k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 5.53k, False: 940]
  ------------------
  766|  6.47k|	}
  767|   147k|yy45:
  768|   147k|	YYSKIP();
  ------------------
  |  |   35|   147k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   147k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|   147k|	yych = YYPEEK();
  ------------------
  |  |   33|   147k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   147k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   146k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 146k, False: 524]
  |  |  ------------------
  ------------------
  770|   147k|yy46:
  771|   147k|	switch (yych) {
  772|    524|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 524, False: 147k]
  ------------------
  773|    195|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 195, False: 147k]
  ------------------
  774|   147k|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 147k, False: 719]
  ------------------
  775|   147k|	}
  776|  1.23k|yy47:
  777|  1.23k|	YYRESTORE();
  ------------------
  |  |   37|  1.23k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  1.23k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  1.23k|	goto yy42;
  779|    195|yy48:
  780|    195|	YYSKIP();
  ------------------
  |  |   35|    195|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    195|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    195|	{ goto match_uri; }
  782|  31.8k|yy49:
  783|  31.8k|	YYSKIP();
  ------------------
  |  |   35|  31.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  31.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|  31.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  31.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  31.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  31.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 31.3k, False: 553]
  |  |  ------------------
  ------------------
  785|  32.8k|yy50:
  786|  32.8k|	switch (yych) {
  787|  27.9k|		case '0':
  ------------------
  |  Branch (787:3): [True: 27.9k, False: 4.88k]
  ------------------
  788|  28.2k|		case '1':
  ------------------
  |  Branch (788:3): [True: 330, False: 32.4k]
  ------------------
  789|  28.5k|		case '2':
  ------------------
  |  Branch (789:3): [True: 280, False: 32.5k]
  ------------------
  790|  28.7k|		case '3':
  ------------------
  |  Branch (790:3): [True: 234, False: 32.5k]
  ------------------
  791|  29.1k|		case '4':
  ------------------
  |  Branch (791:3): [True: 332, False: 32.4k]
  ------------------
  792|  30.1k|		case '5':
  ------------------
  |  Branch (792:3): [True: 1.06k, False: 31.7k]
  ------------------
  793|  30.4k|		case '6':
  ------------------
  |  Branch (793:3): [True: 297, False: 32.5k]
  ------------------
  794|  30.7k|		case '7':
  ------------------
  |  Branch (794:3): [True: 328, False: 32.4k]
  ------------------
  795|  31.5k|		case '8':
  ------------------
  |  Branch (795:3): [True: 717, False: 32.0k]
  ------------------
  796|  31.8k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 365, False: 32.4k]
  ------------------
  797|    234|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 234, False: 32.5k]
  ------------------
  798|    706|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 706, False: 32.1k]
  ------------------
  799|  32.8k|	}
  800|    234|yy51:
  801|    234|	YYSKIP();
  ------------------
  |  |   35|    234|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    234|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    234|	{ goto match_index; }
  803|  32.8k|}
  804|       |
  805|       |
  806|    234| match_index:
  807|    234|    len = (size_t)(pos - 1 - begin);
  808|    234|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 234]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    234|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    234|    if(nsMapping)
  ------------------
  |  Branch (811:8): [True: 0, False: 234]
  ------------------
  812|      0|        qn->namespaceIndex =
  813|      0|            UA_NamespaceMapping_remote2Local(nsMapping, qn->namespaceIndex);
  814|    234|    goto match_name;
  815|       |
  816|    195| match_uri:
  817|    195|    str.length = (size_t)(pos - 1 - begin);
  818|    195|    str.data = (UA_Byte*)(uintptr_t)begin;
  819|    195|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  820|    195|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    195|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (820:8): [True: 195, False: 0]
  ------------------
  821|    195|        pos = begin; /* Use the entire string for the name */
  822|       |
  823|  8.56k| match_name:
  824|  8.56k|    str.length = (size_t)(end - pos);
  825|  8.56k|    str.data = (UA_Byte*)(uintptr_t)pos;
  826|  8.56k|    res = UA_String_copy(&str, &qn->name);
  827|  8.56k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  578|  8.56k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (578:23): [True: 8.56k, False: 1]
  |  |  ------------------
  ------------------
  828|  8.56k|        res = UA_String_unescape(&qn->name, false, escName);
  829|  8.56k|    return res;
  830|    195|}

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

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

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

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

ua_types.c:UA_ByteString_init:
  243|  8.34k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  243|  18.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  243|  1.85k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  243|    469|# 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|  8.56k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  243|  41.8k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  243|  1.63k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  243|  41.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  243|  35.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  243|  16.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  243|     85|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  243|    499|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_clear:
  243|  31.7k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_DataValue_clear:
  243|  25.8k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_equal:
  243|    129|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_ByteString_clear:
  243|  6.85k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_String_clear:
  243|  6.89k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

