UA_unbase64:
   75|  6.16k|UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) {
   76|       |    /* Empty base64 results in an empty byte-string */
   77|  6.16k|    if(len == 0) {
  ------------------
  |  Branch (77:8): [True: 1.23k, False: 4.92k]
  ------------------
   78|  1.23k|        *out_len = 0;
   79|  1.23k|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  1.23k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
   80|  1.23k|    }
   81|       |
   82|       |    /* Allocate the output string. Append four bytes to allow missing padding */
   83|  4.92k|    size_t olen = (len / 4 * 3) + 4;
   84|  4.92k|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |   22|  4.92k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   85|  4.92k|    if(!out)
  ------------------
  |  Branch (85:8): [True: 11, False: 4.91k]
  ------------------
   86|     11|        return NULL;
   87|       |
   88|       |    /* Iterate over the input */
   89|  4.91k|    size_t pad = 0;
   90|  4.91k|    unsigned char count = 0;
   91|  4.91k|    unsigned char block[4];
   92|  4.91k|    unsigned char *pos = out;
   93|   157k|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (93:23): [True: 152k, False: 4.87k]
  ------------------
   94|   152k|        if(src[i] & 0x80)
  ------------------
  |  Branch (94:12): [True: 11, False: 152k]
  ------------------
   95|     11|            goto error; /* Non-ASCII input */
   96|   152k|        unsigned char tmp = dtable[src[i]];
   97|   152k|        if(tmp == 0x80)
  ------------------
  |  Branch (97:12): [True: 20, False: 152k]
  ------------------
   98|     20|            goto error; /* Not an allowed character */
   99|   152k|        if(tmp == 0x7f)
  ------------------
  |  Branch (99:12): [True: 1.66k, False: 150k]
  ------------------
  100|  1.66k|            continue; /* Whitespace is ignored to accomodate RFC 2045, used in
  101|       |                       * XML for xs:base64Binary. */
  102|   150k|        block[count++] = tmp;
  103|       |
  104|       |        /* Padding */
  105|   150k|        if(src[i] == '=') {
  ------------------
  |  Branch (105:12): [True: 344, False: 150k]
  ------------------
  106|    344|            if(count < 3) /* Padding can only be the last two bytes of a block */
  ------------------
  |  Branch (106:16): [True: 3, False: 341]
  ------------------
  107|      3|                goto error;
  108|    341|            block[count-1] = 0;
  109|    341|            pad++;
  110|   150k|        } else if(pad > 0) {
  ------------------
  |  Branch (110:19): [True: 9, False: 150k]
  ------------------
  111|      9|            goto error; /* Padding not terminated correctly */
  112|      9|        }
  113|       |
  114|       |        /* Write three output characters for four characters of input */
  115|   150k|        if(count == 4) {
  ------------------
  |  Branch (115:12): [True: 35.7k, False: 115k]
  ------------------
  116|  35.7k|            if(pad > 2)
  ------------------
  |  Branch (116:16): [True: 0, False: 35.7k]
  ------------------
  117|      0|                goto error; /* Invalid padding */
  118|  35.7k|            *pos++ = (block[0] << 2) | (block[1] >> 4);
  119|  35.7k|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  120|  35.7k|            *pos++ = (block[2] << 6) | block[3];
  121|  35.7k|            count = 0;
  122|  35.7k|            pos -= pad;
  123|  35.7k|            pad = 0;
  124|  35.7k|        }
  125|   150k|    }
  126|       |
  127|       |    /* Base64URL permits omitting the padding in the final block. A single
  128|       |     * character cannot encode a byte, and explicit padding must be complete. */
  129|  4.87k|    if(count == 1 || pad > 0)
  ------------------
  |  Branch (129:8): [True: 15, False: 4.85k]
  |  Branch (129:22): [True: 6, False: 4.84k]
  ------------------
  130|     21|        goto error;
  131|  4.84k|    if(count >= 2) {
  ------------------
  |  Branch (131:8): [True: 2.93k, False: 1.91k]
  ------------------
  132|  2.93k|        *pos++ = (block[0] << 2) | (block[1] >> 4);
  133|  2.93k|        if(count == 3)
  ------------------
  |  Branch (133:12): [True: 1.97k, False: 954]
  ------------------
  134|  1.97k|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  135|  2.93k|    }
  136|       |
  137|  4.84k|    *out_len = (size_t)(pos - out);
  138|  4.84k|    if(*out_len == 0) {
  ------------------
  |  Branch (138:8): [True: 205, False: 4.64k]
  ------------------
  139|    205|        UA_free(out);
  ------------------
  |  |   23|    205|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  140|    205|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|    205|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  141|    205|    }
  142|  4.64k|    return out;
  143|       |
  144|     64| error:
  145|     64|    UA_free(out);
  ------------------
  |  |   23|     64|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  146|       |    return NULL;
  147|  4.84k|}

cj5_parse:
  306|  7.13k|          cj5_options *options) {
  307|  7.13k|    cj5_result r;
  308|  7.13k|    cj5__parser parser;
  309|  7.13k|    memset(&parser, 0x0, sizeof(parser));
  310|  7.13k|    parser.curr_tok_idx = 0;
  311|  7.13k|    parser.json5 = json5;
  312|  7.13k|    parser.len = len;
  313|  7.13k|    parser.tokens = tokens;
  314|  7.13k|    parser.max_tokens = max_tokens;
  315|       |
  316|  7.13k|    if(options)
  ------------------
  |  Branch (316:8): [True: 7.13k, False: 0]
  ------------------
  317|  7.13k|        parser.stop_early = options->stop_early;
  318|       |
  319|  7.13k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  320|  7.13k|    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|  7.13k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  324|       |                                   // (value) or ',' (comma).
  325|  7.13k|    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|  7.13k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  330|       |
  331|  7.13k|    cj5_token *token = NULL; // The current token
  332|       |
  333|  8.80k| start_parsing:
  334|  61.3M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (334:11): [True: 61.3M, False: 6.73k]
  ------------------
  335|  61.3M|        char c = json5[parser.pos];
  336|  61.3M|        switch(c) {
  337|  1.09M|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (337:9): [True: 1.09M, False: 60.2M]
  ------------------
  338|  1.09M|        case '\r':
  ------------------
  |  Branch (338:9): [True: 1.45k, False: 61.3M]
  ------------------
  339|  3.58M|        case '\t':
  ------------------
  |  Branch (339:9): [True: 2.49M, False: 58.8M]
  ------------------
  340|  3.92M|        case ' ':
  ------------------
  |  Branch (340:9): [True: 331k, False: 61.0M]
  ------------------
  341|  3.92M|            break;
  342|       |
  343|    521|        case '#': // Skip comment
  ------------------
  |  Branch (343:9): [True: 521, False: 61.3M]
  ------------------
  344|  4.29k|        case '/':
  ------------------
  |  Branch (344:9): [True: 3.77k, False: 61.3M]
  ------------------
  345|  4.29k|            cj5__skip_comment(&parser);
  346|  4.29k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (346:16): [True: 456, False: 3.84k]
  ------------------
  347|    456|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (347:16): [True: 157, False: 299]
  ------------------
  348|    157|                goto finish;
  349|  4.14k|            break;
  350|       |
  351|   199k|        case '{': // Open an object or array
  ------------------
  |  Branch (351:9): [True: 199k, False: 61.1M]
  ------------------
  352|   225k|        case '[':
  ------------------
  |  Branch (352:9): [True: 25.5k, False: 61.3M]
  ------------------
  353|       |            // Check the nesting depth
  354|   225k|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   53|   225k|#define CJ5_MAX_NESTING 256
  ------------------
  |  Branch (354:16): [True: 3, False: 225k]
  ------------------
  355|      3|                parser.error = CJ5_ERROR_INVALID;
  356|      3|                goto finish;
  357|      3|            }
  358|       |
  359|       |            // Correct next?
  360|   225k|            if(next[depth] != 'v') {
  ------------------
  |  Branch (360:16): [True: 29, False: 225k]
  ------------------
  361|     29|                parser.error = CJ5_ERROR_INVALID;
  362|     29|                goto finish;
  363|     29|            }
  364|       |
  365|   225k|            depth++; // Increase the nesting depth
  366|   225k|            nesting[depth] = c; // Set the nesting type
  367|   225k|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (367:27): [True: 199k, False: 25.5k]
  ------------------
  368|       |
  369|       |            // Create a token for the object or array
  370|   225k|            token = cj5__alloc_token(&parser);
  371|   225k|            if(token) {
  ------------------
  |  Branch (371:16): [True: 147k, False: 77.6k]
  ------------------
  372|   147k|                token->parent_id = parser.curr_tok_idx;
  373|   147k|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (373:31): [True: 123k, False: 24.4k]
  ------------------
  374|   147k|                token->start = parser.pos;
  375|   147k|                token->size = 0;
  376|   147k|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  377|       |                                                              // is for this token
  378|   147k|            }
  379|   225k|            break;
  380|       |
  381|   197k|        case '}': // Close an object or array
  ------------------
  |  Branch (381:9): [True: 197k, False: 61.1M]
  ------------------
  382|   201k|        case ']':
  ------------------
  |  Branch (382:9): [True: 3.38k, False: 61.3M]
  ------------------
  383|       |            // Check the nesting depth. Note that a "virtual root object" at
  384|       |            // depth zero must not be closed.
  385|   201k|            if(depth == 0) {
  ------------------
  |  Branch (385:16): [True: 22, False: 201k]
  ------------------
  386|     22|                parser.error = CJ5_ERROR_INVALID;
  387|     22|                goto finish;
  388|     22|            }
  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|   201k|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (393:16): [True: 8, False: 201k]
  ------------------
  394|   201k|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (394:17): [True: 197k, False: 3.37k]
  |  Branch (394:29): [True: 55.9k, False: 141k]
  |  Branch (394:51): [True: 4, False: 55.9k]
  ------------------
  395|     12|                parser.error = CJ5_ERROR_INVALID;
  396|     12|                goto finish;
  397|     12|            }
  398|       |
  399|   200k|            if(token) {
  ------------------
  |  Branch (399:16): [True: 123k, False: 77.5k]
  ------------------
  400|       |                // Finalize the current token
  401|   123k|                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|   123k|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (406:20): [True: 118k, False: 4.85k]
  ------------------
  407|   118k|                    parser.curr_tok_idx = token->parent_id;
  408|   118k|                    token = &tokens[token->parent_id];
  409|   118k|                    token->size++;
  410|   118k|                }
  411|   123k|            }
  412|       |
  413|       |            // Step one level up
  414|   200k|            depth--;
  415|   200k|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (415:27): [True: 5.17k, False: 195k]
  ------------------
  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|   200k|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (421:16): [True: 5.17k, False: 195k]
  |  Branch (421:30): [True: 0, False: 5.17k]
  ------------------
  422|      0|                goto finish;
  423|       |
  424|   200k|            break;
  425|       |
  426|  3.29M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (426:9): [True: 3.29M, False: 58.0M]
  ------------------
  427|  3.29M|            if(next[depth] != ':') {
  ------------------
  |  Branch (427:16): [True: 1.33k, False: 3.29M]
  ------------------
  428|  1.33k|                parser.error = CJ5_ERROR_INVALID;
  429|  1.33k|                goto finish;
  430|  1.33k|            }
  431|  3.29M|            next[depth] = 'v';
  432|  3.29M|            break;
  433|       |
  434|  25.2M|        case ',': // Comma
  ------------------
  |  Branch (434:9): [True: 25.2M, False: 36.0M]
  ------------------
  435|  25.2M|            if(next[depth] != ',') {
  ------------------
  |  Branch (435:16): [True: 14, False: 25.2M]
  ------------------
  436|     14|                parser.error = CJ5_ERROR_INVALID;
  437|     14|                goto finish;
  438|     14|            }
  439|  25.2M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (439:27): [True: 3.23M, False: 22.0M]
  ------------------
  440|  25.2M|            break;
  441|       |
  442|  28.4M|        default: // Value or key
  ------------------
  |  Branch (442:9): [True: 28.4M, False: 32.9M]
  ------------------
  443|  28.4M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (443:16): [True: 25.1M, False: 3.29M]
  ------------------
  444|  25.1M|                cj5__parse_primitive(&parser); // Parse primitive value
  445|  25.1M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (445:20): [True: 25.1M, False: 1.66k]
  ------------------
  446|       |                    // Parent is object or array
  447|  25.1M|                    if(token)
  ------------------
  |  Branch (447:24): [True: 24.8M, False: 239k]
  ------------------
  448|  24.8M|                        token->size++;
  449|  25.1M|                    next[depth] = ',';
  450|  25.1M|                } else {
  451|       |                    // The current value was the root element. Don't look for
  452|       |                    // any next element.
  453|  1.66k|                    next[depth] = 0;
  454|       |
  455|       |                    // The first element was successfully parsed. Stop early or try to
  456|       |                    // parse the full input string?
  457|  1.66k|                    if(parser.stop_early)
  ------------------
  |  Branch (457:24): [True: 0, False: 1.66k]
  ------------------
  458|      0|                        goto finish;
  459|  1.66k|                }
  460|  25.1M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (460:23): [True: 3.29M, False: 222]
  ------------------
  461|  3.29M|                cj5__parse_key(&parser);
  462|  3.29M|                if(token)
  ------------------
  |  Branch (462:20): [True: 3.02M, False: 267k]
  ------------------
  463|  3.02M|                    token->size++; // Keys count towards the length
  464|  3.29M|                next[depth] = ':';
  465|  3.29M|            } else {
  466|    222|                parser.error = CJ5_ERROR_INVALID;
  467|    222|            }
  468|       |
  469|  28.4M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (469:16): [True: 14.2M, False: 14.1M]
  |  Branch (469:32): [True: 498, False: 14.2M]
  ------------------
  470|    498|                goto finish;
  471|       |
  472|  28.4M|            break;
  473|  61.3M|        }
  474|  61.3M|    }
  475|       |
  476|       |    // Are we back to the initial nesting depth?
  477|  6.73k|    if(depth != 0) {
  ------------------
  |  Branch (477:8): [True: 202, False: 6.53k]
  ------------------
  478|    202|        parser.error = CJ5_ERROR_INCOMPLETE;
  479|    202|        goto finish;
  480|    202|    }
  481|       |
  482|       |    // Close the virtual root object if there is one
  483|  6.53k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (483:8): [True: 1.26k, False: 5.26k]
  |  Branch (483:29): [True: 1.23k, False: 33]
  ------------------
  484|       |        // Check the we end after a complete key-value pair (or dangling comma)
  485|  1.23k|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (485:12): [True: 1.21k, False: 18]
  |  Branch (485:30): [True: 67, False: 1.14k]
  ------------------
  486|     67|            parser.error = CJ5_ERROR_INVALID;
  487|  1.23k|        tokens[0].end = parser.pos - 1;
  488|  1.23k|    }
  489|       |
  490|  8.80k| finish:
  491|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  492|       |    // and restart parsing.
  493|  8.80k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (493:8): [True: 2.84k, False: 5.95k]
  ------------------
  494|  2.84k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (494:8): [True: 2.33k, False: 510]
  ------------------
  495|  2.33k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (495:8): [True: 2.04k, False: 293]
  |  Branch (495:22): [True: 1.66k, False: 380]
  ------------------
  496|  1.66k|        parser.token_count = 0;
  497|  1.66k|        token = cj5__alloc_token(&parser);
  498|  1.66k|        if(token) {
  ------------------
  |  Branch (498:12): [True: 1.66k, False: 0]
  ------------------
  499|  1.66k|            token->parent_id = 0;
  500|  1.66k|            token->type = CJ5_TOKEN_OBJECT;
  501|  1.66k|            token->start = 0;
  502|  1.66k|            token->size = 0;
  503|       |
  504|  1.66k|            nesting[0] = '{';
  505|  1.66k|            next[0] = 'k';
  506|       |
  507|  1.66k|            parser.curr_tok_idx = 0;
  508|  1.66k|            parser.pos = 0;
  509|  1.66k|            parser.error = CJ5_ERROR_NONE;
  510|  1.66k|            goto start_parsing;
  511|  1.66k|        }
  512|  1.66k|    }
  513|       |
  514|  7.13k|    memset(&r, 0x0, sizeof(r));
  515|  7.13k|    r.error = parser.error;
  516|  7.13k|    r.error_pos = parser.pos;
  517|  7.13k|    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|  7.13k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (521:8): [True: 29, False: 7.10k]
  ------------------
  522|     29|        r.error = CJ5_ERROR_INCOMPLETE;
  523|       |
  524|       |    // Set the tokens and original string only if successfully parsed
  525|  7.13k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (525:8): [True: 5.92k, False: 1.21k]
  ------------------
  526|  5.92k|        r.tokens = tokens;
  527|  5.92k|        r.json5 = json5;
  528|  5.92k|    }
  529|       |
  530|  7.13k|    return r;
  531|  8.80k|}
cj5_get_str:
  629|   122k|            char *buf, unsigned int *buflen) {
  630|   122k|    const cj5_token *token = &r->tokens[tok_index];
  631|   122k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (631:8): [True: 0, False: 122k]
  ------------------
  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|   122k|    const char *pos = &r->json5[token->start];
  639|   122k|    const char *end = &r->json5[token->end + 1];
  640|   122k|    unsigned int outpos = 0;
  641|   122k|    cj5_error_code error = CJ5_ERROR_NONE;
  642|  23.9M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (642:11): [True: 23.8M, False: 122k]
  ------------------
  643|  23.8M|        uint8_t c = (uint8_t)*pos;
  644|       |        // Unprintable ascii characters must be escaped
  645|  23.8M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (645:12): [True: 61, False: 23.8M]
  |  Branch (645:23): [True: 3, False: 23.8M]
  ------------------
  646|     64|            error = CJ5_ERROR_INVALID;
  647|     64|            goto done;
  648|     64|        }
  649|       |
  650|       |        // Unescaped Ascii character or utf8 byte
  651|  23.8M|        if(c != '\\') {
  ------------------
  |  Branch (651:12): [True: 23.8M, False: 12.4k]
  ------------------
  652|  23.8M|            buf[outpos++] = (char)c;
  653|  23.8M|            continue;
  654|  23.8M|        }
  655|       |
  656|       |        // End of input before the escaped character
  657|  12.4k|        if(pos + 1 >= end) {
  ------------------
  |  Branch (657:12): [True: 0, False: 12.4k]
  ------------------
  658|      0|            error = CJ5_ERROR_INCOMPLETE;
  659|      0|            goto done;
  660|      0|        }
  661|       |
  662|       |        // Process escaped character
  663|  12.4k|        pos++;
  664|  12.4k|        c = (uint8_t)*pos;
  665|  12.4k|        switch(c) {
  666|    345|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (666:9): [True: 345, False: 12.0k]
  ------------------
  667|    284|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (667:9): [True: 284, False: 12.1k]
  ------------------
  668|    294|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (668:9): [True: 294, False: 12.1k]
  ------------------
  669|    453|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (669:9): [True: 453, False: 11.9k]
  ------------------
  670|    457|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (670:9): [True: 457, False: 11.9k]
  ------------------
  671|  4.13k|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (671:9): [True: 4.13k, False: 8.29k]
  ------------------
  672|  6.45k|        case 'u': {
  ------------------
  |  Branch (672:9): [True: 6.45k, False: 5.96k]
  ------------------
  673|       |            // Parse a unicode code point
  674|  6.45k|            if(pos + 4 >= end) {
  ------------------
  |  Branch (674:16): [True: 3, False: 6.45k]
  ------------------
  675|      3|                error = CJ5_ERROR_INCOMPLETE;
  676|      3|                goto done;
  677|      3|            }
  678|  6.45k|            pos++;
  679|  6.45k|            uint32_t utf;
  680|  6.45k|            error = parse_codepoint(pos, &utf);
  681|  6.45k|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (681:16): [True: 11, False: 6.44k]
  ------------------
  682|     11|                goto done;
  683|  6.44k|            pos += 3;
  684|       |
  685|       |            // Parse a surrogate pair
  686|  6.44k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (686:16): [True: 1.81k, False: 4.63k]
  |  Branch (686:33): [True: 697, False: 1.11k]
  ------------------
  687|    697|                if(pos + 6 >= end) {
  ------------------
  |  Branch (687:20): [True: 14, False: 683]
  ------------------
  688|     14|                    error = CJ5_ERROR_INVALID;
  689|     14|                    goto done;
  690|     14|                }
  691|    683|                if(pos[1] != '\\' || pos[2] != 'u') {
  ------------------
  |  Branch (691:20): [True: 3, False: 680]
  |  Branch (691:38): [True: 11, False: 669]
  ------------------
  692|     14|                    error = CJ5_ERROR_INVALID;
  693|     14|                    goto done;
  694|     14|                }
  695|    669|                pos += 3;
  696|    669|                uint32_t utf2;
  697|    669|                error = parse_codepoint(pos, &utf2);
  698|    669|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (698:20): [True: 16, False: 653]
  ------------------
  699|     16|                    goto done;
  700|    653|                pos += 3;
  701|       |                // High or low surrogate pair
  702|    653|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (702:23): [True: 373, False: 280]
  ------------------
  703|    373|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  704|    653|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  705|    653|            }
  706|       |
  707|       |            // Write the utf8 bytes of the code point
  708|  6.40k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  709|  6.40k|            if(len == 0) {
  ------------------
  |  Branch (709:16): [True: 39, False: 6.36k]
  ------------------
  710|     39|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  711|     39|                goto done;
  712|     39|            }
  713|  6.36k|            outpos += len;
  714|  6.36k|            break;
  715|  6.40k|        }
  716|  12.4k|        }
  717|  12.4k|    }
  718|       |
  719|   122k| 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|   122k|    buf[outpos] = 0;
  723|       |
  724|       |    // Set the output length
  725|   122k|    if(buflen)
  ------------------
  |  Branch (725:8): [True: 122k, False: 0]
  ------------------
  726|   122k|        *buflen = outpos;
  727|   122k|    return error;
  728|   122k|}
cj5.c:cj5__skip_comment:
  261|  4.29k|cj5__skip_comment(cj5__parser* parser) {
  262|  4.29k|    const char* json5 = parser->json5;
  263|       |
  264|       |    // Single-line comment
  265|  4.29k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (265:8): [True: 521, False: 3.77k]
  ------------------
  266|  1.14k|    skip_line:
  267|  1.58M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (267:15): [True: 1.58M, False: 74]
  ------------------
  268|  1.58M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (268:16): [True: 1.07k, False: 1.58M]
  ------------------
  269|  1.07k|                parser->pos--; // Reparse the newline in the main parse loop
  270|  1.07k|                return;
  271|  1.07k|            }
  272|  1.58M|            parser->pos++;
  273|  1.58M|        }
  274|     74|        return;
  275|  1.14k|    }
  276|       |
  277|       |    // Comment begins with '/' but not enough space for another character
  278|  3.77k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (278:8): [True: 27, False: 3.75k]
  ------------------
  279|     27|        parser->error = CJ5_ERROR_INVALID;
  280|     27|        return;
  281|     27|    }
  282|  3.75k|    parser->pos++;
  283|       |
  284|       |    // Comment begins with '//' -> single-line comment
  285|  3.75k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (285:8): [True: 628, False: 3.12k]
  ------------------
  286|    628|        goto skip_line;
  287|       |
  288|       |    // Multi-line comments begin with '/*' and end with '*/'
  289|  3.12k|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (289:8): [True: 3.09k, False: 30]
  ------------------
  290|  3.09k|        parser->pos++;
  291|  1.50M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (291:15): [True: 1.50M, False: 100]
  ------------------
  292|  1.50M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (292:16): [True: 7.57k, False: 1.49M]
  |  Branch (292:45): [True: 2.99k, False: 4.58k]
  ------------------
  293|  2.99k|                parser->pos++;
  294|  2.99k|                return;
  295|  2.99k|            }
  296|  1.50M|        }
  297|  3.09k|    }
  298|       |
  299|       |    // Unknown comment type or the multi-line comment is not terminated
  300|    130|    parser->error = CJ5_ERROR_INCOMPLETE;
  301|    130|}
cj5.c:cj5__alloc_token:
   89|  28.6M|cj5__alloc_token(cj5__parser *parser) {
   90|  28.6M|    cj5_token* token = NULL;
   91|  28.6M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (91:8): [True: 14.2M, False: 14.3M]
  ------------------
   92|  14.2M|        token = &parser->tokens[parser->token_count];
   93|  14.2M|        memset(token, 0x0, sizeof(cj5_token));
   94|  14.3M|    } else {
   95|  14.3M|        parser->error = CJ5_ERROR_OVERFLOW;
   96|  14.3M|    }
   97|       |
   98|       |    // Always increase the index. So we know eventually how many token would be
   99|       |    // required (if there are not enough).
  100|  28.6M|    parser->token_count++;
  101|  28.6M|    return token;
  102|  28.6M|}
cj5.c:cj5__parse_primitive:
  153|  25.1M|cj5__parse_primitive(cj5__parser* parser) {
  154|  25.1M|    const char* json5 = parser->json5;
  155|  25.1M|    unsigned int len = parser->len;
  156|  25.1M|    unsigned int start = parser->pos;
  157|       |
  158|       |    // String value
  159|  25.1M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (159:8): [True: 952k, False: 24.1M]
  ------------------
  160|  24.1M|       json5[start] == '\'') {
  ------------------
  |  Branch (160:8): [True: 1.01k, False: 24.1M]
  ------------------
  161|   953k|        cj5__parse_string(parser);
  162|   953k|        return;
  163|   953k|    }
  164|       |
  165|       |    // Fast comparison of bool, and null.
  166|       |    // Make the comparison case-insensitive.
  167|  24.1M|    uint32_t fourcc = 0;
  168|  24.1M|    if(start + 3 < len) {
  ------------------
  |  Branch (168:8): [True: 24.1M, False: 4.41k]
  ------------------
  169|  24.1M|        fourcc += (unsigned char)json5[start] | 32U;
  170|  24.1M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  171|  24.1M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  172|  24.1M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  173|  24.1M|    }
  174|       |    
  175|  24.1M|    cj5_token_type type;
  176|  24.1M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (176:8): [True: 6.91k, False: 24.1M]
  ------------------
  177|  6.91k|        type = CJ5_TOKEN_NULL;
  178|  6.91k|        parser->pos += 3;
  179|  24.1M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (179:15): [True: 438, False: 24.1M]
  ------------------
  180|    438|        type = CJ5_TOKEN_BOOL;
  181|    438|        parser->pos += 3;
  182|  24.1M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (182:15): [True: 225, False: 24.1M]
  ------------------
  183|       |        // "false" has five characters
  184|    225|        type = CJ5_TOKEN_BOOL;
  185|    225|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (185:12): [True: 1, False: 224]
  |  Branch (185:32): [True: 16, False: 208]
  ------------------
  186|     17|            parser->error = CJ5_ERROR_INVALID;
  187|     17|            return;
  188|     17|        }
  189|    208|        parser->pos += 4;
  190|  24.1M|    } else {
  191|       |        // Numbers are checked for basic compatibility.
  192|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  193|  24.1M|        type = CJ5_TOKEN_NUMBER;
  194|  54.9M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (194:15): [True: 54.9M, False: 1.23k]
  ------------------
  195|  54.9M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   86|   109M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (195:16): [True: 29.2M, False: 25.7M]
  ------------------
  196|  29.2M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (196:16): [True: 29.2M, False: 4.62k]
  ------------------
  197|  29.2M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   85|  84.2M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (197:16): [True: 27.0M, False: 2.22M]
  ------------------
  198|  27.0M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   84|  81.9M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (198:16): [True: 24.4M, False: 2.59M]
  ------------------
  199|  24.4M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (199:16): [True: 24.4M, False: 1.23k]
  |  Branch (199:48): [True: 24.1M, False: 248k]
  ------------------
  200|  24.1M|                break;
  201|  24.1M|            }
  202|  54.9M|        }
  203|  24.1M|        parser->pos--; // Point to the last character that is still inside the
  204|       |                       // primitive value
  205|  24.1M|    }
  206|       |
  207|  24.1M|    cj5_token *token = cj5__alloc_token(parser);
  208|  24.1M|    if(token) {
  ------------------
  |  Branch (208:8): [True: 11.9M, False: 12.2M]
  ------------------
  209|  11.9M|        token->type = type;
  210|  11.9M|        token->start = start;
  211|  11.9M|        token->end = parser->pos;
  212|  11.9M|        token->size = parser->pos - start + 1;
  213|  11.9M|        token->parent_id = parser->curr_tok_idx;
  214|  11.9M|    }
  215|  24.1M|}
cj5.c:cj5__parse_string:
  105|  2.19M|cj5__parse_string(cj5__parser *parser) {
  106|  2.19M|    const char *json5 = parser->json5;
  107|  2.19M|    unsigned int len = parser->len;
  108|  2.19M|    unsigned int start = parser->pos;
  109|  2.19M|    char str_open = json5[start];
  110|       |
  111|  2.19M|    parser->pos++;
  112|  66.3M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (112:11): [True: 66.3M, False: 145]
  ------------------
  113|  66.3M|        char c = json5[parser->pos];
  114|       |
  115|       |        // End of string
  116|  66.3M|        if(str_open == c) {
  ------------------
  |  Branch (116:12): [True: 2.19M, False: 64.1M]
  ------------------
  117|  2.19M|            cj5_token *token = cj5__alloc_token(parser);
  118|  2.19M|            if(token) {
  ------------------
  |  Branch (118:16): [True: 1.11M, False: 1.08M]
  ------------------
  119|  1.11M|                token->type = CJ5_TOKEN_STRING;
  120|  1.11M|                token->start = start + 1;
  121|  1.11M|                token->end = parser->pos - 1;
  122|  1.11M|                token->size = token->end - token->start + 1;
  123|  1.11M|                token->parent_id = parser->curr_tok_idx;
  124|  1.11M|            } 
  125|  2.19M|            return;
  126|  2.19M|        }
  127|       |
  128|       |        // Unescaped newlines are forbidden
  129|  64.1M|        if(c == '\n') {
  ------------------
  |  Branch (129:12): [True: 4, False: 64.1M]
  ------------------
  130|      4|            parser->error = CJ5_ERROR_INVALID;
  131|      4|            return;
  132|      4|        }
  133|       |
  134|       |        // Skip escape character
  135|  64.1M|        if(c == '\\') {
  ------------------
  |  Branch (135:12): [True: 220k, False: 63.8M]
  ------------------
  136|   220k|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (136:16): [True: 3, False: 220k]
  ------------------
  137|      3|                parser->error = CJ5_ERROR_INCOMPLETE;
  138|      3|                return;
  139|      3|            }
  140|   220k|            parser->pos++;
  141|   220k|        }
  142|  64.1M|    }
  143|       |
  144|       |    // The file has ended before the string terminates
  145|    145|    parser->error = CJ5_ERROR_INCOMPLETE;
  146|    145|}
cj5.c:cj5__isrange:
   80|   125M|cj5__isrange(char ch, char from, char to) {
   81|   125M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   82|   125M|}
cj5.c:cj5__parse_key:
  218|  3.29M|cj5__parse_key(cj5__parser* parser) {
  219|  3.29M|    const char* json5 = parser->json5;
  220|  3.29M|    unsigned int start = parser->pos;
  221|  3.29M|    cj5_token* token;
  222|       |
  223|       |    // Key is a a normal string
  224|  3.29M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (224:8): [True: 1.24M, False: 2.04M]
  |  Branch (224:32): [True: 2.26k, False: 2.04M]
  ------------------
  225|  1.24M|        cj5__parse_string(parser);
  226|  1.24M|        return;
  227|  1.24M|    }
  228|       |
  229|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  230|  2.04M|    unsigned int len = parser->len;
  231|  6.84M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (231:11): [True: 6.84M, False: 75]
  ------------------
  232|  6.84M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   85|  13.6M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 1.92M, False: 4.92M]
  |  |  ------------------
  ------------------
  233|  4.92M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  11.7M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 2.45M, False: 2.46M]
  |  |  ------------------
  ------------------
  234|  2.46M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (234:12): [True: 20.8k, False: 2.44M]
  |  Branch (234:41): [True: 778, False: 2.44M]
  ------------------
  235|  4.39M|            continue;
  236|  2.44M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   86|  4.89M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 401k, False: 2.04M]
  |  |  ------------------
  ------------------
  |  Branch (236:46): [True: 401k, False: 8]
  ------------------
  237|   401k|            continue;
  238|  2.04M|        break;
  239|  2.44M|    }
  240|       |
  241|       |    // An empty key is not allowed
  242|  2.04M|    if(parser->pos <= start) {
  ------------------
  |  Branch (242:8): [True: 107, False: 2.04M]
  ------------------
  243|    107|        parser->error = CJ5_ERROR_INVALID;
  244|    107|        return;
  245|    107|    }
  246|       |
  247|       |    // Move pos to the last character within the unquoted key
  248|  2.04M|    parser->pos--;
  249|       |
  250|  2.04M|    token = cj5__alloc_token(parser);
  251|  2.04M|    if(token) {
  ------------------
  |  Branch (251:8): [True: 1.07M, False: 971k]
  ------------------
  252|  1.07M|        token->type = CJ5_TOKEN_STRING;
  253|  1.07M|        token->start = start;
  254|  1.07M|        token->end = parser->pos;
  255|  1.07M|        token->size = parser->pos - start + 1;
  256|  1.07M|        token->parent_id = parser->curr_tok_idx;
  257|  1.07M|    }
  258|  2.04M|}
cj5.c:parse_codepoint:
  608|  7.12k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  609|  7.12k|    uint32_t utf = 0;
  610|  35.5k|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (610:29): [True: 28.4k, False: 7.09k]
  ------------------
  611|  28.4k|        char byte = pos[i];
  612|  28.4k|        if(cj5__isnum(byte)) {
  ------------------
  |  |   86|  28.4k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 16.6k, False: 11.8k]
  |  |  ------------------
  ------------------
  613|  16.6k|            byte = (char)(byte - '0');
  614|  16.6k|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (614:19): [True: 6.82k, False: 4.99k]
  ------------------
  615|  6.82k|            byte = (char)(byte - ('a' - 10));
  616|  6.82k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (616:19): [True: 4.96k, False: 27]
  ------------------
  617|  4.96k|            byte = (char)(byte - ('A' - 10));
  618|  4.96k|        } else {
  619|     27|            return CJ5_ERROR_INVALID;
  620|     27|        }
  621|  28.4k|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  622|  28.4k|    }
  623|  7.09k|    *out_utf = utf;
  624|  7.09k|    return CJ5_ERROR_NONE;
  625|  7.12k|}

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

parseUInt64:
   30|   780k|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|   780k|    size_t i = 0;
   32|   780k|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|   780k|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 43.2k, False: 737k]
  |  Branch (35:20): [True: 15.8k, False: 27.3k]
  |  Branch (35:37): [True: 3.28k, False: 12.6k]
  ------------------
   36|  3.28k|        i = 2;
   37|  41.0k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 38.1k, False: 2.98k]
  ------------------
   38|  38.1k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  38.1k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 38.0k, False: 74]
  |  Branch (39:28): [True: 35.9k, False: 2.13k]
  ------------------
   40|  35.9k|                c = (uint8_t)(c - '0');
   41|  2.20k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 2.12k, False: 77]
  |  Branch (41:33): [True: 1.91k, False: 216]
  ------------------
   42|  1.91k|                c = (uint8_t)(c - 'a' + 10);
   43|    293|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 217, False: 76]
  |  Branch (43:33): [True: 0, False: 217]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    293|            else
   46|    293|                break;
   47|  37.8k|            n = (n << 4) | (c & 0xF);
   48|  37.8k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 12, False: 37.8k]
  ------------------
   49|     12|                return 0;
   50|  37.8k|            prev = n;
   51|  37.8k|        }
   52|  3.27k|        *result = n;
   53|  3.27k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 3.25k, False: 21]
  ------------------
   54|  3.28k|    }
   55|       |
   56|       |    /* Decimal */
   57|  2.83M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 2.09M, False: 740k]
  ------------------
   58|  2.09M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 16.4k, False: 2.07M]
  |  Branch (58:28): [True: 20.2k, False: 2.05M]
  ------------------
   59|  36.6k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  2.05M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  2.05M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 19, False: 2.05M]
  ------------------
   63|     19|            return 0;
   64|  2.05M|        prev = n;
   65|  2.05M|    }
   66|   777k|    *result = n;
   67|   777k|    return i;
   68|   777k|}
parseInt64:
   71|   319k|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|   319k|    size_t i = 0;
   74|   319k|    bool neg = false;
   75|   319k|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 12.3k, False: 307k]
  |  Branch (75:23): [True: 450, False: 306k]
  ------------------
   76|  12.7k|        neg = (*str == '-');
   77|  12.7k|        i++;
   78|  12.7k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|   319k|    uint64_t n = 0;
   82|   319k|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|   319k|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 81, False: 319k]
  ------------------
   84|     81|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|   319k|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 307k, False: 12.3k]
  ------------------
   88|   307k|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 56, False: 307k]
  ------------------
   89|     56|            return 0;
   90|   307k|        *result = (int64_t)n;
   91|   307k|    } 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|  12.3k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 5, False: 12.3k]
  ------------------
   98|      5|            return 0;
   99|  12.3k|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 8.12k, False: 4.17k]
  ------------------
  100|  12.3k|            ? (int64_t)(-9223372036854775807LL - 1)
  101|  12.3k|            : -(int64_t)n;
  102|  12.3k|    }
  103|   319k|    return len + i;
  104|   319k|}
parseDouble:
  106|   617k|size_t parseDouble(const char *str, size_t size, double *result) {
  107|   617k|    char buf[2000];
  108|   617k|    if(size >= 2000)
  ------------------
  |  Branch (108:8): [True: 1, False: 617k]
  ------------------
  109|      1|        return 0;
  110|   617k|    memcpy(buf, str, size);
  111|   617k|    buf[size] = 0;
  112|   617k|    errno = 0;
  113|   617k|    char *endptr;
  114|   617k|    *result = strtod(buf, &endptr);
  115|   617k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (115:8): [True: 202, False: 617k]
  |  Branch (115:22): [True: 0, False: 202]
  ------------------
  116|      0|        return 0;
  117|   617k|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|   617k|}

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

findEncodingMetaData:
  313|  3.84k|                     UA_UInt16 dsWriterId) {
  314|  3.84k|    if(!eo)
  ------------------
  |  Branch (314:8): [True: 0, False: 3.84k]
  ------------------
  315|      0|        return NULL;
  316|  3.84k|    for(size_t i = 0; i < eo->metaDataSize; i++) {
  ------------------
  |  Branch (316:23): [True: 0, False: 3.84k]
  ------------------
  317|      0|        if(eo->metaData[i].dataSetWriterId == dsWriterId)
  ------------------
  |  Branch (317:12): [True: 0, False: 0]
  ------------------
  318|      0|            return &eo->metaData[i];
  319|      0|    }
  320|  3.84k|    return NULL;
  321|  3.84k|}
UA_NetworkMessage_clear:
 1124|  5.92k|UA_NetworkMessage_clear(UA_NetworkMessage* p) {
 1125|  5.92k|    if(p->promotedFieldsEnabled) {
  ------------------
  |  Branch (1125:8): [True: 0, False: 5.92k]
  ------------------
 1126|      0|        UA_Array_delete(p->promotedFields, p->promotedFieldsSize,
 1127|      0|                        &UA_TYPES[UA_TYPES_VARIANT]);
  ------------------
  |  |  810|      0|#define UA_TYPES_VARIANT 23
  ------------------
 1128|      0|    }
 1129|       |
 1130|  5.92k|    if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) {
  ------------------
  |  Branch (1130:8): [True: 5.92k, False: 0]
  ------------------
 1131|  5.92k|        if(p->payload.dataSetMessages) {
  ------------------
  |  Branch (1131:12): [True: 5.43k, False: 495]
  ------------------
 1132|  11.0k|            for(size_t i = 0; i < p->messageCount; i++)
  ------------------
  |  Branch (1132:31): [True: 5.60k, False: 5.43k]
  ------------------
 1133|  5.60k|                UA_DataSetMessage_clear(&p->payload.dataSetMessages[i]);
 1134|  5.43k|            UA_free(p->payload.dataSetMessages);
  ------------------
  |  |   23|  5.43k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1135|  5.43k|        }
 1136|  5.92k|    }
 1137|       |
 1138|  5.92k|    UA_ByteString_clear(&p->securityFooter);
 1139|  5.92k|    UA_String_clear(&p->messageId);
 1140|       |
 1141|  5.92k|    if(p->publisherIdEnabled &&
  ------------------
  |  Branch (1141:8): [True: 331, False: 5.59k]
  ------------------
 1142|    331|       p->publisherId.idType == UA_PUBLISHERIDTYPE_STRING)
  ------------------
  |  Branch (1142:8): [True: 64, False: 267]
  ------------------
 1143|     64|       UA_String_clear(&p->publisherId.id.string);
 1144|       |
 1145|  5.92k|    memset(p, 0, sizeof(UA_NetworkMessage));
 1146|  5.92k|}
UA_DataSetMessage_clear:
 2058|  5.60k|UA_DataSetMessage_clear(UA_DataSetMessage* p) {
 2059|  5.60k|    if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) {
  ------------------
  |  Branch (2059:8): [True: 5.59k, False: 2]
  ------------------
 2060|  5.59k|        if(p->data.keyFrameFields)
  ------------------
  |  Branch (2060:12): [True: 3.84k, False: 1.75k]
  ------------------
 2061|  3.84k|            UA_Array_delete(p->data.keyFrameFields, p->fieldCount,
 2062|  3.84k|                            &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  776|  3.84k|#define UA_TYPES_DATAVALUE 22
  ------------------
 2063|  5.59k|    } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) {
  ------------------
  |  Branch (2063:15): [True: 2, False: 0]
  ------------------
 2064|      2|        if(p->data.deltaFrameFields) {
  ------------------
  |  Branch (2064:12): [True: 0, False: 2]
  ------------------
 2065|      0|            for(UA_UInt16 i = 0; i < p->fieldCount; i++)
  ------------------
  |  Branch (2065:34): [True: 0, False: 0]
  ------------------
 2066|      0|                UA_DataValue_clear(&p->data.deltaFrameFields[i].value);
 2067|      0|            UA_free(p->data.deltaFrameFields);
  ------------------
  |  |   23|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2068|      0|        }
 2069|      2|    }
 2070|       |
 2071|  5.60k|    memset(p, 0, sizeof(UA_DataSetMessage));
 2072|  5.60k|}

UA_NetworkMessage_decodeJson:
  788|  6.64k|                             const UA_DecodeJsonOptions *jo) {
  789|       |    /* Set up the context */
  790|  6.64k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
  791|  6.64k|    PubSubDecodeJsonCtx ctx;
  792|  6.64k|    memset(&ctx, 0, sizeof(PubSubDecodeJsonCtx));
  793|  6.64k|    ctx.ctx.tokens = tokens;
  794|  6.64k|    if(eo)
  ------------------
  |  Branch (794:8): [True: 0, False: 6.64k]
  ------------------
  795|      0|        ctx.eo = *eo;
  796|  6.64k|    if(jo) {
  ------------------
  |  Branch (796:8): [True: 0, False: 6.64k]
  ------------------
  797|      0|        ctx.ctx.namespaceMapping = jo->namespaceMapping;
  798|      0|        ctx.ctx.serverUrisSize = jo->serverUrisSize;
  799|      0|        ctx.ctx.serverUris = jo->serverUris;
  800|      0|        ctx.ctx.customTypes = jo->customTypes;
  801|      0|    }
  802|       |
  803|  6.64k|    status ret = tokenize(&ctx.ctx, src, UA_JSON_MAXTOKENCOUNT, NULL);
  ------------------
  |  |  127|  6.64k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
  804|  6.64k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.64k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (804:8): [True: 714, False: 5.92k]
  ------------------
  805|    714|        goto cleanup;
  806|       |
  807|  5.92k|    ret = NetworkMessage_decodeJsonInternal(&ctx, dst);
  808|  5.92k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.92k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (808:8): [True: 4.97k, False: 955]
  ------------------
  809|  4.97k|        UA_NetworkMessage_clear(dst);
  810|       |
  811|  6.64k| cleanup:
  812|       |    /* Free token array on the heap */
  813|  6.64k|    if(ctx.ctx.tokens != tokens)
  ------------------
  |  Branch (813:8): [True: 510, False: 6.13k]
  ------------------
  814|    510|        UA_free((void*)(uintptr_t)ctx.ctx.tokens);
  ------------------
  |  |   23|    510|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  815|  6.64k|    return ret;
  816|  5.92k|}
ua_pubsub_networkmessage_json.c:NetworkMessage_decodeJsonInternal:
  700|  5.92k|                                  UA_NetworkMessage *dst) {
  701|  5.92k|    memset(dst, 0, sizeof(UA_NetworkMessage));
  702|  5.92k|    dst->chunkMessage = false;
  703|  5.92k|    dst->groupHeaderEnabled = false;
  704|  5.92k|    dst->payloadHeaderEnabled = false;
  705|  5.92k|    dst->picosecondsEnabled = false;
  706|  5.92k|    dst->promotedFieldsEnabled = false;
  707|       |
  708|       |    /* The NetworkMessage must be a JSON object */
  709|  5.92k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (709:8): [True: 104, False: 5.82k]
  ------------------
  710|    104|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    104|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  711|       |
  712|       |    /* Determine the number of DataSetMessages from Messages and remember
  713|       |     * whether the sender used the single-object layout. */
  714|  5.82k|    size_t searchResultMessages = 0;
  715|  5.82k|    status found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGES, &searchResultMessages);
  716|  5.82k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.82k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (716:8): [True: 134, False: 5.68k]
  ------------------
  717|    134|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|    134|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  718|  5.68k|    const cj5_token *bodyToken = &ctx->ctx.tokens[searchResultMessages];
  719|  5.68k|    size_t messageCount = 1;
  720|  5.68k|    if(bodyToken->type == CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (720:8): [True: 157, False: 5.53k]
  ------------------
  721|    157|        messageCount = (size_t)bodyToken->size;
  722|  5.68k|    dst->jsonSingleDataSetMessage = (bodyToken->type == CJ5_TOKEN_OBJECT);
  723|       |
  724|       |    /* Too many DataSetMessages */
  725|  5.68k|    if(messageCount > UA_NETWORKMESSAGE_MAXMESSAGECOUNT)
  ------------------
  |  |  138|  5.68k|#define UA_NETWORKMESSAGE_MAXMESSAGECOUNT 32
  ------------------
  |  Branch (725:8): [True: 2, False: 5.68k]
  ------------------
  726|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  727|       |
  728|       |    /* MessageType */
  729|  5.68k|    UA_Boolean isUaData = true;
  730|  5.68k|    size_t searchResultMessageType = 0;
  731|  5.68k|    found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGETYPE, &searchResultMessageType);
  732|  5.68k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (732:8): [True: 51, False: 5.63k]
  ------------------
  733|     51|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     51|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  734|  5.63k|    size_t size = getTokenLength(&ctx->ctx.tokens[searchResultMessageType]);
  735|  5.63k|    const char* msgType = &ctx->ctx.json5[ctx->ctx.tokens[searchResultMessageType].start];
  736|  5.63k|    if(size == 7) { /* ua-data */
  ------------------
  |  Branch (736:8): [True: 5.51k, False: 121]
  ------------------
  737|  5.51k|        if(strncmp(msgType, "ua-data", size) != 0)
  ------------------
  |  Branch (737:12): [True: 58, False: 5.45k]
  ------------------
  738|     58|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     58|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  739|  5.45k|        isUaData = true;
  740|  5.45k|    } else if(size == 11) { /* ua-metadata */
  ------------------
  |  Branch (740:15): [True: 72, False: 49]
  ------------------
  741|     72|        if(strncmp(msgType, "ua-metadata", size) != 0)
  ------------------
  |  Branch (741:12): [True: 71, False: 1]
  ------------------
  742|     71|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     71|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  743|      1|        isUaData = false;
  744|     49|    } else {
  745|     49|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     49|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  746|     49|    }
  747|       |
  748|       |    /* Reject metadata messages until their payload decoder is implemented. */
  749|  5.45k|    if(!isUaData)
  ------------------
  |  Branch (749:8): [True: 1, False: 5.45k]
  ------------------
  750|      1|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|      1|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  751|       |
  752|  5.45k|    if(messageCount > 0) {
  ------------------
  |  Branch (752:8): [True: 5.44k, False: 12]
  ------------------
  753|  5.44k|        dst->payload.dataSetMessages = (UA_DataSetMessage*)
  754|  5.44k|            UA_calloc(messageCount, sizeof(UA_DataSetMessage));
  ------------------
  |  |   24|  5.44k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  755|  5.44k|        if(!dst->payload.dataSetMessages)
  ------------------
  |  Branch (755:12): [True: 13, False: 5.43k]
  ------------------
  756|     13|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     13|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  757|  5.44k|    }
  758|  5.44k|    dst->messageCount = (UA_Byte)messageCount;
  759|       |
  760|       |    /* Network Message */
  761|  5.44k|    UA_String messageType;
  762|  5.44k|    DecodeEntry entries[5] = {
  763|  5.44k|        {UA_DECODEKEY_MESSAGEID, &dst->messageId, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|  5.44k|#define UA_TYPES_STRING 11
  ------------------
  764|  5.44k|        {UA_DECODEKEY_MESSAGETYPE, &messageType, NULL, false, NULL},
  765|  5.44k|        {UA_DECODEKEY_PUBLISHERID, &dst->publisherId, decodePublisherIdJsonInternal, false, NULL},
  766|  5.44k|        {UA_DECODEKEY_DATASETCLASSID, &dst->dataSetClassId, NULL, false, &UA_TYPES[UA_TYPES_GUID]},
  ------------------
  |  |  470|  5.44k|#define UA_TYPES_GUID 13
  ------------------
  767|  5.44k|        {UA_DECODEKEY_MESSAGES, dst, DatasetMessage_Array_decodeJsonInternal, false, NULL}
  768|  5.44k|    };
  769|       |
  770|  5.44k|    status ret = decodeFieldsAllowUnknown(&ctx->ctx, entries, 5);
  771|       |    /* Ensure cleanup owns an allocated string PublisherId even if a later
  772|       |     * top-level member fails to decode. */
  773|  5.44k|    dst->publisherIdEnabled = entries[2].found;
  774|  5.44k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.44k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (774:8): [True: 4.48k, False: 955]
  ------------------
  775|  4.48k|        return ret;
  776|       |
  777|    955|    dst->messageIdEnabled = entries[0].found;
  778|    955|    dst->dataSetClassIdEnabled = entries[3].found;
  779|    955|    dst->payloadHeaderEnabled = true;
  780|       |
  781|    955|    return ret;
  782|  5.44k|}
ua_pubsub_networkmessage_json.c:decodePublisherIdJsonInternal:
  670|    331|                              const UA_DataType *type) {
  671|    331|    UA_PublisherId *p = (UA_PublisherId*)dst;
  672|    331|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER) {
  ------------------
  |  Branch (672:8): [True: 245, False: 86]
  ------------------
  673|       |        /* Store in biggest possible integer. The problem is that with a UInt64
  674|       |         * is that a string is expected for it in JSON. Therefore, the maximum
  675|       |         * value is set to UInt32. */
  676|    245|        p->idType = UA_PUBLISHERIDTYPE_UINT32;
  677|    245|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32](ctx, &p->id.uint32, NULL);
  678|    245|    } else if(currentTokenType(ctx) == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (678:15): [True: 84, False: 2]
  ------------------
  679|       |        /* Part 14 encodes both numeric and string PublisherIds as JSON
  680|       |         * strings. Recover numeric ids when the complete token is a UInt64;
  681|       |         * non-numeric strings remain string PublisherIds. */
  682|     84|        size_t index = ctx->index;
  683|     84|        UA_UInt64 numeric = 0;
  684|     84|        status res = decodeJsonJumpTable[UA_DATATYPEKIND_UINT64]
  685|     84|            (ctx, &numeric, &UA_TYPES[UA_TYPES_UINT64]);
  ------------------
  |  |  300|     84|#define UA_TYPES_UINT64 8
  ------------------
  686|     84|        if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     84|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (686:12): [True: 20, False: 64]
  ------------------
  687|     20|            p->idType = UA_PUBLISHERIDTYPE_UINT64;
  688|     20|            p->id.uint64 = numeric;
  689|     20|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     20|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  690|     20|        }
  691|     64|        ctx->index = index;
  692|     64|        p->idType = UA_PUBLISHERIDTYPE_STRING;
  693|     64|        return decodeJsonJumpTable[UA_DATATYPEKIND_STRING](ctx, &p->id.string, NULL);
  694|     84|    }
  695|      2|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  696|    331|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Array_decodeJsonInternal:
  639|  5.07k|                                        const UA_DataType *_) {
  640|  5.07k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  641|       |
  642|       |    /* Array or object */
  643|  5.07k|    size_t length = 1;
  644|  5.07k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_ARRAY) {
  ------------------
  |  Branch (644:8): [True: 134, False: 4.93k]
  ------------------
  645|    134|        length = (size_t)ctx->ctx.tokens[ctx->ctx.index].size;
  646|       |
  647|       |        /* Go to the first array member */
  648|    134|        ctx->ctx.index++;
  649|       |
  650|       |        /* Return early for empty arrays */
  651|    134|        if(length == 0)
  ------------------
  |  Branch (651:12): [True: 12, False: 122]
  ------------------
  652|     12|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     12|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  653|  4.93k|    } else if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (653:15): [True: 493, False: 4.44k]
  ------------------
  654|    493|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    493|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  655|    493|    }
  656|       |
  657|       |    /* Decode array members */
  658|  4.56k|    UA_NetworkMessage *nm = (UA_NetworkMessage*)dst;
  659|  5.50k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (659:23): [True: 4.56k, False: 943]
  ------------------
  660|  4.56k|        status ret = DatasetMessage_Payload_decodeJsonInternal(ctx, nm, i);
  661|  4.56k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  4.56k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (661:12): [True: 3.62k, False: 943]
  ------------------
  662|  3.62k|            return ret;
  663|  4.56k|    }
  664|       |
  665|    943|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    943|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  666|  4.56k|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Payload_decodeJsonInternal:
  557|  4.56k|                                          size_t dsmIndex) {
  558|  4.56k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[dsmIndex];
  559|  4.56k|    UA_ConfigurationVersionDataType cvd = {0};
  560|  4.56k|    struct PayloadData pd;
  561|  4.56k|    pd.nm = nm;
  562|  4.56k|    pd.dsmIndex = dsmIndex;
  563|       |
  564|       |    /* The payload needs its metadata even when the writer id follows it. */
  565|  4.56k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (565:8): [True: 14, False: 4.55k]
  ------------------
  566|     14|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  567|  4.55k|    size_t writerIndex;
  568|  4.55k|    status ret = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_DATASETWRITERID, &writerIndex);
  569|  4.55k|    size_t objectIndex = ctx->ctx.index;
  570|  4.55k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  4.55k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (570:8): [True: 4.39k, False: 155]
  ------------------
  571|  4.39k|        ctx->ctx.index = writerIndex;
  572|  4.39k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_UINT16]
  573|  4.39k|            (&ctx->ctx, &nm->dataSetWriterIds[dsmIndex], &UA_TYPES[UA_TYPES_UINT16]);
  ------------------
  |  |  164|  4.39k|#define UA_TYPES_UINT16 4
  ------------------
  574|  4.39k|        ctx->ctx.index = objectIndex;
  575|  4.39k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  178|  4.39k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  171|  4.39k|    do {                                                                                 \
  |  |  |  |  172|  4.39k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  4.39k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (345:25): [True: 100, False: 4.29k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  173|    100|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  174|    100|        }                                                                                \
  |  |  |  |  175|  4.39k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:13): [Folded, False: 4.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  576|  4.39k|    } else {
  577|       |        /* An omitted writer id is unambiguous only for one message and reader. */
  578|    155|        if(nm->messageCount != 1 || ctx->eo.metaDataSize != 1)
  ------------------
  |  Branch (578:12): [True: 15, False: 140]
  |  Branch (578:37): [True: 140, False: 0]
  ------------------
  579|    155|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    155|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  580|      0|        nm->dataSetWriterIds[dsmIndex] = ctx->eo.metaData[0].dataSetWriterId;
  581|      0|    }
  582|       |
  583|  4.29k|    size_t messageTypeIndex;
  584|  4.29k|    if(lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGETYPE,
  ------------------
  |  Branch (584:8): [True: 122, False: 4.17k]
  ------------------
  585|  4.29k|                       &messageTypeIndex) == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  4.29k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  586|    122|        UA_String messageType = UA_STRING_NULL;
  587|    122|        ctx->ctx.index = messageTypeIndex;
  588|    122|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_STRING](&ctx->ctx, &messageType, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|    122|#define UA_TYPES_STRING 11
  ------------------
  589|    122|        ctx->ctx.index = objectIndex;
  590|    122|        UA_String keyFrame = UA_STRING("ua-keyframe");
  591|    122|        UA_String deltaFrame = UA_STRING("ua-deltaframe");
  592|    122|        if(ret == UA_STATUSCODE_GOOD && UA_String_equal(&messageType, &deltaFrame))
  ------------------
  |  |   17|    244|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (592:12): [True: 118, False: 4]
  |  Branch (592:41): [True: 2, False: 116]
  ------------------
  593|      2|            dsm->header.dataSetMessageType = UA_DATASETMESSAGE_DATADELTAFRAME;
  594|    120|        else if(ret == UA_STATUSCODE_GOOD && !UA_String_equal(&messageType, &keyFrame))
  ------------------
  |  |   17|    240|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (594:17): [True: 116, False: 4]
  |  Branch (594:46): [True: 115, False: 1]
  ------------------
  595|    115|            ret = UA_STATUSCODE_BADNOTSUPPORTED;
  ------------------
  |  |  230|    115|#define UA_STATUSCODE_BADNOTSUPPORTED ((UA_StatusCode) 0x803D0000)
  ------------------
  596|    122|        UA_String_clear(&messageType);
  597|    122|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  178|    122|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  171|    122|    do {                                                                                 \
  |  |  |  |  172|    122|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  345|    122|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (345:25): [True: 119, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  173|    119|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  174|    119|        }                                                                                \
  |  |  |  |  175|    122|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:13): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  598|    122|    }
  599|       |
  600|       |    /* JSON uses UInt32 SequenceNumber and StatusCode. */
  601|  4.17k|    UA_UInt32 sequenceNumber = 0;
  602|  4.17k|    UA_StatusCode statusCode = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.17k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  603|  4.17k|    DecodeEntry entries[7] = {
  604|  4.17k|        {UA_DECODEKEY_DATASETWRITERID, &nm->dataSetWriterIds[dsmIndex], NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  164|  4.17k|#define UA_TYPES_UINT16 4
  ------------------
  605|  4.17k|        {UA_DECODEKEY_SEQUENCENUMBER, &sequenceNumber, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  232|  4.17k|#define UA_TYPES_UINT32 6
  ------------------
  606|  4.17k|        {UA_DECODEKEY_METADATAVERSION, &cvd, &MetaDataVersion_decodeJsonInternal, false, NULL},
  607|  4.17k|        {UA_DECODEKEY_TIMESTAMP, &dsm->header.timestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|  4.17k|#define UA_TYPES_DATETIME 12
  ------------------
  608|  4.17k|        {UA_DECODEKEY_DSM_STATUS, &statusCode,
  609|  4.17k|         &StatusCode_decodeJsonInternal, false, NULL},
  610|       |        /* MessageType was validated before Payload, which can precede it. */
  611|  4.17k|        {UA_DECODEKEY_MESSAGETYPE, NULL, NULL, false, NULL},
  612|  4.17k|        {UA_DECODEKEY_PAYLOAD, &pd, DataSetPayload_decodeJsonInternal, false, NULL}
  613|  4.17k|    };
  614|  4.17k|    ret = decodeFieldsAllowUnknown(&ctx->ctx, entries, 7);
  615|       |
  616|       |    /* Error or no payload found */
  617|  4.17k|    if(ret != UA_STATUSCODE_GOOD || !entries[6].found)
  ------------------
  |  |   17|  8.35k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (617:8): [True: 3.08k, False: 1.08k]
  |  Branch (617:37): [True: 146, False: 943]
  ------------------
  618|  3.23k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  3.23k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  619|       |
  620|    943|    dsm->header.dataSetMessageSequenceNr = sequenceNumber;
  621|    943|    dsm->header.status = statusCode;
  622|       |
  623|    943|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  624|    943|    dsm->header.dataSetMessageSequenceNrEnabled = entries[1].found;
  625|    943|    dsm->header.configVersionMajorVersion = cvd.majorVersion;
  626|    943|    dsm->header.configVersionMinorVersion = cvd.minorVersion;
  627|    943|    dsm->header.configVersionMajorVersionEnabled = entries[2].found;
  628|    943|    dsm->header.configVersionMinorVersionEnabled = entries[2].found;
  629|    943|    dsm->header.timestampEnabled = entries[3].found;
  630|    943|    dsm->header.statusEnabled = entries[4].found;
  631|       |
  632|    943|    dsm->header.picoSecondsIncluded = false;
  633|    943|    dsm->header.dataSetMessageValid = true;
  634|    943|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    943|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  635|  4.17k|}
ua_pubsub_networkmessage_json.c:MetaDataVersion_decodeJsonInternal:
  315|      3|MetaDataVersion_decodeJsonInternal(ParseCtx *ctx, void* cvd, const UA_DataType *_) {
  316|      3|    return decodeJsonJumpTable[UA_DATATYPEKIND_STRUCTURE]
  317|      3|        (ctx, cvd, &UA_TYPES[UA_TYPES_CONFIGURATIONVERSIONDATATYPE]);
  ------------------
  |  | 2153|      3|#define UA_TYPES_CONFIGURATIONVERSIONDATATYPE 57
  ------------------
  318|      3|}
ua_pubsub_networkmessage_json.c:StatusCode_decodeJsonInternal:
  323|      9|                              const UA_DataType *_) {
  324|      9|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (324:8): [True: 6, False: 3]
  ------------------
  325|      6|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32]
  326|      6|            (ctx, statusCode, &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|      6|#define UA_TYPES_UINT32 6
  ------------------
  327|      3|    return decodeJsonJumpTable[UA_DATATYPEKIND_STATUSCODE]
  328|      3|        (ctx, statusCode, &UA_TYPES[UA_TYPES_STATUSCODE]);
  ------------------
  |  |  640|      3|#define UA_TYPES_STATUSCODE 18
  ------------------
  329|      9|}
ua_pubsub_networkmessage_json.c:DataSetPayload_decodeJsonInternal:
  470|  3.85k|DataSetPayload_decodeJsonInternal(ParseCtx *ctx_, void *data, const UA_DataType *_) {
  471|  3.85k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  472|  3.85k|    struct PayloadData *pd = (struct PayloadData*)data;
  473|  3.85k|    UA_NetworkMessage *nm = pd->nm;
  474|  3.85k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[pd->dsmIndex];
  475|       |
  476|  3.85k|    dsm->header.dataSetMessageValid = true;
  477|       |
  478|  3.85k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (478:8): [True: 1, False: 3.85k]
  ------------------
  479|      1|        ctx->ctx.index++;
  480|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  481|      1|    }
  482|       |
  483|  3.85k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (483:8): [True: 3, False: 3.85k]
  ------------------
  484|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  485|       |
  486|       |    /* The number of key-value pairs */
  487|  3.85k|    UA_assert(ctx->ctx.tokens[ctx->ctx.index].size % 2 == 0);
  ------------------
  |  |  248|  3.85k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (487:5): [True: 3.85k, False: 0]
  ------------------
  488|  3.85k|    size_t length = (size_t)(ctx->ctx.tokens[ctx->ctx.index].size) / 2;
  489|       |
  490|  3.85k|    if(length > UA_UINT16_MAX)
  ------------------
  |  |   92|  3.85k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (490:8): [True: 1, False: 3.84k]
  ------------------
  491|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  492|       |
  493|  3.84k|    const UA_DataSetMessage_EncodingMetaData *emd =
  494|  3.84k|            findEncodingMetaData(&ctx->eo, nm->dataSetWriterIds[pd->dsmIndex]);
  495|  3.84k|    size_t fieldsSize = emd ? emd->fieldsSize : length;
  ------------------
  |  Branch (495:25): [True: 0, False: 3.84k]
  ------------------
  496|  3.84k|    if(fieldsSize > UA_UINT16_MAX || length > fieldsSize)
  ------------------
  |  |   92|  7.69k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (496:8): [True: 0, False: 3.84k]
  |  Branch (496:38): [True: 0, False: 3.84k]
  ------------------
  497|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  498|  3.84k|    UA_Boolean delta = dsm->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME;
  499|  3.84k|    if((delta && !emd) || (!delta && length != fieldsSize))
  ------------------
  |  Branch (499:9): [True: 1, False: 3.84k]
  |  Branch (499:18): [True: 1, False: 0]
  |  Branch (499:28): [True: 3.84k, False: 0]
  |  Branch (499:38): [True: 0, False: 3.84k]
  ------------------
  500|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  501|  3.84k|    if(delta) {
  ------------------
  |  Branch (501:8): [True: 0, False: 3.84k]
  ------------------
  502|      0|        dsm->data.deltaFrameFields = (UA_DataSetMessage_DeltaFrameField*)
  503|      0|            UA_calloc(length, sizeof(UA_DataSetMessage_DeltaFrameField));
  ------------------
  |  |   24|      0|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  504|      0|        if(length && !dsm->data.deltaFrameFields)
  ------------------
  |  Branch (504:12): [True: 0, False: 0]
  |  Branch (504:22): [True: 0, False: 0]
  ------------------
  505|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  506|  3.84k|    } else {
  507|  3.84k|        dsm->data.keyFrameFields = (UA_DataValue*)UA_Array_new(length, &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  776|  3.84k|#define UA_TYPES_DATAVALUE 22
  ------------------
  508|  3.84k|        if(!dsm->data.keyFrameFields)
  ------------------
  |  Branch (508:12): [True: 4, False: 3.84k]
  ------------------
  509|      4|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      4|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  510|  3.84k|    }
  511|  3.84k|    dsm->fieldCount = (UA_UInt16)length;
  512|       |
  513|       |    /* Iterate over the key/value pairs in the object. Keys are stored in fieldnames. */
  514|  3.84k|    UA_Boolean stackSeen[64] = {false};
  515|  3.84k|    UA_Boolean *seen = stackSeen;
  516|  3.84k|    if(fieldsSize > sizeof(stackSeen) / sizeof(stackSeen[0])) {
  ------------------
  |  Branch (516:8): [True: 173, False: 3.67k]
  ------------------
  517|    173|        seen = (UA_Boolean*)UA_calloc(fieldsSize, sizeof(UA_Boolean));
  ------------------
  |  |   24|    173|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  518|    173|        if(!seen)
  ------------------
  |  Branch (518:12): [True: 1, False: 172]
  ------------------
  519|      1|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  520|    173|    }
  521|  3.84k|    ctx->ctx.index++; /* Go to the first key */
  522|  3.84k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.84k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  523|  81.8k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (523:23): [True: 80.9k, False: 942]
  ------------------
  524|  80.9k|        UA_assert(currentTokenType(&ctx->ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  248|  80.9k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (524:9): [True: 80.9k, False: 0]
  ------------------
  525|  80.9k|        UA_String fieldName = UA_STRING_NULL;
  526|  80.9k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_STRING](&ctx->ctx, &fieldName, NULL);
  527|  80.9k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  80.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (527:12): [True: 1, False: 80.9k]
  ------------------
  528|      1|            break;
  529|       |
  530|  80.9k|        size_t index = decodingFieldIndex(emd, fieldName, i);
  531|  80.9k|        if(index >= fieldsSize || seen[index]) {
  ------------------
  |  Branch (531:12): [True: 0, False: 80.9k]
  |  Branch (531:35): [True: 0, False: 80.9k]
  ------------------
  532|      0|            UA_String_clear(&fieldName);
  533|      0|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  534|      0|            break;
  535|      0|        }
  536|  80.9k|        seen[index] = true;
  537|  80.9k|        UA_String_clear(&fieldName);
  538|  80.9k|        UA_DataValue *value;
  539|  80.9k|        if(delta) {
  ------------------
  |  Branch (539:12): [True: 0, False: 80.9k]
  ------------------
  540|      0|            dsm->data.deltaFrameFields[i].index = (UA_UInt16)index;
  541|      0|            value = &dsm->data.deltaFrameFields[i].value;
  542|  80.9k|        } else {
  543|  80.9k|            value = &dsm->data.keyFrameFields[index];
  544|  80.9k|        }
  545|  80.9k|        ret = decodeDataSetField(&ctx->ctx, value, emd ? &emd->fields[index] : NULL);
  ------------------
  |  Branch (545:52): [True: 0, False: 80.9k]
  ------------------
  546|  80.9k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  80.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (546:12): [True: 2.90k, False: 78.0k]
  ------------------
  547|  2.90k|            break;
  548|  80.9k|    }
  549|       |
  550|  3.84k|    if(seen != stackSeen)
  ------------------
  |  Branch (550:8): [True: 172, False: 3.67k]
  ------------------
  551|    172|        UA_free(seen);
  ------------------
  |  |   23|    172|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  552|  3.84k|    return ret;
  553|  3.84k|}
ua_pubsub_networkmessage_json.c:decodingFieldIndex:
  333|  80.9k|                   UA_String name, size_t origIndex) {
  334|  80.9k|    if(!emd)
  ------------------
  |  Branch (334:8): [True: 80.9k, False: 0]
  ------------------
  335|  80.9k|        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 emd->fieldsSize;
  341|      0|}
ua_pubsub_networkmessage_json.c:decodeDataSetField:
  436|  80.9k|decodeDataSetField(ParseCtx *ctx, UA_DataValue *dst, const UA_FieldMetaData *field) {
  437|  80.9k|    if(!field || (!field->builtInType && UA_NodeId_isNull(&field->dataType)) ||
  ------------------
  |  Branch (437:8): [True: 80.9k, False: 0]
  |  Branch (437:19): [True: 0, False: 0]
  |  Branch (437:42): [True: 0, False: 0]
  ------------------
  438|      0|       currentTokenType(ctx) == CJ5_TOKEN_NULL)
  ------------------
  |  Branch (438:8): [True: 0, False: 0]
  ------------------
  439|  80.9k|        return decodeJsonJumpTable[UA_DATATYPEKIND_DATAVALUE](ctx, dst, NULL);
  440|       |
  441|      0|    if(currentTokenType(ctx) == CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (441:8): [True: 0, False: 0]
  ------------------
  442|      0|        size_t typeIndex;
  443|       |        /* Preserve empty and reversible DataValues without relying on metadata. */
  444|      0|        if(ctx->tokens[ctx->index].size == 0 ||
  ------------------
  |  Branch (444:12): [True: 0, False: 0]
  ------------------
  445|      0|           lookAheadForKey(ctx, "UaType", &typeIndex) == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (445:12): [True: 0, False: 0]
  ------------------
  446|      0|            return decodeJsonJumpTable[UA_DATATYPEKIND_DATAVALUE](ctx, dst, NULL);
  447|      0|    }
  448|       |
  449|      0|    const UA_DataType *type = UA_findDataTypeWithCustom(&field->dataType, ctx->customTypes);
  450|      0|    if(!type && field->builtInType > 0 && field->builtInType <= 25) {
  ------------------
  |  Branch (450:8): [True: 0, False: 0]
  |  Branch (450:17): [True: 0, False: 0]
  |  Branch (450:43): [True: 0, False: 0]
  ------------------
  451|      0|        UA_NodeId typeId = UA_NODEID_NUMERIC(0, field->builtInType);
  452|      0|        type = UA_findDataType(&typeId);
  453|      0|    }
  454|      0|    if(!type)
  ------------------
  |  Branch (454:8): [True: 0, False: 0]
  ------------------
  455|      0|        return UA_STATUSCODE_BADNOTSUPPORTED;
  ------------------
  |  |  230|      0|#define UA_STATUSCODE_BADNOTSUPPORTED ((UA_StatusCode) 0x803D0000)
  ------------------
  456|      0|    if(field->valueRank > 1)
  ------------------
  |  Branch (456:8): [True: 0, False: 0]
  ------------------
  457|      0|        return UA_STATUSCODE_BADNOTSUPPORTED;
  ------------------
  |  |  230|      0|#define UA_STATUSCODE_BADNOTSUPPORTED ((UA_StatusCode) 0x803D0000)
  ------------------
  458|       |
  459|      0|    if(isVerboseDataValue(ctx, type))
  ------------------
  |  Branch (459:8): [True: 0, False: 0]
  ------------------
  460|      0|        return decodeVerboseDataSetField(ctx, dst, field, type);
  461|      0|    return decodeRawDataSetField(ctx, dst, field, type);
  462|      0|}

UA_findDataTypeWithCustom:
   66|  5.00k|                          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|  1.29M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  1.29M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (72:23): [True: 1.29M, False: 2.05k]
  ------------------
   73|  1.29M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (73:12): [True: 2.95k, False: 1.28M]
  ------------------
   74|  2.95k|            return &UA_TYPES[i];
   75|  1.29M|    }
   76|       |
   77|       |    /* Search in the customTypes */
   78|  2.05k|    while(customTypes) {
  ------------------
  |  Branch (78:11): [True: 0, False: 2.05k]
  ------------------
   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|  2.05k|    return NULL;
   87|  2.05k|}
UA_STRING:
  242|    244|UA_STRING(char *chars) {
  243|    244|    UA_String s = {0, NULL};
  244|    244|    if(!chars)
  ------------------
  |  Branch (244:8): [True: 0, False: 244]
  ------------------
  245|      0|        return s;
  246|    244|    s.length = strlen(chars);
  247|    244|    s.data = (UA_Byte*)chars;
  248|    244|    return s;
  249|    244|}
UA_DateTime_fromStruct:
  534|     85|UA_DateTime_fromStruct(UA_DateTimeStruct ts) {
  535|       |    /* Seconds since the Unix epoch */
  536|     85|    struct musl_tm tm;
  537|     85|    memset(&tm, 0, sizeof(struct musl_tm));
  538|     85|    tm.tm_year = ts.year - 1900;
  539|     85|    tm.tm_mon = ts.month - 1;
  540|     85|    tm.tm_mday = ts.day;
  541|     85|    tm.tm_hour = ts.hour;
  542|     85|    tm.tm_min = ts.min;
  543|     85|    tm.tm_sec = ts.sec;
  544|     85|    long long sec_epoch = musl_tm_to_secs(&tm);
  545|       |
  546|     85|    UA_DateTime t = UA_DATETIME_UNIX_EPOCH;
  ------------------
  |  |  329|     85|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|     85|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|     85|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|     85|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|     85|    t += sec_epoch * UA_DATETIME_SEC;
  ------------------
  |  |  286|     85|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|     85|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|     85|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|     85|    t += ts.milliSec * UA_DATETIME_MSEC;
  ------------------
  |  |  285|     85|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|     85|#define UA_DATETIME_USEC 10LL
  |  |  ------------------
  ------------------
  549|     85|    t += ts.microSec * UA_DATETIME_USEC;
  ------------------
  |  |  284|     85|#define UA_DATETIME_USEC 10LL
  ------------------
  550|     85|    t += ts.nanoSec / 100;
  551|     85|    return t;
  552|     85|}
UA_ByteString_allocBuffer:
  784|  2.04k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  785|  2.04k|    UA_ByteString_init(bs);
  786|  2.04k|    if(length == 0) {
  ------------------
  |  Branch (786:8): [True: 0, False: 2.04k]
  ------------------
  787|      0|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  788|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  789|      0|    }
  790|  2.04k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   24|  2.04k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  791|  2.04k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  345|  2.04k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (345:25): [True: 1, False: 2.04k]
  |  |  ------------------
  ------------------
  792|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  793|  2.04k|    bs->length = length;
  794|  2.04k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.04k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  795|  2.04k|}
UA_new:
 1950|  70.9k|UA_new(const UA_DataType *type) {
 1951|  70.9k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   24|  70.9k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1952|  70.9k|    return p;
 1953|  70.9k|}
UA_copy:
 2126|  38.5k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2127|  38.5k|    memset(dst, 0, type->memSize); /* init */
 2128|  38.5k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2129|  38.5k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  38.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2129:8): [True: 2, False: 38.5k]
  ------------------
 2130|      2|        UA_clear(dst, type);
 2131|  38.5k|    return retval;
 2132|  38.5k|}
UA_clear:
 2229|  1.03M|UA_clear(void *p, const UA_DataType *type) {
 2230|  1.03M|    clearJumpTable[type->typeKind](p, type);
 2231|  1.03M|    memset(p, 0, type->memSize); /* init */
 2232|  1.03M|}
UA_delete:
 2235|    543|UA_delete(void *p, const UA_DataType *type) {
 2236|    543|    clearJumpTable[type->typeKind](p, type);
 2237|    543|    UA_free(p);
  ------------------
  |  |   23|    543|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2238|    543|}
UA_order:
 2703|    234|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2704|    234|    return orderJumpTable[type->typeKind](p1, p2, type);
 2705|    234|}
UA_Array_new:
 2717|  3.84k|UA_Array_new(size_t size, const UA_DataType *type) {
 2718|  3.84k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  101|  3.84k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2718:8): [True: 0, False: 3.84k]
  ------------------
 2719|      0|        return NULL;
 2720|  3.84k|    if(size == 0)
  ------------------
  |  Branch (2720:8): [True: 2, False: 3.84k]
  ------------------
 2721|      2|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|      2|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2722|  3.84k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2722:8): [True: 0, False: 3.84k]
  ------------------
 2723|      0|        return NULL;
 2724|  3.84k|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   24|  3.84k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2725|  3.84k|}
UA_Array_copy:
 2729|  38.5k|              void **dst, const UA_DataType *type) {
 2730|  38.5k|    if(size == 0) {
  ------------------
  |  Branch (2730:8): [True: 1.20k, False: 37.3k]
  ------------------
 2731|  1.20k|        if(src == NULL)
  ------------------
  |  Branch (2731:12): [True: 0, False: 1.20k]
  ------------------
 2732|      0|            *dst = NULL;
 2733|  1.20k|        else
 2734|  1.20k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  1.20k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2735|  1.20k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.20k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2736|  1.20k|    }
 2737|       |
 2738|       |    /* Check the array consistency -- defensive programming in case the user
 2739|       |     * manually created an inconsistent array */
 2740|  37.3k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  345|  74.7k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (345:25): [True: 0, False: 37.3k]
  |  |  |  Branch (345:43): [True: 0, False: 37.3k]
  |  |  |  Branch (345:43): [True: 0, False: 37.3k]
  |  |  ------------------
  ------------------
 2741|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2742|       |
 2743|  37.3k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2743:8): [True: 0, False: 37.3k]
  ------------------
 2744|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2745|  37.3k|    size_t byteSize = size * type->memSize;
 2746|       |
 2747|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2748|  37.3k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   24|  37.3k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2749|  37.3k|    if(!*dst)
  ------------------
  |  Branch (2749:8): [True: 2, False: 37.3k]
  ------------------
 2750|      2|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      2|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2751|       |
 2752|  37.3k|    if(type->pointerFree) {
  ------------------
  |  Branch (2752:8): [True: 37.3k, False: 0]
  ------------------
 2753|  37.3k|        memcpy(*dst, src, byteSize);
 2754|  37.3k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  37.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2755|  37.3k|    }
 2756|       |
 2757|      0|    uintptr_t ptrs = (uintptr_t)src;
 2758|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2759|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2760|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2760:23): [True: 0, False: 0]
  ------------------
 2761|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2762|      0|        ptrs += type->memSize;
 2763|      0|        ptrd += type->memSize;
 2764|      0|    }
 2765|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2765:8): [True: 0, False: 0]
  ------------------
 2766|      0|        UA_Array_delete(*dst, size, type);
 2767|       |        *dst = NULL;
 2768|      0|    }
 2769|      0|    return retval;
 2770|  37.3k|}
UA_Array_delete:
 2872|   286k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2873|   286k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2873:8): [True: 54.9k, False: 231k]
  ------------------
 2874|  54.9k|        uintptr_t ptr = (uintptr_t)p;
 2875|   949k|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2875:27): [True: 894k, False: 54.9k]
  ------------------
 2876|   894k|            UA_clear((void*)ptr, type);
 2877|   894k|            ptr += type->memSize;
 2878|   894k|        }
 2879|  54.9k|    }
 2880|   286k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   23|   286k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2881|   286k|}
ua_types.c:Variant_clear:
 1406|   845k|Variant_clear(void *p, const UA_DataType *_) {
 1407|   845k|    UA_Variant *v = (UA_Variant *)p;
 1408|       |
 1409|       |    /* The content is "borrowed" */
 1410|   845k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1410:8): [True: 0, False: 845k]
  ------------------
 1411|      0|        return;
 1412|       |
 1413|       |    /* Delete the value */
 1414|   845k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  757|  71.2k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1414:8): [True: 71.2k, False: 774k]
  |  Branch (1414:19): [True: 70.6k, False: 544]
  ------------------
 1415|  70.6k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1415:12): [True: 70.3k, False: 280]
  ------------------
 1416|  70.3k|            v->arrayLength = 1;
 1417|  70.6k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1418|  70.6k|        v->data = NULL;
 1419|  70.6k|    }
 1420|       |
 1421|       |    /* Delete the array dimensions */
 1422|   845k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  757|   845k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1422:8): [True: 98, False: 845k]
  ------------------
 1423|     98|        UA_free(v->arrayDimensions);
  ------------------
  |  |   23|     98|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1424|   845k|}
ua_types.c:DataValue_clear:
 1880|   844k|DataValue_clear(void *p, const UA_DataType *_) {
 1881|   844k|    UA_DataValue *dv = (UA_DataValue *)p;
 1882|       |    Variant_clear(&dv->value, NULL);
 1883|   844k|}
ua_types.c:String_copy:
  303|  38.5k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  304|  38.5k|    const UA_String *srcS = (const UA_String*)src;
  305|  38.5k|    UA_String *dstS = (UA_String *)dst;
  306|  38.5k|    UA_StatusCode res =
  307|  38.5k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  308|  38.5k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|  38.5k|#define UA_TYPES_BYTE 2
  ------------------
  309|  38.5k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  38.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (309:8): [True: 38.5k, False: 2]
  ------------------
  310|  38.5k|        dstS->length = srcS->length;
  311|  38.5k|    return res;
  312|  38.5k|}
ua_types.c:nopClear:
 2191|  8.03k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  315|   208k|String_clear(void *p, const UA_DataType *_) {
  316|   208k|    UA_String *s = (UA_String*)p;
  317|   208k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|   208k|#define UA_TYPES_BYTE 2
  ------------------
  318|   208k|}
ua_types.c:NodeId_clear:
  799|  31.2k|NodeId_clear(void *p, const UA_DataType *_) {
  800|  31.2k|    UA_NodeId *id = (UA_NodeId*)p;
  801|  31.2k|    switch(id->identifierType) {
  802|  19.4k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (802:5): [True: 19.4k, False: 11.7k]
  ------------------
  803|  22.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (803:5): [True: 2.62k, False: 28.5k]
  ------------------
  804|  22.0k|        String_clear(&id->identifier.string, NULL);
  805|  22.0k|        break;
  806|  9.15k|    default: break;
  ------------------
  |  Branch (806:5): [True: 9.15k, False: 22.0k]
  ------------------
  807|  31.2k|    }
  808|  31.2k|}
ua_types.c:ExpandedNodeId_clear:
 1100|  18.7k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1101|  18.7k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1102|  18.7k|    NodeId_clear(&id->nodeId, NULL);
 1103|       |    String_clear(&id->namespaceUri, NULL);
 1104|  18.7k|}
ua_types.c:QualifiedName_clear:
  421|  13.2k|QualifiedName_clear(void *p, const UA_DataType *_) {
  422|  13.2k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  423|       |    String_clear(&qn->name, NULL);
  424|  13.2k|}
ua_types.c:LocalizedText_clear:
 1863|  4.19k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1864|  4.19k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1865|  4.19k|    String_clear(&lt->locale, NULL);
 1866|       |    String_clear(&lt->text, NULL);
 1867|  4.19k|}
ua_types.c:ExtensionObject_clear:
 1273|  4.55k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1274|  4.55k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1275|  4.55k|    switch(eo->encoding) {
 1276|  1.96k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1276:5): [True: 1.96k, False: 2.58k]
  ------------------
 1277|  1.96k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1277:5): [True: 1, False: 4.55k]
  ------------------
 1278|  1.96k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1278:5): [True: 4, False: 4.54k]
  ------------------
 1279|  4.00k|    case UA_EXTENSIONOBJECT_ENCODED_JSON:
  ------------------
  |  Branch (1279:5): [True: 2.04k, False: 2.51k]
  ------------------
 1280|  4.00k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1281|  4.00k|        String_clear(&eo->content.encoded.body, NULL);
 1282|  4.00k|        break;
 1283|    543|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1283:5): [True: 543, False: 4.00k]
  ------------------
 1284|    543|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1284:12): [True: 543, False: 0]
  ------------------
 1285|    543|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1286|    543|        break;
 1287|      0|    default:
  ------------------
  |  Branch (1287:5): [True: 0, False: 4.55k]
  ------------------
 1288|      0|        break;
 1289|  4.55k|    }
 1290|  4.55k|}
ua_types.c:DiagnosticInfo_clear:
 1910|    661|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1911|    661|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1912|       |
 1913|    661|    String_clear(&di->additionalInfo, NULL);
 1914|    661|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1914:8): [True: 0, False: 661]
  |  Branch (1914:38): [True: 0, False: 0]
  ------------------
 1915|      0|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1916|      0|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   23|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1917|      0|    }
 1918|    661|}
ua_types.c:clearStructure:
 2135|  2.63k|clearStructure(void *p, const UA_DataType *type) {
 2136|  2.63k|    uintptr_t ptr = (uintptr_t)p;
 2137|  19.9k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2137:23): [True: 17.3k, False: 2.63k]
  ------------------
 2138|  17.3k|        const UA_DataTypeMember *m = &type->members[i];
 2139|  17.3k|        const UA_DataType *mt = m->memberType;
 2140|  17.3k|        ptr += m->padding;
 2141|  17.3k|        if(!m->isOptional) {
  ------------------
  |  Branch (2141:12): [True: 17.3k, False: 0]
  ------------------
 2142|  17.3k|            if(!m->isArray) {
  ------------------
  |  Branch (2142:16): [True: 14.3k, False: 3.04k]
  ------------------
 2143|  14.3k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2144|  14.3k|                ptr += mt->memSize;
 2145|  14.3k|            } else {
 2146|  3.04k|                size_t length = *(size_t*)ptr;
 2147|  3.04k|                ptr += sizeof(size_t);
 2148|  3.04k|                UA_Array_delete(*(void**)ptr, length, mt);
 2149|  3.04k|                ptr += sizeof(void*);
 2150|  3.04k|            }
 2151|  17.3k|        } else { /* field is optional */
 2152|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2152:16): [True: 0, False: 0]
  ------------------
 2153|       |                /* optional scalar field is contained */
 2154|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2154:20): [True: 0, False: 0]
  ------------------
 2155|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2156|      0|                ptr += sizeof(void *);
 2157|      0|            } else {
 2158|       |                /* optional array field is contained */
 2159|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2159:20): [True: 0, False: 0]
  ------------------
 2160|      0|                    size_t length = *(size_t *)ptr;
 2161|      0|                    ptr += sizeof(size_t);
 2162|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2163|      0|                    ptr += sizeof(void *);
 2164|      0|                } else { /* optional array field not contained */
 2165|      0|                    ptr += sizeof(size_t);
 2166|      0|                    ptr += sizeof(void *);
 2167|      0|                }
 2168|      0|            }
 2169|      0|        }
 2170|  17.3k|    }
 2171|  2.63k|}
ua_types.c:nodeIdOrder:
 2321|  1.29M|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2322|  1.29M|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2323|  1.29M|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2324|       |    /* Compare namespaceIndex */
 2325|  1.29M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2325:8): [True: 10.8k, False: 1.28M]
  ------------------
 2326|  10.8k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2326:16): [True: 10.8k, False: 0]
  ------------------
 2327|       |
 2328|       |    /* Compare identifierType */
 2329|  1.28M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2329:8): [True: 409k, False: 872k]
  ------------------
 2330|   409k|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2330:16): [True: 409k, False: 0]
  ------------------
 2331|       |
 2332|       |    /* Compare the identifier */
 2333|   872k|    switch(p1->identifierType) {
 2334|   872k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2334:5): [True: 872k, False: 0]
  ------------------
 2335|   872k|    default:
  ------------------
  |  Branch (2335:5): [True: 0, False: 872k]
  ------------------
 2336|   872k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2336:12): [True: 869k, False: 2.95k]
  ------------------
 2337|   869k|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2337:20): [True: 309k, False: 559k]
  ------------------
 2338|   559k|                UA_ORDER_LESS : UA_ORDER_MORE;
 2339|  2.95k|        return UA_ORDER_EQ;
 2340|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2340:5): [True: 0, False: 872k]
  ------------------
 2341|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2342|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2342:5): [True: 0, False: 872k]
  ------------------
 2343|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2343:5): [True: 0, False: 872k]
  ------------------
 2344|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2345|   872k|    }
 2346|   872k|}
ua_types.c:stringOrder:
 2304|    234|stringOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2305|    234|    const UA_String *p1 = (const UA_String*)p1_;
 2306|    234|    const UA_String *p2 = (const UA_String*)p2_;
 2307|    234|    if(p1->length != p2->length)
  ------------------
  |  Branch (2307:8): [True: 139, False: 95]
  ------------------
 2308|    139|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2308:16): [True: 49, False: 90]
  ------------------
 2309|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2310|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2311|     95|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2311:8): [True: 0, False: 95]
  ------------------
 2312|     95|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2312:8): [True: 0, False: 95]
  ------------------
 2313|     95|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2313:8): [True: 0, False: 95]
  ------------------
 2314|     95|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2315|     95|    if(cmp != 0)
  ------------------
  |  Branch (2315:8): [True: 92, False: 3]
  ------------------
 2316|     92|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2316:16): [True: 34, False: 58]
  ------------------
 2317|      3|    return UA_ORDER_EQ;
 2318|     95|}

ua_types_encoding_json.c:currentTokenType:
  228|  2.79M|cj5_token_type currentTokenType(const ParseCtx *ctx) {
  229|  2.79M|    return ctx->tokens[ctx->index].type;
  230|  2.79M|}
ua_types_encoding_json.c:getTokenLength:
  233|  2.42M|size_t getTokenLength(const cj5_token *t) {
  234|  2.42M|    return (size_t)(1u + t->end - t->start);
  235|  2.42M|}
ua_pubsub_networkmessage_json.c:currentTokenType:
  228|   109k|cj5_token_type currentTokenType(const ParseCtx *ctx) {
  229|   109k|    return ctx->tokens[ctx->index].type;
  230|   109k|}
ua_pubsub_networkmessage_json.c:getTokenLength:
  233|  5.63k|size_t getTokenLength(const cj5_token *t) {
  234|  5.63k|    return (size_t)(1u + t->end - t->start);
  235|  5.63k|}

lookAheadForKey:
 1810|   237k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1811|       |    /* The current index must point to the beginning of an object.
 1812|       |     * This has to be ensured by the caller. */
 1813|   237k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  248|   237k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1813:5): [True: 237k, False: 0]
  ------------------
 1814|       |
 1815|   237k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  233|   237k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1816|   237k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1817|   237k|    unsigned int end = ctx->tokens[ctx->index].end;
 1818|   237k|    ctx->index++; /* Move to the first key */
 1819|   561k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1819:11): [True: 557k, False: 4.50k]
  ------------------
 1820|   557k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1820:11): [True: 481k, False: 76.1k]
  ------------------
 1821|       |        /* Key must be a string */
 1822|   481k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  248|   481k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1822:9): [True: 481k, False: 0]
  ------------------
 1823|       |
 1824|       |        /* Move index to the value */
 1825|   481k|        ctx->index++;
 1826|       |
 1827|       |        /* Value for the key must exist */
 1828|   481k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  248|   481k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1828:9): [True: 481k, False: 0]
  ------------------
 1829|       |
 1830|       |        /* Compare the key (previous index) */
 1831|   481k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1831:12): [True: 156k, False: 324k]
  ------------------
 1832|   156k|            *resultIndex = ctx->index; /* Point result to the current index */
 1833|   156k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   156k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1834|   156k|            break;
 1835|   156k|        }
 1836|       |
 1837|   324k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1838|   324k|    }
 1839|   237k|    ctx->index = oldIndex; /* Restore the old index */
 1840|   237k|    return ret;
 1841|   237k|}
decodeFields:
 2620|  78.1k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2621|       |    return decodeFieldsInternal(ctx, entries, entryCount, false);
 2622|  78.1k|}
decodeFieldsAllowUnknown:
 2626|  9.62k|                         size_t entryCount) {
 2627|       |    return decodeFieldsInternal(ctx, entries, entryCount, true);
 2628|  9.62k|}
tokenize:
 2955|  7.13k|         size_t *decodedLength) {
 2956|       |    /* Tokenize */
 2957|  7.13k|    cj5_options options;
 2958|  7.13k|    options.stop_early = (decodedLength != NULL);
 2959|  7.13k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2960|  7.13k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2961|       |
 2962|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2963|       |     * have needed */
 2964|  7.13k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2964:8): [True: 510, False: 6.62k]
  ------------------
 2965|    510|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2965:8): [True: 510, False: 0]
  ------------------
 2966|       |#if SIZE_MAX <= UINT_MAX
 2967|       |        if((size_t)r.num_tokens > SIZE_MAX / sizeof(cj5_token))
 2968|       |            return UA_STATUSCODE_BADDECODINGERROR;
 2969|       |#endif
 2970|    510|        ctx->tokens = (cj5_token*)
 2971|    510|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   22|    510|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2972|    510|        if(!ctx->tokens)
  ------------------
  |  Branch (2972:12): [True: 12, False: 498]
  ------------------
 2973|     12|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     12|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2974|    498|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2975|    510|    }
 2976|       |
 2977|       |    /* Cannot recover from other errors */
 2978|  6.62k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2978:8): [True: 702, False: 5.92k]
  ------------------
 2979|    702|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    702|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2980|       |
 2981|  5.92k|    if(decodedLength)
  ------------------
  |  Branch (2981:8): [True: 0, False: 5.92k]
  ------------------
 2982|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2983|       |
 2984|       |    /* Set up the context */
 2985|  5.92k|    ctx->json5 = (char*)src->data;
 2986|  5.92k|    ctx->depth = 0;
 2987|  5.92k|    ctx->tokensSize = r.num_tokens;
 2988|  5.92k|    ctx->index = 0;
 2989|  5.92k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.92k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2990|  6.62k|}
ua_types_encoding_json.c:isJsonNullable:
  253|  4.52k|isJsonNullable(const UA_DataType *type) {
  254|  4.52k|    return (type->typeKind >= UA_DATATYPEKIND_STRING &&
  ------------------
  |  Branch (254:13): [True: 4.50k, False: 27]
  ------------------
  255|  4.50k|            type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO &&
  ------------------
  |  Branch (255:13): [True: 4.50k, False: 0]
  ------------------
  256|  4.50k|            type->typeKind != UA_DATATYPEKIND_STATUSCODE);
  ------------------
  |  Branch (256:13): [True: 4.50k, False: 2]
  ------------------
  257|  4.52k|}
ua_types_encoding_json.c:variantDimensionsValid:
  800|    118|                       const UA_UInt32 *dimensions) {
  801|    118|    if(dimensionsSize == 0 || !dimensions)
  ------------------
  |  Branch (801:8): [True: 2, False: 116]
  |  Branch (801:31): [True: 0, False: 116]
  ------------------
  802|      2|        return false;
  803|       |
  804|    116|    size_t total = 1;
  805|    626|    for(size_t i = 0; i < dimensionsSize; i++) {
  ------------------
  |  Branch (805:23): [True: 516, False: 110]
  ------------------
  806|    516|        UA_UInt32 dimension = dimensions[i];
  807|    516|        if(dimension == 0 || total > SIZE_MAX / dimension)
  ------------------
  |  Branch (807:12): [True: 4, False: 512]
  |  Branch (807:30): [True: 2, False: 510]
  ------------------
  808|      6|            return false;
  809|    510|        total *= dimension;
  810|    510|    }
  811|    110|    return total == arrayLength;
  812|    116|}
ua_types_encoding_json.c:jsoneq:
 1354|   861k|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1355|       |    /* TODO: necessary?
 1356|       |       if(json == NULL
 1357|       |            || tok == NULL
 1358|       |            || searchKey == NULL) {
 1359|       |        return -1;
 1360|       |    } */
 1361|       |
 1362|   861k|    size_t len = getTokenLength(tok);
 1363|   861k|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1363:8): [True: 861k, False: 0]
  ------------------
 1364|   861k|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1364:8): [True: 324k, False: 537k]
  ------------------
 1365|   324k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1365:8): [True: 315k, False: 8.59k]
  ------------------
 1366|   315k|        return 0;
 1367|       |
 1368|   545k|    return -1;
 1369|   861k|}
ua_types_encoding_json.c:skipObject:
 1338|   573k|skipObject(ParseCtx *ctx) {
 1339|   573k|    unsigned int end = ctx->tokens[ctx->index].end;
 1340|  39.2M|    do {
 1341|  39.2M|        ctx->index++;
 1342|  39.2M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1342:13): [True: 39.2M, False: 4.50k]
  ------------------
 1343|  39.2M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1343:13): [True: 38.6M, False: 568k]
  ------------------
 1344|   573k|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2481|      3|DECODE_JSON(DiagnosticInfo) {
 2482|      3|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2483|      3|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1323|      3|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|      3|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 3]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|      3|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
 2484|      3|    CHECK_OBJECT;
  ------------------
  |  | 1318|      3|#define CHECK_OBJECT do {                                \
  |  | 1319|      3|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 2, False: 1]
  |  |  ------------------
  |  | 1320|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|      2|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2485|       |
 2486|      1|    DecodeEntry entries[7] = {
 2487|      1|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2488|      1|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      1|#define UA_TYPES_INT32 5
  ------------------
 2489|      1|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2490|      1|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      1|#define UA_TYPES_INT32 5
  ------------------
 2491|      1|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2492|      1|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      1|#define UA_TYPES_INT32 5
  ------------------
 2493|      1|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2494|      1|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      1|#define UA_TYPES_INT32 5
  ------------------
 2495|      1|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2496|      1|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|      1|#define UA_TYPES_STRING 11
  ------------------
 2497|      1|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2498|      1|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|      1|#define UA_TYPES_STATUSCODE 18
  ------------------
 2499|      1|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2500|      1|         DiagnosticInfoInner_decodeJson, false, NULL}
 2501|      1|    };
 2502|      1|    status ret = decodeFields(ctx, entries, 7);
 2503|       |
 2504|      1|    dst->hasSymbolicId = entries[0].found;
 2505|      1|    dst->hasNamespaceUri = entries[1].found;
 2506|      1|    dst->hasLocalizedText = entries[2].found;
 2507|      1|    dst->hasLocale = entries[3].found;
 2508|      1|    dst->hasAdditionalInfo = entries[4].found;
 2509|      1|    dst->hasInnerStatusCode = entries[5].found;
 2510|      1|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2511|      1|    return ret;
 2512|      3|}
ua_types_encoding_json.c:decodeFieldsInternal:
 2527|  87.7k|                     UA_Boolean allowUnknown) {
 2528|  87.7k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  87.7k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  87.7k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 87.7k]
  |  |  ------------------
  |  | 1300|  87.7k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  87.7k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 87.7k]
  |  |  ------------------
  ------------------
 2529|  87.7k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1323|  87.7k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|  87.7k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 1, False: 87.7k]
  |  |  ------------------
  |  | 1325|      1|        ctx->index++;                                \
  |  | 1326|      1|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|  87.7k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 87.7k]
  |  |  ------------------
  ------------------
 2530|       |
 2531|  87.7k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |  128|  87.7k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2531:8): [True: 0, False: 87.7k]
  ------------------
 2532|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2533|       |
 2534|       |    /* Keys and values are counted separately */
 2535|  87.7k|    CHECK_OBJECT;
  ------------------
  |  | 1318|  87.7k|#define CHECK_OBJECT do {                                \
  |  | 1319|  87.7k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 4, False: 87.7k]
  |  |  ------------------
  |  | 1320|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|  87.7k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 87.7k]
  |  |  ------------------
  ------------------
 2536|  87.7k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  248|  87.7k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2536:5): [True: 87.7k, False: 0]
  ------------------
 2537|  87.7k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2538|       |
 2539|  87.7k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2540|  87.7k|    ctx->depth++;
 2541|       |
 2542|  87.7k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  87.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2543|   254k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2543:25): [True: 174k, False: 79.9k]
  ------------------
 2544|       |        /* Key must be a string */
 2545|   174k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  248|   174k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2545:9): [True: 174k, False: 0]
  ------------------
 2546|   174k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  248|   174k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2546:9): [True: 174k, False: 0]
  ------------------
 2547|       |
 2548|       |        /* Search for the decoding entry matching the key. Start at the key
 2549|       |         * index to speed-up the case where they key-order is the same as the
 2550|       |         * entry-order. */
 2551|   174k|        DecodeEntry *entry = NULL;
 2552|   378k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2552:29): [True: 356k, False: 22.1k]
  ------------------
 2553|   356k|            size_t ii = i;
 2554|  69.3M|            while(ii >= entryCount)
  ------------------
  |  Branch (2554:19): [True: 68.9M, False: 356k]
  ------------------
 2555|  68.9M|                ii -= entryCount;
 2556|       |
 2557|       |            /* Compare the key */
 2558|   356k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2558:16): [True: 204k, False: 152k]
  ------------------
 2559|   356k|                      entries[ii].fieldName) != 0)
 2560|   204k|                continue;
 2561|       |
 2562|       |            /* Key was already used -> duplicate, abort */
 2563|   152k|            if(entries[ii].found) {
  ------------------
  |  Branch (2563:16): [True: 2, False: 152k]
  ------------------
 2564|      2|                ctx->depth--;
 2565|      2|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2566|      2|            }
 2567|       |
 2568|       |            /* Found the key */
 2569|   152k|            entries[ii].found = true;
 2570|   152k|            entry = &entries[ii];
 2571|   152k|            break;
 2572|   152k|        }
 2573|       |
 2574|       |        /* The key is unknown */
 2575|   174k|        if(!entry) {
  ------------------
  |  Branch (2575:12): [True: 22.1k, False: 152k]
  ------------------
 2576|  22.1k|            if(allowUnknown) {
  ------------------
  |  Branch (2576:16): [True: 22.0k, False: 143]
  ------------------
 2577|  22.0k|                ctx->index++; /* key -> value */
 2578|  22.0k|                skipObject(ctx);
 2579|  22.0k|                continue;
 2580|  22.0k|            }
 2581|    143|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    143|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2582|    143|            break;
 2583|  22.1k|        }
 2584|       |
 2585|       |        /* Go from key to value */
 2586|   152k|        ctx->index++;
 2587|   152k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  248|   152k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2587:9): [True: 152k, False: 0]
  ------------------
 2588|       |
 2589|       |        /* An entry that was expected but shall not be decoded.
 2590|       |         * Jump over the value. */
 2591|   152k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2591:12): [True: 143k, False: 9.26k]
  |  Branch (2591:32): [True: 141k, False: 1.95k]
  ------------------
 2592|   141k|            skipObject(ctx);
 2593|   141k|            continue;
 2594|   141k|        }
 2595|       |
 2596|       |        /* A null-value is only valid for nullable fields. */
 2597|  11.2k|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2597:12): [True: 39, False: 11.1k]
  |  Branch (2597:55): [True: 36, False: 3]
  ------------------
 2598|     36|            if(!entry->type || !isJsonNullable(entry->type)) {
  ------------------
  |  Branch (2598:16): [True: 0, False: 36]
  |  Branch (2598:32): [True: 1, False: 35]
  ------------------
 2599|      1|                ctx->depth--;
 2600|      1|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2601|      1|            }
 2602|     35|            ctx->index++; /* skip null value */
 2603|     35|            continue;
 2604|     36|        }
 2605|       |
 2606|       |        /* Decode. This also moves to the next key or right after the object for
 2607|       |         * the last value. */
 2608|  11.1k|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2608:42): [True: 9.26k, False: 1.91k]
  ------------------
 2609|  9.26k|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2610|  11.1k|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2611|  11.1k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  11.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2611:12): [True: 7.59k, False: 3.58k]
  ------------------
 2612|  7.59k|            break;
 2613|  11.1k|    }
 2614|       |
 2615|  87.7k|    ctx->depth--;
 2616|  87.7k|    return ret;
 2617|  87.7k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1427|     34|DECODE_JSON(Boolean) {
 1428|     34|    UA_Boolean *dst = (UA_Boolean*)p;
 1429|     34|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|     34|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|     34|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 34]
  |  |  ------------------
  |  | 1300|     34|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|     34|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 34]
  |  |  ------------------
  ------------------
 1430|     34|    CHECK_BOOL;
  ------------------
  |  | 1308|     34|#define CHECK_BOOL do {                                \
  |  | 1309|     34|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1309:8): [True: 32, False: 2]
  |  |  ------------------
  |  | 1310|     32|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   44|     32|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1311|     32|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1311:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1431|      2|    GET_TOKEN;
  ------------------
  |  | 1294|      2|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|      2|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|      2|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1432|       |
 1433|      2|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1433:8): [True: 2, False: 0]
  ------------------
 1434|      2|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1434:8): [True: 2, False: 0]
  |  Branch (1434:38): [True: 2, False: 0]
  ------------------
 1435|      2|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1435:8): [True: 2, False: 0]
  |  Branch (1435:38): [True: 2, False: 0]
  ------------------
 1436|      2|        *dst = true;
 1437|      2|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1437:15): [True: 0, False: 0]
  ------------------
 1438|      0|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1438:15): [True: 0, False: 0]
  |  Branch (1438:45): [True: 0, False: 0]
  ------------------
 1439|      0|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1439:15): [True: 0, False: 0]
  |  Branch (1439:45): [True: 0, False: 0]
  ------------------
 1440|      0|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1440:15): [True: 0, False: 0]
  ------------------
 1441|      0|        *dst = false;
 1442|      0|    } else {
 1443|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1444|      0|    }
 1445|       |
 1446|      2|    ctx->index++;
 1447|      2|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1448|      2|}
ua_types_encoding_json.c:SByte_decodeJson:
 1535|  20.2k|DECODE_JSON(SByte) {
 1536|  20.2k|    UA_SByte *dst = (UA_SByte*)p;
 1537|  20.2k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  20.2k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  20.2k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 20.2k]
  |  |  ------------------
  |  | 1300|  20.2k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  20.2k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 20.2k]
  |  |  ------------------
  ------------------
 1538|  20.2k|    CHECK_NUMBER;
  ------------------
  |  | 1303|  20.2k|#define CHECK_NUMBER do {                                \
  |  | 1304|  20.2k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 5, False: 20.2k]
  |  |  ------------------
  |  | 1305|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|  20.2k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 20.2k]
  |  |  ------------------
  ------------------
 1539|  20.2k|    GET_TOKEN;
  ------------------
  |  | 1294|  20.2k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  20.2k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  20.2k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 20.2k]
  |  |  ------------------
  ------------------
 1540|  20.2k|    UA_Int64 out = 0;
 1541|  20.2k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1542|  20.2k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|  40.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|  40.4k|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   65|  20.1k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1542:8): [True: 40, False: 20.2k]
  |  Branch (1542:35): [True: 92, False: 20.1k]
  |  Branch (1542:57): [True: 56, False: 20.0k]
  ------------------
 1543|    188|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    188|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1544|  20.0k|    *dst = (UA_SByte)out;
 1545|  20.0k|    ctx->index++;
 1546|  20.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  20.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1547|  20.2k|}
ua_types_encoding_json.c:parseSignedInteger:
 1467|   318k|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1468|   318k|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1469|   318k|    if(len == 0)
  ------------------
  |  Branch (1469:8): [True: 100, False: 318k]
  ------------------
 1470|    100|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    100|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1471|       |
 1472|       |    /* There must only be whitespace between the end of the parsed number and
 1473|       |     * the end of the token */
 1474|   357k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1474:25): [True: 38.9k, False: 318k]
  ------------------
 1475|  38.9k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1475:12): [True: 38.8k, False: 23]
  |  Branch (1475:35): [True: 108, False: 38.7k]
  ------------------
 1476|    108|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    108|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1477|  38.9k|    }
 1478|       |
 1479|   318k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   318k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1480|   318k|}
ua_types_encoding_json.c:Byte_decodeJson:
 1482|  8.50k|DECODE_JSON(Byte) {
 1483|  8.50k|    UA_Byte *dst = (UA_Byte*)p;
 1484|  8.50k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  8.50k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  8.50k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 8.50k]
  |  |  ------------------
  |  | 1300|  8.50k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  8.50k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 8.50k]
  |  |  ------------------
  ------------------
 1485|  8.50k|    CHECK_NUMBER;
  ------------------
  |  | 1303|  8.50k|#define CHECK_NUMBER do {                                \
  |  | 1304|  8.50k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 5, False: 8.50k]
  |  |  ------------------
  |  | 1305|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|  8.50k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 8.50k]
  |  |  ------------------
  ------------------
 1486|  8.50k|    GET_TOKEN;
  ------------------
  |  | 1294|  8.50k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  8.50k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  8.50k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 8.50k]
  |  |  ------------------
  ------------------
 1487|  8.50k|    UA_UInt64 out = 0;
 1488|  8.50k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1489|  8.50k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   17|  17.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   74|  8.47k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1489:8): [True: 29, False: 8.47k]
  |  Branch (1489:35): [True: 54, False: 8.41k]
  ------------------
 1490|     83|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     83|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1491|  8.41k|    *dst = (UA_Byte)out;
 1492|  8.41k|    ctx->index++;
 1493|  8.41k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.41k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1494|  8.50k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1451|   388k|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1452|   388k|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1453|   388k|    if(len == 0)
  ------------------
  |  Branch (1453:8): [True: 88, False: 387k]
  ------------------
 1454|     88|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     88|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1455|       |
 1456|       |    /* There must only be whitespace between the end of the parsed number and
 1457|       |     * the end of the token */
 1458|   403k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1458:25): [True: 15.5k, False: 387k]
  ------------------
 1459|  15.5k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1459:12): [True: 15.5k, False: 32]
  |  Branch (1459:35): [True: 137, False: 15.4k]
  ------------------
 1460|    137|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    137|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1461|  15.5k|    }
 1462|       |
 1463|   387k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   387k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1464|   387k|}
ua_types_encoding_json.c:Int16_decodeJson:
 1549|  13.4k|DECODE_JSON(Int16) {
 1550|  13.4k|    UA_Int16 *dst = (UA_Int16*)p;
 1551|  13.4k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  13.4k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  13.4k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 13.4k]
  |  |  ------------------
  |  | 1300|  13.4k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  13.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
 1552|  13.4k|    CHECK_NUMBER;
  ------------------
  |  | 1303|  13.4k|#define CHECK_NUMBER do {                                \
  |  | 1304|  13.4k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 6, False: 13.4k]
  |  |  ------------------
  |  | 1305|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|  13.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
 1553|  13.4k|    GET_TOKEN;
  ------------------
  |  | 1294|  13.4k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  13.4k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  13.4k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
 1554|  13.4k|    UA_Int64 out = 0;
 1555|  13.4k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1556|  13.4k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|  26.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|  26.9k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   83|  13.3k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1556:8): [True: 31, False: 13.4k]
  |  Branch (1556:35): [True: 68, False: 13.3k]
  |  Branch (1556:57): [True: 38, False: 13.3k]
  ------------------
 1557|    137|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    137|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1558|  13.3k|    *dst = (UA_Int16)out;
 1559|  13.3k|    ctx->index++;
 1560|  13.3k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  13.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1561|  13.4k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1496|  22.8k|DECODE_JSON(UInt16) {
 1497|  22.8k|    UA_UInt16 *dst = (UA_UInt16*)p;
 1498|  22.8k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  22.8k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  22.8k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 22.8k]
  |  |  ------------------
  |  | 1300|  22.8k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  22.8k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
 1499|  22.8k|    CHECK_NUMBER;
  ------------------
  |  | 1303|  22.8k|#define CHECK_NUMBER do {                                \
  |  | 1304|  22.8k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 4, False: 22.8k]
  |  |  ------------------
  |  | 1305|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|  22.8k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
 1500|  22.8k|    GET_TOKEN;
  ------------------
  |  | 1294|  22.8k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  22.8k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  22.8k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
 1501|  22.8k|    UA_UInt64 out = 0;
 1502|  22.8k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1503|  22.8k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   17|  45.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   92|  22.8k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1503:8): [True: 28, False: 22.8k]
  |  Branch (1503:35): [True: 85, False: 22.7k]
  ------------------
 1504|    113|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    113|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1505|  22.7k|    *dst = (UA_UInt16)out;
 1506|  22.7k|    ctx->index++;
 1507|  22.7k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  22.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1508|  22.8k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1563|   220k|DECODE_JSON(Int32) {
 1564|   220k|    UA_Int32 *dst = (UA_Int32*)p;
 1565|   220k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|   220k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|   220k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 220k]
  |  |  ------------------
  |  | 1300|   220k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|   220k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 220k]
  |  |  ------------------
  ------------------
 1566|   220k|    CHECK_NUMBER;
  ------------------
  |  | 1303|   220k|#define CHECK_NUMBER do {                                \
  |  | 1304|   220k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 4, False: 220k]
  |  |  ------------------
  |  | 1305|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|   220k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 220k]
  |  |  ------------------
  ------------------
 1567|   220k|    GET_TOKEN;
  ------------------
  |  | 1294|   220k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|   220k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|   220k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 220k]
  |  |  ------------------
  ------------------
 1568|   220k|    UA_Int64 out = 0;
 1569|   220k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1570|   220k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|   440k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|   440k|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  101|   219k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1570:8): [True: 65, False: 220k]
  |  Branch (1570:35): [True: 114, False: 219k]
  |  Branch (1570:57): [True: 21, False: 219k]
  ------------------
 1571|    200|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    200|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1572|   219k|    *dst = (UA_Int32)out;
 1573|   219k|    ctx->index++;
 1574|   219k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   219k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1575|   220k|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1510|   344k|DECODE_JSON(UInt32) {
 1511|   344k|    UA_UInt32 *dst = (UA_UInt32*)p;
 1512|   344k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|   344k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|   344k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 344k]
  |  |  ------------------
  |  | 1300|   344k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|   344k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 344k]
  |  |  ------------------
  ------------------
 1513|   344k|    CHECK_NUMBER;
  ------------------
  |  | 1303|   344k|#define CHECK_NUMBER do {                                \
  |  | 1304|   344k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 5, False: 344k]
  |  |  ------------------
  |  | 1305|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|   344k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 344k]
  |  |  ------------------
  ------------------
 1514|   344k|    GET_TOKEN;
  ------------------
  |  | 1294|   344k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|   344k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|   344k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 344k]
  |  |  ------------------
  ------------------
 1515|   344k|    UA_UInt64 out = 0;
 1516|   344k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1517|   344k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|   689k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  110|   344k|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1517:8): [True: 80, False: 344k]
  |  Branch (1517:35): [True: 113, False: 344k]
  ------------------
 1518|    193|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    193|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1519|   344k|    *dst = (UA_UInt32)out;
 1520|   344k|    ctx->index++;
 1521|   344k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   344k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1522|   344k|}
ua_types_encoding_json.c:Int64_decodeJson:
 1577|  64.9k|DECODE_JSON(Int64) {
 1578|  64.9k|    UA_Int64 *dst = (UA_Int64*)p;
 1579|  64.9k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  64.9k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  64.9k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 64.9k]
  |  |  ------------------
  |  | 1300|  64.9k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  64.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 64.9k]
  |  |  ------------------
  ------------------
 1580|  64.9k|    GET_TOKEN;
  ------------------
  |  | 1294|  64.9k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  64.9k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  64.9k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 64.9k]
  |  |  ------------------
  ------------------
 1581|  64.9k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1582|  64.9k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  64.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1582:8): [True: 72, False: 64.9k]
  ------------------
 1583|     72|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     72|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1584|  64.9k|    ctx->index++;
 1585|  64.9k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  64.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1586|  64.9k|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1524|  11.6k|DECODE_JSON(UInt64) {
 1525|  11.6k|    UA_UInt64 *dst = (UA_UInt64*)p;
 1526|  11.6k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  11.6k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  11.6k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 11.6k]
  |  |  ------------------
  |  | 1300|  11.6k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  11.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 11.6k]
  |  |  ------------------
  ------------------
 1527|  11.6k|    GET_TOKEN;
  ------------------
  |  | 1294|  11.6k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  11.6k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  11.6k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 11.6k]
  |  |  ------------------
  ------------------
 1528|  11.6k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1529|  11.6k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  11.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1529:8): [True: 88, False: 11.5k]
  ------------------
 1530|     88|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     88|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1531|  11.5k|    ctx->index++;
 1532|  11.5k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  11.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1533|  11.6k|}
ua_types_encoding_json.c:Float_decodeJson:
 1649|  52.4k|DECODE_JSON(Float) {
 1650|  52.4k|    UA_Float *dst = (UA_Float*)p;
 1651|  52.4k|    UA_Double v = 0.0;
 1652|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1653|  52.4k|    *dst = (UA_Float)v;
 1654|  52.4k|    return res;
 1655|  52.4k|}
ua_types_encoding_json.c:Double_decodeJson:
 1589|   620k|DECODE_JSON(Double) {
 1590|   620k|    UA_Double *dst = (UA_Double*)p;
 1591|   620k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|   620k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|   620k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 620k]
  |  |  ------------------
  |  | 1300|   620k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|   620k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 620k]
  |  |  ------------------
  ------------------
 1592|   620k|    GET_TOKEN;
  ------------------
  |  | 1294|   620k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|   620k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|   620k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 620k]
  |  |  ------------------
  ------------------
 1593|       |
 1594|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1595|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1596|       |     * Sanity check.
 1597|       |     */
 1598|   620k|    if(tokenSize > 2000)
  ------------------
  |  Branch (1598:8): [True: 1, False: 620k]
  ------------------
 1599|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1600|       |
 1601|   620k|    cj5_token_type tokenType = currentTokenType(ctx);
 1602|       |
 1603|       |    /* It could be a String with Nan, Infinity */
 1604|   620k|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1604:8): [True: 2.73k, False: 617k]
  ------------------
 1605|  2.73k|        ctx->index++;
 1606|       |
 1607|  2.73k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1607:12): [True: 586, False: 2.15k]
  |  Branch (1607:30): [True: 573, False: 13]
  ------------------
 1608|    573|            *dst = INFINITY;
 1609|    573|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    573|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1610|    573|        }
 1611|       |
 1612|  2.16k|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1612:12): [True: 72, False: 2.09k]
  |  Branch (1612:30): [True: 66, False: 6]
  ------------------
 1613|       |            /* workaround an MSVC 2013 issue */
 1614|     66|            *dst = -INFINITY;
 1615|     66|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     66|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1616|     66|        }
 1617|       |
 1618|  2.09k|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1618:12): [True: 212, False: 1.88k]
  |  Branch (1618:30): [True: 195, False: 17]
  ------------------
 1619|    195|            *dst = NAN;
 1620|    195|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    195|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1621|    195|        }
 1622|       |
 1623|  1.90k|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1623:12): [True: 1.83k, False: 71]
  |  Branch (1623:30): [True: 1.82k, False: 5]
  ------------------
 1624|  1.82k|            *dst = NAN;
 1625|  1.82k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.82k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1626|  1.82k|        }
 1627|       |
 1628|     76|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     76|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1629|  1.90k|    }
 1630|       |
 1631|   617k|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1631:8): [True: 9, False: 617k]
  ------------------
 1632|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1633|       |
 1634|   617k|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1635|   617k|    if(len == 0)
  ------------------
  |  Branch (1635:8): [True: 2, False: 617k]
  ------------------
 1636|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1637|       |
 1638|       |    /* There must only be whitespace between the end of the parsed number and
 1639|       |     * the end of the token */
 1640|   617k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1640:25): [True: 31, False: 617k]
  ------------------
 1641|     31|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1641:12): [True: 31, False: 0]
  |  Branch (1641:35): [True: 31, False: 0]
  ------------------
 1642|     31|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     31|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1643|     31|    }
 1644|       |
 1645|   617k|    ctx->index++;
 1646|   617k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   617k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1647|   617k|}
ua_types_encoding_json.c:String_decodeJson:
 1667|   122k|DECODE_JSON(String) {
 1668|   122k|    UA_String *dst = (UA_String*)p;
 1669|   122k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|   122k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|   122k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 122k]
  |  |  ------------------
  |  | 1300|   122k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|   122k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 122k]
  |  |  ------------------
  ------------------
 1670|   122k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1323|   122k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|   122k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 3, False: 122k]
  |  |  ------------------
  |  | 1325|      3|        ctx->index++;                                \
  |  | 1326|      3|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|   122k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 122k]
  |  |  ------------------
  ------------------
 1671|   122k|    CHECK_STRING;
  ------------------
  |  | 1313|   122k|#define CHECK_STRING do {                                \
  |  | 1314|   122k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1314:8): [True: 23, False: 122k]
  |  |  ------------------
  |  | 1315|     23|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     23|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1316|   122k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1316:14): [Folded, False: 122k]
  |  |  ------------------
  ------------------
 1672|   122k|    GET_TOKEN;
  ------------------
  |  | 1294|   122k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|   122k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|   122k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 122k]
  |  |  ------------------
  ------------------
 1673|   122k|    (void)tokenData;
 1674|       |
 1675|       |    /* Empty string? */
 1676|   122k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1676:8): [True: 272, False: 122k]
  ------------------
 1677|    272|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|    272|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1678|    272|        dst->length = 0;
 1679|    272|        ctx->index++;
 1680|    272|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    272|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1681|    272|    }
 1682|       |
 1683|       |    /* The decoded utf8 is at most of the same length as the source string */
 1684|   122k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   22|   122k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1685|   122k|    if(!outBuf)
  ------------------
  |  Branch (1685:8): [True: 23, False: 122k]
  ------------------
 1686|     23|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     23|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1687|       |
 1688|       |    /* Decode the string */
 1689|   122k|    cj5_result r;
 1690|   122k|    r.tokens = ctx->tokens;
 1691|   122k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1692|   122k|    r.json5 = ctx->json5;
 1693|   122k|    unsigned int len = 0;
 1694|   122k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1695|   122k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1695:8): [True: 161, False: 122k]
  ------------------
 1696|    161|        UA_free(outBuf);
  ------------------
  |  |   23|    161|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1697|    161|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    161|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1698|    161|    }
 1699|       |
 1700|       |    /* Set the output */
 1701|   122k|    dst->length = len;
 1702|   122k|    if(dst->length > 0) {
  ------------------
  |  Branch (1702:8): [True: 122k, False: 0]
  ------------------
 1703|   122k|        dst->data = (UA_Byte*)outBuf;
 1704|   122k|    } else {
 1705|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1706|      0|        UA_free(outBuf);
  ------------------
  |  |   23|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1707|      0|    }
 1708|       |
 1709|   122k|    ctx->index++;
 1710|   122k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   122k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1711|   122k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1866|    269|DECODE_JSON(DateTime) {
 1867|    269|    UA_DateTime *dst = (UA_DateTime*)p;
 1868|    269|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|    269|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|    269|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 269]
  |  |  ------------------
  |  | 1300|    269|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|    269|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 269]
  |  |  ------------------
  ------------------
 1869|    269|    CHECK_NULL_SKIP;
  ------------------
  |  | 1323|    269|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|    269|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 269]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|    269|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 269]
  |  |  ------------------
  ------------------
 1870|    269|    CHECK_STRING;
  ------------------
  |  | 1313|    269|#define CHECK_STRING do {                                \
  |  | 1314|    269|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1314:8): [True: 6, False: 263]
  |  |  ------------------
  |  | 1315|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1316|    263|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1316:14): [Folded, False: 263]
  |  |  ------------------
  ------------------
 1871|    263|    GET_TOKEN;
  ------------------
  |  | 1294|    263|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|    263|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|    263|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 263]
  |  |  ------------------
  ------------------
 1872|       |
 1873|       |    /* YYYY-MM-DDTHH:MM:SS[.fffffff]Z */
 1874|    263|    if(tokenSize < 20 || tokenData[tokenSize-1] != 'Z' ||
  ------------------
  |  Branch (1874:8): [True: 12, False: 251]
  |  Branch (1874:26): [True: 16, False: 235]
  ------------------
 1875|    235|       tokenData[4] != '-' || tokenData[7] != '-' ||
  ------------------
  |  Branch (1875:8): [True: 13, False: 222]
  |  Branch (1875:31): [True: 8, False: 214]
  ------------------
 1876|    214|       tokenData[10] != 'T' || tokenData[13] != ':' ||
  ------------------
  |  Branch (1876:8): [True: 6, False: 208]
  |  Branch (1876:32): [True: 10, False: 198]
  ------------------
 1877|    198|       tokenData[16] != ':')
  ------------------
  |  Branch (1877:8): [True: 11, False: 187]
  ------------------
 1878|     76|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     76|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1879|       |
 1880|    187|    const size_t positions[6] = {0, 5, 8, 11, 14, 17};
 1881|    187|    UA_UInt16 values[6];
 1882|  1.26k|    for(size_t i = 0; i < 6; i++) {
  ------------------
  |  Branch (1882:23): [True: 1.08k, False: 179]
  ------------------
 1883|  1.08k|        UA_UInt64 value = 0;
 1884|  1.08k|        size_t digits = (i == 0) ? 4 : 2;
  ------------------
  |  Branch (1884:25): [True: 187, False: 901]
  ------------------
 1885|  1.08k|        if(parseUInt64(&tokenData[positions[i]], digits, &value) != digits)
  ------------------
  |  Branch (1885:12): [True: 8, False: 1.08k]
  ------------------
 1886|      8|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1887|  1.08k|        values[i] = (UA_UInt16)value;
 1888|  1.08k|    }
 1889|       |
 1890|    179|    UA_UInt16 daysInMonth = 31;
 1891|    179|    switch(values[1]) {
 1892|     59|    case 2:
  ------------------
  |  Branch (1892:5): [True: 59, False: 120]
  ------------------
 1893|     59|        daysInMonth = (UA_UInt16)
 1894|     59|            (((values[0] % 4 == 0 && values[0] % 100 != 0) ||
  ------------------
  |  Branch (1894:16): [True: 11, False: 48]
  |  Branch (1894:38): [True: 9, False: 2]
  ------------------
 1895|     50|              values[0] % 400 == 0) ? 29 : 28);
  ------------------
  |  Branch (1895:15): [True: 1, False: 49]
  ------------------
 1896|     59|        break;
 1897|     49|    case 4: case 6: case 9: case 11:
  ------------------
  |  Branch (1897:5): [True: 14, False: 165]
  |  Branch (1897:13): [True: 10, False: 169]
  |  Branch (1897:21): [True: 14, False: 165]
  |  Branch (1897:29): [True: 11, False: 168]
  ------------------
 1898|     49|        daysInMonth = 30;
 1899|     49|        break;
 1900|     71|    default:
  ------------------
  |  Branch (1900:5): [True: 71, False: 108]
  ------------------
 1901|     71|        break;
 1902|    179|    }
 1903|    179|    if(values[0] < 1 || values[1] < 1 || values[1] > 12 ||
  ------------------
  |  Branch (1903:8): [True: 1, False: 178]
  |  Branch (1903:25): [True: 1, False: 177]
  |  Branch (1903:42): [True: 3, False: 174]
  ------------------
 1904|    174|       values[2] < 1 || values[2] > daysInMonth || values[3] > 23 ||
  ------------------
  |  Branch (1904:8): [True: 2, False: 172]
  |  Branch (1904:25): [True: 4, False: 168]
  |  Branch (1904:52): [True: 2, False: 166]
  ------------------
 1905|    166|       values[4] > 59 || values[5] > 59)
  ------------------
  |  Branch (1905:8): [True: 2, False: 164]
  |  Branch (1905:26): [True: 1, False: 163]
  ------------------
 1906|     16|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1907|       |
 1908|    163|    size_t pos = 19;
 1909|    163|    UA_UInt32 fraction = 0;
 1910|    163|    size_t fractionDigits = 0;
 1911|    163|    if(pos < tokenSize - 1 &&
  ------------------
  |  Branch (1911:8): [True: 104, False: 59]
  ------------------
 1912|    104|       (tokenData[pos] == '.' || tokenData[pos] == ',')) {
  ------------------
  |  Branch (1912:9): [True: 75, False: 29]
  |  Branch (1912:34): [True: 12, False: 17]
  ------------------
 1913|     87|        pos++;
 1914|  2.04M|        while(pos < tokenSize - 1 && tokenData[pos] >= '0' &&
  ------------------
  |  Branch (1914:15): [True: 2.04M, False: 28]
  |  Branch (1914:38): [True: 2.04M, False: 33]
  ------------------
 1915|  2.04M|              tokenData[pos] <= '9') {
  ------------------
  |  Branch (1915:15): [True: 2.04M, False: 26]
  ------------------
 1916|  2.04M|            if(fractionDigits < 7)
  ------------------
  |  Branch (1916:16): [True: 447, False: 2.04M]
  ------------------
 1917|    447|                fraction = fraction * 10 + (UA_UInt32)(tokenData[pos] - '0');
 1918|  2.04M|            fractionDigits++;
 1919|  2.04M|            pos++;
 1920|  2.04M|        }
 1921|     87|        if(fractionDigits == 0)
  ------------------
  |  Branch (1921:12): [True: 9, False: 78]
  ------------------
 1922|      9|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1923|    177|        while(fractionDigits < 7) {
  ------------------
  |  Branch (1923:15): [True: 99, False: 78]
  ------------------
 1924|     99|            fraction *= 10;
 1925|     99|            fractionDigits++;
 1926|     99|        }
 1927|     78|    }
 1928|    154|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1928:8): [True: 69, False: 85]
  ------------------
 1929|     69|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     69|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1930|       |
 1931|       |    /* The minimum JSON DateTime is the null value. */
 1932|     85|    if(values[0] == 1 && values[1] == 1 && values[2] == 1 &&
  ------------------
  |  Branch (1932:8): [True: 7, False: 78]
  |  Branch (1932:26): [True: 5, False: 2]
  |  Branch (1932:44): [True: 4, False: 1]
  ------------------
 1933|      4|       values[3] == 0 && values[4] == 0 && values[5] == 0 && fraction == 0) {
  ------------------
  |  Branch (1933:8): [True: 3, False: 1]
  |  Branch (1933:26): [True: 2, False: 1]
  |  Branch (1933:44): [True: 0, False: 2]
  |  Branch (1933:62): [True: 0, False: 0]
  ------------------
 1934|      0|        *dst = 0;
 1935|     85|    } else {
 1936|     85|        UA_DateTimeStruct date;
 1937|     85|        memset(&date, 0, sizeof(date));
 1938|     85|        date.year = (UA_Int16)values[0];
 1939|     85|        date.month = values[1];
 1940|     85|        date.day = values[2];
 1941|     85|        date.hour = values[3];
 1942|     85|        date.min = values[4];
 1943|     85|        date.sec = values[5];
 1944|     85|        date.milliSec = (UA_UInt16)(fraction / 10000);
 1945|     85|        date.microSec = (UA_UInt16)((fraction % 10000) / 10);
 1946|     85|        date.nanoSec = (UA_UInt16)((fraction % 10) * 100);
 1947|     85|        *dst = UA_DateTime_fromStruct(date);
 1948|     85|    }
 1949|       |
 1950|     85|    ctx->index++;
 1951|     85|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     85|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1952|    154|}
ua_types_encoding_json.c:Guid_decodeJson:
 1657|     86|DECODE_JSON(Guid) {
 1658|     86|    UA_Guid *dst = (UA_Guid*)p;
 1659|     86|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|     86|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|     86|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 86]
  |  |  ------------------
  |  | 1300|     86|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|     86|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 86]
  |  |  ------------------
  ------------------
 1660|     86|    CHECK_STRING;
  ------------------
  |  | 1313|     86|#define CHECK_STRING do {                                \
  |  | 1314|     86|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1314:8): [True: 7, False: 79]
  |  |  ------------------
  |  | 1315|      7|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1316|     79|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1316:14): [Folded, False: 79]
  |  |  ------------------
  ------------------
 1661|     79|    GET_TOKEN;
  ------------------
  |  | 1294|     79|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|     79|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|     79|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 79]
  |  |  ------------------
  ------------------
 1662|     79|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1663|     79|    ctx->index++;
 1664|     79|    return UA_Guid_parse(dst, str);
 1665|     86|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1762|  5.02k|DECODE_JSON(ByteString) {
 1763|  5.02k|    UA_ByteString *dst = (UA_ByteString*)p;
 1764|  5.02k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  5.02k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  5.02k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 5.02k]
  |  |  ------------------
  |  | 1300|  5.02k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  5.02k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 5.02k]
  |  |  ------------------
  ------------------
 1765|  5.02k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1323|  5.02k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|  5.02k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 5.02k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|  5.02k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 5.02k]
  |  |  ------------------
  ------------------
 1766|  5.02k|    CHECK_STRING;
  ------------------
  |  | 1313|  5.02k|#define CHECK_STRING do {                                \
  |  | 1314|  5.02k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1314:8): [True: 14, False: 5.01k]
  |  |  ------------------
  |  | 1315|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1316|  5.01k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1316:14): [Folded, False: 5.01k]
  |  |  ------------------
  ------------------
 1767|  5.01k|    GET_TOKEN;
  ------------------
  |  | 1294|  5.01k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  5.01k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  5.01k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 5.01k]
  |  |  ------------------
  ------------------
 1768|       |
 1769|       |    /* Empty bytestring? */
 1770|  5.01k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1770:8): [True: 1.48k, False: 3.53k]
  ------------------
 1771|  1.48k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  1.48k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1772|  1.48k|        dst->length = 0;
 1773|  3.53k|    } else {
 1774|  3.53k|        size_t flen = 0;
 1775|  3.53k|        unsigned char* unB64 =
 1776|  3.53k|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1777|  3.53k|        if(unB64 == 0)
  ------------------
  |  Branch (1777:12): [True: 53, False: 3.47k]
  ------------------
 1778|     53|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     53|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1779|  3.47k|        dst->data = (u8*)unB64;
 1780|  3.47k|        dst->length = flen;
 1781|  3.47k|    }
 1782|       |
 1783|  4.96k|    ctx->index++;
 1784|  4.96k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.96k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1785|  5.01k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1843|  9.10k|DECODE_JSON(NodeId) {
 1844|  9.10k|    UA_NodeId *dst = (UA_NodeId*)p;
 1845|  9.10k|    UA_String str;
 1846|  9.10k|    UA_String_init(&str);
 1847|  9.10k|    status res = String_decodeJson(ctx, &str, NULL);
 1848|  9.10k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  9.10k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1848:8): [True: 9.05k, False: 47]
  ------------------
 1849|  9.05k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1850|  9.10k|    UA_String_clear(&str);
 1851|  9.10k|    return res;
 1852|  9.10k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1854|  17.8k|DECODE_JSON(ExpandedNodeId) {
 1855|  17.8k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1856|  17.8k|    UA_String str;
 1857|  17.8k|    UA_String_init(&str);
 1858|  17.8k|    status res = String_decodeJson(ctx, &str, NULL);
 1859|  17.8k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  17.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1859:8): [True: 17.7k, False: 15]
  ------------------
 1860|  17.7k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1861|  17.7k|                                        ctx->serverUrisSize, ctx->serverUris);
 1862|  17.8k|    UA_String_clear(&str);
 1863|  17.8k|    return res;
 1864|  17.8k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1954|     95|DECODE_JSON(StatusCode) {
 1955|     95|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1956|     95|    CHECK_OBJECT;
  ------------------
  |  | 1318|     95|#define CHECK_OBJECT do {                                \
  |  | 1319|     95|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 7, False: 88]
  |  |  ------------------
  |  | 1320|      7|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|     88|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 88]
  |  |  ------------------
  ------------------
 1957|     88|    DecodeEntry entries[2] = {
 1958|     88|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  232|     88|#define UA_TYPES_UINT32 6
  ------------------
 1959|     88|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1960|     88|    };
 1961|     88|    return decodeFields(ctx, entries, 2);
 1962|     95|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1797|  13.0k|DECODE_JSON(QualifiedName) {
 1798|  13.0k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1799|  13.0k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1323|  13.0k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|  13.0k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 13.0k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|  13.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 13.0k]
  |  |  ------------------
  ------------------
 1800|  13.0k|    UA_String str;
 1801|  13.0k|    UA_String_init(&str);
 1802|  13.0k|    status res = String_decodeJson(ctx, &str, NULL);
 1803|  13.0k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  13.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1803:8): [True: 13.0k, False: 7]
  ------------------
 1804|  13.0k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1805|  13.0k|    UA_String_clear(&str);
 1806|  13.0k|    return res;
 1807|  13.0k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1787|    517|DECODE_JSON(LocalizedText) {
 1788|    517|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1789|    517|    CHECK_OBJECT;
  ------------------
  |  | 1318|    517|#define CHECK_OBJECT do {                                \
  |  | 1319|    517|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 6, False: 511]
  |  |  ------------------
  |  | 1320|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|    511|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 511]
  |  |  ------------------
  ------------------
 1790|    511|    DecodeEntry entries[2] = {
 1791|    511|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|    511|#define UA_TYPES_STRING 11
  ------------------
 1792|    511|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  402|    511|#define UA_TYPES_STRING 11
  ------------------
 1793|    511|    };
 1794|    511|    return decodeFields(ctx, entries, 2);
 1795|    517|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2318|  5.73k|DECODE_JSON(ExtensionObject) {
 2319|  5.73k|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2320|  5.73k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1323|  5.73k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|  5.73k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 5.73k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|  5.73k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 5.73k]
  |  |  ------------------
  ------------------
 2321|  5.73k|    CHECK_OBJECT;
  ------------------
  |  | 1318|  5.73k|#define CHECK_OBJECT do {                                \
  |  | 1319|  5.73k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 18, False: 5.71k]
  |  |  ------------------
  |  | 1320|     18|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|  5.71k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 5.71k]
  |  |  ------------------
  ------------------
 2322|       |
 2323|       |    /* Empty object -> Null ExtensionObject */
 2324|  5.71k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2324:8): [True: 350, False: 5.36k]
  ------------------
 2325|    350|        ctx->index++; /* Skip the empty ExtensionObject */
 2326|    350|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    350|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2327|    350|    }
 2328|       |
 2329|       |    /* Scan the object once for metadata and duplicate keys. */
 2330|  5.36k|    size_t beginIndex = ctx->index;
 2331|  5.36k|    JsonFieldIndex fields[3] = {
 2332|  5.36k|        {UA_JSONKEY_TYPEID, SIZE_MAX},
 2333|  5.36k|        {UA_JSONKEY_ENCODING, SIZE_MAX},
 2334|  5.36k|        {UA_JSONKEY_BODY, SIZE_MAX}
 2335|  5.36k|    };
 2336|  5.36k|    status ret = scanObjectFields(ctx, fields, 3);
 2337|  5.36k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.36k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2337:8): [True: 30, False: 5.33k]
  ------------------
 2338|     30|        return ret;
 2339|       |
 2340|       |    /* Decode the optional non-JSON encoding. */
 2341|  5.33k|    UA_UInt64 encoding = 0;
 2342|  5.33k|    size_t encIndex = fields[1].valueIndex;
 2343|  5.33k|    if(encIndex != SIZE_MAX) {
  ------------------
  |  Branch (2343:8): [True: 245, False: 5.09k]
  ------------------
 2344|    245|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2345|    245|        size_t len = parseUInt64(extObjEncoding,
 2346|    245|                                 getTokenLength(&ctx->tokens[encIndex]),
 2347|    245|                                 &encoding);
 2348|    245|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2348:12): [True: 4, False: 241]
  |  Branch (2348:24): [True: 105, False: 136]
  ------------------
 2349|    109|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    109|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2350|    245|    }
 2351|       |
 2352|       |    /* Decode the type NodeId. */
 2353|  5.23k|    size_t typeIdIndex = fields[0].valueIndex;
 2354|  5.23k|    if(typeIdIndex == SIZE_MAX)
  ------------------
  |  Branch (2354:8): [True: 190, False: 5.04k]
  ------------------
 2355|    190|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    190|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2356|       |
 2357|  5.04k|    UA_NodeId typeId;
 2358|  5.04k|    UA_NodeId_init(&typeId);
 2359|  5.04k|    ParseCtx decodeCtx = *ctx;
 2360|  5.04k|    decodeCtx.index = typeIdIndex;
 2361|  5.04k|    ret = NodeId_decodeJson(&decodeCtx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|  5.04k|#define UA_TYPES_NODEID 16
  ------------------
 2362|  5.04k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  5.04k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2362:8): [True: 118, False: 4.92k]
  ------------------
 2363|    118|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2364|    118|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    118|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2365|    118|    }
 2366|       |
 2367|  4.92k|    size_t bodyIndex = fields[2].valueIndex;
 2368|       |
 2369|       |    /* Binary and XML bodies stay encoded even if the datatype is known. */
 2370|  4.92k|    if(encoding != 0) {
  ------------------
  |  Branch (2370:8): [True: 5, False: 4.91k]
  ------------------
 2371|      5|        dst->encoding = (encoding == 1) ?
  ------------------
  |  Branch (2371:25): [True: 1, False: 4]
  ------------------
 2372|      1|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2373|      5|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2374|      5|        dst->content.encoded.typeId = typeId;
 2375|      5|        if(bodyIndex == SIZE_MAX)
  ------------------
  |  Branch (2375:12): [True: 2, False: 3]
  ------------------
 2376|      2|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2377|      3|        decodeCtx.index = bodyIndex;
 2378|      3|        return ByteString_decodeJson(&decodeCtx,
 2379|      3|                                     &dst->content.encoded.body, NULL);
 2380|      5|    }
 2381|       |
 2382|       |    /* Lookup the JSON datatype. */
 2383|  4.91k|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2384|  4.91k|    if(!type) {
  ------------------
  |  Branch (2384:8): [True: 2.04k, False: 2.87k]
  ------------------
 2385|  2.04k|        dst->encoding = UA_EXTENSIONOBJECT_ENCODED_JSON;
 2386|  2.04k|        dst->content.encoded.typeId = typeId;
 2387|  2.04k|        decodeCtx.index = beginIndex;
 2388|  2.04k|        return tokenToByteString(&decodeCtx, &dst->content.encoded.body);
 2389|  2.04k|    }
 2390|       |
 2391|       |    /* No need to keep the TypeId */
 2392|  2.87k|    UA_NodeId_clear(&typeId);
 2393|       |
 2394|       |    /* Disallow directly nested ExtensionObjects */
 2395|  2.87k|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|  2.87k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2395:8): [True: 1, False: 2.87k]
  ------------------
 2396|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2397|       |
 2398|       |    /* Allocate memory for the decoded data */
 2399|  2.87k|    dst->content.decoded.data = UA_new(type);
 2400|  2.87k|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2400:8): [True: 1, False: 2.87k]
  ------------------
 2401|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2402|  2.87k|    dst->content.decoded.type = type;
 2403|  2.87k|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2404|       |
 2405|  2.87k|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2406|  2.87k|    if(bodyIndex != SIZE_MAX) {
  ------------------
  |  Branch (2406:8): [True: 1.09k, False: 1.77k]
  ------------------
 2407|  1.09k|        decodeCtx.index = bodyIndex;
 2408|  1.09k|        return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2409|  1.09k|    }
 2410|       |
 2411|       |    /* Only JSON structures without an explicit encoding can be in-situ. */
 2412|  1.77k|    if(encoding != 0)
  ------------------
  |  Branch (2412:8): [True: 0, False: 1.77k]
  ------------------
 2413|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2414|       |
 2415|  1.77k|    decodeCtx.index = beginIndex;
 2416|  1.77k|    if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2416:8): [True: 1.72k, False: 49]
  ------------------
 2417|     49|       type->typeKind == UA_DATATYPEKIND_OPTSTRUCT)
  ------------------
  |  Branch (2417:8): [True: 0, False: 49]
  ------------------
 2418|  1.72k|        return decodeJsonStructureExtensionObject(
 2419|  1.72k|            &decodeCtx, dst->content.decoded.data, type);
 2420|     49|    if(type->typeKind == UA_DATATYPEKIND_UNION)
  ------------------
  |  Branch (2420:8): [True: 0, False: 49]
  ------------------
 2421|      0|        return decodeJsonUnionExtensionObject(
 2422|      0|            &decodeCtx, dst->content.decoded.data, type);
 2423|     49|    return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2424|     49|}
ua_types_encoding_json.c:scanObjectFields:
 1387|  5.36k|scanObjectFields(ParseCtx *ctx, JsonFieldIndex *fields, size_t fieldsSize) {
 1388|  5.36k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  248|  5.36k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1388:5): [True: 5.36k, False: 0]
  ------------------
 1389|  5.36k|    size_t keyCount = (size_t)ctx->tokens[ctx->index].size / 2;
 1390|  5.36k|    if(keyCount > UA_JSON_MAX_EXTENSIONOBJECT_FIELDS)
  ------------------
  |  | 1382|  5.36k|#define UA_JSON_MAX_EXTENSIONOBJECT_FIELDS (UA_DATATYPE_MEMBERS_MAX + 3)
  |  |  ------------------
  |  |  |  | 1037|  5.36k|#define UA_DATATYPE_MEMBERS_MAX 511
  |  |  ------------------
  ------------------
  |  Branch (1390:8): [True: 3, False: 5.36k]
  ------------------
 1391|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1392|       |
 1393|  5.36k|    size_t keys[UA_JSON_MAX_EXTENSIONOBJECT_FIELDS];
 1394|  5.36k|    ctx->index++;
 1395|       |
 1396|  16.6k|    for(size_t i = 0; i < keyCount; i++) {
  ------------------
  |  Branch (1396:23): [True: 11.2k, False: 5.33k]
  ------------------
 1397|  11.2k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  248|  11.2k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1397:9): [True: 11.2k, False: 0]
  ------------------
 1398|  11.2k|        const cj5_token *key = &ctx->tokens[ctx->index];
 1399|  11.2k|        size_t keyLength = getTokenLength(key);
 1400|       |
 1401|       |        /* Duplicate names are invalid, including unknown in-situ Structure
 1402|       |         * fields of an ExtensionObject. */
 1403|  35.0k|        for(size_t j = 0; j < i; j++) {
  ------------------
  |  Branch (1403:27): [True: 23.7k, False: 11.2k]
  ------------------
 1404|  23.7k|            const cj5_token *previous = &ctx->tokens[keys[j]];
 1405|  23.7k|            if(keyLength == getTokenLength(previous) &&
  ------------------
  |  Branch (1405:16): [True: 1.44k, False: 22.3k]
  ------------------
 1406|  1.44k|               memcmp(&ctx->json5[key->start], &ctx->json5[previous->start],
  ------------------
  |  Branch (1406:16): [True: 27, False: 1.42k]
  ------------------
 1407|  1.44k|                      keyLength) == 0)
 1408|     27|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     27|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1409|  23.7k|        }
 1410|  11.2k|        keys[i] = ctx->index;
 1411|       |
 1412|       |        /* Record the value position of interesting fields. */
 1413|  11.2k|        ctx->index++;
 1414|  11.2k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  248|  11.2k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1414:9): [True: 11.2k, False: 0]
  ------------------
 1415|  28.2k|        for(size_t j = 0; j < fieldsSize; j++) {
  ------------------
  |  Branch (1415:27): [True: 23.4k, False: 4.83k]
  ------------------
 1416|  23.4k|            if(jsoneq(ctx->json5, key, fields[j].fieldName) == 0) {
  ------------------
  |  Branch (1416:16): [True: 6.42k, False: 17.0k]
  ------------------
 1417|  6.42k|                fields[j].valueIndex = ctx->index;
 1418|  6.42k|                break;
 1419|  6.42k|            }
 1420|  23.4k|        }
 1421|       |
 1422|  11.2k|        skipObject(ctx);
 1423|  11.2k|    }
 1424|  5.33k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1425|  5.36k|}
ua_types_encoding_json.c:tokenToByteString:
 2308|  2.04k|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 2309|  2.04k|    GET_TOKEN;
  ------------------
  |  | 1294|  2.04k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  2.04k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  2.04k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 2.04k]
  |  |  ------------------
  ------------------
 2310|  2.04k|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 2311|  2.04k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  2.04k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2311:8): [True: 1, False: 2.04k]
  ------------------
 2312|      1|        return res;
 2313|  2.04k|    memcpy(p->data, tokenData, tokenSize);
 2314|  2.04k|    skipObject(ctx);
 2315|  2.04k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.04k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2316|  2.04k|}
ua_types_encoding_json.c:decodeJsonStructureExtensionObject:
 2818|  1.73k|                                   const UA_DataType *type) {
 2819|       |    return decodeJsonStructureInternal(ctx, dst, type, true);
 2820|  1.73k|}
ua_types_encoding_json.c:decodeJsonStructureInternal:
 2724|  1.74k|                            UA_Boolean extensionObject) {
 2725|  1.74k|    uintptr_t ptr = (uintptr_t)dst;
 2726|  1.74k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.74k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2727|  1.74k|    const UA_Boolean optional = (type->typeKind == UA_DATATYPEKIND_OPTSTRUCT);
 2728|  1.74k|    size_t offset = (extensionObject ? 1 : 0) + (optional ? 1 : 0);
  ------------------
  |  Branch (2728:22): [True: 1.73k, False: 6]
  |  Branch (2728:50): [True: 0, False: 1.74k]
  ------------------
 2729|  1.74k|    size_t membersSize = type->membersSize + offset;
 2730|  1.74k|    UA_STACKARRAY(DecodeEntry, entries, membersSize);
  ------------------
  |  |  225|  1.74k|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 2731|  1.74k|    memset(entries, 0, sizeof(DecodeEntry) * membersSize);
 2732|  1.74k|    size_t entryIndex = 0;
 2733|  1.74k|    if(extensionObject) {
  ------------------
  |  Branch (2733:8): [True: 1.73k, False: 6]
  ------------------
 2734|  1.73k|        entries[entryIndex++] =
 2735|  1.73k|            (DecodeEntry){UA_JSONKEY_TYPEID, NULL, NULL, false, NULL};
 2736|  1.73k|    }
 2737|  1.74k|    UA_UInt32 encodingMask = 0;
 2738|  1.74k|    size_t encodingMaskIndex = SIZE_MAX;
 2739|  1.74k|    if(optional) {
  ------------------
  |  Branch (2739:8): [True: 0, False: 1.74k]
  ------------------
 2740|      0|        encodingMaskIndex = entryIndex;
 2741|      0|        entries[entryIndex++] =
 2742|      0|            (DecodeEntry){UA_JSONKEY_ENCODINGMASK, &encodingMask, NULL, false,
 2743|      0|                          &UA_TYPES[UA_TYPES_UINT32]};
  ------------------
  |  |  232|      0|#define UA_TYPES_UINT32 6
  ------------------
 2744|      0|    }
 2745|  14.5k|    for(size_t i = 0; i < type->membersSize; ++i, ++entryIndex) {
  ------------------
  |  Branch (2745:23): [True: 12.7k, False: 1.74k]
  ------------------
 2746|  12.7k|        const UA_DataTypeMember *m = &type->members[i];
 2747|  12.7k|        const UA_DataType *mt = m->memberType;
 2748|  12.7k|        entries[entryIndex].type = mt;
 2749|  12.7k|        entries[entryIndex].fieldName = m->memberName;
 2750|  12.7k|        if(!m->isArray) {
  ------------------
  |  Branch (2750:12): [True: 10.4k, False: 2.36k]
  ------------------
 2751|  10.4k|            ptr += m->padding;
 2752|  10.4k|            entries[entryIndex].fieldPointer = (void*)ptr;
 2753|  10.4k|            if(m->isOptional)
  ------------------
  |  Branch (2753:16): [True: 0, False: 10.4k]
  ------------------
 2754|      0|                entries[entryIndex].function = OptionalScalar_decodeJson;
 2755|  10.4k|            ptr += m->isOptional ? sizeof(void*) : mt->memSize;
  ------------------
  |  Branch (2755:20): [True: 0, False: 10.4k]
  ------------------
 2756|  10.4k|        } else {
 2757|  2.36k|            ptr += m->padding;
 2758|  2.36k|            ptr += sizeof(size_t);
 2759|  2.36k|            entries[entryIndex].fieldPointer = (void*)ptr;
 2760|  2.36k|            entries[entryIndex].function = m->isOptional ?
  ------------------
  |  Branch (2760:44): [True: 0, False: 2.36k]
  ------------------
 2761|  2.36k|                OptionalArray_decodeJson : Array_decodeJson;
 2762|  2.36k|            ptr += sizeof(void*);
 2763|  2.36k|        }
 2764|  12.7k|    }
 2765|       |
 2766|  1.74k|    ret = decodeFields(ctx, entries, membersSize);
 2767|       |
 2768|       |    /* Compact JSON uses EncodingMask. Materialize optional fields whose bit is
 2769|       |     * set even when their default value was omitted from the object. */
 2770|  1.74k|    if(ret == UA_STATUSCODE_GOOD && optional &&
  ------------------
  |  |   17|  3.48k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2770:8): [True: 1.72k, False: 14]
  |  Branch (2770:37): [True: 0, False: 1.72k]
  ------------------
 2771|      0|       entries[encodingMaskIndex].found) {
  ------------------
  |  Branch (2771:8): [True: 0, False: 0]
  ------------------
 2772|      0|        size_t optionalIndex = 0;
 2773|      0|        entryIndex = offset;
 2774|      0|        for(size_t i = 0; i < type->membersSize; i++, entryIndex++) {
  ------------------
  |  Branch (2774:27): [True: 0, False: 0]
  ------------------
 2775|      0|            const UA_DataTypeMember *m = &type->members[i];
 2776|      0|            if(!m->isOptional)
  ------------------
  |  Branch (2776:16): [True: 0, False: 0]
  ------------------
 2777|      0|                continue;
 2778|      0|            if(optionalIndex >= 32) {
  ------------------
  |  Branch (2778:16): [True: 0, False: 0]
  ------------------
 2779|      0|                ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2780|      0|                break;
 2781|      0|            }
 2782|      0|            UA_Boolean inMask =
 2783|      0|                (encodingMask & ((UA_UInt32)1 << optionalIndex)) != 0;
 2784|      0|            if(entries[entryIndex].found != inMask) {
  ------------------
  |  Branch (2784:16): [True: 0, False: 0]
  ------------------
 2785|      0|                if(entries[entryIndex].found) {
  ------------------
  |  Branch (2785:20): [True: 0, False: 0]
  ------------------
 2786|      0|                    ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2787|      0|                    break;
 2788|      0|                }
 2789|      0|                if(m->isArray) {
  ------------------
  |  Branch (2789:20): [True: 0, False: 0]
  ------------------
 2790|      0|                    *(void**)entries[entryIndex].fieldPointer =
 2791|      0|                        UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2792|      0|                } else {
 2793|      0|                    void *value = UA_calloc(1, m->memberType->memSize);
  ------------------
  |  |   24|      0|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2794|      0|                    if(!value) {
  ------------------
  |  Branch (2794:24): [True: 0, False: 0]
  ------------------
 2795|      0|                        ret = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2796|      0|                        break;
 2797|      0|                    }
 2798|      0|                    *(void**)entries[entryIndex].fieldPointer = value;
 2799|      0|                }
 2800|      0|            }
 2801|      0|            optionalIndex++;
 2802|      0|        }
 2803|      0|        if(optionalIndex < 32 &&
  ------------------
  |  Branch (2803:12): [True: 0, False: 0]
  ------------------
 2804|      0|           (encodingMask >> optionalIndex) != 0)
  ------------------
  |  Branch (2804:12): [True: 0, False: 0]
  ------------------
 2805|      0|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2806|      0|    }
 2807|       |
 2808|  1.74k|    return ret;
 2809|  1.74k|}
ua_types_encoding_json.c:Array_decodeJson:
 2631|    921|Array_decodeJson(ParseCtx *ctx, void *dst_, const UA_DataType *type) {
 2632|    921|    void **dst = (void**)dst_;
 2633|       |
 2634|       |    /* Save the length of the array */
 2635|    921|    size_t *size_ptr = (size_t*) dst - 1;
 2636|       |
 2637|       |    /* A null JSON array represents a null OPC UA array. */
 2638|    921|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2638:8): [True: 1, False: 920]
  ------------------
 2639|      1|        *size_ptr = 0;
 2640|      1|        *dst = NULL;
 2641|      1|        ctx->index++;
 2642|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2643|      1|    }
 2644|       |
 2645|    920|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2645:8): [True: 10, False: 910]
  ------------------
 2646|     10|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2647|       |
 2648|    910|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2649|       |
 2650|    910|    ctx->index++; /* Go to first array member or to the first element after
 2651|       |                   * the array (if empty) */
 2652|       |
 2653|       |    /* Return early for empty arrays */
 2654|    910|    if(length == 0) {
  ------------------
  |  Branch (2654:8): [True: 142, False: 768]
  ------------------
 2655|    142|        *size_ptr = length;
 2656|    142|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|    142|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2657|    142|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    142|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2658|    142|    }
 2659|       |
 2660|       |    /* Allocate memory */
 2661|    768|    if(length > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2661:8): [True: 0, False: 768]
  ------------------
 2662|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2663|    768|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   24|    768|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2664|    768|    if(*dst == NULL)
  ------------------
  |  Branch (2664:8): [True: 12, False: 756]
  ------------------
 2665|     12|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     12|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2666|       |
 2667|       |    /* Decode array members */
 2668|    756|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2669|    756|    uintptr_t ptr = (uintptr_t)*dst;
 2670|  1.30M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2670:23): [True: 1.30M, False: 395]
  ------------------
 2671|  1.30M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2671:12): [True: 78, False: 1.30M]
  ------------------
 2672|     78|            if(!isJsonNullable(type)) {
  ------------------
  |  Branch (2672:16): [True: 5, False: 73]
  ------------------
 2673|      5|                UA_Array_delete(*dst, i, type);
 2674|      5|                *dst = NULL;
 2675|      5|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2676|      5|            }
 2677|     73|            ptr += type->memSize;
 2678|     73|            ctx->index++;
 2679|     73|            continue;
 2680|     78|        }
 2681|       |
 2682|  1.30M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2683|  1.30M|        ptr += type->memSize;
 2684|  1.30M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  1.30M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2684:12): [True: 356, False: 1.30M]
  ------------------
 2685|    356|            UA_Array_delete(*dst, i+1, type);
 2686|    356|            *dst = NULL;
 2687|    356|            return ret;
 2688|    356|        }
 2689|  1.30M|    }
 2690|       |
 2691|    395|    *size_ptr = length; /* All good, set the size */
 2692|    395|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    395|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2693|    756|}
ua_types_encoding_json.c:DataValue_decodeJson:
 2268|  80.9k|DECODE_JSON(DataValue) {
 2269|  80.9k|    UA_DataValue *dst = (UA_DataValue*)p;
 2270|  80.9k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1323|  80.9k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|  80.9k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 2.42k, False: 78.5k]
  |  |  ------------------
  |  | 1325|  2.42k|        ctx->index++;                                \
  |  | 1326|  2.42k|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|  2.42k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|  78.5k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 78.5k]
  |  |  ------------------
  ------------------
 2271|  78.5k|    CHECK_OBJECT;
  ------------------
  |  | 1318|  78.5k|#define CHECK_OBJECT do {                                \
  |  | 1319|  78.5k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 154, False: 78.3k]
  |  |  ------------------
  |  | 1320|    154|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|    154|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|  78.3k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 78.3k]
  |  |  ------------------
  ------------------
 2272|       |
 2273|       |    /* Decode the Variant in-situ */
 2274|  78.3k|    size_t beginIndex = ctx->index;
 2275|  78.3k|    status ret = decodeJSONVariant(ctx, &dst->value, true);
 2276|  78.3k|    ctx->index = beginIndex;
 2277|  78.3k|    dst->hasValue = (dst->value.type != NULL);
 2278|  78.3k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  78.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2278:8): [True: 2.64k, False: 75.7k]
  ------------------
 2279|  2.64k|        return ret;
 2280|       |
 2281|       |    /* Decode the other members (skip the Variant members) */
 2282|  75.7k|    DecodeEntry entries[8] = {
 2283|  75.7k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 2284|  75.7k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 2285|  75.7k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 2286|  75.7k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|  75.7k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2287|  75.7k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 2288|  75.7k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|  75.7k|#define UA_TYPES_DATETIME 12
  ------------------
 2289|  75.7k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 2290|  75.7k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  164|  75.7k|#define UA_TYPES_UINT16 4
  ------------------
 2291|  75.7k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 2292|  75.7k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|  75.7k|#define UA_TYPES_DATETIME 12
  ------------------
 2293|  75.7k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 2294|  75.7k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  164|  75.7k|#define UA_TYPES_UINT16 4
  ------------------
 2295|  75.7k|    };
 2296|       |
 2297|  75.7k|    ret = decodeFields(ctx, entries, 8);
 2298|  75.7k|    dst->hasStatus = entries[3].found;
 2299|  75.7k|    dst->hasSourceTimestamp = entries[4].found;
 2300|  75.7k|    dst->hasSourcePicoseconds = entries[5].found;
 2301|  75.7k|    dst->hasServerTimestamp = entries[6].found;
 2302|  75.7k|    dst->hasServerPicoseconds = entries[7].found;
 2303|  75.7k|    return ret;
 2304|  78.3k|}
ua_types_encoding_json.c:decodeJSONVariant:
 2125|  78.5k|                  UA_Boolean insideDataValue) {
 2126|       |    /* Empty variant == null */
 2127|  78.5k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2127:8): [True: 6.50k, False: 72.0k]
  ------------------
 2128|  6.50k|        ctx->index++;
 2129|  6.50k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.50k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2130|  6.50k|    }
 2131|       |
 2132|       |    /* Search the value field */
 2133|  72.0k|    size_t valueIndex = 0;
 2134|  72.0k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 2135|       |
 2136|       |    /* Search for the dimensions field */
 2137|  72.0k|    size_t dimIndex = 0;
 2138|  72.0k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 2139|       |
 2140|       |    /* Parse the type kind */
 2141|  72.0k|    size_t typeIndex = 0;
 2142|  72.0k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 2143|  72.0k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (2143:8): [True: 103, False: 71.9k]
  |  Branch (2143:26): [True: 6, False: 71.9k]
  ------------------
 2144|    109|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    109|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2145|  71.9k|    UA_UInt64 typeKind = 0;
 2146|  71.9k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 2147|  71.9k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 2148|  71.9k|    if(len == 0)
  ------------------
  |  Branch (2148:8): [True: 8, False: 71.9k]
  ------------------
 2149|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2150|       |
 2151|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 2152|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 2153|  71.9k|    typeKind--;
 2154|  71.9k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2154:8): [True: 111, False: 71.8k]
  ------------------
 2155|    111|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    111|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2156|  71.8k|    const UA_DataType *type = &UA_TYPES[typeKind];
 2157|       |
 2158|       |    /* These combinations are excluded by the Variant definition. */
 2159|  71.8k|    if(type->typeKind == UA_DATATYPEKIND_DIAGNOSTICINFO ||
  ------------------
  |  Branch (2159:8): [True: 1, False: 71.8k]
  ------------------
 2160|  71.8k|       (insideDataValue && type->typeKind == UA_DATATYPEKIND_DATAVALUE))
  ------------------
  |  Branch (2160:9): [True: 71.7k, False: 40]
  |  Branch (2160:28): [True: 1, False: 71.7k]
  ------------------
 2161|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2162|       |
 2163|       |    /* Value is an array? */
 2164|  71.8k|    UA_Boolean isArray =
 2165|  71.8k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (2165:10): [True: 68.0k, False: 3.74k]
  |  Branch (2165:28): [True: 819, False: 67.2k]
  ------------------
 2166|  71.8k|    if(type->typeKind == UA_DATATYPEKIND_VARIANT && !isArray)
  ------------------
  |  Branch (2166:8): [True: 51, False: 71.7k]
  |  Branch (2166:53): [True: 1, False: 50]
  ------------------
 2167|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2168|       |
 2169|       |    /* Adjust the depth and set the value index as current */
 2170|  71.8k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |  128|  71.8k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2170:8): [True: 0, False: 71.8k]
  ------------------
 2171|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2172|  71.8k|    size_t beginIndex = ctx->index;
 2173|  71.8k|    ctx->index = valueIndex;
 2174|  71.8k|    ctx->depth++;
 2175|       |
 2176|       |    /* Decode the value */
 2177|  71.8k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  71.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2178|  71.8k|    if(!isArray) {
  ------------------
  |  Branch (2178:8): [True: 70.9k, False: 819]
  ------------------
 2179|       |        /* Scalar with dimensions -> error */
 2180|  70.9k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2180:12): [True: 16, False: 70.9k]
  ------------------
 2181|     16|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2182|     16|            goto out;
 2183|     16|        }
 2184|       |
 2185|       |        /* Missing values are only valid for nullable types. */
 2186|  70.9k|        if(valueIndex == 0 && !isJsonNullable(type)) {
  ------------------
  |  Branch (2186:12): [True: 3.72k, False: 67.2k]
  |  Branch (2186:31): [True: 22, False: 3.70k]
  ------------------
 2187|     22|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     22|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2188|     22|            goto out;
 2189|     22|        }
 2190|       |
 2191|       |        /* JSON null is only valid for nullable types. */
 2192|  70.9k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_NULL &&
  ------------------
  |  Branch (2192:12): [True: 67.2k, False: 3.70k]
  |  Branch (2192:30): [True: 691, False: 66.5k]
  ------------------
 2193|    691|           !isJsonNullable(type)) {
  ------------------
  |  Branch (2193:12): [True: 1, False: 690]
  ------------------
 2194|      1|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2195|      1|            goto out;
 2196|      1|        }
 2197|       |
 2198|       |        /* Decode a value wrapped in an ExtensionObject */
 2199|  70.9k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (2199:12): [True: 67.2k, False: 3.70k]
  |  Branch (2199:30): [True: 5.71k, False: 61.5k]
  ------------------
 2200|  5.71k|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 2201|  5.71k|            goto out;
 2202|  5.71k|        }
 2203|       |
 2204|       |        /* Allocate memory for the value */
 2205|  65.2k|        dst->data = UA_new(type);
 2206|  65.2k|        if(!dst->data) {
  ------------------
  |  Branch (2206:12): [True: 3, False: 65.2k]
  ------------------
 2207|      3|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      3|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2208|      3|            goto out;
 2209|      3|        }
 2210|  65.2k|        dst->type = type;
 2211|       |
 2212|       |        /* Decode the value */
 2213|  65.2k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (2213:12): [True: 61.5k, False: 3.70k]
  |  Branch (2213:30): [True: 61.1k, False: 367]
  ------------------
 2214|  61.1k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 2215|  65.2k|    } else {
 2216|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 2217|       |         * members must all have the same type. */
 2218|    819|        const UA_DataType *unwrapType = NULL;
 2219|    819|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|    819|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2219:12): [True: 261, False: 558]
  ------------------
 2220|    261|            unwrapType = getArrayUnwrapType(ctx);
 2221|    819|        if(unwrapType) {
  ------------------
  |  Branch (2221:12): [True: 47, False: 772]
  ------------------
 2222|     47|            dst->type = unwrapType;
 2223|     47|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 2224|    772|        } else {
 2225|    772|            dst->type = type;
 2226|    772|            res = Array_decodeJson(ctx, &dst->data, type);
 2227|    772|        }
 2228|       |
 2229|       |        /* Decode array dimensions */
 2230|    819|        if(dimIndex > 0) {
  ------------------
  |  Branch (2230:12): [True: 149, False: 670]
  ------------------
 2231|    149|            ctx->index = dimIndex;
 2232|    149|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 2233|    149|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|    149|#define UA_TYPES_UINT32 6
  ------------------
 2234|       |
 2235|       |            /* Help clang-analyzer */
 2236|    149|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  248|    149|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2236:13): [True: 31, False: 118]
  |  Branch (2236:13): [True: 118, False: 0]
  ------------------
 2237|       |
 2238|       |            /* Validate the dimensions */
 2239|    149|            if(res == UA_STATUSCODE_GOOD &&
  ------------------
  |  |   17|    298|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2239:16): [True: 118, False: 31]
  ------------------
 2240|    118|               !variantDimensionsValid(dst->arrayLength,
  ------------------
  |  Branch (2240:16): [True: 117, False: 1]
  ------------------
 2241|    118|                                       dst->arrayDimensionsSize,
 2242|    118|                                       dst->arrayDimensions))
 2243|    117|                res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    117|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2244|       |
 2245|       |            /* Only keep >= 2 dimensions */
 2246|    149|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (2246:16): [True: 20, False: 129]
  ------------------
 2247|     20|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   23|     20|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2248|     20|                dst->arrayDimensions = NULL;
 2249|     20|                dst->arrayDimensionsSize = 0;
 2250|     20|            }
 2251|    149|        }
 2252|    819|    }
 2253|       |
 2254|  71.8k| out:
 2255|  71.8k|    ctx->index = beginIndex;
 2256|  71.8k|    skipObject(ctx);
 2257|  71.8k|    ctx->depth--;
 2258|  71.8k|    return res;
 2259|  71.8k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2428|  5.71k|                                        const UA_DataType *type) {
 2429|  5.71k|    (void) type;
 2430|  5.71k|    UA_Variant *dst = (UA_Variant*)p;
 2431|       |
 2432|       |    /* ExtensionObject with null body */
 2433|  5.71k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2433:8): [True: 323, False: 5.39k]
  ------------------
 2434|    323|        dst->data = UA_ExtensionObject_new();
 2435|    323|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|    323|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2436|    323|        ctx->index++;
 2437|    323|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    323|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2438|    323|    }
 2439|       |
 2440|       |    /* Decode the ExtensionObject */
 2441|  5.39k|    UA_ExtensionObject eo;
 2442|  5.39k|    UA_ExtensionObject_init(&eo);
 2443|  5.39k|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2444|  5.39k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  5.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2444:8): [True: 551, False: 4.84k]
  ------------------
 2445|    551|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2446|    551|        return ret;
 2447|    551|    }
 2448|       |
 2449|       |    /* The content is still encoded, cannot unwrap */
 2450|  4.84k|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2450:8): [True: 2.22k, False: 2.61k]
  ------------------
 2451|  2.22k|        goto use_eo;
 2452|       |
 2453|       |    /* The content is a builtin type that could have been directly encoded in
 2454|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2455|       |     * means for us, that somebody made an extra effort to explicitly get an
 2456|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2457|       |     * the same JSON again when encoding again. */
 2458|  2.61k|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2458:8): [True: 288, False: 2.33k]
  ------------------
 2459|    288|        goto use_eo;
 2460|       |
 2461|       |    /* Unwrap the ExtensionObject */
 2462|  2.33k|    dst->data = eo.content.decoded.data;
 2463|  2.33k|    dst->type = eo.content.decoded.type;
 2464|  2.33k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2465|       |
 2466|  2.51k| use_eo:
 2467|       |    /* Don't unwrap */
 2468|  2.51k|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  742|  2.51k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2469|  2.51k|    if(!dst->data) {
  ------------------
  |  Branch (2469:8): [True: 1, False: 2.51k]
  ------------------
 2470|      1|        UA_ExtensionObject_clear(&eo);
 2471|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2472|      1|    }
 2473|  2.51k|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|  2.51k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2474|  2.51k|    *(UA_ExtensionObject*)dst->data = eo;
 2475|  2.51k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.51k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2476|  2.51k|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1999|    261|getArrayUnwrapType(ParseCtx *ctx) {
 2000|    261|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  248|    261|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2000:5): [True: 261, False: 0]
  ------------------
 2001|       |
 2002|       |    /* Return early for empty arrays */
 2003|    261|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2004|    261|    if(length == 0)
  ------------------
  |  Branch (2004:8): [True: 4, False: 257]
  ------------------
 2005|      4|        return NULL;
 2006|       |
 2007|       |    /* Save the original index and go to the first array member */
 2008|    257|    size_t oldIndex = ctx->index;
 2009|    257|    ctx->index++;
 2010|       |
 2011|       |    /* Lookup the type for the first array member */
 2012|    257|    UA_NodeId typeId;
 2013|    257|    UA_NodeId_init(&typeId);
 2014|    257|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 2015|    257|    if(!typeOfBody) {
  ------------------
  |  Branch (2015:8): [True: 182, False: 75]
  ------------------
 2016|    182|        ctx->index = oldIndex; /* Restore the index */
 2017|    182|        return NULL;
 2018|    182|    }
 2019|       |
 2020|       |    /* Get the TypeId encoding for faster comparison below.
 2021|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 2022|     75|    size_t typeIdIndex = 0;
 2023|     75|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2024|     75|    (void)ret;
 2025|     75|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  248|     75|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2025:5): [True: 75, False: 0]
  ------------------
 2026|     75|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 2027|     75|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 2028|       |
 2029|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 2030|       |     * the first member. We still haven't checked the encoding type. */
 2031|    155|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2031:23): [True: 108, False: 47]
  ------------------
 2032|       |        /* Array element must be an object */
 2033|    108|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (2033:12): [True: 1, False: 107]
  ------------------
 2034|      1|            ctx->index = oldIndex; /* Restore the index */
 2035|      1|            return NULL;
 2036|      1|        }
 2037|       |
 2038|       |        /* Check for non-JSON encoding */
 2039|    107|        size_t encIndex = 0;
 2040|    107|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2041|    107|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    107|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2041:12): [True: 2, False: 105]
  ------------------
 2042|      2|            ctx->index = oldIndex; /* Restore the index */
 2043|      2|            return NULL;
 2044|      2|        }
 2045|       |
 2046|       |        /* Get the type NodeId index */
 2047|    105|        size_t memberTypeIdIndex = 0;
 2048|    105|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 2049|    105|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    105|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2049:12): [True: 5, False: 100]
  ------------------
 2050|      5|            ctx->index = oldIndex; /* Restore the index */
 2051|      5|            return NULL;
 2052|      5|        }
 2053|       |
 2054|       |        /* Is it the same type? Compare raw NodeId string */
 2055|    100|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 2056|    100|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 2057|    100|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (2057:12): [True: 3, False: 97]
  ------------------
 2058|     97|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (2058:12): [True: 17, False: 80]
  ------------------
 2059|     20|            ctx->index = oldIndex; /* Restore the index */
 2060|     20|            return NULL;
 2061|     20|        }
 2062|       |
 2063|       |        /* Skip to the next array member */
 2064|     80|        skipObject(ctx);
 2065|     80|    }
 2066|       |
 2067|     47|    ctx->index = oldIndex; /* Restore the index */
 2068|     47|    return typeOfBody;
 2069|     75|}
ua_types_encoding_json.c:getExtensionObjectType:
 1967|    257|getExtensionObjectType(ParseCtx *ctx) {
 1968|    257|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1968:8): [True: 19, False: 238]
  ------------------
 1969|     19|        return NULL;
 1970|       |
 1971|       |    /* Get the type NodeId index */
 1972|    238|    size_t typeIdIndex = 0;
 1973|    238|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1974|    238|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    238|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1974:8): [True: 91, False: 147]
  ------------------
 1975|     91|        return NULL;
 1976|       |
 1977|    147|    size_t oldIndex = ctx->index;
 1978|    147|    ctx->index = (UA_UInt16)typeIdIndex;
 1979|       |
 1980|       |    /* Decode the type NodeId */
 1981|    147|    UA_NodeId typeId;
 1982|    147|    UA_NodeId_init(&typeId);
 1983|    147|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|    147|#define UA_TYPES_NODEID 16
  ------------------
 1984|    147|    ctx->index = oldIndex;
 1985|    147|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    147|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1985:8): [True: 55, False: 92]
  ------------------
 1986|     55|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1987|     55|        return NULL;
 1988|     55|    }
 1989|       |
 1990|       |    /* Lookup an return */
 1991|     92|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1992|     92|    UA_NodeId_clear(&typeId);
 1993|     92|    return type;
 1994|    147|}
ua_types_encoding_json.c:Array_decodeJsonUnwrapExtensionObject:
 2073|     47|                                      const UA_DataType *type) {
 2074|     47|    size_t *size_ptr = (size_t*) dst - 1; /* Save the length pointer of the array */
 2075|     47|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2076|       |
 2077|       |    /* Known from the previous unwrapping-check */
 2078|     47|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  248|     47|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2078:5): [True: 47, False: 0]
  ------------------
 2079|     47|    UA_assert(length > 0);
  ------------------
  |  |  248|     47|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2079:5): [True: 47, False: 0]
  ------------------
 2080|       |
 2081|     47|    ctx->index++; /* Go to first array member */
 2082|       |
 2083|       |    /* Allocate memory */
 2084|     47|    if(length > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2084:8): [True: 0, False: 47]
  ------------------
 2085|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2086|     47|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   24|     47|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2087|     47|    if(*dst == NULL)
  ------------------
  |  Branch (2087:8): [True: 2, False: 45]
  ------------------
 2088|      2|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      2|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2089|       |
 2090|       |    /* Decode array members */
 2091|     45|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     45|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2092|     45|    uintptr_t ptr = (uintptr_t)*dst;
 2093|     49|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2093:23): [True: 46, False: 3]
  ------------------
 2094|     46|        UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  248|     46|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2094:9): [True: 46, False: 0]
  ------------------
 2095|     46|        if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2095:12): [True: 6, False: 40]
  ------------------
 2096|     40|           type->typeKind == UA_DATATYPEKIND_OPTSTRUCT) {
  ------------------
  |  Branch (2096:12): [True: 0, False: 40]
  ------------------
 2097|       |            /* Decode structure in-situ in the ExtensionObject */
 2098|      6|            ret = decodeJsonStructureExtensionObject(ctx, (void*)ptr, type);
 2099|     40|        } else if(type->typeKind == UA_DATATYPEKIND_UNION) {
  ------------------
  |  Branch (2099:19): [True: 0, False: 40]
  ------------------
 2100|       |            /* Decode union in-situ in the ExtensionObject */
 2101|      0|            ret = decodeJsonUnionExtensionObject(ctx, (void*)ptr, type);
 2102|     40|        } else {
 2103|       |            /* Get the body field and decode it */
 2104|     40|            DecodeEntry entries[3] = {
 2105|     40|                {UA_JSONKEY_TYPEID, NULL, NULL, false, NULL},
 2106|     40|                {UA_JSONKEY_BODY, (void*)ptr, NULL, false, type},
 2107|     40|                {UA_JSONKEY_ENCODING, NULL, NULL, false, NULL}
 2108|     40|            };
 2109|     40|            ret = decodeFields(ctx, entries, 3);
 2110|     40|        }
 2111|     46|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     46|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2111:12): [True: 42, False: 4]
  ------------------
 2112|     42|            UA_Array_delete(*dst, i+1, type);
 2113|     42|            *dst = NULL;
 2114|     42|            return ret;
 2115|     42|        }
 2116|      4|        ptr += type->memSize;
 2117|      4|    }
 2118|       |
 2119|      3|    *size_ptr = length; /* All good, set the size */
 2120|      3|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2121|     45|}
ua_types_encoding_json.c:Variant_decodeJson:
 2261|    169|DECODE_JSON(Variant) {
 2262|    169|    UA_Variant *dst = (UA_Variant*)p;
 2263|    169|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1323|    169|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|    169|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 169]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|    169|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 169]
  |  |  ------------------
  ------------------
 2264|    169|    CHECK_OBJECT;
  ------------------
  |  | 1318|    169|#define CHECK_OBJECT do {                                \
  |  | 1319|    169|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 6, False: 163]
  |  |  ------------------
  |  | 1320|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|    163|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 163]
  |  |  ------------------
  ------------------
 2265|    163|    return decodeJSONVariant(ctx, dst, false);
 2266|    169|}
ua_types_encoding_json.c:Enum_decodeJson:
 1717|    798|DECODE_JSON(Enum) {
 1718|    798|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1718:8): [True: 145, False: 653]
  ------------------
 1719|    145|        return Int32_decodeJson(ctx, p, type);
 1720|    653|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (1720:8): [True: 4, False: 649]
  ------------------
 1721|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1722|       |
 1723|    649|    UA_String encoded = UA_STRING_NULL;
 1724|    649|    status ret = String_decodeJson(ctx, &encoded, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|    649|#define UA_TYPES_STRING 11
  ------------------
 1725|    649|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    649|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1725:8): [True: 2, False: 647]
  ------------------
 1726|      2|        return ret;
 1727|       |
 1728|       |    /* Use the suffix after the final underscore, if present. Enumeration
 1729|       |     * names can themselves contain underscores. */
 1730|    647|    size_t numberStart = 0;
 1731|  2.32M|    for(size_t i = encoded.length; i > 0; i--) {
  ------------------
  |  Branch (1731:36): [True: 2.32M, False: 524]
  ------------------
 1732|  2.32M|        if(encoded.data[i - 1] != '_')
  ------------------
  |  Branch (1732:12): [True: 2.32M, False: 123]
  ------------------
 1733|  2.32M|            continue;
 1734|    123|        if(i == 1 || i == encoded.length) {
  ------------------
  |  Branch (1734:12): [True: 1, False: 122]
  |  Branch (1734:22): [True: 1, False: 121]
  ------------------
 1735|      2|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1736|      2|            goto cleanup;
 1737|      2|        }
 1738|    121|        numberStart = i;
 1739|    121|        break;
 1740|    123|    }
 1741|       |
 1742|    645|    size_t numberLength = encoded.length - numberStart;
 1743|    645|    if(numberLength == 0) {
  ------------------
  |  Branch (1743:8): [True: 1, False: 644]
  ------------------
 1744|      1|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1745|      1|        goto cleanup;
 1746|      1|    }
 1747|       |
 1748|    644|    UA_Int64 value = 0;
 1749|    644|    size_t parsed = parseInt64((const char*)&encoded.data[numberStart],
 1750|    644|                               numberLength, &value);
 1751|    644|    if(parsed != numberLength || value < UA_INT32_MIN || value > UA_INT32_MAX) {
  ------------------
  |  |  100|  1.22k|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(parsed != numberLength || value < UA_INT32_MIN || value > UA_INT32_MAX) {
  ------------------
  |  |  101|    537|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1751:8): [True: 61, False: 583]
  |  Branch (1751:34): [True: 46, False: 537]
  |  Branch (1751:58): [True: 8, False: 529]
  ------------------
 1752|    115|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    115|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1753|    115|        goto cleanup;
 1754|    115|    }
 1755|    529|    *(UA_Int32*)p = (UA_Int32)value;
 1756|       |
 1757|    647| cleanup:
 1758|    647|    UA_String_clear(&encoded);
 1759|    647|    return ret;
 1760|    529|}
ua_types_encoding_json.c:decodeJsonStructure:
 2812|      6|decodeJsonStructure(ParseCtx *ctx, void *dst, const UA_DataType *type) {
 2813|       |    return decodeJsonStructureInternal(ctx, dst, type, false);
 2814|      6|}

UA_Guid_parse:
   86|     79|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|     79|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|     79|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     79|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 74, False: 5]
  ------------------
   89|     74|        *guid = UA_GUID_NULL;
   90|     79|    return res;
   91|     79|}
UA_NodeId_parseEx:
  323|  9.05k|                  const UA_NamespaceMapping *nsMapping) {
  324|  9.05k|    UA_StatusCode res =
  325|  9.05k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  9.05k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  9.05k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 282, False: 8.77k]
  ------------------
  327|    282|        UA_NodeId_clear(id);
  328|  9.05k|    return res;
  329|  9.05k|}
UA_ExpandedNodeId_parseEx:
  671|  17.7k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  17.7k|    UA_StatusCode res =
  673|  17.7k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  17.7k|                             nsMapping, serverUrisSize, serverUris);
  675|  17.7k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  17.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 388, False: 17.3k]
  ------------------
  676|    388|        UA_ExpandedNodeId_clear(id);
  677|  17.7k|    return res;
  678|  17.7k|}
UA_QualifiedName_parseEx:
  834|  13.0k|                         const UA_NamespaceMapping *nsMapping) {
  835|  13.0k|    const u8 *pos = str.data;
  836|  13.0k|    const u8 *end = str.data + str.length;
  837|  13.0k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  838|  13.0k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  13.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (838:8): [True: 10, False: 13.0k]
  ------------------
  839|     10|        UA_QualifiedName_clear(qn);
  840|  13.0k|    return res;
  841|  13.0k|}
ua_types_lex.c:parse_guid:
   50|     96|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|     96|    size_t len = (size_t)(e - s);
   52|     96|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 26, False: 70]
  |  Branch (52:21): [True: 12, False: 58]
  |  Branch (52:36): [True: 7, False: 51]
  |  Branch (52:52): [True: 11, False: 40]
  ------------------
   53|     56|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     56|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|     40|    UA_UInt32 tmp;
   56|     40|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 11, False: 29]
  ------------------
   57|     11|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|     29|    guid->data1 = tmp;
   59|       |
   60|     29|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 5, False: 24]
  ------------------
   61|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|     24|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|     24|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 4, False: 20]
  ------------------
   65|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|     20|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|     20|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 2, False: 18]
  ------------------
   69|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|     18|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|     18|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 3, False: 15]
  ------------------
   73|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|     15|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|     70|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 65, False: 5]
  ------------------
   77|     65|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 10, False: 55]
  ------------------
   78|     10|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|     55|        guid->data4[pos] = (UA_Byte)tmp;
   80|     55|    }
   81|       |
   82|      5|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      5|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|     15|}
ua_types_lex.c:parse_nodeid:
  148|  9.05k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  9.05k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  9.05k|    LexContext context;
  151|  9.05k|    memset(&context, 0, sizeof(LexContext));
  152|  9.05k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  9.05k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  9.05k|{
  157|  9.05k|	u8 yych;
  158|  9.05k|	yych = YYPEEK();
  ------------------
  |  |   33|  9.05k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.05k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.05k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 9.05k, False: 7]
  |  |  ------------------
  ------------------
  159|  9.05k|	switch (yych) {
  160|  1.21k|		case 'b':
  ------------------
  |  Branch (160:3): [True: 1.21k, False: 7.84k]
  ------------------
  161|  1.23k|		case 'g':
  ------------------
  |  Branch (161:3): [True: 19, False: 9.04k]
  ------------------
  162|  5.21k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 3.97k, False: 5.08k]
  ------------------
  163|  5.62k|		case 's':
  ------------------
  |  Branch (163:3): [True: 413, False: 8.64k]
  ------------------
  164|  5.62k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  5.62k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  5.62k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  5.62k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  5.62k|			goto yy3;
  167|  3.42k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 3.42k, False: 5.63k]
  ------------------
  168|      9|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 9, False: 9.05k]
  ------------------
  169|  9.05k|	}
  170|      9|yy1:
  171|      9|	YYSKIP();
  ------------------
  |  |   35|      9|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      9|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|    204|yy2:
  173|    204|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    204|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  5.62k|yy3:
  175|  5.62k|	YYSKIP();
  ------------------
  |  |   35|  5.62k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.62k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  5.62k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.62k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.62k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.61k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.61k, False: 11]
  |  |  ------------------
  ------------------
  177|  5.62k|	switch (yych) {
  178|  5.60k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 5.60k, False: 25]
  ------------------
  179|     25|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 25, False: 5.60k]
  ------------------
  180|  5.62k|	}
  181|  3.42k|yy4:
  182|  3.42k|	YYSKIP();
  ------------------
  |  |   35|  3.42k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.42k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  3.42k|	YYBACKUP();
  ------------------
  |  |   36|  3.42k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  3.42k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.42k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  3.42k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.42k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.42k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.42k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.42k, False: 3]
  |  |  ------------------
  ------------------
  185|  3.42k|	switch (yych) {
  186|  3.40k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 3.40k, False: 19]
  ------------------
  187|     19|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 19, False: 3.40k]
  ------------------
  188|  3.42k|	}
  189|  8.85k|yy5:
  190|  8.85k|	YYSKIP();
  ------------------
  |  |   35|  8.85k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.85k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  8.85k|	nsu = context.yyt2;
  192|  8.85k|	ns = context.yyt1;
  193|  8.85k|	YYSTAGP(body);
  ------------------
  |  |   38|  8.85k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  8.85k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  8.85k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  8.85k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  8.85k|	{ goto match; }
  196|  3.40k|yy6:
  197|  3.40k|	YYSKIP();
  ------------------
  |  |   35|  3.40k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.40k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  3.40k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.40k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.40k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.40k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.40k, False: 3]
  |  |  ------------------
  ------------------
  199|  3.40k|	switch (yych) {
  200|    210|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 210, False: 3.19k]
  ------------------
  201|  3.19k|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 3.19k, False: 214]
  ------------------
  202|      4|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 4, False: 3.40k]
  ------------------
  203|  3.40k|	}
  204|    151|yy7:
  205|    151|	YYRESTORE();
  ------------------
  |  |   37|    151|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    151|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    151|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    151|	goto yy2;
  207|    210|yy8:
  208|    210|	YYSKIP();
  ------------------
  |  |   35|    210|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    210|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|    210|	yych = YYPEEK();
  ------------------
  |  |   33|    210|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    210|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    207|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 207, False: 3]
  |  |  ------------------
  ------------------
  210|    210|	switch (yych) {
  211|     57|		case '0':
  ------------------
  |  Branch (211:3): [True: 57, False: 153]
  ------------------
  212|     88|		case '1':
  ------------------
  |  Branch (212:3): [True: 31, False: 179]
  ------------------
  213|    119|		case '2':
  ------------------
  |  Branch (213:3): [True: 31, False: 179]
  ------------------
  214|    124|		case '3':
  ------------------
  |  Branch (214:3): [True: 5, False: 205]
  ------------------
  215|    133|		case '4':
  ------------------
  |  Branch (215:3): [True: 9, False: 201]
  ------------------
  216|    146|		case '5':
  ------------------
  |  Branch (216:3): [True: 13, False: 197]
  ------------------
  217|    158|		case '6':
  ------------------
  |  Branch (217:3): [True: 12, False: 198]
  ------------------
  218|    167|		case '7':
  ------------------
  |  Branch (218:3): [True: 9, False: 201]
  ------------------
  219|    189|		case '8':
  ------------------
  |  Branch (219:3): [True: 22, False: 188]
  ------------------
  220|    201|		case '9':
  ------------------
  |  Branch (220:3): [True: 12, False: 198]
  ------------------
  221|    201|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    201|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    201|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|    201|			goto yy10;
  223|      9|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 9, False: 201]
  ------------------
  224|    210|	}
  225|  3.19k|yy9:
  226|  3.19k|	YYSKIP();
  ------------------
  |  |   35|  3.19k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.19k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|  3.19k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.19k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.19k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.18k, False: 3]
  |  |  ------------------
  ------------------
  228|  3.19k|	switch (yych) {
  229|  3.18k|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 3.18k, False: 10]
  ------------------
  230|     10|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 10, False: 3.18k]
  ------------------
  231|  3.19k|	}
  232|  4.70k|yy10:
  233|  4.70k|	YYSKIP();
  ------------------
  |  |   35|  4.70k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.70k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  4.70k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.70k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.63k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.63k, False: 78]
  |  |  ------------------
  ------------------
  235|  4.70k|	switch (yych) {
  236|  2.47k|		case '0':
  ------------------
  |  Branch (236:3): [True: 2.47k, False: 2.23k]
  ------------------
  237|  2.71k|		case '1':
  ------------------
  |  Branch (237:3): [True: 246, False: 4.46k]
  ------------------
  238|  2.93k|		case '2':
  ------------------
  |  Branch (238:3): [True: 219, False: 4.49k]
  ------------------
  239|  3.22k|		case '3':
  ------------------
  |  Branch (239:3): [True: 288, False: 4.42k]
  ------------------
  240|  3.43k|		case '4':
  ------------------
  |  Branch (240:3): [True: 210, False: 4.49k]
  ------------------
  241|  3.64k|		case '5':
  ------------------
  |  Branch (241:3): [True: 213, False: 4.49k]
  ------------------
  242|  3.86k|		case '6':
  ------------------
  |  Branch (242:3): [True: 213, False: 4.49k]
  ------------------
  243|  4.08k|		case '7':
  ------------------
  |  Branch (243:3): [True: 228, False: 4.48k]
  ------------------
  244|  4.29k|		case '8':
  ------------------
  |  Branch (244:3): [True: 211, False: 4.49k]
  ------------------
  245|  4.50k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 209, False: 4.50k]
  ------------------
  246|    119|		case ';':
  ------------------
  |  Branch (246:3): [True: 119, False: 4.59k]
  ------------------
  247|    119|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    119|#define YYSTAGN(t) t = NULL
  ------------------
  248|    119|			goto yy12;
  249|     82|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 82, False: 4.62k]
  ------------------
  250|  4.70k|	}
  251|  3.18k|yy11:
  252|  3.18k|	YYSKIP();
  ------------------
  |  |   35|  3.18k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.18k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|  3.18k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.18k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.17k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.17k, False: 3]
  |  |  ------------------
  ------------------
  254|  3.18k|	switch (yych) {
  255|      3|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 3, False: 3.17k]
  ------------------
  256|  1.53k|		case ';':
  ------------------
  |  Branch (256:3): [True: 1.53k, False: 1.65k]
  ------------------
  257|  1.53k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.53k|#define YYSTAGN(t) t = NULL
  ------------------
  258|  1.53k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  1.53k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.53k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|  1.53k|			goto yy12;
  260|  1.64k|		default:
  ------------------
  |  Branch (260:3): [True: 1.64k, False: 1.53k]
  ------------------
  261|  1.64k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  1.64k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.64k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|  1.64k|			goto yy13;
  263|  3.18k|	}
  264|  3.28k|yy12:
  265|  3.28k|	YYSKIP();
  ------------------
  |  |   35|  3.28k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.28k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  3.28k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.28k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.28k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.27k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.27k, False: 7]
  |  |  ------------------
  ------------------
  267|  3.28k|	switch (yych) {
  268|  1.14k|		case 'b':
  ------------------
  |  Branch (268:3): [True: 1.14k, False: 2.13k]
  ------------------
  269|  1.45k|		case 'g':
  ------------------
  |  Branch (269:3): [True: 305, False: 2.98k]
  ------------------
  270|  1.86k|		case 'i':
  ------------------
  |  Branch (270:3): [True: 411, False: 2.87k]
  ------------------
  271|  3.27k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 1.41k, False: 1.87k]
  ------------------
  272|      9|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 9, False: 3.27k]
  ------------------
  273|  3.28k|	}
  274|  26.1k|yy13:
  275|  26.1k|	YYSKIP();
  ------------------
  |  |   35|  26.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  26.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|  26.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  26.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  26.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  26.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 26.1k, False: 12]
  |  |  ------------------
  ------------------
  277|  26.1k|	switch (yych) {
  278|     12|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 12, False: 26.1k]
  ------------------
  279|  1.63k|		case ';':
  ------------------
  |  Branch (279:3): [True: 1.63k, False: 24.5k]
  ------------------
  280|  1.63k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.63k|#define YYSTAGN(t) t = NULL
  ------------------
  281|  1.63k|			goto yy12;
  282|  24.5k|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 24.5k, False: 1.64k]
  ------------------
  283|  26.1k|	}
  284|  3.27k|yy14:
  285|  3.27k|	YYSKIP();
  ------------------
  |  |   35|  3.27k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.27k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  3.27k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.27k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.27k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.26k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.26k, False: 8]
  |  |  ------------------
  ------------------
  287|  3.27k|	switch (yych) {
  288|  3.25k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 3.25k, False: 22]
  ------------------
  289|     22|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 22, False: 3.25k]
  ------------------
  290|  3.27k|	}
  291|  3.27k|}
  292|       |
  293|       |
  294|  8.85k| match:
  295|  8.85k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 3.14k, False: 5.71k]
  ------------------
  296|       |        /* NamespaceUri */
  297|  3.14k|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|  3.14k|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|  3.14k|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  3.14k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 3.14k, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|  3.14k|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|  3.14k|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|  3.14k|            return UA_String_copy(&total, &id->identifier.string);
  304|  3.14k|        }
  305|  5.71k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 113, False: 5.60k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|    113|        UA_UInt32 tmp;
  308|    113|        size_t len = (size_t)(body - 1 - ns);
  309|    113|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 12, False: 101]
  ------------------
  310|     12|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|    101|        id->namespaceIndex = (UA_UInt16)tmp;
  312|    101|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 101]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|    101|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  5.70k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  8.85k|}
ua_types_lex.c:escapedUri2Index:
   95|  4.48k|                 const UA_NamespaceMapping *nsMapping) {
   96|  4.48k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 4.48k, False: 0]
  ------------------
   97|  4.48k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  4.48k|#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|  18.1k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  18.1k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  18.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  18.1k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  18.1k|    switch(*body) {
  113|  4.17k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 4.17k, False: 14.0k]
  ------------------
  114|  4.17k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  4.17k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 35, False: 4.13k]
  ------------------
  116|     35|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     35|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  4.17k|        break;
  118|  11.3k|    case 's':
  ------------------
  |  Branch (118:5): [True: 11.3k, False: 6.81k]
  ------------------
  119|  11.3k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  11.3k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  11.3k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  11.3k|        break;
  123|     17|    case 'g':
  ------------------
  |  Branch (123:5): [True: 17, False: 18.1k]
  ------------------
  124|     17|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     17|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     17|        break;
  127|  2.62k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 2.62k, False: 15.5k]
  ------------------
  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|  2.62k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  2.62k|        id->identifier.byteString.data =
  133|  2.62k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  2.62k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 22, False: 2.60k]
  ------------------
  135|     22|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  248|     22|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 22, False: 0]
  ------------------
  136|     22|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     22|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     22|        }
  138|  2.62k|        break;
  139|  2.62k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 18.1k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  18.1k|    }
  143|  18.1k|    return res;
  144|  18.1k|}
ua_types_lex.c:parse_expandednodeid:
  339|  17.7k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  17.7k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  17.7k|    LexContext context;
  342|  17.7k|    memset(&context, 0, sizeof(LexContext));
  343|  17.7k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  17.7k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  17.7k|{
  348|  17.7k|	u8 yych;
  349|  17.7k|	yych = YYPEEK();
  ------------------
  |  |   33|  17.7k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  17.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  17.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 17.7k, False: 2]
  |  |  ------------------
  ------------------
  350|  17.7k|	switch (yych) {
  351|    349|		case 'b':
  ------------------
  |  Branch (351:3): [True: 349, False: 17.4k]
  ------------------
  352|    355|		case 'g':
  ------------------
  |  Branch (352:3): [True: 6, False: 17.7k]
  ------------------
  353|    555|		case 'i':
  ------------------
  |  Branch (353:3): [True: 200, False: 17.5k]
  ------------------
  354|    555|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  355|    555|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  356|    555|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  357|    555|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  358|    555|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  359|    555|			goto yy18;
  360|  1.38k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 1.38k, False: 16.3k]
  ------------------
  361|  1.38k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.38k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  1.38k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.38k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  1.38k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.38k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  1.38k|			goto yy19;
  365|  15.8k|		case 's':
  ------------------
  |  Branch (365:3): [True: 15.8k, False: 1.94k]
  ------------------
  366|  15.8k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  15.8k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  15.8k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  15.8k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  15.8k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  15.8k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  15.8k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  15.8k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  15.8k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  15.8k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  15.8k|			goto yy20;
  372|      4|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 4, False: 17.7k]
  ------------------
  373|  17.7k|	}
  374|      4|yy16:
  375|      4|	YYSKIP();
  ------------------
  |  |   35|      4|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      4|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    376|yy17:
  377|    376|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    376|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|    555|yy18:
  379|    555|	YYSKIP();
  ------------------
  |  |   35|    555|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    555|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|    555|	yych = YYPEEK();
  ------------------
  |  |   33|    555|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    555|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    551|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 551, False: 4]
  |  |  ------------------
  ------------------
  381|    555|	switch (yych) {
  382|    539|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 539, False: 16]
  ------------------
  383|     16|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 16, False: 539]
  ------------------
  384|    555|	}
  385|  1.38k|yy19:
  386|  1.38k|	YYSKIP();
  ------------------
  |  |   35|  1.38k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.38k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  1.38k|	YYBACKUP();
  ------------------
  |  |   36|  1.38k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.38k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.38k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  1.38k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.38k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.38k, False: 1]
  |  |  ------------------
  ------------------
  389|  1.38k|	switch (yych) {
  390|  1.38k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 1.38k, False: 9]
  ------------------
  391|      9|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 9, False: 1.38k]
  ------------------
  392|  1.38k|	}
  393|  15.8k|yy20:
  394|  15.8k|	YYSKIP();
  ------------------
  |  |   35|  15.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  15.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  15.8k|	YYBACKUP();
  ------------------
  |  |   36|  15.8k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  15.8k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  15.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  15.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  15.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  15.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  15.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 15.8k, False: 1]
  |  |  ------------------
  ------------------
  397|  15.8k|	switch (yych) {
  398|  5.06k|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 5.06k, False: 10.7k]
  ------------------
  399|  10.7k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 10.7k, False: 5.07k]
  ------------------
  400|      8|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 8, False: 15.8k]
  ------------------
  401|  15.8k|	}
  402|  17.4k|yy21:
  403|  17.4k|	YYSKIP();
  ------------------
  |  |   35|  17.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  17.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  17.4k|	svr = context.yyt5;
  405|  17.4k|	svu = context.yyt1;
  406|  17.4k|	sve = context.yyt2;
  407|  17.4k|	ns = context.yyt3;
  408|  17.4k|	nsu = context.yyt4;
  409|  17.4k|	YYSTAGP(body);
  ------------------
  |  |   38|  17.4k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  17.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  17.4k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  17.4k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  17.4k|	{ goto match; }
  412|  6.99k|yy22:
  413|  6.99k|	YYSKIP();
  ------------------
  |  |   35|  6.99k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.99k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  6.99k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.99k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.99k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.98k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.98k, False: 1]
  |  |  ------------------
  ------------------
  415|  6.99k|	switch (yych) {
  416|    489|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 489, False: 6.50k]
  ------------------
  417|  6.49k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 6.49k, False: 495]
  ------------------
  418|      6|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 6, False: 6.98k]
  ------------------
  419|  6.99k|	}
  420|    339|yy23:
  421|    339|	YYRESTORE();
  ------------------
  |  |   37|    339|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    339|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    339|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    339|	goto yy17;
  423|  10.7k|yy24:
  424|  10.7k|	YYSKIP();
  ------------------
  |  |   35|  10.7k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  10.7k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  10.7k|	yych = YYPEEK();
  ------------------
  |  |   33|  10.7k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 10.7k, False: 1]
  |  |  ------------------
  ------------------
  426|  10.7k|	switch (yych) {
  427|  5.76k|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 5.76k, False: 4.99k]
  ------------------
  428|  4.99k|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 4.99k, False: 5.76k]
  ------------------
  429|      3|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 3, False: 10.7k]
  ------------------
  430|  10.7k|	}
  431|    489|yy25:
  432|    489|	YYSKIP();
  ------------------
  |  |   35|    489|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    489|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|    489|	yych = YYPEEK();
  ------------------
  |  |   33|    489|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    489|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    488|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 488, False: 1]
  |  |  ------------------
  ------------------
  434|    489|	switch (yych) {
  435|    405|		case '0':
  ------------------
  |  Branch (435:3): [True: 405, False: 84]
  ------------------
  436|    411|		case '1':
  ------------------
  |  Branch (436:3): [True: 6, False: 483]
  ------------------
  437|    421|		case '2':
  ------------------
  |  Branch (437:3): [True: 10, False: 479]
  ------------------
  438|    429|		case '3':
  ------------------
  |  Branch (438:3): [True: 8, False: 481]
  ------------------
  439|    443|		case '4':
  ------------------
  |  Branch (439:3): [True: 14, False: 475]
  ------------------
  440|    452|		case '5':
  ------------------
  |  Branch (440:3): [True: 9, False: 480]
  ------------------
  441|    471|		case '6':
  ------------------
  |  Branch (441:3): [True: 19, False: 470]
  ------------------
  442|    473|		case '7':
  ------------------
  |  Branch (442:3): [True: 2, False: 487]
  ------------------
  443|    484|		case '8':
  ------------------
  |  Branch (443:3): [True: 11, False: 478]
  ------------------
  444|    486|		case '9':
  ------------------
  |  Branch (444:3): [True: 2, False: 487]
  ------------------
  445|    486|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    486|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    486|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    486|			goto yy29;
  447|      3|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 3, False: 486]
  ------------------
  448|    489|	}
  449|  6.49k|yy26:
  450|  6.49k|	YYSKIP();
  ------------------
  |  |   35|  6.49k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.49k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  6.49k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.49k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.49k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.49k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.49k, False: 2]
  |  |  ------------------
  ------------------
  452|  6.49k|	switch (yych) {
  453|  6.48k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 6.48k, False: 8]
  ------------------
  454|      8|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 8, False: 6.48k]
  ------------------
  455|  6.49k|	}
  456|  5.76k|yy27:
  457|  5.76k|	YYSKIP();
  ------------------
  |  |   35|  5.76k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.76k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|  5.76k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.76k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.76k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.76k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.76k, False: 1]
  |  |  ------------------
  ------------------
  459|  5.76k|	switch (yych) {
  460|  5.75k|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 5.75k, False: 6]
  ------------------
  461|      6|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 6, False: 5.75k]
  ------------------
  462|  5.76k|	}
  463|  4.99k|yy28:
  464|  4.99k|	YYSKIP();
  ------------------
  |  |   35|  4.99k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.99k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|  4.99k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.99k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.99k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.99k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.99k, False: 1]
  |  |  ------------------
  ------------------
  466|  4.99k|	switch (yych) {
  467|  4.98k|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 4.98k, False: 13]
  ------------------
  468|     13|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 13, False: 4.98k]
  ------------------
  469|  4.99k|	}
  470|  4.15k|yy29:
  471|  4.15k|	YYSKIP();
  ------------------
  |  |   35|  4.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  4.15k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.15k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.07k, False: 72]
  |  |  ------------------
  ------------------
  473|  4.15k|	switch (yych) {
  474|    853|		case '0':
  ------------------
  |  Branch (474:3): [True: 853, False: 3.29k]
  ------------------
  475|  1.10k|		case '1':
  ------------------
  |  Branch (475:3): [True: 252, False: 3.89k]
  ------------------
  476|  1.37k|		case '2':
  ------------------
  |  Branch (476:3): [True: 266, False: 3.88k]
  ------------------
  477|  1.58k|		case '3':
  ------------------
  |  Branch (477:3): [True: 212, False: 3.93k]
  ------------------
  478|  1.79k|		case '4':
  ------------------
  |  Branch (478:3): [True: 211, False: 3.94k]
  ------------------
  479|  2.25k|		case '5':
  ------------------
  |  Branch (479:3): [True: 456, False: 3.69k]
  ------------------
  480|  2.70k|		case '6':
  ------------------
  |  Branch (480:3): [True: 450, False: 3.70k]
  ------------------
  481|  3.15k|		case '7':
  ------------------
  |  Branch (481:3): [True: 454, False: 3.69k]
  ------------------
  482|  3.35k|		case '8':
  ------------------
  |  Branch (482:3): [True: 201, False: 3.95k]
  ------------------
  483|  3.66k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 310, False: 3.84k]
  ------------------
  484|    405|		case ';':
  ------------------
  |  Branch (484:3): [True: 405, False: 3.74k]
  ------------------
  485|    405|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    405|#define YYSTAGN(t) t = NULL
  ------------------
  486|    405|			goto yy33;
  487|     81|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 81, False: 4.07k]
  ------------------
  488|  4.15k|	}
  489|  6.48k|yy30:
  490|  6.48k|	YYSKIP();
  ------------------
  |  |   35|  6.48k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.48k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  6.48k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.48k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.48k, False: 1]
  |  |  ------------------
  ------------------
  492|  6.48k|	switch (yych) {
  493|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 1, False: 6.48k]
  ------------------
  494|    824|		case ';':
  ------------------
  |  Branch (494:3): [True: 824, False: 5.66k]
  ------------------
  495|    824|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    824|#define YYSTAGN(t) t = NULL
  ------------------
  496|    824|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    824|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    824|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    824|			goto yy33;
  498|  5.66k|		default:
  ------------------
  |  Branch (498:3): [True: 5.66k, False: 825]
  ------------------
  499|  5.66k|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|  5.66k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  5.66k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|  5.66k|			goto yy34;
  501|  6.48k|	}
  502|  5.75k|yy31:
  503|  5.75k|	YYSKIP();
  ------------------
  |  |   35|  5.75k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.75k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|  5.75k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.75k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.75k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.75k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.75k, False: 1]
  |  |  ------------------
  ------------------
  505|  5.75k|	switch (yych) {
  506|    390|		case '0':
  ------------------
  |  Branch (506:3): [True: 390, False: 5.36k]
  ------------------
  507|    440|		case '1':
  ------------------
  |  Branch (507:3): [True: 50, False: 5.70k]
  ------------------
  508|    632|		case '2':
  ------------------
  |  Branch (508:3): [True: 192, False: 5.56k]
  ------------------
  509|    666|		case '3':
  ------------------
  |  Branch (509:3): [True: 34, False: 5.72k]
  ------------------
  510|    675|		case '4':
  ------------------
  |  Branch (510:3): [True: 9, False: 5.74k]
  ------------------
  511|    682|		case '5':
  ------------------
  |  Branch (511:3): [True: 7, False: 5.75k]
  ------------------
  512|    685|		case '6':
  ------------------
  |  Branch (512:3): [True: 3, False: 5.75k]
  ------------------
  513|  5.72k|		case '7':
  ------------------
  |  Branch (513:3): [True: 5.04k, False: 714]
  ------------------
  514|  5.74k|		case '8':
  ------------------
  |  Branch (514:3): [True: 17, False: 5.74k]
  ------------------
  515|  5.75k|		case '9':
  ------------------
  |  Branch (515:3): [True: 5, False: 5.75k]
  ------------------
  516|  5.75k|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|  5.75k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  5.75k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|  5.75k|			goto yy35;
  518|      7|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 7, False: 5.75k]
  ------------------
  519|  5.75k|	}
  520|  4.98k|yy32:
  521|  4.98k|	YYSKIP();
  ------------------
  |  |   35|  4.98k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.98k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|  4.98k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.98k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.98k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.98k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.98k, False: 1]
  |  |  ------------------
  ------------------
  523|  4.98k|	switch (yych) {
  524|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 1, False: 4.98k]
  ------------------
  525|    297|		case ';':
  ------------------
  |  Branch (525:3): [True: 297, False: 4.68k]
  ------------------
  526|    297|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    297|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    297|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|    297|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    297|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    297|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    297|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    297|#define YYSTAGN(t) t = NULL
  ------------------
  529|    297|			goto yy37;
  530|  4.68k|		default:
  ------------------
  |  Branch (530:3): [True: 4.68k, False: 298]
  ------------------
  531|  4.68k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  4.68k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  4.68k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|  4.68k|			goto yy36;
  533|  4.98k|	}
  534|  6.88k|yy33:
  535|  6.88k|	YYSKIP();
  ------------------
  |  |   35|  6.88k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.88k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  6.88k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.88k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.88k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.87k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.87k, False: 7]
  |  |  ------------------
  ------------------
  537|  6.88k|	switch (yych) {
  538|  1.02k|		case 'b':
  ------------------
  |  Branch (538:3): [True: 1.02k, False: 5.85k]
  ------------------
  539|  1.13k|		case 'g':
  ------------------
  |  Branch (539:3): [True: 113, False: 6.76k]
  ------------------
  540|  1.37k|		case 'i':
  ------------------
  |  Branch (540:3): [True: 237, False: 6.64k]
  ------------------
  541|  6.87k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 5.49k, False: 1.38k]
  ------------------
  542|     11|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 11, False: 6.87k]
  ------------------
  543|  6.88k|	}
  544|  1.22M|yy34:
  545|  1.22M|	YYSKIP();
  ------------------
  |  |   35|  1.22M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.22M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|  1.22M|	yych = YYPEEK();
  ------------------
  |  |   33|  1.22M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.22M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.22M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.22M, False: 10]
  |  |  ------------------
  ------------------
  547|  1.22M|	switch (yych) {
  548|     10|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 10, False: 1.22M]
  ------------------
  549|  5.65k|		case ';':
  ------------------
  |  Branch (549:3): [True: 5.65k, False: 1.21M]
  ------------------
  550|  5.65k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  5.65k|#define YYSTAGN(t) t = NULL
  ------------------
  551|  5.65k|			goto yy33;
  552|  1.21M|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 1.21M, False: 5.66k]
  ------------------
  553|  1.22M|	}
  554|  24.8k|yy35:
  555|  24.8k|	YYSKIP();
  ------------------
  |  |   35|  24.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  24.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  24.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  24.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 24.7k, False: 78]
  |  |  ------------------
  ------------------
  557|  24.8k|	switch (yych) {
  558|  1.91k|		case '0':
  ------------------
  |  Branch (558:3): [True: 1.91k, False: 22.9k]
  ------------------
  559|  3.13k|		case '1':
  ------------------
  |  Branch (559:3): [True: 1.22k, False: 23.6k]
  ------------------
  560|  3.38k|		case '2':
  ------------------
  |  Branch (560:3): [True: 249, False: 24.6k]
  ------------------
  561|  3.67k|		case '3':
  ------------------
  |  Branch (561:3): [True: 291, False: 24.5k]
  ------------------
  562|  3.91k|		case '4':
  ------------------
  |  Branch (562:3): [True: 239, False: 24.6k]
  ------------------
  563|  13.5k|		case '5':
  ------------------
  |  Branch (563:3): [True: 9.64k, False: 15.2k]
  ------------------
  564|  17.6k|		case '6':
  ------------------
  |  Branch (564:3): [True: 4.08k, False: 20.7k]
  ------------------
  565|  18.4k|		case '7':
  ------------------
  |  Branch (565:3): [True: 814, False: 24.0k]
  ------------------
  566|  18.8k|		case '8':
  ------------------
  |  Branch (566:3): [True: 363, False: 24.5k]
  ------------------
  567|  19.1k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 302, False: 24.5k]
  ------------------
  568|  5.65k|		case ';':
  ------------------
  |  Branch (568:3): [True: 5.65k, False: 19.2k]
  ------------------
  569|  5.65k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  5.65k|#define YYSTAGN(t) t = NULL
  ------------------
  570|  5.65k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  5.65k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  5.65k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|  5.65k|			goto yy37;
  572|     95|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 95, False: 24.7k]
  ------------------
  573|  24.8k|	}
  574|  3.13M|yy36:
  575|  3.13M|	YYSKIP();
  ------------------
  |  |   35|  3.13M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.13M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  3.13M|	yych = YYPEEK();
  ------------------
  |  |   33|  3.13M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.13M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.13M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.13M, False: 13]
  |  |  ------------------
  ------------------
  577|  3.13M|	switch (yych) {
  578|     14|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 14, False: 3.13M]
  ------------------
  579|  4.67k|		case ';':
  ------------------
  |  Branch (579:3): [True: 4.67k, False: 3.13M]
  ------------------
  580|  4.67k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  4.67k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  4.67k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|  4.67k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  4.67k|#define YYSTAGN(t) t = NULL
  ------------------
  582|  4.67k|			goto yy37;
  583|  3.13M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 3.13M, False: 4.68k]
  ------------------
  584|  3.13M|	}
  585|  10.6k|yy37:
  586|  10.6k|	YYSKIP();
  ------------------
  |  |   35|  10.6k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  10.6k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  10.6k|	yych = YYPEEK();
  ------------------
  |  |   33|  10.6k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 10.6k, False: 6]
  |  |  ------------------
  ------------------
  588|  10.6k|	switch (yych) {
  589|    202|		case 'b':
  ------------------
  |  Branch (589:3): [True: 202, False: 10.4k]
  ------------------
  590|    576|		case 'g':
  ------------------
  |  Branch (590:3): [True: 374, False: 10.2k]
  ------------------
  591|  2.09k|		case 'i':
  ------------------
  |  Branch (591:3): [True: 1.51k, False: 9.10k]
  ------------------
  592|  4.98k|		case 's':
  ------------------
  |  Branch (592:3): [True: 2.89k, False: 7.72k]
  ------------------
  593|  4.98k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  4.98k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  4.98k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  4.98k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  4.98k|			goto yy38;
  596|  5.62k|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 5.62k, False: 4.99k]
  ------------------
  597|     11|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 11, False: 10.6k]
  ------------------
  598|  10.6k|	}
  599|  11.8k|yy38:
  600|  11.8k|	YYSKIP();
  ------------------
  |  |   35|  11.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  11.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  11.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  11.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  11.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  11.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 11.8k, False: 17]
  |  |  ------------------
  ------------------
  602|  11.8k|	switch (yych) {
  603|  11.8k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 11.8k, False: 52]
  ------------------
  604|     52|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 52, False: 11.8k]
  ------------------
  605|  11.8k|	}
  606|  5.62k|yy39:
  607|  5.62k|	YYSKIP();
  ------------------
  |  |   35|  5.62k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.62k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|  5.62k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.62k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.62k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.62k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.62k, False: 1]
  |  |  ------------------
  ------------------
  609|  5.62k|	switch (yych) {
  610|  5.61k|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 5.61k, False: 17]
  ------------------
  611|     17|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 17, False: 5.61k]
  ------------------
  612|  5.62k|	}
  613|  5.62k|}
  614|       |
  615|       |
  616|  17.4k| match:
  617|  17.4k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 4.91k, False: 12.4k]
  ------------------
  618|       |        /* ServerUri */
  619|  4.91k|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|  4.91k|        size_t i = 0;
  621|  4.91k|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 4.91k]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|  4.91k|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 4.91k, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|  4.91k|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|  4.91k|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|  4.91k|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|  4.91k|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  12.4k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 5.63k, False: 6.85k]
  ------------------
  634|       |        /* ServerIndex */
  635|  5.63k|        size_t len = (size_t)(sve - svr);
  636|  5.63k|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 2, False: 5.63k]
  ------------------
  637|      2|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|  5.63k|    }
  639|       |
  640|  12.4k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 6.08k, False: 6.40k]
  ------------------
  641|       |        /* NamespaceUri */
  642|  6.08k|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|  6.08k|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  6.08k|#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|  6.08k|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 856, False: 5.23k]
  ------------------
  647|    856|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|  6.08k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.08k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 6.08k, False: 0]
  ------------------
  649|  6.08k|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|  6.08k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.08k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 1, False: 6.08k]
  ------------------
  651|      1|            return res;
  652|  6.40k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 397, False: 6.00k]
  ------------------
  653|       |        /* NamespaceIndex */
  654|    397|        UA_UInt32 tmp;
  655|    397|        size_t len = (size_t)(body - 1 - ns);
  656|    397|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 1, False: 396]
  ------------------
  657|      1|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|    396|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|    396|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 396]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|    396|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  12.4k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  12.4k|}
ua_types_lex.c:parse_qn:
  707|  13.0k|         UA_UInt16 defaultNamespaceIndex) {
  708|  13.0k|    size_t len;
  709|  13.0k|    UA_UInt32 tmp;
  710|  13.0k|    UA_String str;
  711|  13.0k|    UA_StatusCode res;
  712|       |
  713|  13.0k|    LexContext context;
  714|  13.0k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  13.0k|    const u8 *begin = pos;
  717|  13.0k|    UA_QualifiedName_init(qn);
  718|  13.0k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  13.0k|{
  722|  13.0k|	u8 yych;
  723|  13.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  13.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  12.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 12.8k, False: 206]
  |  |  ------------------
  ------------------
  724|  13.0k|	switch (yych) {
  725|    206|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 206, False: 12.8k]
  ------------------
  726|    549|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 343, False: 12.7k]
  ------------------
  727|    851|		case '0':
  ------------------
  |  Branch (727:3): [True: 851, False: 12.2k]
  ------------------
  728|  1.14k|		case '1':
  ------------------
  |  Branch (728:3): [True: 297, False: 12.7k]
  ------------------
  729|  1.88k|		case '2':
  ------------------
  |  Branch (729:3): [True: 733, False: 12.3k]
  ------------------
  730|  2.09k|		case '3':
  ------------------
  |  Branch (730:3): [True: 218, False: 12.8k]
  ------------------
  731|  2.98k|		case '4':
  ------------------
  |  Branch (731:3): [True: 886, False: 12.1k]
  ------------------
  732|  3.59k|		case '5':
  ------------------
  |  Branch (732:3): [True: 608, False: 12.4k]
  ------------------
  733|  4.33k|		case '6':
  ------------------
  |  Branch (733:3): [True: 739, False: 12.3k]
  ------------------
  734|  4.76k|		case '7':
  ------------------
  |  Branch (734:3): [True: 435, False: 12.6k]
  ------------------
  735|  6.94k|		case '8':
  ------------------
  |  Branch (735:3): [True: 2.17k, False: 10.8k]
  ------------------
  736|  7.30k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 366, False: 12.6k]
  ------------------
  737|  5.19k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 5.19k, False: 7.85k]
  ------------------
  738|  13.0k|	}
  739|    549|yy41:
  740|    549|	YYSKIP();
  ------------------
  |  |   35|    549|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    549|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  12.1k|yy42:
  742|  12.1k|	{ pos = begin; goto match_name; }
  743|  5.19k|yy43:
  744|  5.19k|	YYSKIP();
  ------------------
  |  |   35|  5.19k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.19k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  5.19k|	YYBACKUP();
  ------------------
  |  |   36|  5.19k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  5.19k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  5.19k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  5.19k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.19k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.19k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.99k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.99k, False: 3.20k]
  |  |  ------------------
  ------------------
  747|  5.19k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 3.20k, False: 1.99k]
  ------------------
  748|  1.99k|	goto yy46;
  749|  7.30k|yy44:
  750|  7.30k|	YYSKIP();
  ------------------
  |  |   35|  7.30k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.30k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  7.30k|	YYBACKUP();
  ------------------
  |  |   36|  7.30k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  7.30k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  7.30k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  7.30k|	yych = YYPEEK();
  ------------------
  |  |   33|  7.30k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.30k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.67k, False: 636]
  |  |  ------------------
  ------------------
  753|  7.30k|	switch (yych) {
  754|    812|		case '0':
  ------------------
  |  Branch (754:3): [True: 812, False: 6.49k]
  ------------------
  755|  1.05k|		case '1':
  ------------------
  |  Branch (755:3): [True: 240, False: 7.06k]
  ------------------
  756|  1.55k|		case '2':
  ------------------
  |  Branch (756:3): [True: 502, False: 6.80k]
  ------------------
  757|  1.81k|		case '3':
  ------------------
  |  Branch (757:3): [True: 261, False: 7.04k]
  ------------------
  758|  2.44k|		case '4':
  ------------------
  |  Branch (758:3): [True: 631, False: 6.67k]
  ------------------
  759|  3.05k|		case '5':
  ------------------
  |  Branch (759:3): [True: 612, False: 6.69k]
  ------------------
  760|  3.28k|		case '6':
  ------------------
  |  Branch (760:3): [True: 225, False: 7.08k]
  ------------------
  761|  3.42k|		case '7':
  ------------------
  |  Branch (761:3): [True: 142, False: 7.16k]
  ------------------
  762|  3.65k|		case '8':
  ------------------
  |  Branch (762:3): [True: 232, False: 7.07k]
  ------------------
  763|  4.05k|		case '9':
  ------------------
  |  Branch (763:3): [True: 402, False: 6.90k]
  ------------------
  764|  4.08k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 30, False: 7.27k]
  ------------------
  765|  3.21k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 3.21k, False: 4.08k]
  ------------------
  766|  7.30k|	}
  767|  53.2k|yy45:
  768|  53.2k|	YYSKIP();
  ------------------
  |  |   35|  53.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  53.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  53.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  53.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  53.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  51.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 51.7k, False: 1.50k]
  |  |  ------------------
  ------------------
  770|  55.2k|yy46:
  771|  55.2k|	switch (yych) {
  772|  1.50k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 1.50k, False: 53.7k]
  ------------------
  773|    491|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 491, False: 54.8k]
  ------------------
  774|  53.2k|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 53.2k, False: 1.99k]
  ------------------
  775|  55.2k|	}
  776|  5.20k|yy47:
  777|  5.20k|	YYRESTORE();
  ------------------
  |  |   37|  5.20k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  5.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  5.20k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  5.20k|	goto yy42;
  779|    491|yy48:
  780|    491|	YYSKIP();
  ------------------
  |  |   35|    491|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    491|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    491|	{ goto match_uri; }
  782|  35.3k|yy49:
  783|  35.3k|	YYSKIP();
  ------------------
  |  |   35|  35.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  35.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|  35.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  35.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  35.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  33.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 33.6k, False: 1.67k]
  |  |  ------------------
  ------------------
  785|  39.4k|yy50:
  786|  39.4k|	switch (yych) {
  787|  9.48k|		case '0':
  ------------------
  |  Branch (787:3): [True: 9.48k, False: 29.9k]
  ------------------
  788|  13.1k|		case '1':
  ------------------
  |  Branch (788:3): [True: 3.65k, False: 35.7k]
  ------------------
  789|  18.4k|		case '2':
  ------------------
  |  Branch (789:3): [True: 5.28k, False: 34.1k]
  ------------------
  790|  19.9k|		case '3':
  ------------------
  |  Branch (790:3): [True: 1.52k, False: 37.8k]
  ------------------
  791|  22.2k|		case '4':
  ------------------
  |  Branch (791:3): [True: 2.28k, False: 37.1k]
  ------------------
  792|  25.6k|		case '5':
  ------------------
  |  Branch (792:3): [True: 3.37k, False: 36.0k]
  ------------------
  793|  27.9k|		case '6':
  ------------------
  |  Branch (793:3): [True: 2.30k, False: 37.1k]
  ------------------
  794|  31.2k|		case '7':
  ------------------
  |  Branch (794:3): [True: 3.30k, False: 36.1k]
  ------------------
  795|  32.3k|		case '8':
  ------------------
  |  Branch (795:3): [True: 1.10k, False: 38.3k]
  ------------------
  796|  35.3k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 2.98k, False: 36.4k]
  ------------------
  797|    390|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 390, False: 39.0k]
  ------------------
  798|  3.69k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 3.69k, False: 35.7k]
  ------------------
  799|  39.4k|	}
  800|    390|yy51:
  801|    390|	YYSKIP();
  ------------------
  |  |   35|    390|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    390|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    390|	{ goto match_index; }
  803|  39.4k|}
  804|       |
  805|       |
  806|    390| match_index:
  807|    390|    len = (size_t)(pos - 1 - begin);
  808|    390|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 9, False: 381]
  ------------------
  809|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    381|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    381|    if(nsMapping)
  ------------------
  |  Branch (811:8): [True: 0, False: 381]
  ------------------
  812|      0|        qn->namespaceIndex =
  813|      0|            UA_NamespaceMapping_remote2Local(nsMapping, qn->namespaceIndex);
  814|    381|    goto match_name;
  815|       |
  816|    491| match_uri:
  817|    491|    str.length = (size_t)(pos - 1 - begin);
  818|    491|    str.data = (UA_Byte*)(uintptr_t)begin;
  819|    491|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  820|    491|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    491|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (820:8): [True: 491, False: 0]
  ------------------
  821|    491|        pos = begin; /* Use the entire string for the name */
  822|       |
  823|  13.0k| match_name:
  824|  13.0k|    str.length = (size_t)(end - pos);
  825|  13.0k|    str.data = (UA_Byte*)(uintptr_t)pos;
  826|  13.0k|    res = UA_String_copy(&str, &qn->name);
  827|  13.0k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  344|  13.0k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (344:23): [True: 13.0k, False: 1]
  |  |  ------------------
  ------------------
  828|  13.0k|        res = UA_String_unescape(&qn->name, false, escName);
  829|  13.0k|    return res;
  830|    491|}

UA_readNumberWithBase:
  122|  10.9k|                      UA_UInt32 *number, UA_Byte base) {
  123|  10.9k|    UA_assert(buf);
  ------------------
  |  |  248|  10.9k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (123:5): [True: 10.9k, False: 0]
  ------------------
  124|  10.9k|    UA_assert(number);
  ------------------
  |  |  248|  10.9k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (124:5): [True: 10.9k, False: 0]
  ------------------
  125|       |    /* Accumulate in 64 bits. n stays below 2^32 between the digits, so n * base
  126|       |     * + digit cannot overflow for any base up to 36. */
  127|  10.9k|    u64 n = 0;
  128|  10.9k|    size_t progress = 0;
  129|       |    /* read numbers until the end or a non-number character appears */
  130|   165k|    while(progress < buflen) {
  ------------------
  |  Branch (130:11): [True: 154k, False: 10.8k]
  ------------------
  131|   154k|        u8 c = buf[progress];
  132|   154k|        u32 digit;
  133|   154k|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (133:12): [True: 154k, False: 15]
  |  Branch (133:24): [True: 154k, False: 614]
  |  Branch (133:36): [True: 154k, False: 0]
  ------------------
  134|   154k|           digit = c - '0';
  135|    629|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (135:17): [True: 629, False: 0]
  |  Branch (135:29): [True: 304, False: 325]
  |  Branch (135:41): [True: 282, False: 22]
  |  Branch (135:53): [True: 274, False: 8]
  ------------------
  136|    274|           digit = c-'a' + 10;
  137|    355|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (137:17): [True: 355, False: 0]
  |  Branch (137:29): [True: 336, False: 19]
  |  Branch (137:41): [True: 303, False: 33]
  |  Branch (137:53): [True: 295, False: 8]
  ------------------
  138|    295|           digit = c-'A' + 10;
  139|     60|        else
  140|     60|           break;
  141|   154k|        n = (n * base) + digit;
  142|       |        /* The number does not fit into 32 bits. Report no valid digits
  143|       |         * instead of returning a wrapped value. */
  144|   154k|        if(n > UA_UINT32_MAX)
  ------------------
  |  |  110|   154k|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (144:12): [True: 34, False: 154k]
  ------------------
  145|     34|            return 0;
  146|   154k|        ++progress;
  147|   154k|    }
  148|  10.8k|    *number = (u32)n;
  149|  10.8k|    return progress;
  150|  10.9k|}
UA_readNumber:
  153|  10.7k|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  154|  10.7k|    return UA_readNumberWithBase(buf, buflen, number, 10);
  155|  10.7k|}
UA_String_unescape:
  881|  24.4k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  882|  24.4k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (882:8): [True: 24.4k, False: 0]
  ------------------
  883|  24.4k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  24.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  884|       |
  885|       |    /* Does the string need escaping? */
  886|      0|    UA_String tmp;
  887|      0|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  888|      0|    u8 *pos = str->data;
  889|      0|    u8 *end = str->data + str->length;
  890|      0|    u8 escape_char = (esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (890:23): [True: 0, False: 0]
  ------------------
  891|      0|                      esc == UA_ESCAPING_PERCENT_EXTENDED) ? '%' : '&';
  ------------------
  |  Branch (891:23): [True: 0, False: 0]
  ------------------
  892|      0|    for(; pos < end; pos++) {
  ------------------
  |  Branch (892:11): [True: 0, False: 0]
  ------------------
  893|      0|        if(*pos == escape_char)
  ------------------
  |  Branch (893:12): [True: 0, False: 0]
  ------------------
  894|      0|            goto escape;
  895|      0|    }
  896|       |
  897|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  898|       |
  899|      0| escape:
  900|      0|    if(copyEscape) {
  ------------------
  |  Branch (900:8): [True: 0, False: 0]
  ------------------
  901|      0|        res = UA_String_copy(str, &tmp);
  902|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (902:12): [True: 0, False: 0]
  ------------------
  903|      0|            return res;
  904|      0|        pos = tmp.data;
  905|      0|        end = tmp.data + tmp.length;
  906|      0|    }
  907|       |
  908|      0|    u8 byte = 0;
  909|      0|    u8 *writepos = pos;
  910|       |
  911|      0|    res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  912|      0|    if(esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (912:8): [True: 0, False: 0]
  ------------------
  913|      0|       esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (913:8): [True: 0, False: 0]
  ------------------
  914|       |        /* Percent-Escaping */
  915|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (915:15): [True: 0, False: 0]
  ------------------
  916|      0|            if(*pos == '%') {
  ------------------
  |  Branch (916:16): [True: 0, False: 0]
  ------------------
  917|      0|                if(pos + 2 >= end || !isHex(pos[1]) || !isHex(pos[2]))
  ------------------
  |  Branch (917:20): [True: 0, False: 0]
  |  Branch (917:38): [True: 0, False: 0]
  |  Branch (917:56): [True: 0, False: 0]
  ------------------
  918|      0|                    goto out;
  919|      0|                if(pos[1] >= 'a')
  ------------------
  |  Branch (919:20): [True: 0, False: 0]
  ------------------
  920|      0|                    byte = pos[1] - ('a' - 10);
  921|      0|                else if(pos[1] >= 'A')
  ------------------
  |  Branch (921:25): [True: 0, False: 0]
  ------------------
  922|      0|                    byte = pos[1] - ('A' - 10);
  923|      0|                else
  924|      0|                    byte = pos[1] - '0';
  925|      0|                byte <<= 4;
  926|       |
  927|      0|                if(pos[2] >= 'a')
  ------------------
  |  Branch (927:20): [True: 0, False: 0]
  ------------------
  928|      0|                    byte += (u8)(pos[2] - ('a' - 10));
  929|      0|                else if(pos[2] >= 'A')
  ------------------
  |  Branch (929:25): [True: 0, False: 0]
  ------------------
  930|      0|                    byte += (u8)(pos[2] - ('A' - 10));
  931|      0|                else
  932|      0|                    byte += (u8)(pos[2] - '0');
  933|       |
  934|      0|                pos += 2;
  935|      0|                *writepos++ = byte;
  936|      0|                continue;
  937|      0|            }
  938|      0|            *writepos++ = *pos;
  939|      0|        }
  940|      0|    } else {
  941|       |        /* And-Escaping */
  942|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (942:15): [True: 0, False: 0]
  ------------------
  943|      0|            if(*pos == '&') {
  ------------------
  |  Branch (943:16): [True: 0, False: 0]
  ------------------
  944|      0|                pos++;
  945|      0|                if(pos == end)
  ------------------
  |  Branch (945:20): [True: 0, False: 0]
  ------------------
  946|      0|                    goto out;
  947|      0|            }
  948|      0|            *writepos++ = *pos;
  949|      0|        }
  950|      0|    }
  951|      0|    res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  952|       |
  953|      0| out:
  954|      0|    if(copyEscape) {
  ------------------
  |  Branch (954:8): [True: 0, False: 0]
  ------------------
  955|      0|        tmp.length = (size_t)(writepos - tmp.data);
  956|      0|        if(tmp.length == 0)
  ------------------
  |  Branch (956:12): [True: 0, False: 0]
  ------------------
  957|      0|            UA_String_clear(&tmp);
  958|      0|        if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (958:12): [True: 0, False: 0]
  ------------------
  959|      0|            *str = tmp;
  960|      0|        else
  961|      0|            UA_String_clear(&tmp);
  962|      0|    } else if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (962:15): [True: 0, False: 0]
  ------------------
  963|      0|        str->length = (size_t)(writepos - str->data);
  964|      0|    }
  965|      0|    return res;
  966|      0|}

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

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

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

ua_types.c:UA_ByteString_init:
  138|  2.04k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  138|  38.5k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  138|    282|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  138|    388|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_clear:
  138|     10|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  138|  13.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  138|  40.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  138|  5.39k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  138|  39.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  138|  5.44k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  138|  3.14k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  138|    323|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  138|    552|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_clear:
  138|  81.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_equal:
  138|    234|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_ByteString_clear:
  138|  5.92k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_String_clear:
  138|  5.99k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

