UA_unbase64:
   75|  7.89k|UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) {
   76|       |    /* Empty base64 results in an empty byte-string */
   77|  7.89k|    if(len == 0) {
  ------------------
  |  Branch (77:8): [True: 966, False: 6.92k]
  ------------------
   78|    966|        *out_len = 0;
   79|    966|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|    966|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
   80|    966|    }
   81|       |
   82|       |    /* Allocate the output string. Append four bytes to allow missing padding */
   83|  6.92k|    size_t olen = (len / 4 * 3) + 4;
   84|  6.92k|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |   18|  6.92k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   85|  6.92k|    if(!out)
  ------------------
  |  Branch (85:8): [True: 4, False: 6.92k]
  ------------------
   86|      4|        return NULL;
   87|       |
   88|       |    /* Iterate over the input */
   89|  6.92k|    size_t pad = 0;
   90|  6.92k|    unsigned char count = 0;
   91|  6.92k|    unsigned char block[4];
   92|  6.92k|    unsigned char *pos = out;
   93|  37.7k|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (93:23): [True: 30.9k, False: 6.86k]
  ------------------
   94|  30.9k|        if(src[i] & 0x80)
  ------------------
  |  Branch (94:12): [True: 31, False: 30.8k]
  ------------------
   95|     31|            goto error; /* Non-ASCII input */
   96|  30.8k|        unsigned char tmp = dtable[src[i]];
   97|  30.8k|        if(tmp == 0x80)
  ------------------
  |  Branch (97:12): [True: 9, False: 30.8k]
  ------------------
   98|      9|            goto error; /* Not an allowed character */
   99|  30.8k|        if(tmp == 0x7f)
  ------------------
  |  Branch (99:12): [True: 18.9k, False: 11.9k]
  ------------------
  100|  18.9k|            continue; /* Whitespace is ignored to accomodate RFC 2045, used in
  101|       |                       * XML for xs:base64Binary. */
  102|  11.9k|        block[count++] = tmp;
  103|       |
  104|       |        /* Padding */
  105|  11.9k|        if(src[i] == '=') {
  ------------------
  |  Branch (105:12): [True: 311, False: 11.6k]
  ------------------
  106|    311|            if(count < 3) /* Padding can only be the last two bytes of a block */
  ------------------
  |  Branch (106:16): [True: 4, False: 307]
  ------------------
  107|      4|                goto error;
  108|    307|            block[count-1] = 0;
  109|    307|            pad++;
  110|  11.6k|        } else if(pad > 0) {
  ------------------
  |  Branch (110:19): [True: 10, False: 11.5k]
  ------------------
  111|     10|            goto error; /* Padding not terminated correctly */
  112|     10|        }
  113|       |
  114|       |        /* Write three output characters for four characters of input */
  115|  11.9k|        if(count == 4) {
  ------------------
  |  Branch (115:12): [True: 2.94k, False: 8.95k]
  ------------------
  116|  2.94k|            if(pad > 2)
  ------------------
  |  Branch (116:16): [True: 0, False: 2.94k]
  ------------------
  117|      0|                goto error; /* Invalid padding */
  118|  2.94k|            *pos++ = (block[0] << 2) | (block[1] >> 4);
  119|  2.94k|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  120|  2.94k|            *pos++ = (block[2] << 6) | block[3];
  121|  2.94k|            count = 0;
  122|  2.94k|            pos -= pad;
  123|  2.94k|            pad = 0;
  124|  2.94k|        }
  125|  11.9k|    }
  126|       |
  127|       |    /* Input length not a multiple of four */
  128|  6.86k|    if(count > 0)
  ------------------
  |  Branch (128:8): [True: 27, False: 6.84k]
  ------------------
  129|     27|        goto error;
  130|       |
  131|  6.84k|    *out_len = (size_t)(pos - out);
  132|  6.84k|    if(*out_len == 0) {
  ------------------
  |  Branch (132:8): [True: 6.43k, False: 405]
  ------------------
  133|  6.43k|        UA_free(out);
  ------------------
  |  |   19|  6.43k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  134|  6.43k|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  6.43k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  135|  6.43k|    }
  136|    405|    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.84k|}

cj5_parse:
  306|  8.14k|          cj5_options *options) {
  307|  8.14k|    cj5_result r;
  308|  8.14k|    cj5__parser parser;
  309|  8.14k|    memset(&parser, 0x0, sizeof(parser));
  310|  8.14k|    parser.curr_tok_idx = 0;
  311|  8.14k|    parser.json5 = json5;
  312|  8.14k|    parser.len = len;
  313|  8.14k|    parser.tokens = tokens;
  314|  8.14k|    parser.max_tokens = max_tokens;
  315|       |
  316|  8.14k|    if(options)
  ------------------
  |  Branch (316:8): [True: 8.14k, False: 0]
  ------------------
  317|  8.14k|        parser.stop_early = options->stop_early;
  318|       |
  319|  8.14k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  320|  8.14k|    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.14k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  324|       |                                   // (value) or ',' (comma).
  325|  8.14k|    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.14k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  330|       |
  331|  8.14k|    cj5_token *token = NULL; // The current token
  332|       |
  333|  9.48k| start_parsing:
  334|  72.1M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (334:11): [True: 72.1M, False: 7.71k]
  ------------------
  335|  72.1M|        char c = json5[parser.pos];
  336|  72.1M|        switch(c) {
  337|  1.08M|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (337:9): [True: 1.08M, False: 71.0M]
  ------------------
  338|  2.19M|        case '\r':
  ------------------
  |  Branch (338:9): [True: 1.10M, False: 71.0M]
  ------------------
  339|  2.29M|        case '\t':
  ------------------
  |  Branch (339:9): [True: 103k, False: 72.0M]
  ------------------
  340|  2.50M|        case ' ':
  ------------------
  |  Branch (340:9): [True: 213k, False: 71.9M]
  ------------------
  341|  2.50M|            break;
  342|       |
  343|  24.2k|        case '#': // Skip comment
  ------------------
  |  Branch (343:9): [True: 24.2k, False: 72.1M]
  ------------------
  344|  27.7k|        case '/':
  ------------------
  |  Branch (344:9): [True: 3.57k, False: 72.1M]
  ------------------
  345|  27.7k|            cj5__skip_comment(&parser);
  346|  27.7k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (346:16): [True: 11.7k, False: 16.0k]
  ------------------
  347|  11.7k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (347:16): [True: 156, False: 11.6k]
  ------------------
  348|    156|                goto finish;
  349|  27.6k|            break;
  350|       |
  351|   179k|        case '{': // Open an object or array
  ------------------
  |  Branch (351:9): [True: 179k, False: 71.9M]
  ------------------
  352|   245k|        case '[':
  ------------------
  |  Branch (352:9): [True: 65.2k, False: 72.0M]
  ------------------
  353|       |            // Check the nesting depth
  354|   245k|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   53|   245k|#define CJ5_MAX_NESTING 256
  ------------------
  |  Branch (354:16): [True: 3, False: 245k]
  ------------------
  355|      3|                parser.error = CJ5_ERROR_INVALID;
  356|      3|                goto finish;
  357|      3|            }
  358|       |
  359|       |            // Correct next?
  360|   245k|            if(next[depth] != 'v') {
  ------------------
  |  Branch (360:16): [True: 30, False: 245k]
  ------------------
  361|     30|                parser.error = CJ5_ERROR_INVALID;
  362|     30|                goto finish;
  363|     30|            }
  364|       |
  365|   245k|            depth++; // Increase the nesting depth
  366|   245k|            nesting[depth] = c; // Set the nesting type
  367|   245k|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (367:27): [True: 179k, False: 65.1k]
  ------------------
  368|       |
  369|       |            // Create a token for the object or array
  370|   245k|            token = cj5__alloc_token(&parser);
  371|   245k|            if(token) {
  ------------------
  |  Branch (371:16): [True: 168k, False: 76.2k]
  ------------------
  372|   168k|                token->parent_id = parser.curr_tok_idx;
  373|   168k|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (373:31): [True: 118k, False: 50.5k]
  ------------------
  374|   168k|                token->start = parser.pos;
  375|   168k|                token->size = 0;
  376|   168k|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  377|       |                                                              // is for this token
  378|   168k|            }
  379|   245k|            break;
  380|       |
  381|   177k|        case '}': // Close an object or array
  ------------------
  |  Branch (381:9): [True: 177k, False: 71.9M]
  ------------------
  382|   219k|        case ']':
  ------------------
  |  Branch (382:9): [True: 42.0k, False: 72.1M]
  ------------------
  383|       |            // Check the nesting depth. Note that a "virtual root object" at
  384|       |            // depth zero must not be closed.
  385|   219k|            if(depth == 0) {
  ------------------
  |  Branch (385:16): [True: 20, False: 219k]
  ------------------
  386|     20|                parser.error = CJ5_ERROR_INVALID;
  387|     20|                goto finish;
  388|     20|            }
  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|   219k|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (393:16): [True: 10, False: 219k]
  ------------------
  394|   219k|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (394:17): [True: 177k, False: 42.0k]
  |  Branch (394:29): [True: 151k, False: 25.9k]
  |  Branch (394:51): [True: 5, False: 151k]
  ------------------
  395|     15|                parser.error = CJ5_ERROR_INVALID;
  396|     15|                goto finish;
  397|     15|            }
  398|       |
  399|   219k|            if(token) {
  ------------------
  |  Branch (399:16): [True: 140k, False: 79.0k]
  ------------------
  400|       |                // Finalize the current token
  401|   140k|                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|   140k|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (406:20): [True: 134k, False: 6.07k]
  ------------------
  407|   134k|                    parser.curr_tok_idx = token->parent_id;
  408|   134k|                    token = &tokens[token->parent_id];
  409|   134k|                    token->size++;
  410|   134k|                }
  411|   140k|            }
  412|       |
  413|       |            // Step one level up
  414|   219k|            depth--;
  415|   219k|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (415:27): [True: 6.48k, False: 213k]
  ------------------
  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|   219k|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (421:16): [True: 6.48k, False: 213k]
  |  Branch (421:30): [True: 0, False: 6.48k]
  ------------------
  422|      0|                goto finish;
  423|       |
  424|   219k|            break;
  425|       |
  426|  4.34M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (426:9): [True: 4.34M, False: 67.8M]
  ------------------
  427|  4.34M|            if(next[depth] != ':') {
  ------------------
  |  Branch (427:16): [True: 1.00k, False: 4.34M]
  ------------------
  428|  1.00k|                parser.error = CJ5_ERROR_INVALID;
  429|  1.00k|                goto finish;
  430|  1.00k|            }
  431|  4.34M|            next[depth] = 'v';
  432|  4.34M|            break;
  433|       |
  434|  30.2M|        case ',': // Comma
  ------------------
  |  Branch (434:9): [True: 30.2M, False: 41.9M]
  ------------------
  435|  30.2M|            if(next[depth] != ',') {
  ------------------
  |  Branch (435:16): [True: 16, False: 30.2M]
  ------------------
  436|     16|                parser.error = CJ5_ERROR_INVALID;
  437|     16|                goto finish;
  438|     16|            }
  439|  30.2M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (439:27): [True: 4.18M, False: 26.0M]
  ------------------
  440|  30.2M|            break;
  441|       |
  442|  34.5M|        default: // Value or key
  ------------------
  |  Branch (442:9): [True: 34.5M, False: 37.5M]
  ------------------
  443|  34.5M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (443:16): [True: 30.2M, False: 4.34M]
  ------------------
  444|  30.2M|                cj5__parse_primitive(&parser); // Parse primitive value
  445|  30.2M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (445:20): [True: 30.2M, False: 1.35k]
  ------------------
  446|       |                    // Parent is object or array
  447|  30.2M|                    if(token)
  ------------------
  |  Branch (447:24): [True: 29.0M, False: 1.15M]
  ------------------
  448|  29.0M|                        token->size++;
  449|  30.2M|                    next[depth] = ',';
  450|  30.2M|                } else {
  451|       |                    // The current value was the root element. Don't look for
  452|       |                    // any next element.
  453|  1.35k|                    next[depth] = 0;
  454|       |
  455|       |                    // The first element was successfully parsed. Stop early or try to
  456|       |                    // parse the full input string?
  457|  1.35k|                    if(parser.stop_early)
  ------------------
  |  Branch (457:24): [True: 0, False: 1.35k]
  ------------------
  458|      0|                        goto finish;
  459|  1.35k|                }
  460|  30.2M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (460:23): [True: 4.34M, False: 240]
  ------------------
  461|  4.34M|                cj5__parse_key(&parser);
  462|  4.34M|                if(token)
  ------------------
  |  Branch (462:20): [True: 3.27M, False: 1.06M]
  ------------------
  463|  3.27M|                    token->size++; // Keys count towards the length
  464|  4.34M|                next[depth] = ':';
  465|  4.34M|            } else {
  466|    240|                parser.error = CJ5_ERROR_INVALID;
  467|    240|            }
  468|       |
  469|  34.5M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (469:16): [True: 17.7M, False: 16.7M]
  |  Branch (469:32): [True: 538, False: 17.7M]
  ------------------
  470|    538|                goto finish;
  471|       |
  472|  34.5M|            break;
  473|  72.1M|        }
  474|  72.1M|    }
  475|       |
  476|       |    // Are we back to the initial nesting depth?
  477|  7.71k|    if(depth != 0) {
  ------------------
  |  Branch (477:8): [True: 203, False: 7.50k]
  ------------------
  478|    203|        parser.error = CJ5_ERROR_INCOMPLETE;
  479|    203|        goto finish;
  480|    203|    }
  481|       |
  482|       |    // Close the virtual root object if there is one
  483|  7.50k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (483:8): [True: 936, False: 6.57k]
  |  Branch (483:29): [True: 906, False: 30]
  ------------------
  484|       |        // Check the we end after a complete key-value pair (or dangling comma)
  485|    906|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (485:12): [True: 898, False: 8]
  |  Branch (485:30): [True: 72, False: 826]
  ------------------
  486|     72|            parser.error = CJ5_ERROR_INVALID;
  487|    906|        tokens[0].end = parser.pos - 1;
  488|    906|    }
  489|       |
  490|  9.48k| finish:
  491|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  492|       |    // and restart parsing.
  493|  9.48k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (493:8): [True: 2.56k, False: 6.92k]
  ------------------
  494|  2.56k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (494:8): [True: 2.05k, False: 514]
  ------------------
  495|  2.05k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (495:8): [True: 1.73k, False: 316]
  |  Branch (495:22): [True: 1.34k, False: 392]
  ------------------
  496|  1.34k|        parser.token_count = 0;
  497|  1.34k|        token = cj5__alloc_token(&parser);
  498|  1.34k|        if(token) {
  ------------------
  |  Branch (498:12): [True: 1.34k, False: 0]
  ------------------
  499|  1.34k|            token->parent_id = 0;
  500|  1.34k|            token->type = CJ5_TOKEN_OBJECT;
  501|  1.34k|            token->start = 0;
  502|  1.34k|            token->size = 0;
  503|       |
  504|  1.34k|            nesting[0] = '{';
  505|  1.34k|            next[0] = 'k';
  506|       |
  507|  1.34k|            parser.curr_tok_idx = 0;
  508|  1.34k|            parser.pos = 0;
  509|  1.34k|            parser.error = CJ5_ERROR_NONE;
  510|  1.34k|            goto start_parsing;
  511|  1.34k|        }
  512|  1.34k|    }
  513|       |
  514|  8.14k|    memset(&r, 0x0, sizeof(r));
  515|  8.14k|    r.error = parser.error;
  516|  8.14k|    r.error_pos = parser.pos;
  517|  8.14k|    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.14k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (521:8): [True: 29, False: 8.11k]
  ------------------
  522|     29|        r.error = CJ5_ERROR_INCOMPLETE;
  523|       |
  524|       |    // Set the tokens and original string only if successfully parsed
  525|  8.14k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (525:8): [True: 6.89k, False: 1.25k]
  ------------------
  526|  6.89k|        r.tokens = tokens;
  527|  6.89k|        r.json5 = json5;
  528|  6.89k|    }
  529|       |
  530|  8.14k|    return r;
  531|  9.48k|}
cj5_get_str:
  629|  64.0k|            char *buf, unsigned int *buflen) {
  630|  64.0k|    const cj5_token *token = &r->tokens[tok_index];
  631|  64.0k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (631:8): [True: 0, False: 64.0k]
  ------------------
  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|  64.0k|    const char *pos = &r->json5[token->start];
  639|  64.0k|    const char *end = &r->json5[token->end + 1];
  640|  64.0k|    unsigned int outpos = 0;
  641|  64.0k|    cj5_error_code error = CJ5_ERROR_NONE;
  642|  23.3M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (642:11): [True: 23.3M, False: 63.8k]
  ------------------
  643|  23.3M|        uint8_t c = (uint8_t)*pos;
  644|       |        // Unprintable ascii characters must be escaped
  645|  23.3M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (645:12): [True: 77, False: 23.3M]
  |  Branch (645:23): [True: 3, False: 23.3M]
  ------------------
  646|     80|            error = CJ5_ERROR_INVALID;
  647|     80|            goto done;
  648|     80|        }
  649|       |
  650|       |        // Unescaped Ascii character or utf8 byte
  651|  23.3M|        if(c != '\\') {
  ------------------
  |  Branch (651:12): [True: 23.3M, False: 6.17k]
  ------------------
  652|  23.3M|            buf[outpos++] = (char)c;
  653|  23.3M|            continue;
  654|  23.3M|        }
  655|       |
  656|       |        // End of input before the escaped character
  657|  6.17k|        if(pos + 1 >= end) {
  ------------------
  |  Branch (657:12): [True: 0, False: 6.17k]
  ------------------
  658|      0|            error = CJ5_ERROR_INCOMPLETE;
  659|      0|            goto done;
  660|      0|        }
  661|       |
  662|       |        // Process escaped character
  663|  6.17k|        pos++;
  664|  6.17k|        c = (uint8_t)*pos;
  665|  6.17k|        switch(c) {
  666|    245|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (666:9): [True: 245, False: 5.92k]
  ------------------
  667|    260|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (667:9): [True: 260, False: 5.91k]
  ------------------
  668|    195|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (668:9): [True: 195, False: 5.97k]
  ------------------
  669|    369|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (669:9): [True: 369, False: 5.80k]
  ------------------
  670|    253|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (670:9): [True: 253, False: 5.92k]
  ------------------
  671|  2.78k|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (671:9): [True: 2.78k, False: 3.38k]
  ------------------
  672|  2.06k|        case 'u': {
  ------------------
  |  Branch (672:9): [True: 2.06k, False: 4.11k]
  ------------------
  673|       |            // Parse a unicode code point
  674|  2.06k|            if(pos + 4 >= end) {
  ------------------
  |  Branch (674:16): [True: 3, False: 2.06k]
  ------------------
  675|      3|                error = CJ5_ERROR_INCOMPLETE;
  676|      3|                goto done;
  677|      3|            }
  678|  2.06k|            pos++;
  679|  2.06k|            uint32_t utf;
  680|  2.06k|            error = parse_codepoint(pos, &utf);
  681|  2.06k|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (681:16): [True: 21, False: 2.03k]
  ------------------
  682|     21|                goto done;
  683|  2.03k|            pos += 3;
  684|       |
  685|       |            // Parse a surrogate pair
  686|  2.03k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (686:16): [True: 1.29k, False: 747]
  |  Branch (686:33): [True: 1.00k, False: 287]
  ------------------
  687|  1.00k|                if(pos + 6 >= end) {
  ------------------
  |  Branch (687:20): [True: 17, False: 988]
  ------------------
  688|     17|                    error = CJ5_ERROR_INVALID;
  689|     17|                    goto done;
  690|     17|                }
  691|    988|                if(pos[1] != '\\' && pos[2] != 'u') {
  ------------------
  |  Branch (691:20): [True: 320, False: 668]
  |  Branch (691:38): [True: 12, False: 308]
  ------------------
  692|     12|                    error = CJ5_ERROR_INVALID;
  693|     12|                    goto done;
  694|     12|                }
  695|    976|                pos += 3;
  696|    976|                uint32_t utf2;
  697|    976|                error = parse_codepoint(pos, &utf2);
  698|    976|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (698:20): [True: 15, False: 961]
  ------------------
  699|     15|                    goto done;
  700|    961|                pos += 3;
  701|       |                // High or low surrogate pair
  702|    961|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (702:23): [True: 607, False: 354]
  ------------------
  703|    607|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  704|    961|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  705|    961|            }
  706|       |
  707|       |            // Write the utf8 bytes of the code point
  708|  1.99k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  709|  1.99k|            if(len == 0) {
  ------------------
  |  Branch (709:16): [True: 31, False: 1.96k]
  ------------------
  710|     31|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  711|     31|                goto done;
  712|     31|            }
  713|  1.96k|            outpos += len;
  714|  1.96k|            break;
  715|  1.99k|        }
  716|  6.17k|        }
  717|  6.17k|    }
  718|       |
  719|  64.0k| 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|  64.0k|    buf[outpos] = 0;
  723|       |
  724|       |    // Set the output length
  725|  64.0k|    if(buflen)
  ------------------
  |  Branch (725:8): [True: 64.0k, False: 0]
  ------------------
  726|  64.0k|        *buflen = outpos;
  727|  64.0k|    return error;
  728|  64.0k|}
cj5.c:cj5__skip_comment:
  261|  27.7k|cj5__skip_comment(cj5__parser* parser) {
  262|  27.7k|    const char* json5 = parser->json5;
  263|       |
  264|       |    // Single-line comment
  265|  27.7k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (265:8): [True: 24.2k, False: 3.57k]
  ------------------
  266|  24.5k|    skip_line:
  267|  6.47M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (267:15): [True: 6.47M, False: 67]
  ------------------
  268|  6.47M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (268:16): [True: 24.5k, False: 6.44M]
  ------------------
  269|  24.5k|                parser->pos--; // Reparse the newline in the main parse loop
  270|  24.5k|                return;
  271|  24.5k|            }
  272|  6.44M|            parser->pos++;
  273|  6.44M|        }
  274|     67|        return;
  275|  24.5k|    }
  276|       |
  277|       |    // Comment begins with '/' but not enough space for another character
  278|  3.57k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (278:8): [True: 24, False: 3.55k]
  ------------------
  279|     24|        parser->error = CJ5_ERROR_INVALID;
  280|     24|        return;
  281|     24|    }
  282|  3.55k|    parser->pos++;
  283|       |
  284|       |    // Comment begins with '//' -> single-line comment
  285|  3.55k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (285:8): [True: 373, False: 3.18k]
  ------------------
  286|    373|        goto skip_line;
  287|       |
  288|       |    // Multi-line comments begin with '/*' and end with '*/'
  289|  3.18k|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (289:8): [True: 3.15k, False: 31]
  ------------------
  290|  3.15k|        parser->pos++;
  291|  1.38M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (291:15): [True: 1.38M, False: 101]
  ------------------
  292|  1.38M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (292:16): [True: 7.63k, False: 1.37M]
  |  Branch (292:45): [True: 3.04k, False: 4.58k]
  ------------------
  293|  3.04k|                parser->pos++;
  294|  3.04k|                return;
  295|  3.04k|            }
  296|  1.38M|        }
  297|  3.15k|    }
  298|       |
  299|       |    // Unknown comment type or the multi-line comment is not terminated
  300|    132|    parser->error = CJ5_ERROR_INCOMPLETE;
  301|    132|}
cj5.c:cj5__alloc_token:
   89|  34.8M|cj5__alloc_token(cj5__parser *parser) {
   90|  34.8M|    cj5_token* token = NULL;
   91|  34.8M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (91:8): [True: 16.9M, False: 17.8M]
  ------------------
   92|  16.9M|        token = &parser->tokens[parser->token_count];
   93|  16.9M|        memset(token, 0x0, sizeof(cj5_token));
   94|  17.8M|    } else {
   95|  17.8M|        parser->error = CJ5_ERROR_OVERFLOW;
   96|  17.8M|    }
   97|       |
   98|       |    // Always increase the index. So we know eventually how many token would be
   99|       |    // required (if there are not enough).
  100|  34.8M|    parser->token_count++;
  101|  34.8M|    return token;
  102|  34.8M|}
cj5.c:cj5__parse_primitive:
  153|  30.2M|cj5__parse_primitive(cj5__parser* parser) {
  154|  30.2M|    const char* json5 = parser->json5;
  155|  30.2M|    unsigned int len = parser->len;
  156|  30.2M|    unsigned int start = parser->pos;
  157|       |
  158|       |    // String value
  159|  30.2M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (159:8): [True: 1.33M, False: 28.8M]
  ------------------
  160|  28.8M|       json5[start] == '\'') {
  ------------------
  |  Branch (160:8): [True: 905, False: 28.8M]
  ------------------
  161|  1.33M|        cj5__parse_string(parser);
  162|  1.33M|        return;
  163|  1.33M|    }
  164|       |
  165|       |    // Fast comparison of bool, and null.
  166|       |    // Make the comparison case-insensitive.
  167|  28.8M|    uint32_t fourcc = 0;
  168|  28.8M|    if(start + 3 < len) {
  ------------------
  |  Branch (168:8): [True: 28.8M, False: 631]
  ------------------
  169|  28.8M|        fourcc += (unsigned char)json5[start] | 32U;
  170|  28.8M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  171|  28.8M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  172|  28.8M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  173|  28.8M|    }
  174|       |    
  175|  28.8M|    cj5_token_type type;
  176|  28.8M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (176:8): [True: 5.48k, False: 28.8M]
  ------------------
  177|  5.48k|        type = CJ5_TOKEN_NULL;
  178|  5.48k|        parser->pos += 3;
  179|  28.8M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (179:15): [True: 284, False: 28.8M]
  ------------------
  180|    284|        type = CJ5_TOKEN_BOOL;
  181|    284|        parser->pos += 3;
  182|  28.8M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (182:15): [True: 440, False: 28.8M]
  ------------------
  183|       |        // "false" has five characters
  184|    440|        type = CJ5_TOKEN_BOOL;
  185|    440|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (185:12): [True: 1, False: 439]
  |  Branch (185:32): [True: 19, False: 420]
  ------------------
  186|     20|            parser->error = CJ5_ERROR_INVALID;
  187|     20|            return;
  188|     20|        }
  189|    420|        parser->pos += 4;
  190|  28.8M|    } else {
  191|       |        // Numbers are checked for basic compatibility.
  192|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  193|  28.8M|        type = CJ5_TOKEN_NUMBER;
  194|  68.3M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (194:15): [True: 68.3M, False: 900]
  ------------------
  195|  68.3M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   86|   136M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (195:16): [True: 34.6M, False: 33.6M]
  ------------------
  196|  34.6M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (196:16): [True: 34.6M, False: 9.32k]
  ------------------
  197|  34.6M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   85|   102M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (197:16): [True: 32.2M, False: 2.35M]
  ------------------
  198|  32.2M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   84|   100M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (198:16): [True: 29.2M, False: 3.06M]
  ------------------
  199|  29.2M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (199:16): [True: 29.2M, False: 2.22k]
  |  Branch (199:48): [True: 28.8M, False: 345k]
  ------------------
  200|  28.8M|                break;
  201|  28.8M|            }
  202|  68.3M|        }
  203|  28.8M|        parser->pos--; // Point to the last character that is still inside the
  204|       |                       // primitive value
  205|  28.8M|    }
  206|       |
  207|  28.8M|    cj5_token *token = cj5__alloc_token(parser);
  208|  28.8M|    if(token) {
  ------------------
  |  Branch (208:8): [True: 13.9M, False: 14.8M]
  ------------------
  209|  13.9M|        token->type = type;
  210|  13.9M|        token->start = start;
  211|  13.9M|        token->end = parser->pos;
  212|  13.9M|        token->size = parser->pos - start + 1;
  213|  13.9M|        token->parent_id = parser->curr_tok_idx;
  214|  13.9M|    }
  215|  28.8M|}
cj5.c:cj5__parse_string:
  105|  3.15M|cj5__parse_string(cj5__parser *parser) {
  106|  3.15M|    const char *json5 = parser->json5;
  107|  3.15M|    unsigned int len = parser->len;
  108|  3.15M|    unsigned int start = parser->pos;
  109|  3.15M|    char str_open = json5[start];
  110|       |
  111|  3.15M|    parser->pos++;
  112|  58.2M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (112:11): [True: 58.2M, False: 152]
  ------------------
  113|  58.2M|        char c = json5[parser->pos];
  114|       |
  115|       |        // End of string
  116|  58.2M|        if(str_open == c) {
  ------------------
  |  Branch (116:12): [True: 3.15M, False: 55.0M]
  ------------------
  117|  3.15M|            cj5_token *token = cj5__alloc_token(parser);
  118|  3.15M|            if(token) {
  ------------------
  |  Branch (118:16): [True: 1.53M, False: 1.61M]
  ------------------
  119|  1.53M|                token->type = CJ5_TOKEN_STRING;
  120|  1.53M|                token->start = start + 1;
  121|  1.53M|                token->end = parser->pos - 1;
  122|  1.53M|                token->size = token->end - token->start + 1;
  123|  1.53M|                token->parent_id = parser->curr_tok_idx;
  124|  1.53M|            } 
  125|  3.15M|            return;
  126|  3.15M|        }
  127|       |
  128|       |        // Unescaped newlines are forbidden
  129|  55.0M|        if(c == '\n') {
  ------------------
  |  Branch (129:12): [True: 4, False: 55.0M]
  ------------------
  130|      4|            parser->error = CJ5_ERROR_INVALID;
  131|      4|            return;
  132|      4|        }
  133|       |
  134|       |        // Skip escape character
  135|  55.0M|        if(c == '\\') {
  ------------------
  |  Branch (135:12): [True: 259k, False: 54.8M]
  ------------------
  136|   259k|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (136:16): [True: 4, False: 259k]
  ------------------
  137|      4|                parser->error = CJ5_ERROR_INCOMPLETE;
  138|      4|                return;
  139|      4|            }
  140|   259k|            parser->pos++;
  141|   259k|        }
  142|  55.0M|    }
  143|       |
  144|       |    // The file has ended before the string terminates
  145|    152|    parser->error = CJ5_ERROR_INCOMPLETE;
  146|    152|}
cj5.c:cj5__isrange:
   80|   153M|cj5__isrange(char ch, char from, char to) {
   81|   153M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   82|   153M|}
cj5.c:cj5__parse_key:
  218|  4.34M|cj5__parse_key(cj5__parser* parser) {
  219|  4.34M|    const char* json5 = parser->json5;
  220|  4.34M|    unsigned int start = parser->pos;
  221|  4.34M|    cj5_token* token;
  222|       |
  223|       |    // Key is a a normal string
  224|  4.34M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (224:8): [True: 1.80M, False: 2.53M]
  |  Branch (224:32): [True: 2.23k, False: 2.53M]
  ------------------
  225|  1.81M|        cj5__parse_string(parser);
  226|  1.81M|        return;
  227|  1.81M|    }
  228|       |
  229|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  230|  2.53M|    unsigned int len = parser->len;
  231|  8.59M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (231:11): [True: 8.58M, False: 72]
  ------------------
  232|  8.58M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   85|  17.1M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 2.26M, False: 6.32M]
  |  |  ------------------
  ------------------
  233|  6.32M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  14.9M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 3.23M, False: 3.08M]
  |  |  ------------------
  ------------------
  234|  3.08M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (234:12): [True: 865, False: 3.08M]
  |  Branch (234:41): [True: 1.84k, False: 3.08M]
  ------------------
  235|  5.50M|            continue;
  236|  3.08M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   86|  6.17M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 553k, False: 2.53M]
  |  |  ------------------
  ------------------
  |  Branch (236:46): [True: 553k, False: 12]
  ------------------
  237|   553k|            continue;
  238|  2.53M|        break;
  239|  3.08M|    }
  240|       |
  241|       |    // An empty key is not allowed
  242|  2.53M|    if(parser->pos <= start) {
  ------------------
  |  Branch (242:8): [True: 118, False: 2.53M]
  ------------------
  243|    118|        parser->error = CJ5_ERROR_INVALID;
  244|    118|        return;
  245|    118|    }
  246|       |
  247|       |    // Move pos to the last character within the unquoted key
  248|  2.53M|    parser->pos--;
  249|       |
  250|  2.53M|    token = cj5__alloc_token(parser);
  251|  2.53M|    if(token) {
  ------------------
  |  Branch (251:8): [True: 1.27M, False: 1.25M]
  ------------------
  252|  1.27M|        token->type = CJ5_TOKEN_STRING;
  253|  1.27M|        token->start = start;
  254|  1.27M|        token->end = parser->pos;
  255|  1.27M|        token->size = parser->pos - start + 1;
  256|  1.27M|        token->parent_id = parser->curr_tok_idx;
  257|  1.27M|    }
  258|  2.53M|}
cj5.c:parse_codepoint:
  608|  3.03k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  609|  3.03k|    uint32_t utf = 0;
  610|  15.0k|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (610:29): [True: 12.0k, False: 3.00k]
  ------------------
  611|  12.0k|        char byte = pos[i];
  612|  12.0k|        if(cj5__isnum(byte)) {
  ------------------
  |  |   86|  12.0k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 3.31k, False: 8.77k]
  |  |  ------------------
  ------------------
  613|  3.31k|            byte = (char)(byte - '0');
  614|  8.77k|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (614:19): [True: 6.54k, False: 2.23k]
  ------------------
  615|  6.54k|            byte = (char)(byte - ('a' - 10));
  616|  6.54k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (616:19): [True: 2.19k, False: 36]
  ------------------
  617|  2.19k|            byte = (char)(byte - ('A' - 10));
  618|  2.19k|        } else {
  619|     36|            return CJ5_ERROR_INVALID;
  620|     36|        }
  621|  12.0k|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  622|  12.0k|    }
  623|  3.00k|    *out_utf = utf;
  624|  3.00k|    return CJ5_ERROR_NONE;
  625|  3.03k|}

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

parseUInt64:
   30|  2.67M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  2.67M|    size_t i = 0;
   32|  2.67M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  2.67M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 15.0k, False: 2.65M]
  |  Branch (35:20): [True: 5.92k, False: 9.14k]
  |  Branch (35:37): [True: 1.44k, False: 4.48k]
  ------------------
   36|  1.44k|        i = 2;
   37|   279k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 278k, False: 844]
  ------------------
   38|   278k|            uint8_t c = (uint8_t)str[i] | 32;
   39|   278k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 278k, False: 202]
  |  Branch (39:28): [True: 270k, False: 7.94k]
  ------------------
   40|   270k|                c = (uint8_t)(c - '0');
   41|  8.14k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 7.93k, False: 206]
  |  Branch (41:33): [True: 7.55k, False: 387]
  ------------------
   42|  7.55k|                c = (uint8_t)(c - 'a' + 10);
   43|    593|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 389, False: 204]
  |  Branch (43:33): [True: 0, False: 389]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    593|            else
   46|    593|                break;
   47|   277k|            n = (n << 4) | (c & 0xF);
   48|   277k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 5, False: 277k]
  ------------------
   49|      5|                return 0;
   50|   277k|            prev = n;
   51|   277k|        }
   52|  1.43k|        *result = n;
   53|  1.43k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 1.41k, False: 25]
  ------------------
   54|  1.44k|    }
   55|       |
   56|       |    /* Decimal */
   57|  7.70M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 5.04M, False: 2.65M]
  ------------------
   58|  5.04M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 8.84k, False: 5.03M]
  |  Branch (58:28): [True: 1.05k, False: 5.03M]
  ------------------
   59|  9.90k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  5.03M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  5.03M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 14, False: 5.03M]
  ------------------
   63|     14|            return 0;
   64|  5.03M|        prev = n;
   65|  5.03M|    }
   66|  2.66M|    *result = n;
   67|  2.66M|    return i;
   68|  2.66M|}
parseInt64:
   71|  1.33M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.33M|    size_t i = 0;
   74|  1.33M|    bool neg = false;
   75|  1.33M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 1.08k, False: 1.32M]
  |  Branch (75:23): [True: 335, False: 1.32M]
  ------------------
   76|  1.42k|        neg = (*str == '-');
   77|  1.42k|        i++;
   78|  1.42k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.33M|    uint64_t n = 0;
   82|  1.33M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.33M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 114, False: 1.33M]
  ------------------
   84|    114|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.33M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 1.32M, False: 1.07k]
  ------------------
   88|  1.32M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 65, False: 1.32M]
  ------------------
   89|     65|            return 0;
   90|  1.32M|        *result = (int64_t)n;
   91|  1.32M|    } 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.07k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 1, False: 1.07k]
  ------------------
   98|      1|            return 0;
   99|  1.07k|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 210, False: 862]
  ------------------
  100|  1.07k|            ? (int64_t)(-9223372036854775807LL - 1)
  101|  1.07k|            : -(int64_t)n;
  102|  1.07k|    }
  103|  1.33M|    return len + i;
  104|  1.33M|}
parseDouble:
  106|   531k|size_t parseDouble(const char *str, size_t size, double *result) {
  107|   531k|    char buf[2000];
  108|   531k|    if(size >= 2000)
  ------------------
  |  Branch (108:8): [True: 1, False: 531k]
  ------------------
  109|      1|        return 0;
  110|   531k|    memcpy(buf, str, size);
  111|   531k|    buf[size] = 0;
  112|   531k|    errno = 0;
  113|   531k|    char *endptr;
  114|   531k|    *result = strtod(buf, &endptr);
  115|   531k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (115:8): [True: 214, False: 531k]
  |  Branch (115:22): [True: 0, False: 214]
  ------------------
  116|      0|        return 0;
  117|   531k|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|   531k|}

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

findEncodingMetaData:
  313|  4.94k|                     UA_UInt16 dsWriterId) {
  314|  4.94k|    if(!eo)
  ------------------
  |  Branch (314:8): [True: 0, False: 4.94k]
  ------------------
  315|      0|        return NULL;
  316|  4.94k|    for(size_t i = 0; i < eo->metaDataSize; i++) {
  ------------------
  |  Branch (316:23): [True: 0, False: 4.94k]
  ------------------
  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.94k|    return NULL;
  321|  4.94k|}
UA_NetworkMessage_clear:
 1119|  6.89k|UA_NetworkMessage_clear(UA_NetworkMessage* p) {
 1120|  6.89k|    if(p->promotedFieldsEnabled) {
  ------------------
  |  Branch (1120:8): [True: 0, False: 6.89k]
  ------------------
 1121|      0|        UA_Array_delete(p->promotedFields, p->promotedFieldsSize,
 1122|      0|                        &UA_TYPES[UA_TYPES_VARIANT]);
  ------------------
  |  |  810|      0|#define UA_TYPES_VARIANT 23
  ------------------
 1123|      0|    }
 1124|       |
 1125|  6.89k|    if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) {
  ------------------
  |  Branch (1125:8): [True: 6.89k, False: 0]
  ------------------
 1126|  6.89k|        if(p->payload.dataSetMessages) {
  ------------------
  |  Branch (1126:12): [True: 6.37k, False: 513]
  ------------------
 1127|  12.9k|            for(size_t i = 0; i < p->messageCount; i++)
  ------------------
  |  Branch (1127:31): [True: 6.52k, False: 6.37k]
  ------------------
 1128|  6.52k|                UA_DataSetMessage_clear(&p->payload.dataSetMessages[i]);
 1129|  6.37k|            UA_free(p->payload.dataSetMessages);
  ------------------
  |  |   19|  6.37k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1130|  6.37k|        }
 1131|  6.89k|    }
 1132|       |
 1133|  6.89k|    UA_ByteString_clear(&p->securityFooter);
 1134|  6.89k|    UA_String_clear(&p->messageId);
 1135|       |
 1136|  6.89k|    if(p->publisherIdEnabled &&
  ------------------
  |  Branch (1136:8): [True: 78, False: 6.81k]
  ------------------
 1137|     78|       p->publisherId.idType == UA_PUBLISHERIDTYPE_STRING)
  ------------------
  |  Branch (1137:8): [True: 40, False: 38]
  ------------------
 1138|     40|       UA_String_clear(&p->publisherId.id.string);
 1139|       |
 1140|  6.89k|    memset(p, 0, sizeof(UA_NetworkMessage));
 1141|  6.89k|}
UA_DataSetMessage_clear:
 2053|  6.52k|UA_DataSetMessage_clear(UA_DataSetMessage* p) {
 2054|  6.52k|    if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) {
  ------------------
  |  Branch (2054:8): [True: 6.52k, False: 0]
  ------------------
 2055|  6.52k|        if(p->data.keyFrameFields)
  ------------------
  |  Branch (2055:12): [True: 4.94k, False: 1.57k]
  ------------------
 2056|  4.94k|            UA_Array_delete(p->data.keyFrameFields, p->fieldCount,
 2057|  4.94k|                            &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  776|  4.94k|#define UA_TYPES_DATAVALUE 22
  ------------------
 2058|  6.52k|    } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) {
  ------------------
  |  Branch (2058:15): [True: 0, False: 0]
  ------------------
 2059|      0|        if(p->data.deltaFrameFields) {
  ------------------
  |  Branch (2059:12): [True: 0, False: 0]
  ------------------
 2060|      0|            for(UA_UInt16 i = 0; i < p->fieldCount; i++)
  ------------------
  |  Branch (2060:34): [True: 0, False: 0]
  ------------------
 2061|      0|                UA_DataValue_clear(&p->data.deltaFrameFields[i].value);
 2062|      0|            UA_free(p->data.deltaFrameFields);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2063|      0|        }
 2064|      0|    }
 2065|       |
 2066|  6.52k|    memset(p, 0, sizeof(UA_DataSetMessage));
 2067|  6.52k|}

UA_NetworkMessage_decodeJson:
  611|  7.64k|                             const UA_DecodeJsonOptions *jo) {
  612|       |    /* Set up the context */
  613|  7.64k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
  614|  7.64k|    PubSubDecodeJsonCtx ctx;
  615|  7.64k|    memset(&ctx, 0, sizeof(PubSubDecodeJsonCtx));
  616|  7.64k|    ctx.ctx.tokens = tokens;
  617|  7.64k|    if(eo)
  ------------------
  |  Branch (617:8): [True: 0, False: 7.64k]
  ------------------
  618|      0|        ctx.eo = *eo;
  619|  7.64k|    if(jo) {
  ------------------
  |  Branch (619:8): [True: 0, False: 7.64k]
  ------------------
  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.64k|    status ret = tokenize(&ctx.ctx, src, UA_JSON_MAXTOKENCOUNT, NULL);
  ------------------
  |  |   21|  7.64k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
  627|  7.64k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  7.64k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (627:8): [True: 749, False: 6.89k]
  ------------------
  628|    749|        goto cleanup;
  629|       |
  630|  6.89k|    ret = NetworkMessage_decodeJsonInternal(&ctx, dst);
  631|  6.89k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.89k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (631:8): [True: 6.88k, False: 9]
  ------------------
  632|  6.88k|        UA_NetworkMessage_clear(dst);
  633|       |
  634|  7.64k| cleanup:
  635|       |    /* Free token array on the heap */
  636|  7.64k|    if(ctx.ctx.tokens != tokens)
  ------------------
  |  Branch (636:8): [True: 514, False: 7.12k]
  ------------------
  637|    514|        UA_free((void*)(uintptr_t)ctx.ctx.tokens);
  ------------------
  |  |   19|    514|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  638|  7.64k|    return ret;
  639|  6.89k|}
ua_pubsub_networkmessage_json.c:NetworkMessage_decodeJsonInternal:
  523|  6.89k|                                  UA_NetworkMessage *dst) {
  524|  6.89k|    memset(dst, 0, sizeof(UA_NetworkMessage));
  525|  6.89k|    dst->chunkMessage = false;
  526|  6.89k|    dst->groupHeaderEnabled = false;
  527|  6.89k|    dst->payloadHeaderEnabled = false;
  528|  6.89k|    dst->picosecondsEnabled = false;
  529|  6.89k|    dst->promotedFieldsEnabled = false;
  530|       |
  531|       |    /* The NetworkMessage must be a JSON object */
  532|  6.89k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (532:8): [True: 97, False: 6.79k]
  ------------------
  533|     97|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     97|#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.79k|    size_t searchResultMessages = 0;
  538|  6.79k|    status found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGES, &searchResultMessages);
  539|  6.79k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.79k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (539:8): [True: 148, False: 6.64k]
  ------------------
  540|    148|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|    148|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  541|  6.64k|    const cj5_token *bodyToken = &ctx->ctx.tokens[searchResultMessages];
  542|  6.64k|    size_t messageCount = 1;
  543|  6.64k|    if(bodyToken->type == CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (543:8): [True: 2.32k, False: 4.31k]
  ------------------
  544|  2.32k|        messageCount = (size_t)bodyToken->size;
  545|  6.64k|    dst->jsonSingleDataSetMessage = (bodyToken->type == CJ5_TOKEN_OBJECT);
  546|       |
  547|       |    /* Too many DataSetMessages */
  548|  6.64k|    if(messageCount > UA_NETWORKMESSAGE_MAXMESSAGECOUNT)
  ------------------
  |  |  138|  6.64k|#define UA_NETWORKMESSAGE_MAXMESSAGECOUNT 32
  ------------------
  |  Branch (548:8): [True: 2, False: 6.64k]
  ------------------
  549|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  550|       |
  551|       |    /* MessageType */
  552|  6.64k|    UA_Boolean isUaData = true;
  553|  6.64k|    size_t searchResultMessageType = 0;
  554|  6.64k|    found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGETYPE, &searchResultMessageType);
  555|  6.64k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.64k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (555:8): [True: 52, False: 6.59k]
  ------------------
  556|     52|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     52|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  557|  6.59k|    size_t size = getTokenLength(&ctx->ctx.tokens[searchResultMessageType]);
  558|  6.59k|    const char* msgType = &ctx->ctx.json5[ctx->ctx.tokens[searchResultMessageType].start];
  559|  6.59k|    if(size == 7) { /* ua-data */
  ------------------
  |  Branch (559:8): [True: 6.45k, False: 139]
  ------------------
  560|  6.45k|        if(strncmp(msgType, "ua-data", size) != 0)
  ------------------
  |  Branch (560:12): [True: 58, False: 6.39k]
  ------------------
  561|     58|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     58|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  562|  6.39k|        isUaData = true;
  563|  6.39k|    } else if(size == 11) { /* ua-metadata */
  ------------------
  |  Branch (563:15): [True: 93, False: 46]
  ------------------
  564|     93|        if(strncmp(msgType, "ua-metadata", size) != 0)
  ------------------
  |  Branch (564:12): [True: 92, False: 1]
  ------------------
  565|     92|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     92|#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.39k|    if(!isUaData)
  ------------------
  |  Branch (572:8): [True: 1, False: 6.39k]
  ------------------
  573|      1|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|      1|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  574|       |
  575|  6.39k|    if(messageCount > 0) {
  ------------------
  |  Branch (575:8): [True: 6.38k, False: 8]
  ------------------
  576|  6.38k|        dst->payload.dataSetMessages = (UA_DataSetMessage*)
  577|  6.38k|            UA_calloc(messageCount, sizeof(UA_DataSetMessage));
  ------------------
  |  |   20|  6.38k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  578|  6.38k|        if(!dst->payload.dataSetMessages)
  ------------------
  |  Branch (578:12): [True: 9, False: 6.37k]
  ------------------
  579|      9|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      9|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  580|  6.38k|    }
  581|  6.38k|    dst->messageCount = (UA_Byte)messageCount;
  582|       |
  583|       |    /* Network Message */
  584|  6.38k|    UA_String messageType;
  585|  6.38k|    DecodeEntry entries[5] = {
  586|  6.38k|        {UA_DECODEKEY_MESSAGEID, &dst->messageId, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|  6.38k|#define UA_TYPES_STRING 11
  ------------------
  587|  6.38k|        {UA_DECODEKEY_MESSAGETYPE, &messageType, NULL, false, NULL},
  588|  6.38k|        {UA_DECODEKEY_PUBLISHERID, &dst->publisherId, decodePublisherIdJsonInternal, false, NULL},
  589|  6.38k|        {UA_DECODEKEY_DATASETCLASSID, &dst->dataSetClassId, NULL, false, &UA_TYPES[UA_TYPES_GUID]},
  ------------------
  |  |  470|  6.38k|#define UA_TYPES_GUID 13
  ------------------
  590|  6.38k|        {UA_DECODEKEY_MESSAGES, dst, DatasetMessage_Array_decodeJsonInternal, false, NULL}
  591|  6.38k|    };
  592|       |
  593|  6.38k|    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.38k|    dst->publisherIdEnabled = entries[2].found;
  597|  6.38k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.38k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (597:8): [True: 6.37k, False: 9]
  ------------------
  598|  6.37k|        return ret;
  599|       |
  600|      9|    dst->messageIdEnabled = entries[0].found;
  601|      9|    dst->dataSetClassIdEnabled = entries[3].found;
  602|      9|    dst->payloadHeaderEnabled = true;
  603|       |
  604|      9|    return ret;
  605|  6.38k|}
ua_pubsub_networkmessage_json.c:decodePublisherIdJsonInternal:
  493|     78|                              const UA_DataType *type) {
  494|     78|    UA_PublisherId *p = (UA_PublisherId*)dst;
  495|     78|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER) {
  ------------------
  |  Branch (495:8): [True: 23, False: 55]
  ------------------
  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|     23|        p->idType = UA_PUBLISHERIDTYPE_UINT32;
  500|     23|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32](ctx, &p->id.uint32, NULL);
  501|     55|    } else if(currentTokenType(ctx) == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (501:15): [True: 53, 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|     53|        size_t index = ctx->index;
  506|     53|        UA_UInt64 numeric = 0;
  507|     53|        status res = decodeJsonJumpTable[UA_DATATYPEKIND_UINT64]
  508|     53|            (ctx, &numeric, &UA_TYPES[UA_TYPES_UINT64]);
  ------------------
  |  |  300|     53|#define UA_TYPES_UINT64 8
  ------------------
  509|     53|        if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     53|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (509:12): [True: 13, False: 40]
  ------------------
  510|     13|            p->idType = UA_PUBLISHERIDTYPE_UINT64;
  511|     13|            p->id.uint64 = numeric;
  512|     13|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     13|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  513|     13|        }
  514|     40|        ctx->index = index;
  515|     40|        p->idType = UA_PUBLISHERIDTYPE_STRING;
  516|     40|        return decodeJsonJumpTable[UA_DATATYPEKIND_STRING](ctx, &p->id.string, NULL);
  517|     53|    }
  518|      2|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  519|     78|}
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.30k, False: 3.90k]
  ------------------
  468|  2.30k|        length = (size_t)ctx->ctx.tokens[ctx->ctx.index].size;
  469|       |
  470|       |        /* Go to the first array member */
  471|  2.30k|        ctx->ctx.index++;
  472|       |
  473|       |        /* Return early for empty arrays */
  474|  2.30k|        if(length == 0)
  ------------------
  |  Branch (474:12): [True: 8, False: 2.29k]
  ------------------
  475|      8|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      8|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  476|  3.90k|    } else if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (476:15): [True: 338, False: 3.57k]
  ------------------
  477|    338|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    338|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  478|    338|    }
  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.06k, False: 3.80k]
  |  Branch (431:37): [True: 125, False: 1.93k]
  ------------------
  432|    125|        UA_String keyFrame = UA_STRING("ua-keyframe");
  433|    125|        if(!UA_String_equal(&messageType, &keyFrame))
  ------------------
  |  Branch (433:12): [True: 124, False: 1]
  ------------------
  434|    124|            ret = UA_STATUSCODE_BADNOTSUPPORTED;
  ------------------
  |  |  230|    124|#define UA_STATUSCODE_BADNOTSUPPORTED ((UA_StatusCode) 0x803D0000)
  ------------------
  435|    125|    }
  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.92k, False: 1.93k]
  |  Branch (439:37): [True: 1.92k, False: 18]
  |  Branch (439:58): [True: 17, 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|    304|                              const UA_DataType *_) {
  324|    304|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (324:8): [True: 299, False: 5]
  ------------------
  325|    299|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32]
  326|    299|            (ctx, statusCode, &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|    299|#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|    304|}
ua_pubsub_networkmessage_json.c:DataSetPayload_decodeJsonInternal:
  349|  4.95k|DataSetPayload_decodeJsonInternal(ParseCtx *ctx_, void *data, const UA_DataType *_) {
  350|  4.95k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  351|  4.95k|    struct PayloadData *pd = (struct PayloadData*)data;
  352|  4.95k|    UA_NetworkMessage *nm = pd->nm;
  353|  4.95k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[pd->dsmIndex];
  354|       |
  355|  4.95k|    dsm->header.dataSetMessageValid = true;
  356|       |
  357|  4.95k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (357:8): [True: 1, False: 4.95k]
  ------------------
  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.95k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (362:8): [True: 4, False: 4.95k]
  ------------------
  363|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#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.94k]
  ------------------
  375|      6|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      6|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  376|  4.94k|    dsm->fieldCount = (UA_UInt16)length;
  377|       |
  378|  4.94k|    const UA_DataSetMessage_EncodingMetaData *emd =
  379|  4.94k|            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.94k|    ctx->ctx.index++; /* Go to the first key */
  383|  4.94k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.94k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  384|  27.1k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (384:23): [True: 25.5k, False: 1.60k]
  ------------------
  385|  25.5k|        UA_assert(currentTokenType(&ctx->ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  25.5k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (385:9): [True: 25.5k, False: 0]
  ------------------
  386|  25.5k|        UA_String fieldName = UA_STRING_NULL;
  387|  25.5k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_STRING](&ctx->ctx, &fieldName, NULL);
  388|  25.5k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  25.5k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  25.5k|    do {                                                                                 \
  |  |  |  |  173|  25.5k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  579|  25.5k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (579:25): [True: 2, False: 25.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|      2|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|      2|        }                                                                                \
  |  |  |  |  176|  25.5k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  389|       |
  390|  25.5k|        size_t index = decodingFieldIndex(emd, fieldName, i);
  391|  25.5k|        if(index >= length) {
  ------------------
  |  Branch (391:12): [True: 0, False: 25.5k]
  ------------------
  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.5k|        UA_DataValue_clear(&dsm->data.keyFrameFields[index]);
  396|  25.5k|        UA_String_clear(&fieldName);
  397|  25.5k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_DATAVALUE]
  398|  25.5k|            (&ctx->ctx, &dsm->data.keyFrameFields[index], NULL);
  399|  25.5k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  25.5k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  25.5k|    do {                                                                                 \
  |  |  |  |  173|  25.5k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  579|  25.5k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (579:25): [True: 3.33k, False: 22.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|  3.33k|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|  3.33k|        }                                                                                \
  |  |  |  |  176|  25.5k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 22.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|  25.5k|    }
  401|       |
  402|  1.60k|    return ret;
  403|  4.94k|}
ua_pubsub_networkmessage_json.c:decodingFieldIndex:
  333|  25.5k|                   UA_String name, size_t origIndex) {
  334|  25.5k|    if(!emd)
  ------------------
  |  Branch (334:8): [True: 25.5k, False: 0]
  ------------------
  335|  25.5k|        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.1k|                          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.82M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  3.82M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (72:23): [True: 3.81M, False: 8.44k]
  ------------------
   73|  3.81M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (73:12): [True: 13.7k, False: 3.80M]
  ------------------
   74|  13.7k|            return &UA_TYPES[i];
   75|  3.81M|    }
   76|       |
   77|       |    /* Search in the customTypes */
   78|  8.44k|    while(customTypes) {
  ------------------
  |  Branch (78:11): [True: 0, False: 8.44k]
  ------------------
   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.44k|    return NULL;
   87|  8.44k|}
UA_STRING:
  223|    125|UA_STRING(char *chars) {
  224|    125|    UA_String s = {0, NULL};
  225|    125|    if(!chars)
  ------------------
  |  Branch (225:8): [True: 0, False: 125]
  ------------------
  226|      0|        return s;
  227|    125|    s.length = strlen(chars);
  228|    125|    s.data = (UA_Byte*)chars;
  229|    125|    return s;
  230|    125|}
UA_DateTime_fromStruct:
  515|     99|UA_DateTime_fromStruct(UA_DateTimeStruct ts) {
  516|       |    /* Seconds since the Unix epoch */
  517|     99|    struct musl_tm tm;
  518|     99|    memset(&tm, 0, sizeof(struct musl_tm));
  519|     99|    tm.tm_year = ts.year - 1900;
  520|     99|    tm.tm_mon = ts.month - 1;
  521|     99|    tm.tm_mday = ts.day;
  522|     99|    tm.tm_hour = ts.hour;
  523|     99|    tm.tm_min = ts.min;
  524|     99|    tm.tm_sec = ts.sec;
  525|     99|    long long sec_epoch = musl_tm_to_secs(&tm);
  526|       |
  527|     99|    UA_DateTime t = UA_DATETIME_UNIX_EPOCH;
  ------------------
  |  |  328|     99|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|     99|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|     99|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|     99|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  528|     99|    t += sec_epoch * UA_DATETIME_SEC;
  ------------------
  |  |  286|     99|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|     99|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|     99|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  529|     99|    t += ts.milliSec * UA_DATETIME_MSEC;
  ------------------
  |  |  285|     99|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|     99|#define UA_DATETIME_USEC 10LL
  |  |  ------------------
  ------------------
  530|     99|    t += ts.microSec * UA_DATETIME_USEC;
  ------------------
  |  |  284|     99|#define UA_DATETIME_USEC 10LL
  ------------------
  531|     99|    t += ts.nanoSec / 100;
  532|     99|    return t;
  533|     99|}
UA_ByteString_allocBuffer:
  762|  8.17k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  763|  8.17k|    UA_ByteString_init(bs);
  764|  8.17k|    if(length == 0) {
  ------------------
  |  Branch (764:8): [True: 0, False: 8.17k]
  ------------------
  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.17k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  8.17k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  769|  8.17k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  579|  8.17k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 5, False: 8.16k]
  |  |  ------------------
  ------------------
  770|      5|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  771|  8.16k|    bs->length = length;
  772|  8.16k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.16k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  773|  8.17k|}
UA_new:
 1928|  33.1k|UA_new(const UA_DataType *type) {
 1929|  33.1k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  33.1k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1930|  33.1k|    return p;
 1931|  33.1k|}
UA_copy:
 2104|  16.8k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2105|  16.8k|    memset(dst, 0, type->memSize); /* init */
 2106|  16.8k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2107|  16.8k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  16.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2107:8): [True: 5, False: 16.8k]
  ------------------
 2108|      5|        UA_clear(dst, type);
 2109|  16.8k|    return retval;
 2110|  16.8k|}
UA_clear:
 2207|   486k|UA_clear(void *p, const UA_DataType *type) {
 2208|   486k|    clearJumpTable[type->typeKind](p, type);
 2209|   486k|    memset(p, 0, type->memSize); /* init */
 2210|   486k|}
UA_delete:
 2213|  9.52k|UA_delete(void *p, const UA_DataType *type) {
 2214|  9.52k|    clearJumpTable[type->typeKind](p, type);
 2215|  9.52k|    UA_free(p);
  ------------------
  |  |   19|  9.52k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2216|  9.52k|}
UA_order:
 2681|    125|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2682|    125|    return orderJumpTable[type->typeKind](p1, p2, type);
 2683|    125|}
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: 3, False: 4.94k]
  ------------------
 2699|      3|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      3|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2700|  4.94k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2700:8): [True: 0, False: 4.94k]
  ------------------
 2701|      0|        return NULL;
 2702|  4.94k|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  4.94k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2703|  4.94k|}
UA_Array_copy:
 2707|  16.8k|              void **dst, const UA_DataType *type) {
 2708|  16.8k|    if(size == 0) {
  ------------------
  |  Branch (2708:8): [True: 3.80k, False: 13.0k]
  ------------------
 2709|  3.80k|        if(src == NULL)
  ------------------
  |  Branch (2709:12): [True: 0, False: 3.80k]
  ------------------
 2710|      0|            *dst = NULL;
 2711|  3.80k|        else
 2712|  3.80k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  3.80k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2713|  3.80k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.80k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2714|  3.80k|    }
 2715|       |
 2716|       |    /* Check the array consistency -- defensive programming in case the user
 2717|       |     * manually created an inconsistent array */
 2718|  13.0k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  579|  26.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 13.0k]
  |  |  |  Branch (579:43): [True: 0, False: 13.0k]
  |  |  |  Branch (579:43): [True: 0, False: 13.0k]
  |  |  ------------------
  ------------------
 2719|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2720|       |
 2721|  13.0k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2721:8): [True: 0, False: 13.0k]
  ------------------
 2722|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2723|  13.0k|    size_t byteSize = size * type->memSize;
 2724|       |
 2725|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2726|  13.0k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  13.0k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2727|  13.0k|    if(!*dst)
  ------------------
  |  Branch (2727:8): [True: 5, False: 13.0k]
  ------------------
 2728|      5|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2729|       |
 2730|  13.0k|    if(type->pointerFree) {
  ------------------
  |  Branch (2730:8): [True: 13.0k, False: 0]
  ------------------
 2731|  13.0k|        memcpy(*dst, src, byteSize);
 2732|  13.0k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  13.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2733|  13.0k|    }
 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.0k|}
UA_Array_delete:
 2850|   235k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2851|   235k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2851:8): [True: 52.9k, False: 182k]
  ------------------
 2852|  52.9k|        uintptr_t ptr = (uintptr_t)p;
 2853|   409k|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2853:27): [True: 356k, False: 52.9k]
  ------------------
 2854|   356k|            UA_clear((void*)ptr, type);
 2855|   356k|            ptr += type->memSize;
 2856|   356k|        }
 2857|  52.9k|    }
 2858|   235k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|   235k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2859|   235k|}
ua_types.c:Variant_clear:
 1384|   323k|Variant_clear(void *p, const UA_DataType *_) {
 1385|   323k|    UA_Variant *v = (UA_Variant *)p;
 1386|       |
 1387|       |    /* The content is "borrowed" */
 1388|   323k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1388:8): [True: 0, False: 323k]
  ------------------
 1389|      0|        return;
 1390|       |
 1391|       |    /* Delete the value */
 1392|   323k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  756|  35.3k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1392:8): [True: 35.3k, False: 287k]
  |  Branch (1392:19): [True: 32.2k, False: 3.01k]
  ------------------
 1393|  32.2k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1393:12): [True: 23.5k, False: 8.71k]
  ------------------
 1394|  23.5k|            v->arrayLength = 1;
 1395|  32.2k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1396|  32.2k|        v->data = NULL;
 1397|  32.2k|    }
 1398|       |
 1399|       |    /* Delete the array dimensions */
 1400|   323k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  756|   323k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1400:8): [True: 87, False: 322k]
  ------------------
 1401|     87|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|     87|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1402|   323k|}
ua_types.c:DataValue_clear:
 1858|   310k|DataValue_clear(void *p, const UA_DataType *_) {
 1859|   310k|    UA_DataValue *dv = (UA_DataValue *)p;
 1860|       |    Variant_clear(&dv->value, NULL);
 1861|   310k|}
ua_types.c:String_copy:
  284|  16.8k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  285|  16.8k|    const UA_String *srcS = (const UA_String*)src;
  286|  16.8k|    UA_String *dstS = (UA_String *)dst;
  287|  16.8k|    UA_StatusCode res =
  288|  16.8k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  289|  16.8k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|  16.8k|#define UA_TYPES_BYTE 2
  ------------------
  290|  16.8k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  16.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (290:8): [True: 16.8k, False: 5]
  ------------------
  291|  16.8k|        dstS->length = srcS->length;
  292|  16.8k|    return res;
  293|  16.8k|}
ua_types.c:nopClear:
 2169|  45.7k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  296|   161k|String_clear(void *p, const UA_DataType *_) {
  297|   161k|    UA_String *s = (UA_String*)p;
  298|   161k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|   161k|#define UA_TYPES_BYTE 2
  ------------------
  299|   161k|}
ua_types.c:NodeId_clear:
  777|  53.2k|NodeId_clear(void *p, const UA_DataType *_) {
  778|  53.2k|    UA_NodeId *id = (UA_NodeId*)p;
  779|  53.2k|    switch(id->identifierType) {
  780|  7.41k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (780:5): [True: 7.41k, False: 45.8k]
  ------------------
  781|  8.49k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (781:5): [True: 1.07k, False: 52.1k]
  ------------------
  782|  8.49k|        String_clear(&id->identifier.string, NULL);
  783|  8.49k|        break;
  784|  44.7k|    default: break;
  ------------------
  |  Branch (784:5): [True: 44.7k, False: 8.49k]
  ------------------
  785|  53.2k|    }
  786|  53.2k|}
ua_types.c:ExpandedNodeId_clear:
 1078|  4.51k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1079|  4.51k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1080|  4.51k|    NodeId_clear(&id->nodeId, NULL);
 1081|       |    String_clear(&id->namespaceUri, NULL);
 1082|  4.51k|}
ua_types.c:QualifiedName_clear:
  402|  8.95k|QualifiedName_clear(void *p, const UA_DataType *_) {
  403|  8.95k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  404|       |    String_clear(&qn->name, NULL);
  405|  8.95k|}
ua_types.c:LocalizedText_clear:
 1841|  2.95k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1842|  2.95k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1843|  2.95k|    String_clear(&lt->locale, NULL);
 1844|       |    String_clear(&lt->text, NULL);
 1845|  2.95k|}
ua_types.c:ExtensionObject_clear:
 1251|  36.1k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1252|  36.1k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1253|  36.1k|    switch(eo->encoding) {
 1254|  15.9k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1254:5): [True: 15.9k, False: 20.1k]
  ------------------
 1255|  16.2k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1255:5): [True: 284, False: 35.8k]
  ------------------
 1256|  18.4k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1256:5): [True: 2.17k, False: 33.9k]
  ------------------
 1257|  26.5k|    case UA_EXTENSIONOBJECT_ENCODED_JSON:
  ------------------
  |  Branch (1257:5): [True: 8.17k, False: 27.9k]
  ------------------
 1258|  26.5k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1259|  26.5k|        String_clear(&eo->content.encoded.body, NULL);
 1260|  26.5k|        break;
 1261|  9.52k|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1261:5): [True: 9.52k, False: 26.5k]
  ------------------
 1262|  9.52k|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1262:12): [True: 9.52k, False: 0]
  ------------------
 1263|  9.52k|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1264|  9.52k|        break;
 1265|      0|    default:
  ------------------
  |  Branch (1265:5): [True: 0, False: 36.1k]
  ------------------
 1266|      0|        break;
 1267|  36.1k|    }
 1268|  36.1k|}
ua_types.c:DiagnosticInfo_clear:
 1888|  11.2k|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1889|  11.2k|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1890|       |
 1891|  11.2k|    String_clear(&di->additionalInfo, NULL);
 1892|  11.2k|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1892:8): [True: 1, False: 11.2k]
  |  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|  11.2k|}
ua_types.c:clearStructure:
 2113|  24.4k|clearStructure(void *p, const UA_DataType *type) {
 2114|  24.4k|    uintptr_t ptr = (uintptr_t)p;
 2115|   137k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2115:23): [True: 112k, False: 24.4k]
  ------------------
 2116|   112k|        const UA_DataTypeMember *m = &type->members[i];
 2117|   112k|        const UA_DataType *mt = m->memberType;
 2118|   112k|        ptr += m->padding;
 2119|   112k|        if(!m->isOptional) {
  ------------------
  |  Branch (2119:12): [True: 112k, False: 0]
  ------------------
 2120|   112k|            if(!m->isArray) {
  ------------------
  |  Branch (2120:16): [True: 78.3k, False: 34.5k]
  ------------------
 2121|  78.3k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2122|  78.3k|                ptr += mt->memSize;
 2123|  78.3k|            } else {
 2124|  34.5k|                size_t length = *(size_t*)ptr;
 2125|  34.5k|                ptr += sizeof(size_t);
 2126|  34.5k|                UA_Array_delete(*(void**)ptr, length, mt);
 2127|  34.5k|                ptr += sizeof(void*);
 2128|  34.5k|            }
 2129|   112k|        } 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|   112k|    }
 2149|  24.4k|}
ua_types.c:nodeIdOrder:
 2299|  3.81M|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2300|  3.81M|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2301|  3.81M|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2302|       |    /* Compare namespaceIndex */
 2303|  3.81M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2303:8): [True: 96.2k, False: 3.72M]
  ------------------
 2304|  96.2k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2304:16): [True: 96.2k, False: 0]
  ------------------
 2305|       |
 2306|       |    /* Compare identifierType */
 2307|  3.72M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2307:8): [True: 982k, False: 2.74M]
  ------------------
 2308|   982k|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2308:16): [True: 982k, 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.72M, False: 13.7k]
  ------------------
 2315|  2.72M|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2315:20): [True: 322k, False: 2.40M]
  ------------------
 2316|  2.40M|                UA_ORDER_LESS : UA_ORDER_MORE;
 2317|  13.7k|        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|    125|stringOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2283|    125|    const UA_String *p1 = (const UA_String*)p1_;
 2284|    125|    const UA_String *p2 = (const UA_String*)p2_;
 2285|    125|    if(p1->length != p2->length)
  ------------------
  |  Branch (2285:8): [True: 40, False: 85]
  ------------------
 2286|     40|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2286:16): [True: 4, False: 36]
  ------------------
 2287|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2288|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2289|     85|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2289:8): [True: 0, False: 85]
  ------------------
 2290|     85|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2290:8): [True: 0, False: 85]
  ------------------
 2291|     85|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2291:8): [True: 0, False: 85]
  ------------------
 2292|     85|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2293|     85|    if(cmp != 0)
  ------------------
  |  Branch (2293:8): [True: 84, False: 1]
  ------------------
 2294|     84|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2294:16): [True: 35, False: 49]
  ------------------
 2295|      1|    return UA_ORDER_EQ;
 2296|     85|}

lookAheadForKey:
 1809|   168k|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|   168k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|   168k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1812:5): [True: 168k, False: 0]
  ------------------
 1813|       |
 1814|   168k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  233|   168k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1815|   168k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1816|   168k|    unsigned int end = ctx->tokens[ctx->index].end;
 1817|   168k|    ctx->index++; /* Move to the first key */
 1818|   857k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1818:11): [True: 852k, False: 4.99k]
  ------------------
 1819|   852k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1819:11): [True: 800k, False: 51.8k]
  ------------------
 1820|       |        /* Key must be a string */
 1821|   800k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|   800k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1821:9): [True: 800k, False: 0]
  ------------------
 1822|       |
 1823|       |        /* Move index to the value */
 1824|   800k|        ctx->index++;
 1825|       |
 1826|       |        /* Value for the key must exist */
 1827|   800k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|   800k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1827:9): [True: 800k, False: 0]
  ------------------
 1828|       |
 1829|       |        /* Compare the key (previous index) */
 1830|   800k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1830:12): [True: 111k, False: 688k]
  ------------------
 1831|   111k|            *resultIndex = ctx->index; /* Point result to the current index */
 1832|   111k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   111k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1833|   111k|            break;
 1834|   111k|        }
 1835|       |
 1836|   688k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1837|   688k|    }
 1838|   168k|    ctx->index = oldIndex; /* Restore the old index */
 1839|   168k|    return ret;
 1840|   168k|}
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|  37.6k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2620|       |    return decodeFieldsInternal(ctx, entries, entryCount, false);
 2621|  37.6k|}
decodeFieldsAllowUnknown:
 2625|  12.2k|                         size_t entryCount) {
 2626|       |    return decodeFieldsInternal(ctx, entries, entryCount, true);
 2627|  12.2k|}
tokenize:
 2954|  8.14k|         size_t *decodedLength) {
 2955|       |    /* Tokenize */
 2956|  8.14k|    cj5_options options;
 2957|  8.14k|    options.stop_early = (decodedLength != NULL);
 2958|  8.14k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2959|  8.14k|                             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.14k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2963:8): [True: 514, False: 7.62k]
  ------------------
 2964|    514|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2964:8): [True: 514, 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|    514|        ctx->tokens = (cj5_token*)
 2970|    514|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    514|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2971|    514|        if(!ctx->tokens)
  ------------------
  |  Branch (2971:12): [True: 12, False: 502]
  ------------------
 2972|     12|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     12|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2973|    502|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2974|    514|    }
 2975|       |
 2976|       |    /* Cannot recover from other errors */
 2977|  7.62k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2977:8): [True: 737, False: 6.89k]
  ------------------
 2978|    737|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    737|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2979|       |
 2980|  6.89k|    if(decodedLength)
  ------------------
  |  Branch (2980:8): [True: 0, False: 6.89k]
  ------------------
 2981|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2982|       |
 2983|       |    /* Set up the context */
 2984|  6.89k|    ctx->json5 = (char*)src->data;
 2985|  6.89k|    ctx->depth = 0;
 2986|  6.89k|    ctx->tokensSize = r.num_tokens;
 2987|  6.89k|    ctx->index = 0;
 2988|  6.89k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.89k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2989|  7.62k|}
ua_types_encoding_json.c:isJsonNullable:
  252|  3.57k|isJsonNullable(const UA_DataType *type) {
  253|  3.57k|    return (type->typeKind >= UA_DATATYPEKIND_STRING &&
  ------------------
  |  Branch (253:13): [True: 3.52k, False: 57]
  ------------------
  254|  3.52k|            type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO &&
  ------------------
  |  Branch (254:13): [True: 3.52k, False: 2]
  ------------------
  255|  3.52k|            type->typeKind != UA_DATATYPEKIND_STATUSCODE);
  ------------------
  |  Branch (255:13): [True: 3.51k, False: 4]
  ------------------
  256|  3.57k|}
ua_types_encoding_json.c:variantDimensionsValid:
  799|  1.12k|                       const UA_UInt32 *dimensions) {
  800|  1.12k|    if(dimensionsSize == 0 || !dimensions)
  ------------------
  |  Branch (800:8): [True: 3, False: 1.12k]
  |  Branch (800:31): [True: 0, False: 1.12k]
  ------------------
  801|      3|        return false;
  802|       |
  803|  1.12k|    size_t total = 1;
  804|  2.41k|    for(size_t i = 0; i < dimensionsSize; i++) {
  ------------------
  |  Branch (804:23): [True: 1.30k, False: 1.10k]
  ------------------
  805|  1.30k|        UA_UInt32 dimension = dimensions[i];
  806|  1.30k|        if(dimension == 0 || total > SIZE_MAX / dimension)
  ------------------
  |  Branch (806:12): [True: 12, False: 1.29k]
  |  Branch (806:30): [True: 1, False: 1.29k]
  ------------------
  807|     13|            return false;
  808|  1.29k|        total *= dimension;
  809|  1.29k|    }
  810|  1.10k|    return total == arrayLength;
  811|  1.12k|}
ua_types_encoding_json.c:jsoneq:
 1353|  1.30M|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.30M|    size_t len = getTokenLength(tok);
 1362|  1.30M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1362:8): [True: 1.30M, False: 0]
  ------------------
 1363|  1.30M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1363:8): [True: 227k, False: 1.07M]
  ------------------
 1364|   227k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1364:8): [True: 220k, False: 7.72k]
  ------------------
 1365|   220k|        return 0;
 1366|       |
 1367|  1.08M|    return -1;
 1368|  1.30M|}
ua_types_encoding_json.c:skipObject:
 1337|   897k|skipObject(ParseCtx *ctx) {
 1338|   897k|    unsigned int end = ctx->tokens[ctx->index].end;
 1339|  71.3M|    do {
 1340|  71.3M|        ctx->index++;
 1341|  71.3M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1341:13): [True: 71.3M, False: 11.2k]
  ------------------
 1342|  71.3M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1342:13): [True: 70.4M, False: 886k]
  ------------------
 1343|   897k|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2480|    427|DECODE_JSON(DiagnosticInfo) {
 2481|    427|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2482|    427|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1322|    427|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|    427|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 218, False: 209]
  |  |  ------------------
  |  | 1324|    218|        ctx->index++;                                \
  |  | 1325|    218|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    218|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|    218|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 209]
  |  |  ------------------
  ------------------
 2483|    209|    CHECK_OBJECT;
  ------------------
  |  | 1317|    209|#define CHECK_OBJECT do {                                \
  |  | 1318|    209|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 3, False: 206]
  |  |  ------------------
  |  | 1319|      3|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|    206|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 206]
  |  |  ------------------
  ------------------
 2484|       |
 2485|    206|    DecodeEntry entries[7] = {
 2486|    206|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2487|    206|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|    206|#define UA_TYPES_INT32 5
  ------------------
 2488|    206|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2489|    206|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|    206|#define UA_TYPES_INT32 5
  ------------------
 2490|    206|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2491|    206|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|    206|#define UA_TYPES_INT32 5
  ------------------
 2492|    206|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2493|    206|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|    206|#define UA_TYPES_INT32 5
  ------------------
 2494|    206|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2495|    206|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|    206|#define UA_TYPES_STRING 11
  ------------------
 2496|    206|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2497|    206|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|    206|#define UA_TYPES_STATUSCODE 18
  ------------------
 2498|    206|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2499|    206|         DiagnosticInfoInner_decodeJson, false, NULL}
 2500|    206|    };
 2501|    206|    status ret = decodeFields(ctx, entries, 7);
 2502|       |
 2503|    206|    dst->hasSymbolicId = entries[0].found;
 2504|    206|    dst->hasNamespaceUri = entries[1].found;
 2505|    206|    dst->hasLocalizedText = entries[2].found;
 2506|    206|    dst->hasLocale = entries[3].found;
 2507|    206|    dst->hasAdditionalInfo = entries[4].found;
 2508|    206|    dst->hasInnerStatusCode = entries[5].found;
 2509|    206|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2510|    206|    return ret;
 2511|    209|}
ua_types_encoding_json.c:decodeFieldsInternal:
 2526|  49.9k|                     UA_Boolean allowUnknown) {
 2527|  49.9k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  49.9k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  49.9k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 49.9k]
  |  |  ------------------
  |  | 1299|  49.9k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  49.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 49.9k]
  |  |  ------------------
  ------------------
 2528|  49.9k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1322|  49.9k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  49.9k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 214, False: 49.7k]
  |  |  ------------------
  |  | 1324|    214|        ctx->index++;                                \
  |  | 1325|    214|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    214|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  49.7k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 49.7k]
  |  |  ------------------
  ------------------
 2529|       |
 2530|  49.7k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |   22|  49.7k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2530:8): [True: 1, False: 49.7k]
  ------------------
 2531|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2532|       |
 2533|       |    /* Keys and values are counted separately */
 2534|  49.7k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  49.7k|#define CHECK_OBJECT do {                                \
  |  | 1318|  49.7k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 21, False: 49.6k]
  |  |  ------------------
  |  | 1319|     21|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  49.6k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 49.6k]
  |  |  ------------------
  ------------------
 2535|  49.6k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  399|  49.6k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2535:5): [True: 49.6k, False: 0]
  ------------------
 2536|  49.6k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2537|       |
 2538|  49.6k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2539|  49.6k|    ctx->depth++;
 2540|       |
 2541|  49.6k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  49.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2542|   147k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2542:25): [True: 108k, False: 39.4k]
  ------------------
 2543|       |        /* Key must be a string */
 2544|   108k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|   108k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2544:9): [True: 108k, False: 0]
  ------------------
 2545|   108k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|   108k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2545:9): [True: 108k, 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|   108k|        DecodeEntry *entry = NULL;
 2551|   416k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2551:29): [True: 381k, False: 35.0k]
  ------------------
 2552|   381k|            size_t ii = i;
 2553|   181M|            while(ii >= entryCount)
  ------------------
  |  Branch (2553:19): [True: 181M, False: 381k]
  ------------------
 2554|   181M|                ii -= entryCount;
 2555|       |
 2556|       |            /* Compare the key */
 2557|   381k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2557:16): [True: 307k, False: 73.1k]
  ------------------
 2558|   381k|                      entries[ii].fieldName) != 0)
 2559|   307k|                continue;
 2560|       |
 2561|       |            /* Key was already used -> duplicate, abort */
 2562|  73.1k|            if(entries[ii].found) {
  ------------------
  |  Branch (2562:16): [True: 3, False: 73.1k]
  ------------------
 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|  73.1k|            entries[ii].found = true;
 2569|  73.1k|            entry = &entries[ii];
 2570|  73.1k|            break;
 2571|  73.1k|        }
 2572|       |
 2573|       |        /* The key is unknown */
 2574|   108k|        if(!entry) {
  ------------------
  |  Branch (2574:12): [True: 35.0k, False: 73.1k]
  ------------------
 2575|  35.0k|            if(allowUnknown) {
  ------------------
  |  Branch (2575:16): [True: 34.9k, False: 65]
  ------------------
 2576|  34.9k|                ctx->index++; /* key -> value */
 2577|  34.9k|                skipObject(ctx);
 2578|  34.9k|                continue;
 2579|  34.9k|            }
 2580|     65|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     65|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2581|     65|            break;
 2582|  35.0k|        }
 2583|       |
 2584|       |        /* Go from key to value */
 2585|  73.1k|        ctx->index++;
 2586|  73.1k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  73.1k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2586:9): [True: 73.1k, False: 0]
  ------------------
 2587|       |
 2588|       |        /* An entry that was expected but shall not be decoded.
 2589|       |         * Jump over the value. */
 2590|  73.1k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2590:12): [True: 61.1k, False: 12.0k]
  |  Branch (2590:32): [True: 59.8k, False: 1.26k]
  ------------------
 2591|  59.8k|            skipObject(ctx);
 2592|  59.8k|            continue;
 2593|  59.8k|        }
 2594|       |
 2595|       |        /* A null-value is only valid for nullable fields. */
 2596|  13.3k|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2596:12): [True: 173, False: 13.1k]
  |  Branch (2596:55): [True: 46, False: 127]
  ------------------
 2597|     46|            if(!entry->type || !isJsonNullable(entry->type)) {
  ------------------
  |  Branch (2597:16): [True: 0, False: 46]
  |  Branch (2597:32): [True: 7, False: 39]
  ------------------
 2598|      7|                ctx->depth--;
 2599|      7|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2600|      7|            }
 2601|     39|            ctx->index++; /* skip null value */
 2602|     39|            continue;
 2603|     46|        }
 2604|       |
 2605|       |        /* Decode. This also moves to the next key or right after the object for
 2606|       |         * the last value. */
 2607|  13.2k|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2607:42): [True: 12.0k, False: 1.22k]
  ------------------
 2608|  12.0k|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2609|  13.2k|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2610|  13.2k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  13.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2610:12): [True: 10.2k, False: 3.07k]
  ------------------
 2611|  10.2k|            break;
 2612|  13.2k|    }
 2613|       |
 2614|  49.6k|    ctx->depth--;
 2615|  49.6k|    return ret;
 2616|  49.6k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1426|    187|DECODE_JSON(Boolean) {
 1427|    187|    UA_Boolean *dst = (UA_Boolean*)p;
 1428|    187|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|    187|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|    187|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 187]
  |  |  ------------------
  |  | 1299|    187|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|    187|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 187]
  |  |  ------------------
  ------------------
 1429|    187|    CHECK_BOOL;
  ------------------
  |  | 1307|    187|#define CHECK_BOOL do {                                \
  |  | 1308|    187|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1308:8): [True: 47, False: 140]
  |  |  ------------------
  |  | 1309|     47|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   44|     47|#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|   386k|DECODE_JSON(SByte) {
 1535|   386k|    UA_SByte *dst = (UA_SByte*)p;
 1536|   386k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   386k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   386k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 386k]
  |  |  ------------------
  |  | 1299|   386k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   386k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 386k]
  |  |  ------------------
  ------------------
 1537|   386k|    CHECK_NUMBER;
  ------------------
  |  | 1302|   386k|#define CHECK_NUMBER do {                                \
  |  | 1303|   386k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 20, False: 386k]
  |  |  ------------------
  |  | 1304|     20|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|   386k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 386k]
  |  |  ------------------
  ------------------
 1538|   386k|    GET_TOKEN;
  ------------------
  |  | 1293|   386k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   386k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   386k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 386k]
  |  |  ------------------
  ------------------
 1539|   386k|    UA_Int64 out = 0;
 1540|   386k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1541|   386k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|   772k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   772k|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   65|   386k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1541:8): [True: 62, False: 386k]
  |  Branch (1541:35): [True: 93, False: 386k]
  |  Branch (1541:57): [True: 52, False: 386k]
  ------------------
 1542|    207|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    207|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1543|   386k|    *dst = (UA_SByte)out;
 1544|   386k|    ctx->index++;
 1545|   386k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   386k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1546|   386k|}
ua_types_encoding_json.c:parseSignedInteger:
 1466|  1.33M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1467|  1.33M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1468|  1.33M|    if(len == 0)
  ------------------
  |  Branch (1468:8): [True: 143, False: 1.33M]
  ------------------
 1469|    143|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    143|#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.13M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1473:25): [True: 800k, False: 1.33M]
  ------------------
 1474|   800k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1474:12): [True: 511k, False: 288k]
  |  Branch (1474:35): [True: 122, False: 511k]
  ------------------
 1475|    122|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    122|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1476|   800k|    }
 1477|       |
 1478|  1.33M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.33M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1479|  1.33M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1481|   528k|DECODE_JSON(Byte) {
 1482|   528k|    UA_Byte *dst = (UA_Byte*)p;
 1483|   528k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   528k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   528k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 528k]
  |  |  ------------------
  |  | 1299|   528k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   528k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 528k]
  |  |  ------------------
  ------------------
 1484|   528k|    CHECK_NUMBER;
  ------------------
  |  | 1302|   528k|#define CHECK_NUMBER do {                                \
  |  | 1303|   528k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 10, False: 528k]
  |  |  ------------------
  |  | 1304|     10|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|   528k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 528k]
  |  |  ------------------
  ------------------
 1485|   528k|    GET_TOKEN;
  ------------------
  |  | 1293|   528k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   528k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   528k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 528k]
  |  |  ------------------
  ------------------
 1486|   528k|    UA_UInt64 out = 0;
 1487|   528k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1488|   528k|    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|   528k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1488:8): [True: 36, False: 528k]
  |  Branch (1488:35): [True: 102, False: 528k]
  ------------------
 1489|    138|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    138|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1490|   528k|    *dst = (UA_Byte)out;
 1491|   528k|    ctx->index++;
 1492|   528k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   528k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1493|   528k|}
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: 106, False: 1.30M]
  ------------------
 1453|    106|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    106|#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.75M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1457:25): [True: 455k, False: 1.29M]
  ------------------
 1458|   455k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1458:12): [True: 32.5k, False: 422k]
  |  Branch (1458:35): [True: 140, False: 32.3k]
  ------------------
 1459|    140|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    140|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1460|   455k|    }
 1461|       |
 1462|  1.29M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.29M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1463|  1.30M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1548|  3.56k|DECODE_JSON(Int16) {
 1549|  3.56k|    UA_Int16 *dst = (UA_Int16*)p;
 1550|  3.56k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  3.56k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  3.56k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 3.56k]
  |  |  ------------------
  |  | 1299|  3.56k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  3.56k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 3.56k]
  |  |  ------------------
  ------------------
 1551|  3.56k|    CHECK_NUMBER;
  ------------------
  |  | 1302|  3.56k|#define CHECK_NUMBER do {                                \
  |  | 1303|  3.56k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 10, False: 3.55k]
  |  |  ------------------
  |  | 1304|     10|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|  3.55k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 3.55k]
  |  |  ------------------
  ------------------
 1552|  3.55k|    GET_TOKEN;
  ------------------
  |  | 1293|  3.55k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  3.55k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  3.55k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 3.55k]
  |  |  ------------------
  ------------------
 1553|  3.55k|    UA_Int64 out = 0;
 1554|  3.55k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1555|  3.55k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|  7.11k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|  7.08k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   83|  3.43k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1555:8): [True: 28, False: 3.52k]
  |  Branch (1555:35): [True: 95, False: 3.43k]
  |  Branch (1555:57): [True: 39, False: 3.39k]
  ------------------
 1556|    162|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    162|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1557|  3.39k|    *dst = (UA_Int16)out;
 1558|  3.39k|    ctx->index++;
 1559|  3.39k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1560|  3.55k|}
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: 12, False: 555k]
  |  |  ------------------
  |  | 1304|     12|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     12|#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: 33, False: 555k]
  |  Branch (1502:35): [True: 78, False: 555k]
  ------------------
 1503|    111|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    111|#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|  83.5k|DECODE_JSON(Int32) {
 1563|  83.5k|    UA_Int32 *dst = (UA_Int32*)p;
 1564|  83.5k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  83.5k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  83.5k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 83.5k]
  |  |  ------------------
  |  | 1299|  83.5k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  83.5k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 83.5k]
  |  |  ------------------
  ------------------
 1565|  83.5k|    CHECK_NUMBER;
  ------------------
  |  | 1302|  83.5k|#define CHECK_NUMBER do {                                \
  |  | 1303|  83.5k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 11, False: 83.5k]
  |  |  ------------------
  |  | 1304|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|  83.5k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 83.5k]
  |  |  ------------------
  ------------------
 1566|  83.5k|    GET_TOKEN;
  ------------------
  |  | 1293|  83.5k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  83.5k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  83.5k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 83.5k]
  |  |  ------------------
  ------------------
 1567|  83.5k|    UA_Int64 out = 0;
 1568|  83.5k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1569|  83.5k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|   167k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|   167k|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  101|  83.3k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1569:8): [True: 70, False: 83.5k]
  |  Branch (1569:35): [True: 127, False: 83.3k]
  |  Branch (1569:57): [True: 10, False: 83.3k]
  ------------------
 1570|    207|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    207|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1571|  83.3k|    *dst = (UA_Int32)out;
 1572|  83.3k|    ctx->index++;
 1573|  83.3k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  83.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1574|  83.5k|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1509|  34.9k|DECODE_JSON(UInt32) {
 1510|  34.9k|    UA_UInt32 *dst = (UA_UInt32*)p;
 1511|  34.9k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  34.9k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  34.9k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 34.9k]
  |  |  ------------------
  |  | 1299|  34.9k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  34.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 34.9k]
  |  |  ------------------
  ------------------
 1512|  34.9k|    CHECK_NUMBER;
  ------------------
  |  | 1302|  34.9k|#define CHECK_NUMBER do {                                \
  |  | 1303|  34.9k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1303:8): [True: 42, False: 34.8k]
  |  |  ------------------
  |  | 1304|     42|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     42|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1305|  34.8k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 34.8k]
  |  |  ------------------
  ------------------
 1513|  34.8k|    GET_TOKEN;
  ------------------
  |  | 1293|  34.8k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  34.8k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  34.8k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 34.8k]
  |  |  ------------------
  ------------------
 1514|  34.8k|    UA_UInt64 out = 0;
 1515|  34.8k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1516|  34.8k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|  69.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  110|  34.7k|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1516:8): [True: 91, False: 34.7k]
  |  Branch (1516:35): [True: 163, False: 34.6k]
  ------------------
 1517|    254|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    254|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1518|  34.6k|    *dst = (UA_UInt32)out;
 1519|  34.6k|    ctx->index++;
 1520|  34.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  34.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1521|  34.8k|}
ua_types_encoding_json.c:Int64_decodeJson:
 1576|   856k|DECODE_JSON(Int64) {
 1577|   856k|    UA_Int64 *dst = (UA_Int64*)p;
 1578|   856k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   856k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   856k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 856k]
  |  |  ------------------
  |  | 1299|   856k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   856k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 856k]
  |  |  ------------------
  ------------------
 1579|   856k|    GET_TOKEN;
  ------------------
  |  | 1293|   856k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   856k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   856k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 856k]
  |  |  ------------------
  ------------------
 1580|   856k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1581|   856k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   856k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1581:8): [True: 105, False: 856k]
  ------------------
 1582|    105|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    105|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1583|   856k|    ctx->index++;
 1584|   856k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   856k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1585|   856k|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1523|   180k|DECODE_JSON(UInt64) {
 1524|   180k|    UA_UInt64 *dst = (UA_UInt64*)p;
 1525|   180k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   180k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   180k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 180k]
  |  |  ------------------
  |  | 1299|   180k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   180k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 180k]
  |  |  ------------------
  ------------------
 1526|   180k|    GET_TOKEN;
  ------------------
  |  | 1293|   180k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   180k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   180k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 180k]
  |  |  ------------------
  ------------------
 1527|   180k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1528|   180k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   180k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1528:8): [True: 86, False: 180k]
  ------------------
 1529|     86|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     86|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1530|   180k|    ctx->index++;
 1531|   180k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   180k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1532|   180k|}
ua_types_encoding_json.c:Float_decodeJson:
 1648|   532k|DECODE_JSON(Float) {
 1649|   532k|    UA_Float *dst = (UA_Float*)p;
 1650|   532k|    UA_Double v = 0.0;
 1651|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1652|   532k|    *dst = (UA_Float)v;
 1653|   532k|    return res;
 1654|   532k|}
ua_types_encoding_json.c:Double_decodeJson:
 1588|   532k|DECODE_JSON(Double) {
 1589|   532k|    UA_Double *dst = (UA_Double*)p;
 1590|   532k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|   532k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|   532k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 532k]
  |  |  ------------------
  |  | 1299|   532k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|   532k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 532k]
  |  |  ------------------
  ------------------
 1591|   532k|    GET_TOKEN;
  ------------------
  |  | 1293|   532k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|   532k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|   532k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 532k]
  |  |  ------------------
  ------------------
 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|   532k|    if(tokenSize > 2000)
  ------------------
  |  Branch (1597:8): [True: 3, False: 532k]
  ------------------
 1598|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1599|       |
 1600|   532k|    cj5_token_type tokenType = currentTokenType(ctx);
 1601|       |
 1602|       |    /* It could be a String with Nan, Infinity */
 1603|   532k|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1603:8): [True: 931, False: 531k]
  ------------------
 1604|    931|        ctx->index++;
 1605|       |
 1606|    931|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1606:12): [True: 216, False: 715]
  |  Branch (1606:30): [True: 206, False: 10]
  ------------------
 1607|    206|            *dst = INFINITY;
 1608|    206|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    206|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1609|    206|        }
 1610|       |
 1611|    725|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1611:12): [True: 233, False: 492]
  |  Branch (1611:30): [True: 217, False: 16]
  ------------------
 1612|       |            /* workaround an MSVC 2013 issue */
 1613|    217|            *dst = -INFINITY;
 1614|    217|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    217|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1615|    217|        }
 1616|       |
 1617|    508|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1617:12): [True: 234, False: 274]
  |  Branch (1617:30): [True: 217, False: 17]
  ------------------
 1618|    217|            *dst = NAN;
 1619|    217|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    217|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1620|    217|        }
 1621|       |
 1622|    291|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1622:12): [True: 216, False: 75]
  |  Branch (1622:30): [True: 208, False: 8]
  ------------------
 1623|    208|            *dst = NAN;
 1624|    208|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    208|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1625|    208|        }
 1626|       |
 1627|     83|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     83|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1628|    291|    }
 1629|       |
 1630|   531k|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1630:8): [True: 3, False: 531k]
  ------------------
 1631|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1632|       |
 1633|   531k|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1634|   531k|    if(len == 0)
  ------------------
  |  Branch (1634:8): [True: 6, False: 531k]
  ------------------
 1635|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#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|   531k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1639:25): [True: 34, False: 531k]
  ------------------
 1640|     34|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1640:12): [True: 34, False: 0]
  |  Branch (1640:35): [True: 34, False: 0]
  ------------------
 1641|     34|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     34|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1642|     34|    }
 1643|       |
 1644|   531k|    ctx->index++;
 1645|   531k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   531k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1646|   531k|}
ua_types_encoding_json.c:String_decodeJson:
 1666|  66.8k|DECODE_JSON(String) {
 1667|  66.8k|    UA_String *dst = (UA_String*)p;
 1668|  66.8k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  66.8k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  66.8k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 66.8k]
  |  |  ------------------
  |  | 1299|  66.8k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  66.8k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 66.8k]
  |  |  ------------------
  ------------------
 1669|  66.8k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1322|  66.8k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  66.8k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 199, False: 66.6k]
  |  |  ------------------
  |  | 1324|    199|        ctx->index++;                                \
  |  | 1325|    199|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    199|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  66.6k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 66.6k]
  |  |  ------------------
  ------------------
 1670|  66.6k|    CHECK_STRING;
  ------------------
  |  | 1312|  66.6k|#define CHECK_STRING do {                                \
  |  | 1313|  66.6k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1313:8): [True: 894, False: 65.7k]
  |  |  ------------------
  |  | 1314|    894|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|    894|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1315|  65.7k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1315:14): [Folded, False: 65.7k]
  |  |  ------------------
  ------------------
 1671|  65.7k|    GET_TOKEN;
  ------------------
  |  | 1293|  65.7k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  65.7k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  65.7k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 65.7k]
  |  |  ------------------
  ------------------
 1672|  65.7k|    (void)tokenData;
 1673|       |
 1674|       |    /* Empty string? */
 1675|  65.7k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1675:8): [True: 1.72k, False: 64.0k]
  ------------------
 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|  64.0k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|  64.0k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1684|  64.0k|    if(!outBuf)
  ------------------
  |  Branch (1684:8): [True: 15, False: 64.0k]
  ------------------
 1685|     15|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     15|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1686|       |
 1687|       |    /* Decode the string */
 1688|  64.0k|    cj5_result r;
 1689|  64.0k|    r.tokens = ctx->tokens;
 1690|  64.0k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1691|  64.0k|    r.json5 = ctx->json5;
 1692|  64.0k|    unsigned int len = 0;
 1693|  64.0k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1694|  64.0k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1694:8): [True: 179, False: 63.8k]
  ------------------
 1695|    179|        UA_free(outBuf);
  ------------------
  |  |   19|    179|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1696|    179|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    179|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1697|    179|    }
 1698|       |
 1699|       |    /* Set the output */
 1700|  63.8k|    dst->length = len;
 1701|  63.8k|    if(dst->length > 0) {
  ------------------
  |  Branch (1701:8): [True: 63.8k, False: 0]
  ------------------
 1702|  63.8k|        dst->data = (UA_Byte*)outBuf;
 1703|  63.8k|    } 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|  63.8k|    ctx->index++;
 1709|  63.8k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  63.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1710|  64.0k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1865|    609|DECODE_JSON(DateTime) {
 1866|    609|    UA_DateTime *dst = (UA_DateTime*)p;
 1867|    609|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|    609|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|    609|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 609]
  |  |  ------------------
  |  | 1299|    609|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|    609|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 609]
  |  |  ------------------
  ------------------
 1868|    609|    CHECK_NULL_SKIP;
  ------------------
  |  | 1322|    609|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|    609|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 326, False: 283]
  |  |  ------------------
  |  | 1324|    326|        ctx->index++;                                \
  |  | 1325|    326|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    326|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|    326|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 283]
  |  |  ------------------
  ------------------
 1869|    283|    CHECK_STRING;
  ------------------
  |  | 1312|    283|#define CHECK_STRING do {                                \
  |  | 1313|    283|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1313:8): [True: 14, False: 269]
  |  |  ------------------
  |  | 1314|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1315|    269|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1315:14): [Folded, False: 269]
  |  |  ------------------
  ------------------
 1870|    269|    GET_TOKEN;
  ------------------
  |  | 1293|    269|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|    269|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|    269|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 269]
  |  |  ------------------
  ------------------
 1871|       |
 1872|       |    /* YYYY-MM-DDTHH:MM:SS[.fffffff]Z */
 1873|    269|    if(tokenSize < 20 || tokenData[tokenSize-1] != 'Z' ||
  ------------------
  |  Branch (1873:8): [True: 14, False: 255]
  |  Branch (1873:26): [True: 12, False: 243]
  ------------------
 1874|    243|       tokenData[4] != '-' || tokenData[7] != '-' ||
  ------------------
  |  Branch (1874:8): [True: 10, False: 233]
  |  Branch (1874:31): [True: 9, False: 224]
  ------------------
 1875|    224|       tokenData[10] != 'T' || tokenData[13] != ':' ||
  ------------------
  |  Branch (1875:8): [True: 5, False: 219]
  |  Branch (1875:32): [True: 10, False: 209]
  ------------------
 1876|    209|       tokenData[16] != ':')
  ------------------
  |  Branch (1876:8): [True: 9, False: 200]
  ------------------
 1877|     69|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     69|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1878|       |
 1879|    200|    const size_t positions[6] = {0, 5, 8, 11, 14, 17};
 1880|    200|    UA_UInt16 values[6];
 1881|  1.35k|    for(size_t i = 0; i < 6; i++) {
  ------------------
  |  Branch (1881:23): [True: 1.16k, False: 192]
  ------------------
 1882|  1.16k|        UA_UInt64 value = 0;
 1883|  1.16k|        size_t digits = (i == 0) ? 4 : 2;
  ------------------
  |  Branch (1883:25): [True: 200, False: 966]
  ------------------
 1884|  1.16k|        if(parseUInt64(&tokenData[positions[i]], digits, &value) != digits)
  ------------------
  |  Branch (1884:12): [True: 8, False: 1.15k]
  ------------------
 1885|      8|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1886|  1.15k|        values[i] = (UA_UInt16)value;
 1887|  1.15k|    }
 1888|       |
 1889|    192|    UA_UInt16 daysInMonth = 31;
 1890|    192|    switch(values[1]) {
 1891|     45|    case 2:
  ------------------
  |  Branch (1891:5): [True: 45, False: 147]
  ------------------
 1892|     45|        daysInMonth = (UA_UInt16)
 1893|     45|            (((values[0] % 4 == 0 && values[0] % 100 != 0) ||
  ------------------
  |  Branch (1893:16): [True: 12, False: 33]
  |  Branch (1893:38): [True: 9, False: 3]
  ------------------
 1894|     36|              values[0] % 400 == 0) ? 29 : 28);
  ------------------
  |  Branch (1894:15): [True: 1, False: 35]
  ------------------
 1895|     45|        break;
 1896|     34|    case 4: case 6: case 9: case 11:
  ------------------
  |  Branch (1896:5): [True: 13, False: 179]
  |  Branch (1896:13): [True: 7, False: 185]
  |  Branch (1896:21): [True: 11, False: 181]
  |  Branch (1896:29): [True: 3, False: 189]
  ------------------
 1897|     34|        daysInMonth = 30;
 1898|     34|        break;
 1899|    113|    default:
  ------------------
  |  Branch (1899:5): [True: 113, False: 79]
  ------------------
 1900|    113|        break;
 1901|    192|    }
 1902|    192|    if(values[0] < 1 || values[1] < 1 || values[1] > 12 ||
  ------------------
  |  Branch (1902:8): [True: 1, False: 191]
  |  Branch (1902:25): [True: 1, False: 190]
  |  Branch (1902:42): [True: 3, False: 187]
  ------------------
 1903|    187|       values[2] < 1 || values[2] > daysInMonth || values[3] > 23 ||
  ------------------
  |  Branch (1903:8): [True: 1, False: 186]
  |  Branch (1903:25): [True: 3, False: 183]
  |  Branch (1903:52): [True: 3, False: 180]
  ------------------
 1904|    180|       values[4] > 59 || values[5] > 59)
  ------------------
  |  Branch (1904:8): [True: 1, False: 179]
  |  Branch (1904:26): [True: 1, False: 178]
  ------------------
 1905|     14|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1906|       |
 1907|    178|    size_t pos = 19;
 1908|    178|    UA_UInt32 fraction = 0;
 1909|    178|    size_t fractionDigits = 0;
 1910|    178|    if(pos < tokenSize - 1 &&
  ------------------
  |  Branch (1910:8): [True: 114, False: 64]
  ------------------
 1911|    114|       (tokenData[pos] == '.' || tokenData[pos] == ',')) {
  ------------------
  |  Branch (1911:9): [True: 35, False: 79]
  |  Branch (1911:34): [True: 61, False: 18]
  ------------------
 1912|     96|        pos++;
 1913|  2.92M|        while(pos < tokenSize - 1 && tokenData[pos] >= '0' &&
  ------------------
  |  Branch (1913:15): [True: 2.92M, False: 38]
  |  Branch (1913:38): [True: 2.92M, False: 43]
  ------------------
 1914|  2.92M|              tokenData[pos] <= '9') {
  ------------------
  |  Branch (1914:15): [True: 2.92M, False: 15]
  ------------------
 1915|  2.92M|            if(fractionDigits < 7)
  ------------------
  |  Branch (1915:16): [True: 479, False: 2.92M]
  ------------------
 1916|    479|                fraction = fraction * 10 + (UA_UInt32)(tokenData[pos] - '0');
 1917|  2.92M|            fractionDigits++;
 1918|  2.92M|            pos++;
 1919|  2.92M|        }
 1920|     96|        if(fractionDigits == 0)
  ------------------
  |  Branch (1920:12): [True: 12, False: 84]
  ------------------
 1921|     12|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1922|    193|        while(fractionDigits < 7) {
  ------------------
  |  Branch (1922:15): [True: 109, False: 84]
  ------------------
 1923|    109|            fraction *= 10;
 1924|    109|            fractionDigits++;
 1925|    109|        }
 1926|     84|    }
 1927|    166|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1927:8): [True: 66, False: 100]
  ------------------
 1928|     66|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     66|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1929|       |
 1930|       |    /* The minimum JSON DateTime is the null value. */
 1931|    100|    if(values[0] == 1 && values[1] == 1 && values[2] == 1 &&
  ------------------
  |  Branch (1931:8): [True: 35, False: 65]
  |  Branch (1931:26): [True: 32, False: 3]
  |  Branch (1931:44): [True: 30, False: 2]
  ------------------
 1932|     30|       values[3] == 0 && values[4] == 0 && values[5] == 0 && fraction == 0) {
  ------------------
  |  Branch (1932:8): [True: 29, False: 1]
  |  Branch (1932:26): [True: 25, False: 4]
  |  Branch (1932:44): [True: 20, False: 5]
  |  Branch (1932:62): [True: 1, False: 19]
  ------------------
 1933|      1|        *dst = 0;
 1934|     99|    } else {
 1935|     99|        UA_DateTimeStruct date;
 1936|     99|        memset(&date, 0, sizeof(date));
 1937|     99|        date.year = (UA_Int16)values[0];
 1938|     99|        date.month = values[1];
 1939|     99|        date.day = values[2];
 1940|     99|        date.hour = values[3];
 1941|     99|        date.min = values[4];
 1942|     99|        date.sec = values[5];
 1943|     99|        date.milliSec = (UA_UInt16)(fraction / 10000);
 1944|     99|        date.microSec = (UA_UInt16)((fraction % 10000) / 10);
 1945|     99|        date.nanoSec = (UA_UInt16)((fraction % 10) * 100);
 1946|     99|        *dst = UA_DateTime_fromStruct(date);
 1947|     99|    }
 1948|       |
 1949|    100|    ctx->index++;
 1950|    100|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    100|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1951|    166|}
ua_types_encoding_json.c:Guid_decodeJson:
 1656|     74|DECODE_JSON(Guid) {
 1657|     74|    UA_Guid *dst = (UA_Guid*)p;
 1658|     74|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|     74|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|     74|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 74]
  |  |  ------------------
  |  | 1299|     74|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|     74|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 74]
  |  |  ------------------
  ------------------
 1659|     74|    CHECK_STRING;
  ------------------
  |  | 1312|     74|#define CHECK_STRING do {                                \
  |  | 1313|     74|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1313:8): [True: 15, False: 59]
  |  |  ------------------
  |  | 1314|     15|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1315|     59|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1315:14): [Folded, False: 59]
  |  |  ------------------
  ------------------
 1660|     59|    GET_TOKEN;
  ------------------
  |  | 1293|     59|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|     59|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|     59|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 59]
  |  |  ------------------
  ------------------
 1661|     59|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1662|     59|    ctx->index++;
 1663|     59|    return UA_Guid_parse(dst, str);
 1664|     74|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1761|  9.85k|DECODE_JSON(ByteString) {
 1762|  9.85k|    UA_ByteString *dst = (UA_ByteString*)p;
 1763|  9.85k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1297|  9.85k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1298|  9.85k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1298:8): [True: 0, False: 9.85k]
  |  |  ------------------
  |  | 1299|  9.85k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1300|  9.85k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1300:13): [Folded, False: 9.85k]
  |  |  ------------------
  ------------------
 1764|  9.85k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1322|  9.85k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  9.85k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 197, False: 9.66k]
  |  |  ------------------
  |  | 1324|    197|        ctx->index++;                                \
  |  | 1325|    197|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  9.66k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 9.66k]
  |  |  ------------------
  ------------------
 1765|  9.66k|    CHECK_STRING;
  ------------------
  |  | 1312|  9.66k|#define CHECK_STRING do {                                \
  |  | 1313|  9.66k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1313:8): [True: 17, False: 9.64k]
  |  |  ------------------
  |  | 1314|     17|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1315|  9.64k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1315:14): [Folded, False: 9.64k]
  |  |  ------------------
  ------------------
 1766|  9.64k|    GET_TOKEN;
  ------------------
  |  | 1293|  9.64k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  9.64k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  9.64k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 9.64k]
  |  |  ------------------
  ------------------
 1767|       |
 1768|       |    /* Empty bytestring? */
 1769|  9.64k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1769:8): [True: 2.82k, False: 6.81k]
  ------------------
 1770|  2.82k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  2.82k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1771|  2.82k|        dst->length = 0;
 1772|  6.81k|    } else {
 1773|  6.81k|        size_t flen = 0;
 1774|  6.81k|        unsigned char* unB64 =
 1775|  6.81k|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1776|  6.81k|        if(unB64 == 0)
  ------------------
  |  Branch (1776:12): [True: 57, False: 6.75k]
  ------------------
 1777|     57|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     57|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1778|  6.75k|        dst->data = (u8*)unB64;
 1779|  6.75k|        dst->length = flen;
 1780|  6.75k|    }
 1781|       |
 1782|  9.58k|    ctx->index++;
 1783|  9.58k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.58k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1784|  9.64k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1842|  28.1k|DECODE_JSON(NodeId) {
 1843|  28.1k|    UA_NodeId *dst = (UA_NodeId*)p;
 1844|  28.1k|    UA_String str;
 1845|  28.1k|    UA_String_init(&str);
 1846|  28.1k|    status res = String_decodeJson(ctx, &str, NULL);
 1847|  28.1k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  28.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1847:8): [True: 27.2k, False: 939]
  ------------------
 1848|  27.2k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1849|  28.1k|    UA_String_clear(&str);
 1850|  28.1k|    return res;
 1851|  28.1k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1853|  3.69k|DECODE_JSON(ExpandedNodeId) {
 1854|  3.69k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1855|  3.69k|    UA_String str;
 1856|  3.69k|    UA_String_init(&str);
 1857|  3.69k|    status res = String_decodeJson(ctx, &str, NULL);
 1858|  3.69k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.69k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1858:8): [True: 3.67k, False: 14]
  ------------------
 1859|  3.67k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1860|  3.67k|                                        ctx->serverUrisSize, ctx->serverUris);
 1861|  3.69k|    UA_String_clear(&str);
 1862|  3.69k|    return res;
 1863|  3.69k|}
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.69k|DECODE_JSON(QualifiedName) {
 1797|  8.69k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1798|  8.69k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1322|  8.69k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  8.69k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 194, False: 8.50k]
  |  |  ------------------
  |  | 1324|    194|        ctx->index++;                                \
  |  | 1325|    194|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    194|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  8.50k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 8.50k]
  |  |  ------------------
  ------------------
 1799|  8.50k|    UA_String str;
 1800|  8.50k|    UA_String_init(&str);
 1801|  8.50k|    status res = String_decodeJson(ctx, &str, NULL);
 1802|  8.50k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  8.50k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1802:8): [True: 8.48k, False: 14]
  ------------------
 1803|  8.48k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1804|  8.50k|    UA_String_clear(&str);
 1805|  8.50k|    return res;
 1806|  8.69k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1786|  1.29k|DECODE_JSON(LocalizedText) {
 1787|  1.29k|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1788|  1.29k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  1.29k|#define CHECK_OBJECT do {                                \
  |  | 1318|  1.29k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 13, False: 1.28k]
  |  |  ------------------
  |  | 1319|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  1.28k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 1.28k]
  |  |  ------------------
  ------------------
 1789|  1.28k|    DecodeEntry entries[2] = {
 1790|  1.28k|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|  1.28k|#define UA_TYPES_STRING 11
  ------------------
 1791|  1.28k|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  402|  1.28k|#define UA_TYPES_STRING 11
  ------------------
 1792|  1.28k|    };
 1793|  1.28k|    return decodeFields(ctx, entries, 2);
 1794|  1.29k|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2317|  23.5k|DECODE_JSON(ExtensionObject) {
 2318|  23.5k|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2319|  23.5k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1322|  23.5k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  23.5k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 0, False: 23.5k]
  |  |  ------------------
  |  | 1324|      0|        ctx->index++;                                \
  |  | 1325|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  23.5k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 23.5k]
  |  |  ------------------
  ------------------
 2320|  23.5k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  23.5k|#define CHECK_OBJECT do {                                \
  |  | 1318|  23.5k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 69, False: 23.4k]
  |  |  ------------------
  |  | 1319|     69|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     69|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  23.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 23.4k]
  |  |  ------------------
  ------------------
 2321|       |
 2322|       |    /* Empty object -> Null ExtensionObject */
 2323|  23.4k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2323:8): [True: 2.23k, False: 21.2k]
  ------------------
 2324|  2.23k|        ctx->index++; /* Skip the empty ExtensionObject */
 2325|  2.23k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.23k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2326|  2.23k|    }
 2327|       |
 2328|       |    /* Scan the object once for metadata and duplicate keys. */
 2329|  21.2k|    size_t beginIndex = ctx->index;
 2330|  21.2k|    JsonFieldIndex fields[3] = {
 2331|  21.2k|        {UA_JSONKEY_TYPEID, SIZE_MAX},
 2332|  21.2k|        {UA_JSONKEY_ENCODING, SIZE_MAX},
 2333|  21.2k|        {UA_JSONKEY_BODY, SIZE_MAX}
 2334|  21.2k|    };
 2335|  21.2k|    status ret = scanObjectFields(ctx, fields, 3);
 2336|  21.2k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  21.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2336:8): [True: 46, False: 21.2k]
  ------------------
 2337|     46|        return ret;
 2338|       |
 2339|       |    /* Decode the optional non-JSON encoding. */
 2340|  21.2k|    UA_UInt64 encoding = 0;
 2341|  21.2k|    size_t encIndex = fields[1].valueIndex;
 2342|  21.2k|    if(encIndex != SIZE_MAX) {
  ------------------
  |  Branch (2342:8): [True: 2.90k, False: 18.3k]
  ------------------
 2343|  2.90k|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2344|  2.90k|        size_t len = parseUInt64(extObjEncoding,
 2345|  2.90k|                                 getTokenLength(&ctx->tokens[encIndex]),
 2346|  2.90k|                                 &encoding);
 2347|  2.90k|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2347:12): [True: 4, False: 2.90k]
  |  Branch (2347:24): [True: 110, False: 2.79k]
  ------------------
 2348|    114|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    114|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2349|  2.90k|    }
 2350|       |
 2351|       |    /* Decode the type NodeId. */
 2352|  21.0k|    size_t typeIdIndex = fields[0].valueIndex;
 2353|  21.0k|    if(typeIdIndex == SIZE_MAX)
  ------------------
  |  Branch (2353:8): [True: 241, False: 20.8k]
  ------------------
 2354|    241|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    241|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2355|       |
 2356|  20.8k|    UA_NodeId typeId;
 2357|  20.8k|    UA_NodeId_init(&typeId);
 2358|  20.8k|    ParseCtx decodeCtx = *ctx;
 2359|  20.8k|    decodeCtx.index = typeIdIndex;
 2360|  20.8k|    ret = NodeId_decodeJson(&decodeCtx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|  20.8k|#define UA_TYPES_NODEID 16
  ------------------
 2361|  20.8k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  20.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2361:8): [True: 208, False: 20.6k]
  ------------------
 2362|    208|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2363|    208|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    208|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2364|    208|    }
 2365|       |
 2366|  20.6k|    size_t bodyIndex = fields[2].valueIndex;
 2367|       |
 2368|       |    /* Binary and XML bodies stay encoded even if the datatype is known. */
 2369|  20.6k|    if(encoding != 0) {
  ------------------
  |  Branch (2369:8): [True: 2.45k, False: 18.1k]
  ------------------
 2370|  2.45k|        dst->encoding = (encoding == 1) ?
  ------------------
  |  Branch (2370:25): [True: 284, False: 2.17k]
  ------------------
 2371|    284|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2372|  2.45k|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2373|  2.45k|        dst->content.encoded.typeId = typeId;
 2374|  2.45k|        if(bodyIndex == SIZE_MAX)
  ------------------
  |  Branch (2374:12): [True: 17, False: 2.43k]
  ------------------
 2375|     17|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2376|  2.43k|        decodeCtx.index = bodyIndex;
 2377|  2.43k|        return ByteString_decodeJson(&decodeCtx,
 2378|  2.43k|                                     &dst->content.encoded.body, NULL);
 2379|  2.45k|    }
 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.17k, False: 10.0k]
  ------------------
 2384|  8.17k|        dst->encoding = UA_EXTENSIONOBJECT_ENCODED_JSON;
 2385|  8.17k|        dst->content.encoded.typeId = typeId;
 2386|  8.17k|        decodeCtx.index = beginIndex;
 2387|  8.17k|        return tokenToByteString(&decodeCtx, &dst->content.encoded.body);
 2388|  8.17k|    }
 2389|       |
 2390|       |    /* No need to keep the TypeId */
 2391|  10.0k|    UA_NodeId_clear(&typeId);
 2392|       |
 2393|       |    /* Disallow directly nested ExtensionObjects */
 2394|  10.0k|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|  10.0k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2394:8): [True: 2, False: 10.0k]
  ------------------
 2395|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2396|       |
 2397|       |    /* Allocate memory for the decoded data */
 2398|  10.0k|    dst->content.decoded.data = UA_new(type);
 2399|  10.0k|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2399:8): [True: 1, False: 10.0k]
  ------------------
 2400|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2401|  10.0k|    dst->content.decoded.type = type;
 2402|  10.0k|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2403|       |
 2404|  10.0k|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2405|  10.0k|    if(bodyIndex != SIZE_MAX) {
  ------------------
  |  Branch (2405:8): [True: 8.48k, False: 1.52k]
  ------------------
 2406|  8.48k|        decodeCtx.index = bodyIndex;
 2407|  8.48k|        return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2408|  8.48k|    }
 2409|       |
 2410|       |    /* Only JSON structures without an explicit encoding can be in-situ. */
 2411|  1.52k|    if(encoding != 0)
  ------------------
  |  Branch (2411:8): [True: 0, False: 1.52k]
  ------------------
 2412|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2413|       |
 2414|  1.52k|    decodeCtx.index = beginIndex;
 2415|  1.52k|    if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2415:8): [True: 1.14k, False: 384]
  ------------------
 2416|    384|       type->typeKind == UA_DATATYPEKIND_OPTSTRUCT)
  ------------------
  |  Branch (2416:8): [True: 0, False: 384]
  ------------------
 2417|  1.14k|        return decodeJsonStructureExtensionObject(
 2418|  1.14k|            &decodeCtx, dst->content.decoded.data, type);
 2419|    384|    if(type->typeKind == UA_DATATYPEKIND_UNION)
  ------------------
  |  Branch (2419:8): [True: 0, False: 384]
  ------------------
 2420|      0|        return decodeJsonUnionExtensionObject(
 2421|      0|            &decodeCtx, dst->content.decoded.data, type);
 2422|    384|    return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2423|    384|}
ua_types_encoding_json.c:scanObjectFields:
 1386|  21.2k|scanObjectFields(ParseCtx *ctx, JsonFieldIndex *fields, size_t fieldsSize) {
 1387|  21.2k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|  21.2k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1387:5): [True: 21.2k, False: 0]
  ------------------
 1388|  21.2k|    size_t keyCount = (size_t)ctx->tokens[ctx->index].size / 2;
 1389|  21.2k|    if(keyCount > UA_JSON_MAX_EXTENSIONOBJECT_FIELDS)
  ------------------
  |  | 1381|  21.2k|#define UA_JSON_MAX_EXTENSIONOBJECT_FIELDS (UA_DATATYPE_MEMBERS_MAX + 3)
  |  |  ------------------
  |  |  |  | 1036|  21.2k|#define UA_DATATYPE_MEMBERS_MAX 511
  |  |  ------------------
  ------------------
  |  Branch (1389:8): [True: 9, False: 21.2k]
  ------------------
 1390|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1391|       |
 1392|  21.2k|    size_t keys[UA_JSON_MAX_EXTENSIONOBJECT_FIELDS];
 1393|  21.2k|    ctx->index++;
 1394|       |
 1395|  76.1k|    for(size_t i = 0; i < keyCount; i++) {
  ------------------
  |  Branch (1395:23): [True: 54.9k, False: 21.2k]
  ------------------
 1396|  54.9k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  54.9k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1396:9): [True: 54.9k, False: 0]
  ------------------
 1397|  54.9k|        const cj5_token *key = &ctx->tokens[ctx->index];
 1398|  54.9k|        size_t keyLength = getTokenLength(key);
 1399|       |
 1400|       |        /* Duplicate names are invalid, including unknown in-situ Structure
 1401|       |         * fields of an ExtensionObject. */
 1402|   115k|        for(size_t j = 0; j < i; j++) {
  ------------------
  |  Branch (1402:27): [True: 60.7k, False: 54.9k]
  ------------------
 1403|  60.7k|            const cj5_token *previous = &ctx->tokens[keys[j]];
 1404|  60.7k|            if(keyLength == getTokenLength(previous) &&
  ------------------
  |  Branch (1404:16): [True: 5.71k, False: 55.0k]
  ------------------
 1405|  5.71k|               memcmp(&ctx->json5[key->start], &ctx->json5[previous->start],
  ------------------
  |  Branch (1405:16): [True: 37, False: 5.67k]
  ------------------
 1406|  5.71k|                      keyLength) == 0)
 1407|     37|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1408|  60.7k|        }
 1409|  54.9k|        keys[i] = ctx->index;
 1410|       |
 1411|       |        /* Record the value position of interesting fields. */
 1412|  54.9k|        ctx->index++;
 1413|  54.9k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  54.9k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1413:9): [True: 54.9k, False: 0]
  ------------------
 1414|   139k|        for(size_t j = 0; j < fieldsSize; j++) {
  ------------------
  |  Branch (1414:27): [True: 120k, False: 19.7k]
  ------------------
 1415|   120k|            if(jsoneq(ctx->json5, key, fields[j].fieldName) == 0) {
  ------------------
  |  Branch (1415:16): [True: 35.2k, False: 85.0k]
  ------------------
 1416|  35.2k|                fields[j].valueIndex = ctx->index;
 1417|  35.2k|                break;
 1418|  35.2k|            }
 1419|   120k|        }
 1420|       |
 1421|  54.9k|        skipObject(ctx);
 1422|  54.9k|    }
 1423|  21.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  21.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1424|  21.2k|}
ua_types_encoding_json.c:tokenToByteString:
 2307|  8.17k|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 2308|  8.17k|    GET_TOKEN;
  ------------------
  |  | 1293|  8.17k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1294|  8.17k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1295|  8.17k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1295:17): [Folded, False: 8.17k]
  |  |  ------------------
  ------------------
 2309|  8.17k|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 2310|  8.17k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  8.17k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2310:8): [True: 5, False: 8.16k]
  ------------------
 2311|      5|        return res;
 2312|  8.16k|    memcpy(p->data, tokenData, tokenSize);
 2313|  8.16k|    skipObject(ctx);
 2314|  8.16k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.16k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2315|  8.17k|}
ua_types_encoding_json.c:decodeJsonStructureExtensionObject:
 2817|  11.2k|                                   const UA_DataType *type) {
 2818|       |    return decodeJsonStructureInternal(ctx, dst, type, true);
 2819|  11.2k|}
ua_types_encoding_json.c:decodeJsonStructureInternal:
 2723|  12.8k|                            UA_Boolean extensionObject) {
 2724|  12.8k|    uintptr_t ptr = (uintptr_t)dst;
 2725|  12.8k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  12.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2726|  12.8k|    const UA_Boolean optional = (type->typeKind == UA_DATATYPEKIND_OPTSTRUCT);
 2727|  12.8k|    size_t offset = (extensionObject ? 1 : 0) + (optional ? 1 : 0);
  ------------------
  |  Branch (2727:22): [True: 11.2k, False: 1.62k]
  |  Branch (2727:50): [True: 0, False: 12.8k]
  ------------------
 2728|  12.8k|    size_t membersSize = type->membersSize + offset;
 2729|  12.8k|    UA_STACKARRAY(DecodeEntry, entries, membersSize);
  ------------------
  |  |  375|  12.8k|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 2730|  12.8k|    memset(entries, 0, sizeof(DecodeEntry) * membersSize);
 2731|  12.8k|    size_t entryIndex = 0;
 2732|  12.8k|    if(extensionObject) {
  ------------------
  |  Branch (2732:8): [True: 11.2k, False: 1.62k]
  ------------------
 2733|  11.2k|        entries[entryIndex++] =
 2734|  11.2k|            (DecodeEntry){UA_JSONKEY_TYPEID, NULL, NULL, false, NULL};
 2735|  11.2k|    }
 2736|  12.8k|    UA_UInt32 encodingMask = 0;
 2737|  12.8k|    size_t encodingMaskIndex = SIZE_MAX;
 2738|  12.8k|    if(optional) {
  ------------------
  |  Branch (2738:8): [True: 0, False: 12.8k]
  ------------------
 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|  58.5k|    for(size_t i = 0; i < type->membersSize; ++i, ++entryIndex) {
  ------------------
  |  Branch (2744:23): [True: 45.7k, False: 12.8k]
  ------------------
 2745|  45.7k|        const UA_DataTypeMember *m = &type->members[i];
 2746|  45.7k|        const UA_DataType *mt = m->memberType;
 2747|  45.7k|        entries[entryIndex].type = mt;
 2748|  45.7k|        entries[entryIndex].fieldName = m->memberName;
 2749|  45.7k|        if(!m->isArray) {
  ------------------
  |  Branch (2749:12): [True: 22.1k, False: 23.5k]
  ------------------
 2750|  22.1k|            ptr += m->padding;
 2751|  22.1k|            entries[entryIndex].fieldPointer = (void*)ptr;
 2752|  22.1k|            if(m->isOptional)
  ------------------
  |  Branch (2752:16): [True: 0, False: 22.1k]
  ------------------
 2753|      0|                entries[entryIndex].function = OptionalScalar_decodeJson;
 2754|  22.1k|            ptr += m->isOptional ? sizeof(void*) : mt->memSize;
  ------------------
  |  Branch (2754:20): [True: 0, False: 22.1k]
  ------------------
 2755|  23.5k|        } else {
 2756|  23.5k|            ptr += m->padding;
 2757|  23.5k|            ptr += sizeof(size_t);
 2758|  23.5k|            entries[entryIndex].fieldPointer = (void*)ptr;
 2759|  23.5k|            entries[entryIndex].function = m->isOptional ?
  ------------------
  |  Branch (2759:44): [True: 0, False: 23.5k]
  ------------------
 2760|  23.5k|                OptionalArray_decodeJson : Array_decodeJson;
 2761|  23.5k|            ptr += sizeof(void*);
 2762|  23.5k|        }
 2763|  45.7k|    }
 2764|       |
 2765|  12.8k|    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|  12.8k|    if(ret == UA_STATUSCODE_GOOD && optional &&
  ------------------
  |  |   17|  25.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2769:8): [True: 12.8k, False: 22]
  |  Branch (2769:37): [True: 0, False: 12.8k]
  ------------------
 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|  12.8k|    return ret;
 2808|  12.8k|}
ua_types_encoding_json.c:Array_decodeJson:
 2630|  12.9k|Array_decodeJson(ParseCtx *ctx, void *dst_, const UA_DataType *type) {
 2631|  12.9k|    void **dst = (void**)dst_;
 2632|       |
 2633|       |    /* Save the length of the array */
 2634|  12.9k|    size_t *size_ptr = (size_t*) dst - 1;
 2635|       |
 2636|       |    /* A null JSON array represents a null OPC UA array. */
 2637|  12.9k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2637:8): [True: 126, False: 12.7k]
  ------------------
 2638|    126|        *size_ptr = 0;
 2639|    126|        *dst = NULL;
 2640|    126|        ctx->index++;
 2641|    126|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    126|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2642|    126|    }
 2643|       |
 2644|  12.7k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2644:8): [True: 16, False: 12.7k]
  ------------------
 2645|     16|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2646|       |
 2647|  12.7k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2648|       |
 2649|  12.7k|    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.7k|    if(length == 0) {
  ------------------
  |  Branch (2653:8): [True: 491, False: 12.2k]
  ------------------
 2654|    491|        *size_ptr = length;
 2655|    491|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|    491|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2656|    491|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    491|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2657|    491|    }
 2658|       |
 2659|       |    /* Allocate memory */
 2660|  12.2k|    if(length > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2660:8): [True: 0, False: 12.2k]
  ------------------
 2661|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2662|  12.2k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  12.2k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2663|  12.2k|    if(*dst == NULL)
  ------------------
  |  Branch (2663:8): [True: 13, False: 12.2k]
  ------------------
 2664|     13|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     13|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2665|       |
 2666|       |    /* Decode array members */
 2667|  12.2k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2668|  12.2k|    uintptr_t ptr = (uintptr_t)*dst;
 2669|  3.20M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2669:23): [True: 3.19M, False: 9.77k]
  ------------------
 2670|  3.19M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2670:12): [True: 768, False: 3.19M]
  ------------------
 2671|    768|            if(!isJsonNullable(type)) {
  ------------------
  |  Branch (2671:16): [True: 8, False: 760]
  ------------------
 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|    760|            ptr += type->memSize;
 2677|    760|            ctx->index++;
 2678|    760|            continue;
 2679|    768|        }
 2680|       |
 2681|  3.19M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2682|  3.19M|        ptr += type->memSize;
 2683|  3.19M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  3.19M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2683:12): [True: 2.49k, False: 3.19M]
  ------------------
 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.19M|    }
 2689|       |
 2690|  9.77k|    *size_ptr = length; /* All good, set the size */
 2691|  9.77k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.77k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2692|  12.2k|}
ua_types_encoding_json.c:DataValue_decodeJson:
 2267|  26.3k|DECODE_JSON(DataValue) {
 2268|  26.3k|    UA_DataValue *dst = (UA_DataValue*)p;
 2269|  26.3k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1322|  26.3k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  26.3k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 367, False: 26.0k]
  |  |  ------------------
  |  | 1324|    367|        ctx->index++;                                \
  |  | 1325|    367|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    367|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  26.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 26.0k]
  |  |  ------------------
  ------------------
 2270|  26.0k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  26.0k|#define CHECK_OBJECT do {                                \
  |  | 1318|  26.0k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 42, False: 25.9k]
  |  |  ------------------
  |  | 1319|     42|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     42|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  25.9k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 25.9k]
  |  |  ------------------
  ------------------
 2271|       |
 2272|       |    /* Decode the Variant in-situ */
 2273|  25.9k|    size_t beginIndex = ctx->index;
 2274|  25.9k|    status ret = decodeJSONVariant(ctx, &dst->value, true);
 2275|  25.9k|    ctx->index = beginIndex;
 2276|  25.9k|    dst->hasValue = (dst->value.type != NULL);
 2277|  25.9k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  25.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2277:8): [True: 3.64k, False: 22.3k]
  ------------------
 2278|  3.64k|        return ret;
 2279|       |
 2280|       |    /* Decode the other members (skip the Variant members) */
 2281|  22.3k|    DecodeEntry entries[8] = {
 2282|  22.3k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 2283|  22.3k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 2284|  22.3k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 2285|  22.3k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|  22.3k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2286|  22.3k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 2287|  22.3k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|  22.3k|#define UA_TYPES_DATETIME 12
  ------------------
 2288|  22.3k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 2289|  22.3k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  164|  22.3k|#define UA_TYPES_UINT16 4
  ------------------
 2290|  22.3k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 2291|  22.3k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|  22.3k|#define UA_TYPES_DATETIME 12
  ------------------
 2292|  22.3k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 2293|  22.3k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  164|  22.3k|#define UA_TYPES_UINT16 4
  ------------------
 2294|  22.3k|    };
 2295|       |
 2296|  22.3k|    ret = decodeFields(ctx, entries, 8);
 2297|  22.3k|    dst->hasStatus = entries[3].found;
 2298|  22.3k|    dst->hasSourceTimestamp = entries[4].found;
 2299|  22.3k|    dst->hasSourcePicoseconds = entries[5].found;
 2300|  22.3k|    dst->hasServerTimestamp = entries[6].found;
 2301|  22.3k|    dst->hasServerPicoseconds = entries[7].found;
 2302|  22.3k|    return ret;
 2303|  25.9k|}
ua_types_encoding_json.c:decodeJSONVariant:
 2124|  37.9k|                  UA_Boolean insideDataValue) {
 2125|       |    /* Empty variant == null */
 2126|  37.9k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2126:8): [True: 1.92k, False: 36.0k]
  ------------------
 2127|  1.92k|        ctx->index++;
 2128|  1.92k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.92k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2129|  1.92k|    }
 2130|       |
 2131|       |    /* Search the value field */
 2132|  36.0k|    size_t valueIndex = 0;
 2133|  36.0k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 2134|       |
 2135|       |    /* Search for the dimensions field */
 2136|  36.0k|    size_t dimIndex = 0;
 2137|  36.0k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 2138|       |
 2139|       |    /* Parse the type kind */
 2140|  36.0k|    size_t typeIndex = 0;
 2141|  36.0k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 2142|  36.0k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (2142:8): [True: 73, False: 36.0k]
  |  Branch (2142:26): [True: 1, False: 35.9k]
  ------------------
 2143|     74|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     74|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2144|  35.9k|    UA_UInt64 typeKind = 0;
 2145|  35.9k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 2146|  35.9k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 2147|  35.9k|    if(len == 0)
  ------------------
  |  Branch (2147:8): [True: 5, False: 35.9k]
  ------------------
 2148|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#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.9k|    typeKind--;
 2153|  35.9k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2153:8): [True: 133, False: 35.8k]
  ------------------
 2154|    133|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    133|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2155|  35.8k|    const UA_DataType *type = &UA_TYPES[typeKind];
 2156|       |
 2157|       |    /* These combinations are excluded by the Variant definition. */
 2158|  35.8k|    if(type->typeKind == UA_DATATYPEKIND_DIAGNOSTICINFO ||
  ------------------
  |  Branch (2158:8): [True: 1, False: 35.8k]
  ------------------
 2159|  35.8k|       (insideDataValue && type->typeKind == UA_DATATYPEKIND_DATAVALUE))
  ------------------
  |  Branch (2159:9): [True: 24.7k, False: 11.1k]
  |  Branch (2159:28): [True: 1, False: 24.7k]
  ------------------
 2160|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2161|       |
 2162|       |    /* Value is an array? */
 2163|  35.8k|    UA_Boolean isArray =
 2164|  35.8k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (2164:10): [True: 33.3k, False: 2.48k]
  |  Branch (2164:28): [True: 11.7k, False: 21.6k]
  ------------------
 2165|  35.8k|    if(type->typeKind == UA_DATATYPEKIND_VARIANT && !isArray)
  ------------------
  |  Branch (2165:8): [True: 1.92k, False: 33.9k]
  |  Branch (2165:53): [True: 1, False: 1.92k]
  ------------------
 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.8k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |   22|  35.8k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2169:8): [True: 1, False: 35.8k]
  ------------------
 2170|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2171|  35.8k|    size_t beginIndex = ctx->index;
 2172|  35.8k|    ctx->index = valueIndex;
 2173|  35.8k|    ctx->depth++;
 2174|       |
 2175|       |    /* Decode the value */
 2176|  35.8k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  35.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2177|  35.8k|    if(!isArray) {
  ------------------
  |  Branch (2177:8): [True: 24.1k, False: 11.7k]
  ------------------
 2178|       |        /* Scalar with dimensions -> error */
 2179|  24.1k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2179:12): [True: 2, False: 24.1k]
  ------------------
 2180|      2|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2181|      2|            goto out;
 2182|      2|        }
 2183|       |
 2184|       |        /* Missing values are only valid for nullable types. */
 2185|  24.1k|        if(valueIndex == 0 && !isJsonNullable(type)) {
  ------------------
  |  Branch (2185:12): [True: 2.48k, False: 21.6k]
  |  Branch (2185:31): [True: 47, False: 2.43k]
  ------------------
 2186|     47|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     47|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2187|     47|            goto out;
 2188|     47|        }
 2189|       |
 2190|       |        /* JSON null is only valid for nullable types. */
 2191|  24.1k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_NULL &&
  ------------------
  |  Branch (2191:12): [True: 21.6k, False: 2.43k]
  |  Branch (2191:30): [True: 282, False: 21.3k]
  ------------------
 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.1k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (2198:12): [True: 21.6k, False: 2.43k]
  |  Branch (2198:30): [True: 1.61k, False: 20.0k]
  ------------------
 2199|  1.61k|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 2200|  1.61k|            goto out;
 2201|  1.61k|        }
 2202|       |
 2203|       |        /* Allocate memory for the value */
 2204|  22.4k|        dst->data = UA_new(type);
 2205|  22.4k|        if(!dst->data) {
  ------------------
  |  Branch (2205:12): [True: 5, False: 22.4k]
  ------------------
 2206|      5|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2207|      5|            goto out;
 2208|      5|        }
 2209|  22.4k|        dst->type = type;
 2210|       |
 2211|       |        /* Decode the value */
 2212|  22.4k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (2212:12): [True: 20.0k, False: 2.43k]
  |  Branch (2212:30): [True: 19.8k, False: 196]
  ------------------
 2213|  19.8k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 2214|  22.4k|    } else {
 2215|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 2216|       |         * members must all have the same type. */
 2217|  11.7k|        const UA_DataType *unwrapType = NULL;
 2218|  11.7k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|  11.7k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2218:12): [True: 7.69k, False: 4.00k]
  ------------------
 2219|  7.69k|            unwrapType = getArrayUnwrapType(ctx);
 2220|  11.7k|        if(unwrapType) {
  ------------------
  |  Branch (2220:12): [True: 525, False: 11.1k]
  ------------------
 2221|    525|            dst->type = unwrapType;
 2222|    525|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 2223|  11.1k|        } else {
 2224|  11.1k|            dst->type = type;
 2225|  11.1k|            res = Array_decodeJson(ctx, &dst->data, type);
 2226|  11.1k|        }
 2227|       |
 2228|       |        /* Decode array dimensions */
 2229|  11.7k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2229:12): [True: 1.24k, False: 10.4k]
  ------------------
 2230|  1.24k|            ctx->index = dimIndex;
 2231|  1.24k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 2232|  1.24k|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|  1.24k|#define UA_TYPES_UINT32 6
  ------------------
 2233|       |
 2234|       |            /* Help clang-analyzer */
 2235|  1.24k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  399|  1.24k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2235:13): [True: 86, False: 1.16k]
  |  Branch (2235:13): [True: 1.16k, False: 0]
  ------------------
 2236|       |
 2237|       |            /* Validate the dimensions */
 2238|  1.24k|            if(res == UA_STATUSCODE_GOOD &&
  ------------------
  |  |   17|  2.49k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2238:16): [True: 1.12k, False: 122]
  ------------------
 2239|  1.12k|               !variantDimensionsValid(dst->arrayLength,
  ------------------
  |  Branch (2239:16): [True: 140, False: 984]
  ------------------
 2240|  1.12k|                                       dst->arrayDimensionsSize,
 2241|  1.12k|                                       dst->arrayDimensions))
 2242|    140|                res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    140|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2243|       |
 2244|       |            /* Only keep >= 2 dimensions */
 2245|  1.24k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (2245:16): [True: 1.07k, False: 173]
  ------------------
 2246|  1.07k|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|  1.07k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2247|  1.07k|                dst->arrayDimensions = NULL;
 2248|  1.07k|                dst->arrayDimensionsSize = 0;
 2249|  1.07k|            }
 2250|  1.24k|        }
 2251|  11.7k|    }
 2252|       |
 2253|  35.8k| out:
 2254|  35.8k|    ctx->index = beginIndex;
 2255|  35.8k|    skipObject(ctx);
 2256|  35.8k|    ctx->depth--;
 2257|  35.8k|    return res;
 2258|  35.8k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2427|  1.61k|                                        const UA_DataType *type) {
 2428|  1.61k|    (void) type;
 2429|  1.61k|    UA_Variant *dst = (UA_Variant*)p;
 2430|       |
 2431|       |    /* ExtensionObject with null body */
 2432|  1.61k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2432:8): [True: 85, False: 1.52k]
  ------------------
 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.52k|    UA_ExtensionObject eo;
 2441|  1.52k|    UA_ExtensionObject_init(&eo);
 2442|  1.52k|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2443|  1.52k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  1.52k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2443:8): [True: 491, False: 1.03k]
  ------------------
 2444|    491|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2445|    491|        return ret;
 2446|    491|    }
 2447|       |
 2448|       |    /* The content is still encoded, cannot unwrap */
 2449|  1.03k|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2449:8): [True: 296, False: 741]
  ------------------
 2450|    296|        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|    741|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2457:8): [True: 249, False: 492]
  ------------------
 2458|    249|        goto use_eo;
 2459|       |
 2460|       |    /* Unwrap the ExtensionObject */
 2461|    492|    dst->data = eo.content.decoded.data;
 2462|    492|    dst->type = eo.content.decoded.type;
 2463|    492|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    492|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2464|       |
 2465|    545| use_eo:
 2466|       |    /* Don't unwrap */
 2467|    545|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  742|    545|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2468|    545|    if(!dst->data) {
  ------------------
  |  Branch (2468:8): [True: 1, False: 544]
  ------------------
 2469|      1|        UA_ExtensionObject_clear(&eo);
 2470|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2471|      1|    }
 2472|    544|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|    544|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2473|    544|    *(UA_ExtensionObject*)dst->data = eo;
 2474|    544|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    544|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2475|    545|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1998|  7.69k|getArrayUnwrapType(ParseCtx *ctx) {
 1999|  7.69k|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|  7.69k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1999:5): [True: 7.69k, False: 0]
  ------------------
 2000|       |
 2001|       |    /* Return early for empty arrays */
 2002|  7.69k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2003|  7.69k|    if(length == 0)
  ------------------
  |  Branch (2003:8): [True: 222, False: 7.47k]
  ------------------
 2004|    222|        return NULL;
 2005|       |
 2006|       |    /* Save the original index and go to the first array member */
 2007|  7.47k|    size_t oldIndex = ctx->index;
 2008|  7.47k|    ctx->index++;
 2009|       |
 2010|       |    /* Lookup the type for the first array member */
 2011|  7.47k|    UA_NodeId typeId;
 2012|  7.47k|    UA_NodeId_init(&typeId);
 2013|  7.47k|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 2014|  7.47k|    if(!typeOfBody) {
  ------------------
  |  Branch (2014:8): [True: 3.78k, False: 3.69k]
  ------------------
 2015|  3.78k|        ctx->index = oldIndex; /* Restore the index */
 2016|  3.78k|        return NULL;
 2017|  3.78k|    }
 2018|       |
 2019|       |    /* Get the TypeId encoding for faster comparison below.
 2020|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 2021|  3.69k|    size_t typeIdIndex = 0;
 2022|  3.69k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2023|  3.69k|    (void)ret;
 2024|  3.69k|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  399|  3.69k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2024:5): [True: 3.69k, False: 0]
  ------------------
 2025|  3.69k|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 2026|  3.69k|    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|  18.5k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2030:23): [True: 18.0k, False: 525]
  ------------------
 2031|       |        /* Array element must be an object */
 2032|  18.0k|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (2032:12): [True: 36, False: 18.0k]
  ------------------
 2033|     36|            ctx->index = oldIndex; /* Restore the index */
 2034|     36|            return NULL;
 2035|     36|        }
 2036|       |
 2037|       |        /* Check for non-JSON encoding */
 2038|  18.0k|        size_t encIndex = 0;
 2039|  18.0k|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2040|  18.0k|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  18.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2040:12): [True: 78, False: 17.9k]
  ------------------
 2041|     78|            ctx->index = oldIndex; /* Restore the index */
 2042|     78|            return NULL;
 2043|     78|        }
 2044|       |
 2045|       |        /* Get the type NodeId index */
 2046|  17.9k|        size_t memberTypeIdIndex = 0;
 2047|  17.9k|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 2048|  17.9k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  17.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2048:12): [True: 265, False: 17.6k]
  ------------------
 2049|    265|            ctx->index = oldIndex; /* Restore the index */
 2050|    265|            return NULL;
 2051|    265|        }
 2052|       |
 2053|       |        /* Is it the same type? Compare raw NodeId string */
 2054|  17.6k|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 2055|  17.6k|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 2056|  17.6k|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (2056:12): [True: 2.49k, False: 15.1k]
  ------------------
 2057|  15.1k|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (2057:12): [True: 297, False: 14.8k]
  ------------------
 2058|  2.79k|            ctx->index = oldIndex; /* Restore the index */
 2059|  2.79k|            return NULL;
 2060|  2.79k|        }
 2061|       |
 2062|       |        /* Skip to the next array member */
 2063|  14.8k|        skipObject(ctx);
 2064|  14.8k|    }
 2065|       |
 2066|    525|    ctx->index = oldIndex; /* Restore the index */
 2067|    525|    return typeOfBody;
 2068|  3.69k|}
ua_types_encoding_json.c:getExtensionObjectType:
 1966|  7.47k|getExtensionObjectType(ParseCtx *ctx) {
 1967|  7.47k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1967:8): [True: 209, False: 7.26k]
  ------------------
 1968|    209|        return NULL;
 1969|       |
 1970|       |    /* Get the type NodeId index */
 1971|  7.26k|    size_t typeIdIndex = 0;
 1972|  7.26k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1973|  7.26k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  7.26k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1973:8): [True: 859, False: 6.40k]
  ------------------
 1974|    859|        return NULL;
 1975|       |
 1976|  6.40k|    size_t oldIndex = ctx->index;
 1977|  6.40k|    ctx->index = (UA_UInt16)typeIdIndex;
 1978|       |
 1979|       |    /* Decode the type NodeId */
 1980|  6.40k|    UA_NodeId typeId;
 1981|  6.40k|    UA_NodeId_init(&typeId);
 1982|  6.40k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|  6.40k|#define UA_TYPES_NODEID 16
  ------------------
 1983|  6.40k|    ctx->index = oldIndex;
 1984|  6.40k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  6.40k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1984:8): [True: 2.44k, False: 3.96k]
  ------------------
 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|  3.96k|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1991|  3.96k|    UA_NodeId_clear(&typeId);
 1992|  3.96k|    return type;
 1993|  6.40k|}
ua_types_encoding_json.c:Array_decodeJsonUnwrapExtensionObject:
 2072|    525|                                      const UA_DataType *type) {
 2073|    525|    size_t *size_ptr = (size_t*) dst - 1; /* Save the length pointer of the array */
 2074|    525|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2075|       |
 2076|       |    /* Known from the previous unwrapping-check */
 2077|    525|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|    525|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2077:5): [True: 525, False: 0]
  ------------------
 2078|    525|    UA_assert(length > 0);
  ------------------
  |  |  399|    525|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2078:5): [True: 525, False: 0]
  ------------------
 2079|       |
 2080|    525|    ctx->index++; /* Go to first array member */
 2081|       |
 2082|       |    /* Allocate memory */
 2083|    525|    if(length > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2083:8): [True: 0, False: 525]
  ------------------
 2084|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2085|    525|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|    525|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2086|    525|    if(*dst == NULL)
  ------------------
  |  Branch (2086:8): [True: 1, False: 524]
  ------------------
 2087|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2088|       |
 2089|       |    /* Decode array members */
 2090|    524|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    524|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2091|    524|    uintptr_t ptr = (uintptr_t)*dst;
 2092|  11.2k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2092:23): [True: 10.8k, False: 462]
  ------------------
 2093|  10.8k|        UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|  10.8k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2093:9): [True: 10.8k, False: 0]
  ------------------
 2094|  10.8k|        if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2094:12): [True: 10.0k, False: 773]
  ------------------
 2095|  10.0k|           type->typeKind == UA_DATATYPEKIND_OPTSTRUCT) {
  ------------------
  |  Branch (2095:12): [True: 0, False: 773]
  ------------------
 2096|       |            /* Decode structure in-situ in the ExtensionObject */
 2097|  10.0k|            ret = decodeJsonStructureExtensionObject(ctx, (void*)ptr, type);
 2098|  10.0k|        } else if(type->typeKind == UA_DATATYPEKIND_UNION) {
  ------------------
  |  Branch (2098:19): [True: 0, False: 773]
  ------------------
 2099|       |            /* Decode union in-situ in the ExtensionObject */
 2100|      0|            ret = decodeJsonUnionExtensionObject(ctx, (void*)ptr, type);
 2101|    773|        } else {
 2102|       |            /* Get the body field and decode it */
 2103|    773|            DecodeEntry entries[3] = {
 2104|    773|                {UA_JSONKEY_TYPEID, NULL, NULL, false, NULL},
 2105|    773|                {UA_JSONKEY_BODY, (void*)ptr, NULL, false, type},
 2106|    773|                {UA_JSONKEY_ENCODING, NULL, NULL, false, NULL}
 2107|    773|            };
 2108|    773|            ret = decodeFields(ctx, entries, 3);
 2109|    773|        }
 2110|  10.8k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  10.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2110:12): [True: 62, False: 10.7k]
  ------------------
 2111|     62|            UA_Array_delete(*dst, i+1, type);
 2112|     62|            *dst = NULL;
 2113|     62|            return ret;
 2114|     62|        }
 2115|  10.7k|        ptr += type->memSize;
 2116|  10.7k|    }
 2117|       |
 2118|    462|    *size_ptr = length; /* All good, set the size */
 2119|    462|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    462|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2120|    524|}
ua_types_encoding_json.c:Variant_decodeJson:
 2260|  12.2k|DECODE_JSON(Variant) {
 2261|  12.2k|    UA_Variant *dst = (UA_Variant*)p;
 2262|  12.2k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1322|  12.2k|#define CHECK_NULL_SKIP do {                         \
  |  | 1323|  12.2k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1323:8): [True: 194, False: 12.0k]
  |  |  ------------------
  |  | 1324|    194|        ctx->index++;                                \
  |  | 1325|    194|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    194|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1326|  12.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1326:14): [Folded, False: 12.0k]
  |  |  ------------------
  ------------------
 2263|  12.0k|    CHECK_OBJECT;
  ------------------
  |  | 1317|  12.0k|#define CHECK_OBJECT do {                                \
  |  | 1318|  12.0k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1318:8): [True: 10, False: 12.0k]
  |  |  ------------------
  |  | 1319|     10|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1320|  12.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1320:14): [Folded, False: 12.0k]
  |  |  ------------------
  ------------------
 2264|  12.0k|    return decodeJSONVariant(ctx, dst, false);
 2265|  12.0k|}
ua_types_encoding_json.c:Enum_decodeJson:
 1716|    706|DECODE_JSON(Enum) {
 1717|    706|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1717:8): [True: 471, False: 235]
  ------------------
 1718|    471|        return Int32_decodeJson(ctx, p, type);
 1719|    235|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (1719:8): [True: 13, False: 222]
  ------------------
 1720|     13|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1721|       |
 1722|    222|    UA_String encoded = UA_STRING_NULL;
 1723|    222|    status ret = String_decodeJson(ctx, &encoded, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|    222|#define UA_TYPES_STRING 11
  ------------------
 1724|    222|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    222|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1724:8): [True: 7, False: 215]
  ------------------
 1725|      7|        return ret;
 1726|       |
 1727|       |    /* Use the suffix after the final underscore, if present. Enumeration
 1728|       |     * names can themselves contain underscores. */
 1729|    215|    size_t numberStart = 0;
 1730|  3.56M|    for(size_t i = encoded.length; i > 0; i--) {
  ------------------
  |  Branch (1730:36): [True: 3.56M, False: 181]
  ------------------
 1731|  3.56M|        if(encoded.data[i - 1] != '_')
  ------------------
  |  Branch (1731:12): [True: 3.56M, False: 34]
  ------------------
 1732|  3.56M|            continue;
 1733|     34|        if(i == 1 || i == encoded.length) {
  ------------------
  |  Branch (1733:12): [True: 1, False: 33]
  |  Branch (1733:22): [True: 1, False: 32]
  ------------------
 1734|      2|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1735|      2|            goto cleanup;
 1736|      2|        }
 1737|     32|        numberStart = i;
 1738|     32|        break;
 1739|     34|    }
 1740|       |
 1741|    213|    size_t numberLength = encoded.length - numberStart;
 1742|    213|    if(numberLength == 0) {
  ------------------
  |  Branch (1742:8): [True: 1, False: 212]
  ------------------
 1743|      1|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1744|      1|        goto cleanup;
 1745|      1|    }
 1746|       |
 1747|    212|    UA_Int64 value = 0;
 1748|    212|    size_t parsed = parseInt64((const char*)&encoded.data[numberStart],
 1749|    212|                               numberLength, &value);
 1750|    212|    if(parsed != numberLength || value < UA_INT32_MIN || value > UA_INT32_MAX) {
  ------------------
  |  |  100|    370|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(parsed != numberLength || value < UA_INT32_MIN || value > UA_INT32_MAX) {
  ------------------
  |  |  101|     98|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1750:8): [True: 54, False: 158]
  |  Branch (1750:34): [True: 60, False: 98]
  |  Branch (1750:58): [True: 2, False: 96]
  ------------------
 1751|    116|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    116|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1752|    116|        goto cleanup;
 1753|    116|    }
 1754|     96|    *(UA_Int32*)p = (UA_Int32)value;
 1755|       |
 1756|    215| cleanup:
 1757|    215|    UA_String_clear(&encoded);
 1758|    215|    return ret;
 1759|     96|}
ua_types_encoding_json.c:decodeJsonStructure:
 2811|  1.62k|decodeJsonStructure(ParseCtx *ctx, void *dst, const UA_DataType *type) {
 2812|       |    return decodeJsonStructureInternal(ctx, dst, type, false);
 2813|  1.62k|}

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

UA_Guid_parse:
   86|     59|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|     59|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|     59|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     59|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 53, False: 6]
  ------------------
   89|     53|        *guid = UA_GUID_NULL;
   90|     59|    return res;
   91|     59|}
UA_NodeId_parseEx:
  323|  27.2k|                  const UA_NamespaceMapping *nsMapping) {
  324|  27.2k|    UA_StatusCode res =
  325|  27.2k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  27.2k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  27.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 1.83k, False: 25.3k]
  ------------------
  327|  1.83k|        UA_NodeId_clear(id);
  328|  27.2k|    return res;
  329|  27.2k|}
UA_ExpandedNodeId_parseEx:
  671|  3.67k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  3.67k|    UA_StatusCode res =
  673|  3.67k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  3.67k|                             nsMapping, serverUrisSize, serverUris);
  675|  3.67k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.67k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 459, False: 3.22k]
  ------------------
  676|    459|        UA_ExpandedNodeId_clear(id);
  677|  3.67k|    return res;
  678|  3.67k|}
UA_QualifiedName_parseEx:
  834|  8.48k|                         const UA_NamespaceMapping *nsMapping) {
  835|  8.48k|    const u8 *pos = str.data;
  836|  8.48k|    const u8 *end = str.data + str.length;
  837|  8.48k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  838|  8.48k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  8.48k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (838:8): [True: 1, False: 8.48k]
  ------------------
  839|      1|        UA_QualifiedName_clear(qn);
  840|  8.48k|    return res;
  841|  8.48k|}
ua_types_lex.c:parse_guid:
   50|     84|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|     84|    size_t len = (size_t)(e - s);
   52|     84|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 14, False: 70]
  |  Branch (52:21): [True: 12, False: 58]
  |  Branch (52:36): [True: 3, False: 55]
  |  Branch (52:52): [True: 11, False: 44]
  ------------------
   53|     40|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     40|#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: 9, False: 35]
  ------------------
   57|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|     35|    guid->data1 = tmp;
   59|       |
   60|     35|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 6, False: 29]
  ------------------
   61|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|     29|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|     29|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 5, False: 24]
  ------------------
   65|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|     24|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|     24|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 4, False: 20]
  ------------------
   69|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|     20|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|     20|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 5, False: 15]
  ------------------
   73|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|     15|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|     86|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 78, False: 8]
  ------------------
   77|     78|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 7, False: 71]
  ------------------
   78|      7|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|     71|        guid->data4[pos] = (UA_Byte)tmp;
   80|     71|    }
   81|       |
   82|      8|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      8|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|     15|}
ua_types_lex.c:parse_nodeid:
  148|  27.2k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  27.2k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  27.2k|    LexContext context;
  151|  27.2k|    memset(&context, 0, sizeof(LexContext));
  152|  27.2k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  27.2k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  27.2k|{
  157|  27.2k|	u8 yych;
  158|  27.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  27.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  27.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  26.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 26.4k, False: 758]
  |  |  ------------------
  ------------------
  159|  27.2k|	switch (yych) {
  160|    517|		case 'b':
  ------------------
  |  Branch (160:3): [True: 517, False: 26.6k]
  ------------------
  161|    561|		case 'g':
  ------------------
  |  Branch (161:3): [True: 44, False: 27.1k]
  ------------------
  162|  19.9k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 19.4k, False: 7.77k]
  ------------------
  163|  24.0k|		case 's':
  ------------------
  |  Branch (163:3): [True: 4.01k, False: 23.1k]
  ------------------
  164|  24.0k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  24.0k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  24.0k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  24.0k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  24.0k|			goto yy3;
  167|  1.69k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 1.69k, False: 25.5k]
  ------------------
  168|  1.50k|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 1.50k, False: 25.7k]
  ------------------
  169|  27.2k|	}
  170|  1.50k|yy1:
  171|  1.50k|	YYSKIP();
  ------------------
  |  |   35|  1.50k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.50k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|  1.74k|yy2:
  173|  1.74k|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|  1.74k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  24.0k|yy3:
  175|  24.0k|	YYSKIP();
  ------------------
  |  |   35|  24.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  24.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  24.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  24.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  23.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 23.9k, False: 14]
  |  |  ------------------
  ------------------
  177|  24.0k|	switch (yych) {
  178|  23.9k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 23.9k, False: 35]
  ------------------
  179|     35|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 35, False: 23.9k]
  ------------------
  180|  24.0k|	}
  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.69k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.69k, False: 3]
  |  |  ------------------
  ------------------
  185|  1.69k|	switch (yych) {
  186|  1.68k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 1.68k, False: 8]
  ------------------
  187|      8|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 8, False: 1.68k]
  ------------------
  188|  1.69k|	}
  189|  25.4k|yy5:
  190|  25.4k|	YYSKIP();
  ------------------
  |  |   35|  25.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  25.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  25.4k|	nsu = context.yyt2;
  192|  25.4k|	ns = context.yyt1;
  193|  25.4k|	YYSTAGP(body);
  ------------------
  |  |   38|  25.4k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  25.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  25.4k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  25.4k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  25.4k|	{ goto match; }
  196|  1.68k|yy6:
  197|  1.68k|	YYSKIP();
  ------------------
  |  |   35|  1.68k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.68k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  1.68k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.68k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.68k|#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: 4]
  |  |  ------------------
  ------------------
  199|  1.68k|	switch (yych) {
  200|    670|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 670, False: 1.01k]
  ------------------
  201|  1.01k|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 1.01k, False: 675]
  ------------------
  202|      5|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 5, False: 1.68k]
  ------------------
  203|  1.68k|	}
  204|    197|yy7:
  205|    197|	YYRESTORE();
  ------------------
  |  |   37|    197|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    197|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    197|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    197|	goto yy2;
  207|    670|yy8:
  208|    670|	YYSKIP();
  ------------------
  |  |   35|    670|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    670|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|    670|	yych = YYPEEK();
  ------------------
  |  |   33|    670|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    670|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    667|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 667, False: 3]
  |  |  ------------------
  ------------------
  210|    670|	switch (yych) {
  211|    281|		case '0':
  ------------------
  |  Branch (211:3): [True: 281, False: 389]
  ------------------
  212|    324|		case '1':
  ------------------
  |  Branch (212:3): [True: 43, False: 627]
  ------------------
  213|    377|		case '2':
  ------------------
  |  Branch (213:3): [True: 53, False: 617]
  ------------------
  214|    398|		case '3':
  ------------------
  |  Branch (214:3): [True: 21, False: 649]
  ------------------
  215|    424|		case '4':
  ------------------
  |  Branch (215:3): [True: 26, False: 644]
  ------------------
  216|    500|		case '5':
  ------------------
  |  Branch (216:3): [True: 76, False: 594]
  ------------------
  217|    589|		case '6':
  ------------------
  |  Branch (217:3): [True: 89, False: 581]
  ------------------
  218|    626|		case '7':
  ------------------
  |  Branch (218:3): [True: 37, False: 633]
  ------------------
  219|    655|		case '8':
  ------------------
  |  Branch (219:3): [True: 29, False: 641]
  ------------------
  220|    659|		case '9':
  ------------------
  |  Branch (220:3): [True: 4, False: 666]
  ------------------
  221|    659|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    659|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    659|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|    659|			goto yy10;
  223|     11|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 11, False: 659]
  ------------------
  224|    670|	}
  225|  1.01k|yy9:
  226|  1.01k|	YYSKIP();
  ------------------
  |  |   35|  1.01k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|  1.01k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.01k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.00k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.00k, False: 4]
  |  |  ------------------
  ------------------
  228|  1.01k|	switch (yych) {
  229|  1.00k|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 1.00k, False: 6]
  ------------------
  230|      6|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 6, False: 1.00k]
  ------------------
  231|  1.01k|	}
  232|  3.68k|yy10:
  233|  3.68k|	YYSKIP();
  ------------------
  |  |   35|  3.68k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.68k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  3.68k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.68k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.68k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.57k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.57k, False: 104]
  |  |  ------------------
  ------------------
  235|  3.68k|	switch (yych) {
  236|    574|		case '0':
  ------------------
  |  Branch (236:3): [True: 574, False: 3.10k]
  ------------------
  237|    850|		case '1':
  ------------------
  |  Branch (237:3): [True: 276, False: 3.40k]
  ------------------
  238|  1.08k|		case '2':
  ------------------
  |  Branch (238:3): [True: 238, False: 3.44k]
  ------------------
  239|  1.38k|		case '3':
  ------------------
  |  Branch (239:3): [True: 293, False: 3.38k]
  ------------------
  240|  1.61k|		case '4':
  ------------------
  |  Branch (240:3): [True: 235, False: 3.44k]
  ------------------
  241|  1.84k|		case '5':
  ------------------
  |  Branch (241:3): [True: 225, False: 3.45k]
  ------------------
  242|  2.09k|		case '6':
  ------------------
  |  Branch (242:3): [True: 257, False: 3.42k]
  ------------------
  243|  2.35k|		case '7':
  ------------------
  |  Branch (243:3): [True: 257, False: 3.42k]
  ------------------
  244|  2.68k|		case '8':
  ------------------
  |  Branch (244:3): [True: 329, False: 3.35k]
  ------------------
  245|  3.02k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 337, False: 3.34k]
  ------------------
  246|    552|		case ';':
  ------------------
  |  Branch (246:3): [True: 552, False: 3.12k]
  ------------------
  247|    552|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    552|#define YYSTAGN(t) t = NULL
  ------------------
  248|    552|			goto yy12;
  249|    107|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 107, False: 3.57k]
  ------------------
  250|  3.68k|	}
  251|  1.00k|yy11:
  252|  1.00k|	YYSKIP();
  ------------------
  |  |   35|  1.00k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.00k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|  1.00k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.00k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.00k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.00k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.00k, False: 4]
  |  |  ------------------
  ------------------
  254|  1.00k|	switch (yych) {
  255|      4|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 4, False: 1.00k]
  ------------------
  256|    619|		case ';':
  ------------------
  |  Branch (256:3): [True: 619, False: 388]
  ------------------
  257|    619|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    619|#define YYSTAGN(t) t = NULL
  ------------------
  258|    619|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    619|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    619|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|    619|			goto yy12;
  260|    384|		default:
  ------------------
  |  Branch (260:3): [True: 384, False: 623]
  ------------------
  261|    384|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    384|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    384|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    384|			goto yy13;
  263|  1.00k|	}
  264|  1.54k|yy12:
  265|  1.54k|	YYSKIP();
  ------------------
  |  |   35|  1.54k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  1.54k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.54k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.52k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.52k, False: 15]
  |  |  ------------------
  ------------------
  267|  1.54k|	switch (yych) {
  268|    205|		case 'b':
  ------------------
  |  Branch (268:3): [True: 205, False: 1.33k]
  ------------------
  269|    412|		case 'g':
  ------------------
  |  Branch (269:3): [True: 207, False: 1.33k]
  ------------------
  270|    748|		case 'i':
  ------------------
  |  Branch (270:3): [True: 336, False: 1.20k]
  ------------------
  271|  1.52k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 778, False: 764]
  ------------------
  272|     16|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 16, False: 1.52k]
  ------------------
  273|  1.54k|	}
  274|  1.25k|yy13:
  275|  1.25k|	YYSKIP();
  ------------------
  |  |   35|  1.25k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.25k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|  1.25k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.25k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.25k|#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: 13]
  |  |  ------------------
  ------------------
  277|  1.25k|	switch (yych) {
  278|     13|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 13, False: 1.23k]
  ------------------
  279|    371|		case ';':
  ------------------
  |  Branch (279:3): [True: 371, False: 881]
  ------------------
  280|    371|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    371|#define YYSTAGN(t) t = NULL
  ------------------
  281|    371|			goto yy12;
  282|    868|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 868, False: 384]
  ------------------
  283|  1.25k|	}
  284|  1.52k|yy14:
  285|  1.52k|	YYSKIP();
  ------------------
  |  |   35|  1.52k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.52k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  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.49k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.49k, False: 30]
  |  |  ------------------
  ------------------
  287|  1.52k|	switch (yych) {
  288|  1.49k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 1.49k, False: 35]
  ------------------
  289|     35|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 35, False: 1.49k]
  ------------------
  290|  1.52k|	}
  291|  1.52k|}
  292|       |
  293|       |
  294|  25.4k| match:
  295|  25.4k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 956, False: 24.5k]
  ------------------
  296|       |        /* NamespaceUri */
  297|    956|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|    956|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|    956|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    956|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 956, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|    956|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|    956|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|    956|            return UA_String_copy(&total, &id->identifier.string);
  304|    956|        }
  305|  24.5k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 535, False: 23.9k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|    535|        UA_UInt32 tmp;
  308|    535|        size_t len = (size_t)(body - 1 - ns);
  309|    535|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 535]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|    535|        id->namespaceIndex = (UA_UInt16)tmp;
  312|    535|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 535]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|    535|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  24.5k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  25.4k|}
ua_types_lex.c:escapedUri2Index:
   95|  1.86k|                 const UA_NamespaceMapping *nsMapping) {
   96|  1.86k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 1.86k, False: 0]
  ------------------
   97|  1.86k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  1.86k|#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|  26.7k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  26.7k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  26.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  26.7k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  26.7k|    switch(*body) {
  113|  20.1k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 20.1k, False: 6.53k]
  ------------------
  114|  20.1k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  20.1k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 61, False: 20.1k]
  ------------------
  116|     61|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     61|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  20.1k|        break;
  118|  5.43k|    case 's':
  ------------------
  |  Branch (118:5): [True: 5.43k, False: 21.2k]
  ------------------
  119|  5.43k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  5.43k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  5.43k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  5.43k|        break;
  123|     25|    case 'g':
  ------------------
  |  Branch (123:5): [True: 25, False: 26.6k]
  ------------------
  124|     25|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     25|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     25|        break;
  127|  1.07k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 1.07k, False: 25.6k]
  ------------------
  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.07k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  1.07k|        id->identifier.byteString.data =
  133|  1.07k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  1.07k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 28, False: 1.04k]
  ------------------
  135|     28|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  399|     28|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 28, False: 0]
  ------------------
  136|     28|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     28|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     28|        }
  138|  1.07k|        break;
  139|  1.07k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 26.7k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  26.7k|    }
  143|  26.7k|    return res;
  144|  26.7k|}
ua_types_lex.c:parse_expandednodeid:
  339|  3.67k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  3.67k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  3.67k|    LexContext context;
  342|  3.67k|    memset(&context, 0, sizeof(LexContext));
  343|  3.67k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  3.67k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  3.67k|{
  348|  3.67k|	u8 yych;
  349|  3.67k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.67k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.67k, False: 5]
  |  |  ------------------
  ------------------
  350|  3.67k|	switch (yych) {
  351|    220|		case 'b':
  ------------------
  |  Branch (351:3): [True: 220, False: 3.45k]
  ------------------
  352|    227|		case 'g':
  ------------------
  |  Branch (352:3): [True: 7, False: 3.67k]
  ------------------
  353|    442|		case 'i':
  ------------------
  |  Branch (353:3): [True: 215, False: 3.46k]
  ------------------
  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.30k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 1.30k, False: 2.37k]
  ------------------
  361|  1.30k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.30k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  1.30k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.30k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  1.30k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.30k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  1.30k|			goto yy19;
  365|  1.93k|		case 's':
  ------------------
  |  Branch (365:3): [True: 1.93k, False: 1.74k]
  ------------------
  366|  1.93k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.93k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  1.93k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.93k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  1.93k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.93k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  1.93k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.93k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  1.93k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.93k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  1.93k|			goto yy20;
  372|      7|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 7, False: 3.67k]
  ------------------
  373|  3.67k|	}
  374|      7|yy16:
  375|      7|	YYSKIP();
  ------------------
  |  |   35|      7|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      7|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    438|yy17:
  377|    438|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    438|#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|    421|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 421, False: 21]
  ------------------
  383|     21|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 21, False: 421]
  ------------------
  384|    442|	}
  385|  1.30k|yy19:
  386|  1.30k|	YYSKIP();
  ------------------
  |  |   35|  1.30k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  1.30k|	YYBACKUP();
  ------------------
  |  |   36|  1.30k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.30k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  1.30k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.30k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.29k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.29k, False: 1]
  |  |  ------------------
  ------------------
  389|  1.30k|	switch (yych) {
  390|  1.28k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 1.28k, False: 14]
  ------------------
  391|     14|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 14, False: 1.28k]
  ------------------
  392|  1.30k|	}
  393|  1.93k|yy20:
  394|  1.93k|	YYSKIP();
  ------------------
  |  |   35|  1.93k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.93k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  1.93k|	YYBACKUP();
  ------------------
  |  |   36|  1.93k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.93k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.93k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  1.93k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.93k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.93k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.92k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.92k, False: 3]
  |  |  ------------------
  ------------------
  397|  1.93k|	switch (yych) {
  398|    214|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 214, False: 1.71k]
  ------------------
  399|  1.71k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.71k, False: 220]
  ------------------
  400|      6|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 6, False: 1.92k]
  ------------------
  401|  1.93k|	}
  402|  3.24k|yy21:
  403|  3.24k|	YYSKIP();
  ------------------
  |  |   35|  3.24k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.24k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  3.24k|	svr = context.yyt5;
  405|  3.24k|	svu = context.yyt1;
  406|  3.24k|	sve = context.yyt2;
  407|  3.24k|	ns = context.yyt3;
  408|  3.24k|	nsu = context.yyt4;
  409|  3.24k|	YYSTAGP(body);
  ------------------
  |  |   38|  3.24k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.24k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  3.24k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  3.24k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  3.24k|	{ goto match; }
  412|  1.74k|yy22:
  413|  1.74k|	YYSKIP();
  ------------------
  |  |   35|  1.74k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.74k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  1.74k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.74k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.74k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.74k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.74k, False: 8]
  |  |  ------------------
  ------------------
  415|  1.74k|	switch (yych) {
  416|    522|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 522, False: 1.22k]
  ------------------
  417|  1.21k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 1.21k, False: 535]
  ------------------
  418|     13|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 13, False: 1.73k]
  ------------------
  419|  1.74k|	}
  420|    390|yy23:
  421|    390|	YYRESTORE();
  ------------------
  |  |   37|    390|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    390|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    390|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    390|	goto yy17;
  423|  1.71k|yy24:
  424|  1.71k|	YYSKIP();
  ------------------
  |  |   35|  1.71k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.71k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.71k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.70k, False: 1]
  |  |  ------------------
  ------------------
  426|  1.71k|	switch (yych) {
  427|    600|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 600, False: 1.11k]
  ------------------
  428|  1.10k|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 1.10k, False: 603]
  ------------------
  429|      3|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 3, False: 1.70k]
  ------------------
  430|  1.71k|	}
  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|    162|		case '0':
  ------------------
  |  Branch (435:3): [True: 162, False: 360]
  ------------------
  436|    203|		case '1':
  ------------------
  |  Branch (436:3): [True: 41, False: 481]
  ------------------
  437|    222|		case '2':
  ------------------
  |  Branch (437:3): [True: 19, False: 503]
  ------------------
  438|    245|		case '3':
  ------------------
  |  Branch (438:3): [True: 23, False: 499]
  ------------------
  439|    257|		case '4':
  ------------------
  |  Branch (439:3): [True: 12, False: 510]
  ------------------
  440|    283|		case '5':
  ------------------
  |  Branch (440:3): [True: 26, False: 496]
  ------------------
  441|    497|		case '6':
  ------------------
  |  Branch (441:3): [True: 214, False: 308]
  ------------------
  442|    506|		case '7':
  ------------------
  |  Branch (442:3): [True: 9, False: 513]
  ------------------
  443|    513|		case '8':
  ------------------
  |  Branch (443:3): [True: 7, False: 515]
  ------------------
  444|    517|		case '9':
  ------------------
  |  Branch (444:3): [True: 4, False: 518]
  ------------------
  445|    517|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    517|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    517|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    517|			goto yy29;
  447|      5|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 5, False: 517]
  ------------------
  448|    522|	}
  449|  1.21k|yy26:
  450|  1.21k|	YYSKIP();
  ------------------
  |  |   35|  1.21k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  1.21k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.21k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.21k|#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]
  |  |  ------------------
  ------------------
  452|  1.21k|	switch (yych) {
  453|  1.20k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 1.20k, False: 12]
  ------------------
  454|     12|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 12, False: 1.20k]
  ------------------
  455|  1.21k|	}
  456|    600|yy27:
  457|    600|	YYSKIP();
  ------------------
  |  |   35|    600|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    600|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|    600|	yych = YYPEEK();
  ------------------
  |  |   33|    600|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    600|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    599|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 599, False: 1]
  |  |  ------------------
  ------------------
  459|    600|	switch (yych) {
  460|    588|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 588, False: 12]
  ------------------
  461|     12|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 12, False: 588]
  ------------------
  462|    600|	}
  463|  1.10k|yy28:
  464|  1.10k|	YYSKIP();
  ------------------
  |  |   35|  1.10k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.10k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|  1.10k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.10k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.10k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.10k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.10k, False: 2]
  |  |  ------------------
  ------------------
  466|  1.10k|	switch (yych) {
  467|  1.09k|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 1.09k, False: 9]
  ------------------
  468|      9|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 9, False: 1.09k]
  ------------------
  469|  1.10k|	}
  470|  3.66k|yy29:
  471|  3.66k|	YYSKIP();
  ------------------
  |  |   35|  3.66k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.66k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  3.66k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.66k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.66k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.58k, False: 83]
  |  |  ------------------
  ------------------
  473|  3.66k|	switch (yych) {
  474|    722|		case '0':
  ------------------
  |  Branch (474:3): [True: 722, False: 2.94k]
  ------------------
  475|    958|		case '1':
  ------------------
  |  Branch (475:3): [True: 236, False: 3.42k]
  ------------------
  476|  1.23k|		case '2':
  ------------------
  |  Branch (476:3): [True: 272, False: 3.39k]
  ------------------
  477|  1.51k|		case '3':
  ------------------
  |  Branch (477:3): [True: 280, False: 3.38k]
  ------------------
  478|  1.80k|		case '4':
  ------------------
  |  Branch (478:3): [True: 298, False: 3.36k]
  ------------------
  479|  2.04k|		case '5':
  ------------------
  |  Branch (479:3): [True: 234, False: 3.43k]
  ------------------
  480|  2.33k|		case '6':
  ------------------
  |  Branch (480:3): [True: 292, False: 3.37k]
  ------------------
  481|  2.59k|		case '7':
  ------------------
  |  Branch (481:3): [True: 261, False: 3.40k]
  ------------------
  482|  2.87k|		case '8':
  ------------------
  |  Branch (482:3): [True: 276, False: 3.38k]
  ------------------
  483|  3.14k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 276, False: 3.38k]
  ------------------
  484|    430|		case ';':
  ------------------
  |  Branch (484:3): [True: 430, False: 3.23k]
  ------------------
  485|    430|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    430|#define YYSTAGN(t) t = NULL
  ------------------
  486|    430|			goto yy33;
  487|     87|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 87, False: 3.57k]
  ------------------
  488|  3.66k|	}
  489|  1.20k|yy30:
  490|  1.20k|	YYSKIP();
  ------------------
  |  |   35|  1.20k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  1.20k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.20k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.20k, False: 1]
  |  |  ------------------
  ------------------
  492|  1.20k|	switch (yych) {
  493|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 1, False: 1.20k]
  ------------------
  494|    633|		case ';':
  ------------------
  |  Branch (494:3): [True: 633, False: 568]
  ------------------
  495|    633|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    633|#define YYSTAGN(t) t = NULL
  ------------------
  496|    633|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    633|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    633|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    633|			goto yy33;
  498|    567|		default:
  ------------------
  |  Branch (498:3): [True: 567, False: 634]
  ------------------
  499|    567|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    567|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    567|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    567|			goto yy34;
  501|  1.20k|	}
  502|    588|yy31:
  503|    588|	YYSKIP();
  ------------------
  |  |   35|    588|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    588|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|    588|	yych = YYPEEK();
  ------------------
  |  |   33|    588|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    588|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    587|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 587, False: 1]
  |  |  ------------------
  ------------------
  505|    588|	switch (yych) {
  506|    203|		case '0':
  ------------------
  |  Branch (506:3): [True: 203, False: 385]
  ------------------
  507|    292|		case '1':
  ------------------
  |  Branch (507:3): [True: 89, False: 499]
  ------------------
  508|    323|		case '2':
  ------------------
  |  Branch (508:3): [True: 31, False: 557]
  ------------------
  509|    365|		case '3':
  ------------------
  |  Branch (509:3): [True: 42, False: 546]
  ------------------
  510|    392|		case '4':
  ------------------
  |  Branch (510:3): [True: 27, False: 561]
  ------------------
  511|    457|		case '5':
  ------------------
  |  Branch (511:3): [True: 65, False: 523]
  ------------------
  512|    503|		case '6':
  ------------------
  |  Branch (512:3): [True: 46, False: 542]
  ------------------
  513|    558|		case '7':
  ------------------
  |  Branch (513:3): [True: 55, False: 533]
  ------------------
  514|    574|		case '8':
  ------------------
  |  Branch (514:3): [True: 16, False: 572]
  ------------------
  515|    579|		case '9':
  ------------------
  |  Branch (515:3): [True: 5, False: 583]
  ------------------
  516|    579|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|    579|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    579|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|    579|			goto yy35;
  518|      9|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 9, False: 579]
  ------------------
  519|    588|	}
  520|  1.09k|yy32:
  521|  1.09k|	YYSKIP();
  ------------------
  |  |   35|  1.09k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|  1.09k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.09k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.09k, False: 1]
  |  |  ------------------
  ------------------
  523|  1.09k|	switch (yych) {
  524|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 1, False: 1.09k]
  ------------------
  525|    728|		case ';':
  ------------------
  |  Branch (525:3): [True: 728, False: 370]
  ------------------
  526|    728|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    728|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    728|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|    728|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    728|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    728|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    728|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    728|#define YYSTAGN(t) t = NULL
  ------------------
  529|    728|			goto yy37;
  530|    369|		default:
  ------------------
  |  Branch (530:3): [True: 369, False: 729]
  ------------------
  531|    369|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    369|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    369|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    369|			goto yy36;
  533|  1.09k|	}
  534|  1.62k|yy33:
  535|  1.62k|	YYSKIP();
  ------------------
  |  |   35|  1.62k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.62k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  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.60k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.60k, False: 15]
  |  |  ------------------
  ------------------
  537|  1.62k|	switch (yych) {
  538|    212|		case 'b':
  ------------------
  |  Branch (538:3): [True: 212, False: 1.40k]
  ------------------
  539|    432|		case 'g':
  ------------------
  |  Branch (539:3): [True: 220, False: 1.40k]
  ------------------
  540|    965|		case 'i':
  ------------------
  |  Branch (540:3): [True: 533, False: 1.08k]
  ------------------
  541|  1.60k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 638, False: 983]
  ------------------
  542|     18|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 18, False: 1.60k]
  ------------------
  543|  1.62k|	}
  544|  2.48k|yy34:
  545|  2.48k|	YYSKIP();
  ------------------
  |  |   35|  2.48k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.48k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|  2.48k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.48k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.48k, False: 9]
  |  |  ------------------
  ------------------
  547|  2.48k|	switch (yych) {
  548|      9|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 9, False: 2.48k]
  ------------------
  549|    558|		case ';':
  ------------------
  |  Branch (549:3): [True: 558, False: 1.93k]
  ------------------
  550|    558|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    558|#define YYSTAGN(t) t = NULL
  ------------------
  551|    558|			goto yy33;
  552|  1.92k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 1.92k, False: 567]
  ------------------
  553|  2.48k|	}
  554|  98.0k|yy35:
  555|  98.0k|	YYSKIP();
  ------------------
  |  |   35|  98.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  98.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  98.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  98.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  98.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  97.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 97.9k, False: 81]
  |  |  ------------------
  ------------------
  557|  98.0k|	switch (yych) {
  558|  94.7k|		case '0':
  ------------------
  |  Branch (558:3): [True: 94.7k, False: 3.31k]
  ------------------
  559|  95.0k|		case '1':
  ------------------
  |  Branch (559:3): [True: 274, False: 97.7k]
  ------------------
  560|  95.3k|		case '2':
  ------------------
  |  Branch (560:3): [True: 283, False: 97.7k]
  ------------------
  561|  95.5k|		case '3':
  ------------------
  |  Branch (561:3): [True: 241, False: 97.8k]
  ------------------
  562|  95.8k|		case '4':
  ------------------
  |  Branch (562:3): [True: 263, False: 97.7k]
  ------------------
  563|  96.3k|		case '5':
  ------------------
  |  Branch (563:3): [True: 531, False: 97.5k]
  ------------------
  564|  96.5k|		case '6':
  ------------------
  |  Branch (564:3): [True: 239, False: 97.8k]
  ------------------
  565|  96.9k|		case '7':
  ------------------
  |  Branch (565:3): [True: 364, False: 97.6k]
  ------------------
  566|  97.2k|		case '8':
  ------------------
  |  Branch (566:3): [True: 264, False: 97.7k]
  ------------------
  567|  97.4k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 272, False: 97.7k]
  ------------------
  568|    467|		case ';':
  ------------------
  |  Branch (568:3): [True: 467, False: 97.5k]
  ------------------
  569|    467|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    467|#define YYSTAGN(t) t = NULL
  ------------------
  570|    467|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    467|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    467|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|    467|			goto yy37;
  572|    112|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 112, False: 97.9k]
  ------------------
  573|  98.0k|	}
  574|  2.60M|yy36:
  575|  2.60M|	YYSKIP();
  ------------------
  |  |   35|  2.60M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.60M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  2.60M|	yych = YYPEEK();
  ------------------
  |  |   33|  2.60M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.60M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.60M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.60M, False: 19]
  |  |  ------------------
  ------------------
  577|  2.60M|	switch (yych) {
  578|     19|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 19, False: 2.60M]
  ------------------
  579|    350|		case ';':
  ------------------
  |  Branch (579:3): [True: 350, False: 2.60M]
  ------------------
  580|    350|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    350|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    350|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    350|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    350|#define YYSTAGN(t) t = NULL
  ------------------
  582|    350|			goto yy37;
  583|  2.59M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 2.59M, False: 369]
  ------------------
  584|  2.60M|	}
  585|  1.54k|yy37:
  586|  1.54k|	YYSKIP();
  ------------------
  |  |   35|  1.54k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.54k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.54k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.53k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.53k, False: 9]
  |  |  ------------------
  ------------------
  588|  1.54k|	switch (yych) {
  589|    211|		case 'b':
  ------------------
  |  Branch (589:3): [True: 211, False: 1.33k]
  ------------------
  590|    625|		case 'g':
  ------------------
  |  Branch (590:3): [True: 414, False: 1.13k]
  ------------------
  591|    829|		case 'i':
  ------------------
  |  Branch (591:3): [True: 204, False: 1.34k]
  ------------------
  592|  1.06k|		case 's':
  ------------------
  |  Branch (592:3): [True: 231, False: 1.31k]
  ------------------
  593|  1.06k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.06k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.06k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.06k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.06k|			goto yy38;
  596|    472|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 472, False: 1.07k]
  ------------------
  597|     13|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 13, False: 1.53k]
  ------------------
  598|  1.54k|	}
  599|  2.66k|yy38:
  600|  2.66k|	YYSKIP();
  ------------------
  |  |   35|  2.66k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.66k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  2.66k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.66k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.66k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.61k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.61k, False: 48]
  |  |  ------------------
  ------------------
  602|  2.66k|	switch (yych) {
  603|  2.60k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 2.60k, False: 57]
  ------------------
  604|     57|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 57, False: 2.60k]
  ------------------
  605|  2.66k|	}
  606|    472|yy39:
  607|    472|	YYSKIP();
  ------------------
  |  |   35|    472|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    472|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|    472|	yych = YYPEEK();
  ------------------
  |  |   33|    472|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    472|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    471|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 471, False: 1]
  |  |  ------------------
  ------------------
  609|    472|	switch (yych) {
  610|    462|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 462, False: 10]
  ------------------
  611|     10|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 10, False: 462]
  ------------------
  612|    472|	}
  613|    472|}
  614|       |
  615|       |
  616|  3.24k| match:
  617|  3.24k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 1.02k, False: 2.21k]
  ------------------
  618|       |        /* ServerUri */
  619|  1.02k|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|  1.02k|        size_t i = 0;
  621|  1.02k|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 1.02k]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|  1.02k|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 1.02k, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|  1.02k|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|  1.02k|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|  1.02k|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|  1.02k|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  2.21k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 452, False: 1.76k]
  ------------------
  634|       |        /* ServerIndex */
  635|    452|        size_t len = (size_t)(sve - svr);
  636|    452|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 452]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|    452|    }
  639|       |
  640|  2.21k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 952, False: 1.26k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    952|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    952|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    952|#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|    952|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 714, False: 238]
  ------------------
  647|    714|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    952|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    952|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 952, False: 0]
  ------------------
  649|    952|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    952|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    952|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 1, False: 951]
  ------------------
  651|      1|            return res;
  652|  1.26k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 418, False: 849]
  ------------------
  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.21k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  2.21k|}
ua_types_lex.c:parse_qn:
  707|  8.48k|         UA_UInt16 defaultNamespaceIndex) {
  708|  8.48k|    size_t len;
  709|  8.48k|    UA_UInt32 tmp;
  710|  8.48k|    UA_String str;
  711|  8.48k|    UA_StatusCode res;
  712|       |
  713|  8.48k|    LexContext context;
  714|  8.48k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  8.48k|    const u8 *begin = pos;
  717|  8.48k|    UA_QualifiedName_init(qn);
  718|  8.48k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  8.48k|{
  722|  8.48k|	u8 yych;
  723|  8.48k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.48k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.71k, False: 774]
  |  |  ------------------
  ------------------
  724|  8.48k|	switch (yych) {
  725|    774|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 774, False: 7.71k]
  ------------------
  726|    973|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 199, False: 8.28k]
  ------------------
  727|    334|		case '0':
  ------------------
  |  Branch (727:3): [True: 334, False: 8.15k]
  ------------------
  728|    627|		case '1':
  ------------------
  |  Branch (728:3): [True: 293, False: 8.19k]
  ------------------
  729|  1.18k|		case '2':
  ------------------
  |  Branch (729:3): [True: 556, False: 7.93k]
  ------------------
  730|  1.44k|		case '3':
  ------------------
  |  Branch (730:3): [True: 261, False: 8.22k]
  ------------------
  731|  2.72k|		case '4':
  ------------------
  |  Branch (731:3): [True: 1.28k, False: 7.20k]
  ------------------
  732|  3.13k|		case '5':
  ------------------
  |  Branch (732:3): [True: 412, False: 8.07k]
  ------------------
  733|  5.16k|		case '6':
  ------------------
  |  Branch (733:3): [True: 2.02k, False: 6.45k]
  ------------------
  734|  5.53k|		case '7':
  ------------------
  |  Branch (734:3): [True: 369, False: 8.11k]
  ------------------
  735|  6.19k|		case '8':
  ------------------
  |  Branch (735:3): [True: 659, False: 7.82k]
  ------------------
  736|  6.45k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 257, False: 8.22k]
  ------------------
  737|  1.06k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 1.06k, False: 7.42k]
  ------------------
  738|  8.48k|	}
  739|    973|yy41:
  740|    973|	YYSKIP();
  ------------------
  |  |   35|    973|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    973|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  8.03k|yy42:
  742|  8.03k|	{ pos = begin; goto match_name; }
  743|  1.06k|yy43:
  744|  1.06k|	YYSKIP();
  ------------------
  |  |   35|  1.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  1.06k|	YYBACKUP();
  ------------------
  |  |   36|  1.06k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.06k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  1.06k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    663|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 663, False: 400]
  |  |  ------------------
  ------------------
  747|  1.06k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 400, False: 663]
  ------------------
  748|    663|	goto yy46;
  749|  6.45k|yy44:
  750|  6.45k|	YYSKIP();
  ------------------
  |  |   35|  6.45k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.45k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  6.45k|	YYBACKUP();
  ------------------
  |  |   36|  6.45k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  6.45k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  6.45k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  6.45k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.45k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.45k|#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.11k]
  |  |  ------------------
  ------------------
  753|  6.45k|	switch (yych) {
  754|    138|		case '0':
  ------------------
  |  Branch (754:3): [True: 138, False: 6.31k]
  ------------------
  755|    198|		case '1':
  ------------------
  |  Branch (755:3): [True: 60, False: 6.39k]
  ------------------
  756|    244|		case '2':
  ------------------
  |  Branch (756:3): [True: 46, False: 6.40k]
  ------------------
  757|    263|		case '3':
  ------------------
  |  Branch (757:3): [True: 19, False: 6.43k]
  ------------------
  758|    335|		case '4':
  ------------------
  |  Branch (758:3): [True: 72, False: 6.37k]
  ------------------
  759|    393|		case '5':
  ------------------
  |  Branch (759:3): [True: 58, False: 6.39k]
  ------------------
  760|    461|		case '6':
  ------------------
  |  Branch (760:3): [True: 68, False: 6.38k]
  ------------------
  761|    520|		case '7':
  ------------------
  |  Branch (761:3): [True: 59, False: 6.39k]
  ------------------
  762|    677|		case '8':
  ------------------
  |  Branch (762:3): [True: 157, False: 6.29k]
  ------------------
  763|    724|		case '9':
  ------------------
  |  Branch (763:3): [True: 47, False: 6.40k]
  ------------------
  764|    955|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 231, False: 6.21k]
  ------------------
  765|  5.49k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 5.49k, False: 955]
  ------------------
  766|  6.45k|	}
  767|  5.06k|yy45:
  768|  5.06k|	YYSKIP();
  ------------------
  |  |   35|  5.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  5.06k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.59k, False: 469]
  |  |  ------------------
  ------------------
  770|  5.73k|yy46:
  771|  5.73k|	switch (yych) {
  772|    469|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 469, False: 5.26k]
  ------------------
  773|    194|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 194, False: 5.53k]
  ------------------
  774|  5.06k|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 5.06k, False: 663]
  ------------------
  775|  5.73k|	}
  776|  1.17k|yy47:
  777|  1.17k|	YYRESTORE();
  ------------------
  |  |   37|  1.17k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  1.17k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  1.17k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  1.17k|	goto yy42;
  779|    194|yy48:
  780|    194|	YYSKIP();
  ------------------
  |  |   35|    194|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    194|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    194|	{ goto match_uri; }
  782|  36.8k|yy49:
  783|  36.8k|	YYSKIP();
  ------------------
  |  |   35|  36.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  36.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|  36.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  36.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  36.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  36.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 36.2k, False: 552]
  |  |  ------------------
  ------------------
  785|  37.7k|yy50:
  786|  37.7k|	switch (yych) {
  787|  24.5k|		case '0':
  ------------------
  |  Branch (787:3): [True: 24.5k, False: 13.2k]
  ------------------
  788|  24.8k|		case '1':
  ------------------
  |  Branch (788:3): [True: 363, False: 37.4k]
  ------------------
  789|  25.7k|		case '2':
  ------------------
  |  Branch (789:3): [True: 847, False: 36.9k]
  ------------------
  790|  26.2k|		case '3':
  ------------------
  |  Branch (790:3): [True: 527, False: 37.2k]
  ------------------
  791|  26.8k|		case '4':
  ------------------
  |  Branch (791:3): [True: 559, False: 37.2k]
  ------------------
  792|  28.3k|		case '5':
  ------------------
  |  Branch (792:3): [True: 1.53k, False: 36.2k]
  ------------------
  793|  35.0k|		case '6':
  ------------------
  |  Branch (793:3): [True: 6.69k, False: 31.0k]
  ------------------
  794|  35.4k|		case '7':
  ------------------
  |  Branch (794:3): [True: 370, False: 37.4k]
  ------------------
  795|  36.3k|		case '8':
  ------------------
  |  Branch (795:3): [True: 925, False: 36.8k]
  ------------------
  796|  36.8k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 476, False: 37.2k]
  ------------------
  797|    253|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 253, False: 37.5k]
  ------------------
  798|    702|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 702, False: 37.0k]
  ------------------
  799|  37.7k|	}
  800|    253|yy51:
  801|    253|	YYSKIP();
  ------------------
  |  |   35|    253|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    253|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    253|	{ goto match_index; }
  803|  37.7k|}
  804|       |
  805|       |
  806|    253| match_index:
  807|    253|    len = (size_t)(pos - 1 - begin);
  808|    253|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 253]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    253|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    253|    if(nsMapping)
  ------------------
  |  Branch (811:8): [True: 0, False: 253]
  ------------------
  812|      0|        qn->namespaceIndex =
  813|      0|            UA_NamespaceMapping_remote2Local(nsMapping, qn->namespaceIndex);
  814|    253|    goto match_name;
  815|       |
  816|    194| match_uri:
  817|    194|    str.length = (size_t)(pos - 1 - begin);
  818|    194|    str.data = (UA_Byte*)(uintptr_t)begin;
  819|    194|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  820|    194|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    194|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (820:8): [True: 194, False: 0]
  ------------------
  821|    194|        pos = begin; /* Use the entire string for the name */
  822|       |
  823|  8.48k| match_name:
  824|  8.48k|    str.length = (size_t)(end - pos);
  825|  8.48k|    str.data = (UA_Byte*)(uintptr_t)pos;
  826|  8.48k|    res = UA_String_copy(&str, &qn->name);
  827|  8.48k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  578|  8.48k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (578:23): [True: 8.48k, False: 1]
  |  |  ------------------
  ------------------
  828|  8.48k|        res = UA_String_unescape(&qn->name, false, escName);
  829|  8.48k|    return res;
  830|    194|}

UA_readNumberWithBase:
  111|  22.0k|UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) {
  112|  22.0k|    UA_assert(buf);
  ------------------
  |  |  399|  22.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (112:5): [True: 22.0k, False: 0]
  ------------------
  113|  22.0k|    UA_assert(number);
  ------------------
  |  |  399|  22.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (113:5): [True: 22.0k, False: 0]
  ------------------
  114|  22.0k|    u32 n = 0;
  115|  22.0k|    size_t progress = 0;
  116|       |    /* read numbers until the end or a non-number character appears */
  117|  2.42M|    while(progress < buflen) {
  ------------------
  |  Branch (117:11): [True: 2.40M, False: 21.9k]
  ------------------
  118|  2.40M|        u8 c = buf[progress];
  119|  2.40M|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (119:12): [True: 2.40M, False: 30]
  |  Branch (119:24): [True: 2.40M, False: 705]
  |  Branch (119:36): [True: 2.40M, False: 0]
  ------------------
  120|  2.40M|           n = (n * base) + c - '0';
  121|    735|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (121:17): [True: 735, False: 0]
  |  Branch (121:29): [True: 421, False: 314]
  |  Branch (121:41): [True: 391, False: 30]
  |  Branch (121:53): [True: 372, False: 19]
  ------------------
  122|    372|           n = (n * base) + c-'a' + 10;
  123|    363|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (123:17): [True: 363, False: 0]
  |  Branch (123:29): [True: 328, False: 35]
  |  Branch (123:41): [True: 276, False: 52]
  |  Branch (123:53): [True: 266, False: 10]
  ------------------
  124|    266|           n = (n * base) + c-'A' + 10;
  125|     97|        else
  126|     97|           break;
  127|  2.40M|        ++progress;
  128|  2.40M|    }
  129|  22.0k|    *number = n;
  130|  22.0k|    return progress;
  131|  22.0k|}
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|  13.9k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  804|  13.9k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (804:8): [True: 13.9k, False: 0]
  ------------------
  805|  13.9k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  13.9k|#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.0k|isTrue(uint8_t expr) {
  168|  51.0k|    return expr;
  169|  51.0k|}
ua_pubsub_networkmessage_json.c:isGood:
  157|  51.0k|isGood(UA_StatusCode code) {
  158|  51.0k|    return code == UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  51.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  159|  51.0k|}

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

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

ua_types.c:UA_ByteString_init:
  243|  8.17k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  243|  16.8k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  243|  1.83k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  243|    459|# 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.48k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  243|  40.5k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  243|  1.52k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  243|  40.3k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  243|  34.7k|# 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|    492|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_clear:
  243|  31.3k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_DataValue_clear:
  243|  25.5k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_equal:
  243|    125|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_ByteString_clear:
  243|  6.89k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_String_clear:
  243|  6.93k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

