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

cj5_parse:
  306|  8.12k|          cj5_options *options) {
  307|  8.12k|    cj5_result r;
  308|  8.12k|    cj5__parser parser;
  309|  8.12k|    memset(&parser, 0x0, sizeof(parser));
  310|  8.12k|    parser.curr_tok_idx = 0;
  311|  8.12k|    parser.json5 = json5;
  312|  8.12k|    parser.len = len;
  313|  8.12k|    parser.tokens = tokens;
  314|  8.12k|    parser.max_tokens = max_tokens;
  315|       |
  316|  8.12k|    if(options)
  ------------------
  |  Branch (316:8): [True: 8.12k, False: 0]
  ------------------
  317|  8.12k|        parser.stop_early = options->stop_early;
  318|       |
  319|  8.12k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  320|  8.12k|    char nesting[CJ5_MAX_NESTING]; // Contains either '\0', '{' or '[' for the
  321|       |                                   // type of nesting at each depth. '\0'
  322|       |                                   // indicates we are out of the root object.
  323|  8.12k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  324|       |                                   // (value) or ',' (comma).
  325|  8.12k|    next[0] = 'v';  // The root is a "value" (object, array or primitive). If we
  326|       |                    // detect a colon after the first value then everything is
  327|       |                    // wrapped into a "virtual root object" and the parsing is
  328|       |                    // restarted.
  329|  8.12k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  330|       |
  331|  8.12k|    cj5_token *token = NULL; // The current token
  332|       |
  333|  9.48k| start_parsing:
  334|  72.4M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (334:11): [True: 72.4M, False: 7.67k]
  ------------------
  335|  72.4M|        char c = json5[parser.pos];
  336|  72.4M|        switch(c) {
  337|   586k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (337:9): [True: 586k, False: 71.8M]
  ------------------
  338|  1.69M|        case '\r':
  ------------------
  |  Branch (338:9): [True: 1.10M, False: 71.3M]
  ------------------
  339|  1.78M|        case '\t':
  ------------------
  |  Branch (339:9): [True: 96.9k, False: 72.3M]
  ------------------
  340|  1.99M|        case ' ':
  ------------------
  |  Branch (340:9): [True: 207k, False: 72.2M]
  ------------------
  341|  1.99M|            break;
  342|       |
  343|  3.03k|        case '#': // Skip comment
  ------------------
  |  Branch (343:9): [True: 3.03k, False: 72.4M]
  ------------------
  344|  6.67k|        case '/':
  ------------------
  |  Branch (344:9): [True: 3.64k, False: 72.4M]
  ------------------
  345|  6.67k|            cj5__skip_comment(&parser);
  346|  6.67k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (346:16): [True: 1.28k, False: 5.39k]
  ------------------
  347|  1.28k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (347:16): [True: 164, False: 1.11k]
  ------------------
  348|    164|                goto finish;
  349|  6.51k|            break;
  350|       |
  351|   143k|        case '{': // Open an object or array
  ------------------
  |  Branch (351:9): [True: 143k, False: 72.2M]
  ------------------
  352|   204k|        case '[':
  ------------------
  |  Branch (352:9): [True: 61.1k, False: 72.3M]
  ------------------
  353|       |            // Check the nesting depth
  354|   204k|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   53|   204k|#define CJ5_MAX_NESTING 256
  ------------------
  |  Branch (354:16): [True: 2, False: 204k]
  ------------------
  355|      2|                parser.error = CJ5_ERROR_INVALID;
  356|      2|                goto finish;
  357|      2|            }
  358|       |
  359|       |            // Correct next?
  360|   204k|            if(next[depth] != 'v') {
  ------------------
  |  Branch (360:16): [True: 32, False: 204k]
  ------------------
  361|     32|                parser.error = CJ5_ERROR_INVALID;
  362|     32|                goto finish;
  363|     32|            }
  364|       |
  365|   204k|            depth++; // Increase the nesting depth
  366|   204k|            nesting[depth] = c; // Set the nesting type
  367|   204k|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (367:27): [True: 143k, False: 61.1k]
  ------------------
  368|       |
  369|       |            // Create a token for the object or array
  370|   204k|            token = cj5__alloc_token(&parser);
  371|   204k|            if(token) {
  ------------------
  |  Branch (371:16): [True: 147k, False: 57.8k]
  ------------------
  372|   147k|                token->parent_id = parser.curr_tok_idx;
  373|   147k|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (373:31): [True: 98.9k, False: 48.1k]
  ------------------
  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|   204k|            break;
  380|       |
  381|   141k|        case '}': // Close an object or array
  ------------------
  |  Branch (381:9): [True: 141k, False: 72.2M]
  ------------------
  382|   180k|        case ']':
  ------------------
  |  Branch (382:9): [True: 38.4k, False: 72.3M]
  ------------------
  383|       |            // Check the nesting depth. Note that a "virtual root object" at
  384|       |            // depth zero must not be closed.
  385|   180k|            if(depth == 0) {
  ------------------
  |  Branch (385:16): [True: 23, False: 180k]
  ------------------
  386|     23|                parser.error = CJ5_ERROR_INVALID;
  387|     23|                goto finish;
  388|     23|            }
  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|   180k|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (393:16): [True: 11, False: 180k]
  ------------------
  394|   180k|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (394:17): [True: 141k, False: 38.4k]
  |  Branch (394:29): [True: 119k, False: 22.3k]
  |  Branch (394:51): [True: 5, False: 119k]
  ------------------
  395|     16|                parser.error = CJ5_ERROR_INVALID;
  396|     16|                goto finish;
  397|     16|            }
  398|       |
  399|   180k|            if(token) {
  ------------------
  |  Branch (399:16): [True: 119k, False: 60.6k]
  ------------------
  400|       |                // Finalize the current token
  401|   119k|                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|   119k|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (406:20): [True: 113k, False: 6.02k]
  ------------------
  407|   113k|                    parser.curr_tok_idx = token->parent_id;
  408|   113k|                    token = &tokens[token->parent_id];
  409|   113k|                    token->size++;
  410|   113k|                }
  411|   119k|            }
  412|       |
  413|       |            // Step one level up
  414|   180k|            depth--;
  415|   180k|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (415:27): [True: 6.42k, False: 173k]
  ------------------
  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|   180k|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (421:16): [True: 6.42k, False: 173k]
  |  Branch (421:30): [True: 0, False: 6.42k]
  ------------------
  422|      0|                goto finish;
  423|       |
  424|   180k|            break;
  425|       |
  426|  4.25M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (426:9): [True: 4.25M, False: 68.1M]
  ------------------
  427|  4.25M|            if(next[depth] != ':') {
  ------------------
  |  Branch (427:16): [True: 1.01k, False: 4.24M]
  ------------------
  428|  1.01k|                parser.error = CJ5_ERROR_INVALID;
  429|  1.01k|                goto finish;
  430|  1.01k|            }
  431|  4.24M|            next[depth] = 'v';
  432|  4.24M|            break;
  433|       |
  434|  30.7M|        case ',': // Comma
  ------------------
  |  Branch (434:9): [True: 30.7M, False: 41.6M]
  ------------------
  435|  30.7M|            if(next[depth] != ',') {
  ------------------
  |  Branch (435:16): [True: 23, False: 30.7M]
  ------------------
  436|     23|                parser.error = CJ5_ERROR_INVALID;
  437|     23|                goto finish;
  438|     23|            }
  439|  30.7M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (439:27): [True: 4.12M, False: 26.6M]
  ------------------
  440|  30.7M|            break;
  441|       |
  442|  35.0M|        default: // Value or key
  ------------------
  |  Branch (442:9): [True: 35.0M, False: 37.4M]
  ------------------
  443|  35.0M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (443:16): [True: 30.7M, False: 4.25M]
  ------------------
  444|  30.7M|                cj5__parse_primitive(&parser); // Parse primitive value
  445|  30.7M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (445:20): [True: 30.7M, False: 1.37k]
  ------------------
  446|       |                    // Parent is object or array
  447|  30.7M|                    if(token)
  ------------------
  |  Branch (447:24): [True: 29.5M, False: 1.20M]
  ------------------
  448|  29.5M|                        token->size++;
  449|  30.7M|                    next[depth] = ',';
  450|  30.7M|                } else {
  451|       |                    // The current value was the root element. Don't look for
  452|       |                    // any next element.
  453|  1.37k|                    next[depth] = 0;
  454|       |
  455|       |                    // The first element was successfully parsed. Stop early or try to
  456|       |                    // parse the full input string?
  457|  1.37k|                    if(parser.stop_early)
  ------------------
  |  Branch (457:24): [True: 0, False: 1.37k]
  ------------------
  458|      0|                        goto finish;
  459|  1.37k|                }
  460|  30.7M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (460:23): [True: 4.25M, False: 234]
  ------------------
  461|  4.25M|                cj5__parse_key(&parser);
  462|  4.25M|                if(token)
  ------------------
  |  Branch (462:20): [True: 3.09M, False: 1.15M]
  ------------------
  463|  3.09M|                    token->size++; // Keys count towards the length
  464|  4.25M|                next[depth] = ':';
  465|  4.25M|            } else {
  466|    234|                parser.error = CJ5_ERROR_INVALID;
  467|    234|            }
  468|       |
  469|  35.0M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (469:16): [True: 18.4M, False: 16.5M]
  |  Branch (469:32): [True: 533, False: 18.4M]
  ------------------
  470|    533|                goto finish;
  471|       |
  472|  35.0M|            break;
  473|  72.4M|        }
  474|  72.4M|    }
  475|       |
  476|       |    // Are we back to the initial nesting depth?
  477|  7.67k|    if(depth != 0) {
  ------------------
  |  Branch (477:8): [True: 205, False: 7.47k]
  ------------------
  478|    205|        parser.error = CJ5_ERROR_INCOMPLETE;
  479|    205|        goto finish;
  480|    205|    }
  481|       |
  482|       |    // Close the virtual root object if there is one
  483|  7.47k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (483:8): [True: 954, False: 6.52k]
  |  Branch (483:29): [True: 926, False: 28]
  ------------------
  484|       |        // Check the we end after a complete key-value pair (or dangling comma)
  485|    926|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (485:12): [True: 916, False: 10]
  |  Branch (485:30): [True: 67, False: 849]
  ------------------
  486|     67|            parser.error = CJ5_ERROR_INVALID;
  487|    926|        tokens[0].end = parser.pos - 1;
  488|    926|    }
  489|       |
  490|  9.48k| finish:
  491|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  492|       |    // and restart parsing.
  493|  9.48k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (493:8): [True: 2.60k, False: 6.88k]
  ------------------
  494|  2.60k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (494:8): [True: 2.08k, False: 520]
  ------------------
  495|  2.08k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (495:8): [True: 1.76k, False: 317]
  |  Branch (495:22): [True: 1.36k, False: 397]
  ------------------
  496|  1.36k|        parser.token_count = 0;
  497|  1.36k|        token = cj5__alloc_token(&parser);
  498|  1.36k|        if(token) {
  ------------------
  |  Branch (498:12): [True: 1.36k, False: 0]
  ------------------
  499|  1.36k|            token->parent_id = 0;
  500|  1.36k|            token->type = CJ5_TOKEN_OBJECT;
  501|  1.36k|            token->start = 0;
  502|  1.36k|            token->size = 0;
  503|       |
  504|  1.36k|            nesting[0] = '{';
  505|  1.36k|            next[0] = 'k';
  506|       |
  507|  1.36k|            parser.curr_tok_idx = 0;
  508|  1.36k|            parser.pos = 0;
  509|  1.36k|            parser.error = CJ5_ERROR_NONE;
  510|  1.36k|            goto start_parsing;
  511|  1.36k|        }
  512|  1.36k|    }
  513|       |
  514|  8.12k|    memset(&r, 0x0, sizeof(r));
  515|  8.12k|    r.error = parser.error;
  516|  8.12k|    r.error_pos = parser.pos;
  517|  8.12k|    r.num_tokens = parser.token_count; // How many tokens (would) have been
  518|       |                                       // consumed by the parser?
  519|       |
  520|       |    // Not a single token was parsed -> return an error
  521|  8.12k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (521:8): [True: 27, False: 8.09k]
  ------------------
  522|     27|        r.error = CJ5_ERROR_INCOMPLETE;
  523|       |
  524|       |    // Set the tokens and original string only if successfully parsed
  525|  8.12k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (525:8): [True: 6.86k, False: 1.26k]
  ------------------
  526|  6.86k|        r.tokens = tokens;
  527|  6.86k|        r.json5 = json5;
  528|  6.86k|    }
  529|       |
  530|  8.12k|    return r;
  531|  9.48k|}
cj5_get_str:
  629|  62.6k|            char *buf, unsigned int *buflen) {
  630|  62.6k|    const cj5_token *token = &r->tokens[tok_index];
  631|  62.6k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (631:8): [True: 0, False: 62.6k]
  ------------------
  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|  62.6k|    const char *pos = &r->json5[token->start];
  639|  62.6k|    const char *end = &r->json5[token->end + 1];
  640|  62.6k|    unsigned int outpos = 0;
  641|  62.6k|    cj5_error_code error = CJ5_ERROR_NONE;
  642|  21.3M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (642:11): [True: 21.2M, False: 62.4k]
  ------------------
  643|  21.2M|        uint8_t c = (uint8_t)*pos;
  644|       |        // Unprintable ascii characters must be escaped
  645|  21.2M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (645:12): [True: 69, False: 21.2M]
  |  Branch (645:23): [True: 3, False: 21.2M]
  ------------------
  646|     72|            error = CJ5_ERROR_INVALID;
  647|     72|            goto done;
  648|     72|        }
  649|       |
  650|       |        // Unescaped Ascii character or utf8 byte
  651|  21.2M|        if(c != '\\') {
  ------------------
  |  Branch (651:12): [True: 21.2M, False: 6.67k]
  ------------------
  652|  21.2M|            buf[outpos++] = (char)c;
  653|  21.2M|            continue;
  654|  21.2M|        }
  655|       |
  656|       |        // End of input before the escaped character
  657|  6.67k|        if(pos + 1 >= end) {
  ------------------
  |  Branch (657:12): [True: 0, False: 6.67k]
  ------------------
  658|      0|            error = CJ5_ERROR_INCOMPLETE;
  659|      0|            goto done;
  660|      0|        }
  661|       |
  662|       |        // Process escaped character
  663|  6.67k|        pos++;
  664|  6.67k|        c = (uint8_t)*pos;
  665|  6.67k|        switch(c) {
  666|    230|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (666:9): [True: 230, False: 6.44k]
  ------------------
  667|    243|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (667:9): [True: 243, False: 6.43k]
  ------------------
  668|    195|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (668:9): [True: 195, False: 6.47k]
  ------------------
  669|    307|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (669:9): [True: 307, False: 6.36k]
  ------------------
  670|    261|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (670:9): [True: 261, False: 6.41k]
  ------------------
  671|  3.37k|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (671:9): [True: 3.37k, False: 3.29k]
  ------------------
  672|  2.06k|        case 'u': {
  ------------------
  |  Branch (672:9): [True: 2.06k, False: 4.61k]
  ------------------
  673|       |            // Parse a unicode code point
  674|  2.06k|            if(pos + 4 >= end) {
  ------------------
  |  Branch (674:16): [True: 3, False: 2.05k]
  ------------------
  675|      3|                error = CJ5_ERROR_INCOMPLETE;
  676|      3|                goto done;
  677|      3|            }
  678|  2.05k|            pos++;
  679|  2.05k|            uint32_t utf;
  680|  2.05k|            error = parse_codepoint(pos, &utf);
  681|  2.05k|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (681:16): [True: 23, False: 2.03k]
  ------------------
  682|     23|                goto done;
  683|  2.03k|            pos += 3;
  684|       |
  685|       |            // Parse a surrogate pair
  686|  2.03k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (686:16): [True: 1.30k, False: 733]
  |  Branch (686:33): [True: 1.00k, False: 296]
  ------------------
  687|  1.00k|                if(pos + 6 >= end) {
  ------------------
  |  Branch (687:20): [True: 14, False: 991]
  ------------------
  688|     14|                    error = CJ5_ERROR_INVALID;
  689|     14|                    goto done;
  690|     14|                }
  691|    991|                if(pos[1] != '\\' && pos[2] != 'u') {
  ------------------
  |  Branch (691:20): [True: 320, False: 671]
  |  Branch (691:38): [True: 12, False: 308]
  ------------------
  692|     12|                    error = CJ5_ERROR_INVALID;
  693|     12|                    goto done;
  694|     12|                }
  695|    979|                pos += 3;
  696|    979|                uint32_t utf2;
  697|    979|                error = parse_codepoint(pos, &utf2);
  698|    979|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (698:20): [True: 17, False: 962]
  ------------------
  699|     17|                    goto done;
  700|    962|                pos += 3;
  701|       |                // High or low surrogate pair
  702|    962|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (702:23): [True: 606, False: 356]
  ------------------
  703|    606|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  704|    962|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  705|    962|            }
  706|       |
  707|       |            // Write the utf8 bytes of the code point
  708|  1.99k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  709|  1.99k|            if(len == 0) {
  ------------------
  |  Branch (709:16): [True: 32, False: 1.95k]
  ------------------
  710|     32|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  711|     32|                goto done;
  712|     32|            }
  713|  1.95k|            outpos += len;
  714|  1.95k|            break;
  715|  1.99k|        }
  716|  6.67k|        }
  717|  6.67k|    }
  718|       |
  719|  62.6k| 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|  62.6k|    buf[outpos] = 0;
  723|       |
  724|       |    // Set the output length
  725|  62.6k|    if(buflen)
  ------------------
  |  Branch (725:8): [True: 62.6k, False: 0]
  ------------------
  726|  62.6k|        *buflen = outpos;
  727|  62.6k|    return error;
  728|  62.6k|}
cj5.c:cj5__skip_comment:
  261|  6.67k|cj5__skip_comment(cj5__parser* parser) {
  262|  6.67k|    const char* json5 = parser->json5;
  263|       |
  264|       |    // Single-line comment
  265|  6.67k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (265:8): [True: 3.03k, False: 3.64k]
  ------------------
  266|  3.40k|    skip_line:
  267|  2.79M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (267:15): [True: 2.79M, False: 69]
  ------------------
  268|  2.79M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (268:16): [True: 3.33k, False: 2.79M]
  ------------------
  269|  3.33k|                parser->pos--; // Reparse the newline in the main parse loop
  270|  3.33k|                return;
  271|  3.33k|            }
  272|  2.79M|            parser->pos++;
  273|  2.79M|        }
  274|     69|        return;
  275|  3.40k|    }
  276|       |
  277|       |    // Comment begins with '/' but not enough space for another character
  278|  3.64k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (278:8): [True: 29, False: 3.61k]
  ------------------
  279|     29|        parser->error = CJ5_ERROR_INVALID;
  280|     29|        return;
  281|     29|    }
  282|  3.61k|    parser->pos++;
  283|       |
  284|       |    // Comment begins with '//' -> single-line comment
  285|  3.61k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (285:8): [True: 366, False: 3.24k]
  ------------------
  286|    366|        goto skip_line;
  287|       |
  288|       |    // Multi-line comments begin with '/*' and end with '*/'
  289|  3.24k|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (289:8): [True: 3.20k, False: 38]
  ------------------
  290|  3.20k|        parser->pos++;
  291|  1.44M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (291:15): [True: 1.44M, False: 97]
  ------------------
  292|  1.44M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (292:16): [True: 7.71k, False: 1.43M]
  |  Branch (292:45): [True: 3.11k, False: 4.59k]
  ------------------
  293|  3.11k|                parser->pos++;
  294|  3.11k|                return;
  295|  3.11k|            }
  296|  1.44M|        }
  297|  3.20k|    }
  298|       |
  299|       |    // Unknown comment type or the multi-line comment is not terminated
  300|    135|    parser->error = CJ5_ERROR_INCOMPLETE;
  301|    135|}
cj5.c:cj5__alloc_token:
   89|  35.2M|cj5__alloc_token(cj5__parser *parser) {
   90|  35.2M|    cj5_token* token = NULL;
   91|  35.2M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (91:8): [True: 16.7M, False: 18.4M]
  ------------------
   92|  16.7M|        token = &parser->tokens[parser->token_count];
   93|  16.7M|        memset(token, 0x0, sizeof(cj5_token));
   94|  18.4M|    } else {
   95|  18.4M|        parser->error = CJ5_ERROR_OVERFLOW;
   96|  18.4M|    }
   97|       |
   98|       |    // Always increase the index. So we know eventually how many token would be
   99|       |    // required (if there are not enough).
  100|  35.2M|    parser->token_count++;
  101|  35.2M|    return token;
  102|  35.2M|}
cj5.c:cj5__parse_primitive:
  153|  30.7M|cj5__parse_primitive(cj5__parser* parser) {
  154|  30.7M|    const char* json5 = parser->json5;
  155|  30.7M|    unsigned int len = parser->len;
  156|  30.7M|    unsigned int start = parser->pos;
  157|       |
  158|       |    // String value
  159|  30.7M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (159:8): [True: 1.29M, False: 29.4M]
  ------------------
  160|  29.4M|       json5[start] == '\'') {
  ------------------
  |  Branch (160:8): [True: 912, False: 29.4M]
  ------------------
  161|  1.30M|        cj5__parse_string(parser);
  162|  1.30M|        return;
  163|  1.30M|    }
  164|       |
  165|       |    // Fast comparison of bool, and null.
  166|       |    // Make the comparison case-insensitive.
  167|  29.4M|    uint32_t fourcc = 0;
  168|  29.4M|    if(start + 3 < len) {
  ------------------
  |  Branch (168:8): [True: 29.4M, False: 613]
  ------------------
  169|  29.4M|        fourcc += (unsigned char)json5[start] | 32U;
  170|  29.4M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  171|  29.4M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  172|  29.4M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  173|  29.4M|    }
  174|       |    
  175|  29.4M|    cj5_token_type type;
  176|  29.4M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (176:8): [True: 5.28k, False: 29.4M]
  ------------------
  177|  5.28k|        type = CJ5_TOKEN_NULL;
  178|  5.28k|        parser->pos += 3;
  179|  29.4M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (179:15): [True: 362, False: 29.4M]
  ------------------
  180|    362|        type = CJ5_TOKEN_BOOL;
  181|    362|        parser->pos += 3;
  182|  29.4M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (182:15): [True: 514, False: 29.4M]
  ------------------
  183|       |        // "false" has five characters
  184|    514|        type = CJ5_TOKEN_BOOL;
  185|    514|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (185:12): [True: 2, False: 512]
  |  Branch (185:32): [True: 20, False: 492]
  ------------------
  186|     22|            parser->error = CJ5_ERROR_INVALID;
  187|     22|            return;
  188|     22|        }
  189|    492|        parser->pos += 4;
  190|  29.4M|    } else {
  191|       |        // Numbers are checked for basic compatibility.
  192|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  193|  29.4M|        type = CJ5_TOKEN_NUMBER;
  194|  69.0M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (194:15): [True: 69.0M, False: 929]
  ------------------
  195|  69.0M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   86|   138M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (195:16): [True: 35.8M, False: 33.1M]
  ------------------
  196|  35.8M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (196:16): [True: 35.8M, False: 1.95k]
  ------------------
  197|  35.8M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   85|   104M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (197:16): [True: 32.8M, False: 2.97M]
  ------------------
  198|  32.8M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   84|   101M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (198:16): [True: 29.8M, False: 3.04M]
  ------------------
  199|  29.8M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (199:16): [True: 29.8M, False: 2.43k]
  |  Branch (199:48): [True: 29.4M, False: 363k]
  ------------------
  200|  29.4M|                break;
  201|  29.4M|            }
  202|  69.0M|        }
  203|  29.4M|        parser->pos--; // Point to the last character that is still inside the
  204|       |                       // primitive value
  205|  29.4M|    }
  206|       |
  207|  29.4M|    cj5_token *token = cj5__alloc_token(parser);
  208|  29.4M|    if(token) {
  ------------------
  |  Branch (208:8): [True: 13.8M, False: 15.6M]
  ------------------
  209|  13.8M|        token->type = type;
  210|  13.8M|        token->start = start;
  211|  13.8M|        token->end = parser->pos;
  212|  13.8M|        token->size = parser->pos - start + 1;
  213|  13.8M|        token->parent_id = parser->curr_tok_idx;
  214|  13.8M|    }
  215|  29.4M|}
cj5.c:cj5__parse_string:
  105|  3.07M|cj5__parse_string(cj5__parser *parser) {
  106|  3.07M|    const char *json5 = parser->json5;
  107|  3.07M|    unsigned int len = parser->len;
  108|  3.07M|    unsigned int start = parser->pos;
  109|  3.07M|    char str_open = json5[start];
  110|       |
  111|  3.07M|    parser->pos++;
  112|  60.0M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (112:11): [True: 60.0M, False: 145]
  ------------------
  113|  60.0M|        char c = json5[parser->pos];
  114|       |
  115|       |        // End of string
  116|  60.0M|        if(str_open == c) {
  ------------------
  |  Branch (116:12): [True: 3.07M, False: 56.9M]
  ------------------
  117|  3.07M|            cj5_token *token = cj5__alloc_token(parser);
  118|  3.07M|            if(token) {
  ------------------
  |  Branch (118:16): [True: 1.52M, False: 1.55M]
  ------------------
  119|  1.52M|                token->type = CJ5_TOKEN_STRING;
  120|  1.52M|                token->start = start + 1;
  121|  1.52M|                token->end = parser->pos - 1;
  122|  1.52M|                token->size = token->end - token->start + 1;
  123|  1.52M|                token->parent_id = parser->curr_tok_idx;
  124|  1.52M|            } 
  125|  3.07M|            return;
  126|  3.07M|        }
  127|       |
  128|       |        // Unescaped newlines are forbidden
  129|  56.9M|        if(c == '\n') {
  ------------------
  |  Branch (129:12): [True: 6, False: 56.9M]
  ------------------
  130|      6|            parser->error = CJ5_ERROR_INVALID;
  131|      6|            return;
  132|      6|        }
  133|       |
  134|       |        // Skip escape character
  135|  56.9M|        if(c == '\\') {
  ------------------
  |  Branch (135:12): [True: 260k, False: 56.7M]
  ------------------
  136|   260k|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (136:16): [True: 3, False: 260k]
  ------------------
  137|      3|                parser->error = CJ5_ERROR_INCOMPLETE;
  138|      3|                return;
  139|      3|            }
  140|   260k|            parser->pos++;
  141|   260k|        }
  142|  56.9M|    }
  143|       |
  144|       |    // The file has ended before the string terminates
  145|    145|    parser->error = CJ5_ERROR_INCOMPLETE;
  146|    145|}
cj5.c:cj5__isrange:
   80|   154M|cj5__isrange(char ch, char from, char to) {
   81|   154M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   82|   154M|}
cj5.c:cj5__parse_key:
  218|  4.25M|cj5__parse_key(cj5__parser* parser) {
  219|  4.25M|    const char* json5 = parser->json5;
  220|  4.25M|    unsigned int start = parser->pos;
  221|  4.25M|    cj5_token* token;
  222|       |
  223|       |    // Key is a a normal string
  224|  4.25M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (224:8): [True: 1.77M, False: 2.47M]
  |  Branch (224:32): [True: 2.29k, False: 2.47M]
  ------------------
  225|  1.77M|        cj5__parse_string(parser);
  226|  1.77M|        return;
  227|  1.77M|    }
  228|       |
  229|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  230|  2.47M|    unsigned int len = parser->len;
  231|  8.09M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (231:11): [True: 8.09M, False: 74]
  ------------------
  232|  8.09M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   85|  16.1M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 2.01M, False: 6.07M]
  |  |  ------------------
  ------------------
  233|  6.07M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  14.1M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 3.12M, False: 2.95M]
  |  |  ------------------
  ------------------
  234|  2.95M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (234:12): [True: 1.18k, False: 2.94M]
  |  Branch (234:41): [True: 1.84k, False: 2.94M]
  ------------------
  235|  5.14M|            continue;
  236|  2.94M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   86|  5.89M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 476k, False: 2.47M]
  |  |  ------------------
  ------------------
  |  Branch (236:46): [True: 476k, False: 11]
  ------------------
  237|   476k|            continue;
  238|  2.47M|        break;
  239|  2.94M|    }
  240|       |
  241|       |    // An empty key is not allowed
  242|  2.47M|    if(parser->pos <= start) {
  ------------------
  |  Branch (242:8): [True: 123, False: 2.47M]
  ------------------
  243|    123|        parser->error = CJ5_ERROR_INVALID;
  244|    123|        return;
  245|    123|    }
  246|       |
  247|       |    // Move pos to the last character within the unquoted key
  248|  2.47M|    parser->pos--;
  249|       |
  250|  2.47M|    token = cj5__alloc_token(parser);
  251|  2.47M|    if(token) {
  ------------------
  |  Branch (251:8): [True: 1.26M, False: 1.20M]
  ------------------
  252|  1.26M|        token->type = CJ5_TOKEN_STRING;
  253|  1.26M|        token->start = start;
  254|  1.26M|        token->end = parser->pos;
  255|  1.26M|        token->size = parser->pos - start + 1;
  256|  1.26M|        token->parent_id = parser->curr_tok_idx;
  257|  1.26M|    }
  258|  2.47M|}
cj5.c:parse_codepoint:
  608|  3.03k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  609|  3.03k|    uint32_t utf = 0;
  610|  15.0k|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (610:29): [True: 12.0k, False: 2.99k]
  ------------------
  611|  12.0k|        char byte = pos[i];
  612|  12.0k|        if(cj5__isnum(byte)) {
  ------------------
  |  |   86|  12.0k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 3.26k, False: 8.83k]
  |  |  ------------------
  ------------------
  613|  3.26k|            byte = (char)(byte - '0');
  614|  8.83k|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (614:19): [True: 6.57k, False: 2.25k]
  ------------------
  615|  6.57k|            byte = (char)(byte - ('a' - 10));
  616|  6.57k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (616:19): [True: 2.21k, False: 40]
  ------------------
  617|  2.21k|            byte = (char)(byte - ('A' - 10));
  618|  2.21k|        } else {
  619|     40|            return CJ5_ERROR_INVALID;
  620|     40|        }
  621|  12.0k|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  622|  12.0k|    }
  623|  2.99k|    *out_utf = utf;
  624|  2.99k|    return CJ5_ERROR_NONE;
  625|  3.03k|}

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

parseUInt64:
   30|  2.97M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  2.97M|    size_t i = 0;
   32|  2.97M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  2.97M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 12.9k, False: 2.96M]
  |  Branch (35:20): [True: 6.57k, False: 6.41k]
  |  Branch (35:37): [True: 1.41k, False: 5.16k]
  ------------------
   36|  1.41k|        i = 2;
   37|   139k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 138k, False: 825]
  ------------------
   38|   138k|            uint8_t c = (uint8_t)str[i] | 32;
   39|   138k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 138k, False: 199]
  |  Branch (39:28): [True: 130k, False: 7.71k]
  ------------------
   40|   130k|                c = (uint8_t)(c - '0');
   41|  7.91k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 7.70k, False: 203]
  |  Branch (41:33): [True: 7.32k, False: 383]
  ------------------
   42|  7.32k|                c = (uint8_t)(c - 'a' + 10);
   43|    586|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 384, False: 202]
  |  Branch (43:33): [True: 0, False: 384]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    586|            else
   46|    586|                break;
   47|   138k|            n = (n << 4) | (c & 0xF);
   48|   138k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 5, False: 138k]
  ------------------
   49|      5|                return 0;
   50|   138k|            prev = n;
   51|   138k|        }
   52|  1.41k|        *result = n;
   53|  1.41k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 1.38k, False: 27]
  ------------------
   54|  1.41k|    }
   55|       |
   56|       |    /* Decimal */
   57|  8.80M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 5.83M, False: 2.97M]
  ------------------
   58|  5.83M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 6.43k, False: 5.83M]
  |  Branch (58:28): [True: 1.02k, False: 5.83M]
  ------------------
   59|  7.46k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  5.83M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  5.83M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 14, False: 5.83M]
  ------------------
   63|     14|            return 0;
   64|  5.83M|        prev = n;
   65|  5.83M|    }
   66|  2.97M|    *result = n;
   67|  2.97M|    return i;
   68|  2.97M|}
parseInt64:
   71|  1.61M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.61M|    size_t i = 0;
   74|  1.61M|    bool neg = false;
   75|  1.61M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 1.01k, False: 1.61M]
  |  Branch (75:23): [True: 350, False: 1.61M]
  ------------------
   76|  1.36k|        neg = (*str == '-');
   77|  1.36k|        i++;
   78|  1.36k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.61M|    uint64_t n = 0;
   82|  1.61M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.61M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 102, False: 1.61M]
  ------------------
   84|    102|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.61M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 1.61M, False: 1.00k]
  ------------------
   88|  1.61M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 55, False: 1.61M]
  ------------------
   89|     55|            return 0;
   90|  1.61M|        *result = (int64_t)n;
   91|  1.61M|    } else {
   92|       |        /* n is unsigned, so 9223372036854775808UL == 2^63 fits without
   93|       |         * overflow. (int64_t)n would also fit for n in [0, 2^63], but
   94|       |         * the negation -(int64_t)(2^63) is undefined because the result
   95|       |         * (which is +2^63) cannot be represented. Use the unsigned
   96|       |         * representation and reinterpret as int64_t instead. */
   97|  1.00k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 1, False: 1.00k]
  ------------------
   98|      1|            return 0;
   99|  1.00k|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 194, False: 809]
  ------------------
  100|  1.00k|            ? (int64_t)(-9223372036854775807LL - 1)
  101|  1.00k|            : -(int64_t)n;
  102|  1.00k|    }
  103|  1.61M|    return len + i;
  104|  1.61M|}
parseDouble:
  106|   525k|size_t parseDouble(const char *str, size_t size, double *result) {
  107|   525k|    char buf[2000];
  108|   525k|    if(size >= 2000)
  ------------------
  |  Branch (108:8): [True: 1, False: 525k]
  ------------------
  109|      1|        return 0;
  110|   525k|    memcpy(buf, str, size);
  111|   525k|    buf[size] = 0;
  112|   525k|    errno = 0;
  113|   525k|    char *endptr;
  114|   525k|    *result = strtod(buf, &endptr);
  115|   525k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (115:8): [True: 199, False: 524k]
  |  Branch (115:22): [True: 0, False: 199]
  ------------------
  116|      0|        return 0;
  117|   525k|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|   525k|}

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

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

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

UA_findDataTypeWithCustom:
   66|  21.9k|                          const UA_DataTypeArray *customTypes) {
   67|       |    /* Always look in built-in types first (may contain data types from all
   68|       |     * namespaces).
   69|       |     *
   70|       |     * TODO: The standard-defined types are ordered. See if binary search is
   71|       |     * more efficient. */
   72|  3.80M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  3.80M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (72:23): [True: 3.79M, False: 8.63k]
  ------------------
   73|  3.79M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (73:12): [True: 13.2k, False: 3.77M]
  ------------------
   74|  13.2k|            return &UA_TYPES[i];
   75|  3.79M|    }
   76|       |
   77|       |    /* Search in the customTypes */
   78|  8.63k|    while(customTypes) {
  ------------------
  |  Branch (78:11): [True: 0, False: 8.63k]
  ------------------
   79|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (79:27): [True: 0, False: 0]
  ------------------
   80|      0|            if(nodeIdOrder(&customTypes->types[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (80:16): [True: 0, False: 0]
  ------------------
   81|      0|                return &customTypes->types[i];
   82|      0|        }
   83|      0|        customTypes = customTypes->next;
   84|      0|    }
   85|       |
   86|  8.63k|    return NULL;
   87|  8.63k|}
UA_STRING:
  223|    127|UA_STRING(char *chars) {
  224|    127|    UA_String s = {0, NULL};
  225|    127|    if(!chars)
  ------------------
  |  Branch (225:8): [True: 0, False: 127]
  ------------------
  226|      0|        return s;
  227|    127|    s.length = strlen(chars);
  228|    127|    s.data = (UA_Byte*)chars;
  229|    127|    return s;
  230|    127|}
UA_DateTime_fromStruct:
  515|    124|UA_DateTime_fromStruct(UA_DateTimeStruct ts) {
  516|       |    /* Seconds since the Unix epoch */
  517|    124|    struct musl_tm tm;
  518|    124|    memset(&tm, 0, sizeof(struct musl_tm));
  519|    124|    tm.tm_year = ts.year - 1900;
  520|    124|    tm.tm_mon = ts.month - 1;
  521|    124|    tm.tm_mday = ts.day;
  522|    124|    tm.tm_hour = ts.hour;
  523|    124|    tm.tm_min = ts.min;
  524|    124|    tm.tm_sec = ts.sec;
  525|    124|    long long sec_epoch = musl_tm_to_secs(&tm);
  526|       |
  527|    124|    UA_DateTime t = UA_DATETIME_UNIX_EPOCH;
  ------------------
  |  |  328|    124|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|    124|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|    124|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|    124|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  528|    124|    t += sec_epoch * UA_DATETIME_SEC;
  ------------------
  |  |  286|    124|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|    124|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    124|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  529|    124|    t += ts.milliSec * UA_DATETIME_MSEC;
  ------------------
  |  |  285|    124|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    124|#define UA_DATETIME_USEC 10LL
  |  |  ------------------
  ------------------
  530|    124|    t += ts.microSec * UA_DATETIME_USEC;
  ------------------
  |  |  284|    124|#define UA_DATETIME_USEC 10LL
  ------------------
  531|    124|    t += ts.nanoSec / 100;
  532|    124|    return t;
  533|    124|}
UA_ByteString_allocBuffer:
  762|  8.37k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  763|  8.37k|    UA_ByteString_init(bs);
  764|  8.37k|    if(length == 0) {
  ------------------
  |  Branch (764:8): [True: 0, False: 8.37k]
  ------------------
  765|      0|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  766|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  767|      0|    }
  768|  8.37k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  8.37k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  769|  8.37k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  579|  8.37k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 5, False: 8.36k]
  |  |  ------------------
  ------------------
  770|      5|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  771|  8.36k|    bs->length = length;
  772|  8.36k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.36k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  773|  8.37k|}
UA_new:
 1926|  26.7k|UA_new(const UA_DataType *type) {
 1927|  26.7k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  26.7k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1928|  26.7k|    return p;
 1929|  26.7k|}
UA_copy:
 2102|  22.0k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2103|  22.0k|    memset(dst, 0, type->memSize); /* init */
 2104|  22.0k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2105|  22.0k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  22.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2105:8): [True: 6, False: 22.0k]
  ------------------
 2106|      6|        UA_clear(dst, type);
 2107|  22.0k|    return retval;
 2108|  22.0k|}
UA_clear:
 2205|   399k|UA_clear(void *p, const UA_DataType *type) {
 2206|   399k|    clearJumpTable[type->typeKind](p, type);
 2207|   399k|    memset(p, 0, type->memSize); /* init */
 2208|   399k|}
UA_delete:
 2211|  9.02k|UA_delete(void *p, const UA_DataType *type) {
 2212|  9.02k|    clearJumpTable[type->typeKind](p, type);
 2213|  9.02k|    UA_free(p);
  ------------------
  |  |   19|  9.02k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2214|  9.02k|}
UA_order:
 2679|    127|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2680|    127|    return orderJumpTable[type->typeKind](p1, p2, type);
 2681|    127|}
UA_Array_new:
 2693|  4.88k|UA_Array_new(size_t size, const UA_DataType *type) {
 2694|  4.88k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  101|  4.88k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2694:8): [True: 0, False: 4.88k]
  ------------------
 2695|      0|        return NULL;
 2696|  4.88k|    if(size == 0)
  ------------------
  |  Branch (2696:8): [True: 3, False: 4.88k]
  ------------------
 2697|      3|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      3|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2698|  4.88k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2698:8): [True: 0, False: 4.88k]
  ------------------
 2699|      0|        return NULL;
 2700|  4.88k|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  4.88k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2701|  4.88k|}
UA_Array_copy:
 2705|  22.0k|              void **dst, const UA_DataType *type) {
 2706|  22.0k|    if(size == 0) {
  ------------------
  |  Branch (2706:8): [True: 4.28k, False: 17.7k]
  ------------------
 2707|  4.28k|        if(src == NULL)
  ------------------
  |  Branch (2707:12): [True: 0, False: 4.28k]
  ------------------
 2708|      0|            *dst = NULL;
 2709|  4.28k|        else
 2710|  4.28k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  4.28k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2711|  4.28k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.28k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2712|  4.28k|    }
 2713|       |
 2714|       |    /* Check the array consistency -- defensive programming in case the user
 2715|       |     * manually created an inconsistent array */
 2716|  17.7k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  579|  35.4k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 17.7k]
  |  |  |  Branch (579:43): [True: 0, False: 17.7k]
  |  |  |  Branch (579:43): [True: 0, False: 17.7k]
  |  |  ------------------
  ------------------
 2717|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2718|       |
 2719|  17.7k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2719:8): [True: 0, False: 17.7k]
  ------------------
 2720|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2721|  17.7k|    size_t byteSize = size * type->memSize;
 2722|       |
 2723|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2724|  17.7k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  17.7k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2725|  17.7k|    if(!*dst)
  ------------------
  |  Branch (2725:8): [True: 6, False: 17.7k]
  ------------------
 2726|      6|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      6|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2727|       |
 2728|  17.7k|    if(type->pointerFree) {
  ------------------
  |  Branch (2728:8): [True: 17.7k, False: 0]
  ------------------
 2729|  17.7k|        memcpy(*dst, src, byteSize);
 2730|  17.7k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  17.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2731|  17.7k|    }
 2732|       |
 2733|      0|    uintptr_t ptrs = (uintptr_t)src;
 2734|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2735|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2736|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2736:23): [True: 0, False: 0]
  ------------------
 2737|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2738|      0|        ptrs += type->memSize;
 2739|      0|        ptrd += type->memSize;
 2740|      0|    }
 2741|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2741:8): [True: 0, False: 0]
  ------------------
 2742|      0|        UA_Array_delete(*dst, size, type);
 2743|       |        *dst = NULL;
 2744|      0|    }
 2745|      0|    return retval;
 2746|  17.7k|}
UA_Array_delete:
 2848|   182k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2849|   182k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2849:8): [True: 31.6k, False: 151k]
  ------------------
 2850|  31.6k|        uintptr_t ptr = (uintptr_t)p;
 2851|   308k|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2851:27): [True: 277k, False: 31.6k]
  ------------------
 2852|   277k|            UA_clear((void*)ptr, type);
 2853|   277k|            ptr += type->memSize;
 2854|   277k|        }
 2855|  31.6k|    }
 2856|   182k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|   182k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2857|   182k|}
ua_types.c:Variant_clear:
 1384|   245k|Variant_clear(void *p, const UA_DataType *_) {
 1385|   245k|    UA_Variant *v = (UA_Variant *)p;
 1386|       |
 1387|       |    /* The content is "borrowed" */
 1388|   245k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1388:8): [True: 0, False: 245k]
  ------------------
 1389|      0|        return;
 1390|       |
 1391|       |    /* Delete the value */
 1392|   245k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  756|  29.1k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1392:8): [True: 29.1k, False: 216k]
  |  Branch (1392:19): [True: 26.1k, False: 3.03k]
  ------------------
 1393|  26.1k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1393:12): [True: 17.6k, False: 8.47k]
  ------------------
 1394|  17.6k|            v->arrayLength = 1;
 1395|  26.1k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1396|  26.1k|        v->data = NULL;
 1397|  26.1k|    }
 1398|       |
 1399|       |    /* Delete the array dimensions */
 1400|   245k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  756|   245k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1400:8): [True: 82, False: 245k]
  ------------------
 1401|     82|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|     82|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1402|   245k|}
ua_types.c:DataValue_clear:
 1856|   233k|DataValue_clear(void *p, const UA_DataType *_) {
 1857|   233k|    UA_DataValue *dv = (UA_DataValue *)p;
 1858|       |    Variant_clear(&dv->value, NULL);
 1859|   233k|}
ua_types.c:String_copy:
  284|  22.0k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  285|  22.0k|    const UA_String *srcS = (const UA_String*)src;
  286|  22.0k|    UA_String *dstS = (UA_String *)dst;
  287|  22.0k|    UA_StatusCode res =
  288|  22.0k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  289|  22.0k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|  22.0k|#define UA_TYPES_BYTE 2
  ------------------
  290|  22.0k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  22.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (290:8): [True: 22.0k, False: 6]
  ------------------
  291|  22.0k|        dstS->length = srcS->length;
  292|  22.0k|    return res;
  293|  22.0k|}
ua_types.c:nopClear:
 2167|  15.7k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  296|   142k|String_clear(void *p, const UA_DataType *_) {
  297|   142k|    UA_String *s = (UA_String*)p;
  298|   142k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|   142k|#define UA_TYPES_BYTE 2
  ------------------
  299|   142k|}
ua_types.c:NodeId_clear:
  777|  43.1k|NodeId_clear(void *p, const UA_DataType *_) {
  778|  43.1k|    UA_NodeId *id = (UA_NodeId*)p;
  779|  43.1k|    switch(id->identifierType) {
  780|  8.47k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (780:5): [True: 8.47k, False: 34.7k]
  ------------------
  781|  9.55k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (781:5): [True: 1.08k, False: 42.1k]
  ------------------
  782|  9.55k|        String_clear(&id->identifier.string, NULL);
  783|  9.55k|        break;
  784|  33.6k|    default: break;
  ------------------
  |  Branch (784:5): [True: 33.6k, False: 9.55k]
  ------------------
  785|  43.1k|    }
  786|  43.1k|}
ua_types.c:ExpandedNodeId_clear:
 1078|  4.71k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1079|  4.71k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1080|  4.71k|    NodeId_clear(&id->nodeId, NULL);
 1081|       |    String_clear(&id->namespaceUri, NULL);
 1082|  4.71k|}
ua_types.c:QualifiedName_clear:
  402|  13.0k|QualifiedName_clear(void *p, const UA_DataType *_) {
  403|  13.0k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  404|       |    String_clear(&qn->name, NULL);
  405|  13.0k|}
ua_types.c:LocalizedText_clear:
 1839|  2.15k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1840|  2.15k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1841|  2.15k|    String_clear(&lt->locale, NULL);
 1842|       |    String_clear(&lt->text, NULL);
 1843|  2.15k|}
ua_types.c:ExtensionObject_clear:
 1251|  27.4k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1252|  27.4k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1253|  27.4k|    switch(eo->encoding) {
 1254|  6.69k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1254:5): [True: 6.69k, False: 20.8k]
  ------------------
 1255|  7.09k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1255:5): [True: 402, False: 27.0k]
  ------------------
 1256|  10.0k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1256:5): [True: 2.99k, False: 24.4k]
  ------------------
 1257|  18.4k|    case UA_EXTENSIONOBJECT_ENCODED_JSON:
  ------------------
  |  Branch (1257:5): [True: 8.37k, False: 19.1k]
  ------------------
 1258|  18.4k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1259|  18.4k|        String_clear(&eo->content.encoded.body, NULL);
 1260|  18.4k|        break;
 1261|  9.02k|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1261:5): [True: 9.02k, False: 18.4k]
  ------------------
 1262|  9.02k|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1262:12): [True: 9.02k, False: 0]
  ------------------
 1263|  9.02k|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1264|  9.02k|        break;
 1265|      0|    default:
  ------------------
  |  Branch (1265:5): [True: 0, False: 27.4k]
  ------------------
 1266|      0|        break;
 1267|  27.4k|    }
 1268|  27.4k|}
ua_types.c:DiagnosticInfo_clear:
 1886|  2.29k|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1887|  2.29k|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1888|       |
 1889|  2.29k|    String_clear(&di->additionalInfo, NULL);
 1890|  2.29k|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1890:8): [True: 1, False: 2.29k]
  |  Branch (1890:38): [True: 1, False: 0]
  ------------------
 1891|      1|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1892|      1|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      1|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1893|      1|    }
 1894|  2.29k|}
ua_types.c:clearStructure:
 2111|  5.28k|clearStructure(void *p, const UA_DataType *type) {
 2112|  5.28k|    uintptr_t ptr = (uintptr_t)p;
 2113|  30.0k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2113:23): [True: 24.7k, False: 5.28k]
  ------------------
 2114|  24.7k|        const UA_DataTypeMember *m = &type->members[i];
 2115|  24.7k|        const UA_DataType *mt = m->memberType;
 2116|  24.7k|        ptr += m->padding;
 2117|  24.7k|        if(!m->isOptional) {
  ------------------
  |  Branch (2117:12): [True: 24.7k, False: 0]
  ------------------
 2118|  24.7k|            if(!m->isArray) {
  ------------------
  |  Branch (2118:16): [True: 18.2k, False: 6.52k]
  ------------------
 2119|  18.2k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2120|  18.2k|                ptr += mt->memSize;
 2121|  18.2k|            } else {
 2122|  6.52k|                size_t length = *(size_t*)ptr;
 2123|  6.52k|                ptr += sizeof(size_t);
 2124|  6.52k|                UA_Array_delete(*(void**)ptr, length, mt);
 2125|  6.52k|                ptr += sizeof(void*);
 2126|  6.52k|            }
 2127|  24.7k|        } else { /* field is optional */
 2128|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2128:16): [True: 0, False: 0]
  ------------------
 2129|       |                /* optional scalar field is contained */
 2130|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2130:20): [True: 0, False: 0]
  ------------------
 2131|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2132|      0|                ptr += sizeof(void *);
 2133|      0|            } else {
 2134|       |                /* optional array field is contained */
 2135|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2135:20): [True: 0, False: 0]
  ------------------
 2136|      0|                    size_t length = *(size_t *)ptr;
 2137|      0|                    ptr += sizeof(size_t);
 2138|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2139|      0|                    ptr += sizeof(void *);
 2140|      0|                } else { /* optional array field not contained */
 2141|      0|                    ptr += sizeof(size_t);
 2142|      0|                    ptr += sizeof(void *);
 2143|      0|                }
 2144|      0|            }
 2145|      0|        }
 2146|  24.7k|    }
 2147|  5.28k|}
ua_types.c:nodeIdOrder:
 2297|  3.79M|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2298|  3.79M|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2299|  3.79M|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2300|       |    /* Compare namespaceIndex */
 2301|  3.79M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2301:8): [True: 91.1k, False: 3.70M]
  ------------------
 2302|  91.1k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2302:16): [True: 91.1k, False: 0]
  ------------------
 2303|       |
 2304|       |    /* Compare identifierType */
 2305|  3.70M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2305:8): [True: 1.00M, False: 2.69M]
  ------------------
 2306|  1.00M|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2306:16): [True: 1.00M, False: 0]
  ------------------
 2307|       |
 2308|       |    /* Compare the identifier */
 2309|  2.69M|    switch(p1->identifierType) {
 2310|  2.69M|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2310:5): [True: 2.69M, False: 0]
  ------------------
 2311|  2.69M|    default:
  ------------------
  |  Branch (2311:5): [True: 0, False: 2.69M]
  ------------------
 2312|  2.69M|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2312:12): [True: 2.68M, False: 13.2k]
  ------------------
 2313|  2.68M|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2313:20): [True: 281k, False: 2.40M]
  ------------------
 2314|  2.40M|                UA_ORDER_LESS : UA_ORDER_MORE;
 2315|  13.2k|        return UA_ORDER_EQ;
 2316|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2316:5): [True: 0, False: 2.69M]
  ------------------
 2317|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2318|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2318:5): [True: 0, False: 2.69M]
  ------------------
 2319|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2319:5): [True: 0, False: 2.69M]
  ------------------
 2320|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2321|  2.69M|    }
 2322|  2.69M|}
ua_types.c:stringOrder:
 2280|    127|stringOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2281|    127|    const UA_String *p1 = (const UA_String*)p1_;
 2282|    127|    const UA_String *p2 = (const UA_String*)p2_;
 2283|    127|    if(p1->length != p2->length)
  ------------------
  |  Branch (2283:8): [True: 41, False: 86]
  ------------------
 2284|     41|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2284:16): [True: 4, False: 37]
  ------------------
 2285|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2286|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2287|     86|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2287:8): [True: 0, False: 86]
  ------------------
 2288|     86|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2288:8): [True: 0, False: 86]
  ------------------
 2289|     86|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2289:8): [True: 0, False: 86]
  ------------------
 2290|     86|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2291|     86|    if(cmp != 0)
  ------------------
  |  Branch (2291:8): [True: 85, False: 1]
  ------------------
 2292|     85|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2292:16): [True: 32, False: 53]
  ------------------
 2293|      1|    return UA_ORDER_EQ;
 2294|     86|}

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

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

UA_Guid_parse:
   86|     68|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|     68|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|     68|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     68|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 62, False: 6]
  ------------------
   89|     62|        *guid = UA_GUID_NULL;
   90|     68|    return res;
   91|     68|}
UA_NodeId_parseEx:
  323|  27.8k|                  const UA_NamespaceMapping *nsMapping) {
  324|  27.8k|    UA_StatusCode res =
  325|  27.8k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  27.8k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  27.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 1.84k, False: 25.9k]
  ------------------
  327|  1.84k|        UA_NodeId_clear(id);
  328|  27.8k|    return res;
  329|  27.8k|}
UA_ExpandedNodeId_parseEx:
  671|  3.82k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  3.82k|    UA_StatusCode res =
  673|  3.82k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  3.82k|                             nsMapping, serverUrisSize, serverUris);
  675|  3.82k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.82k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 457, False: 3.36k]
  ------------------
  676|    457|        UA_ExpandedNodeId_clear(id);
  677|  3.82k|    return res;
  678|  3.82k|}
UA_QualifiedName_parseEx:
  834|  12.5k|                         const UA_NamespaceMapping *nsMapping) {
  835|  12.5k|    const u8 *pos = str.data;
  836|  12.5k|    const u8 *end = str.data + str.length;
  837|  12.5k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  838|  12.5k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  12.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (838:8): [True: 2, False: 12.5k]
  ------------------
  839|      2|        UA_QualifiedName_clear(qn);
  840|  12.5k|    return res;
  841|  12.5k|}
ua_types_lex.c:parse_guid:
   50|     93|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|     93|    size_t len = (size_t)(e - s);
   52|     93|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 27, False: 66]
  |  Branch (52:21): [True: 13, False: 53]
  |  Branch (52:36): [True: 4, False: 49]
  |  Branch (52:52): [True: 5, False: 44]
  ------------------
   53|     49|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     49|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|     44|    UA_UInt32 tmp;
   56|     44|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 9, False: 35]
  ------------------
   57|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|     35|    guid->data1 = tmp;
   59|       |
   60|     35|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 7, False: 28]
  ------------------
   61|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|     28|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|     28|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 5, False: 23]
  ------------------
   65|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|     23|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|     23|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 4, False: 19]
  ------------------
   69|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|     19|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|     19|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 3, False: 16]
  ------------------
   73|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|     16|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|     97|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 87, False: 10]
  ------------------
   77|     87|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 6, False: 81]
  ------------------
   78|      6|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|     81|        guid->data4[pos] = (UA_Byte)tmp;
   80|     81|    }
   81|       |
   82|     10|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     10|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|     16|}
ua_types_lex.c:parse_nodeid:
  148|  27.8k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  27.8k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  27.8k|    LexContext context;
  151|  27.8k|    memset(&context, 0, sizeof(LexContext));
  152|  27.8k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  27.8k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  27.8k|{
  157|  27.8k|	u8 yych;
  158|  27.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  27.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  27.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  27.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 27.0k, False: 747]
  |  |  ------------------
  ------------------
  159|  27.8k|	switch (yych) {
  160|    515|		case 'b':
  ------------------
  |  Branch (160:3): [True: 515, False: 27.2k]
  ------------------
  161|    558|		case 'g':
  ------------------
  |  Branch (161:3): [True: 43, False: 27.7k]
  ------------------
  162|  19.7k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 19.1k, False: 8.63k]
  ------------------
  163|  24.6k|		case 's':
  ------------------
  |  Branch (163:3): [True: 4.97k, False: 22.8k]
  ------------------
  164|  24.6k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  24.6k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  24.6k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  24.6k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  24.6k|			goto yy3;
  167|  1.60k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 1.60k, False: 26.2k]
  ------------------
  168|  1.50k|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 1.50k, False: 26.2k]
  ------------------
  169|  27.8k|	}
  170|  1.50k|yy1:
  171|  1.50k|	YYSKIP();
  ------------------
  |  |   35|  1.50k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.50k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|  1.76k|yy2:
  173|  1.76k|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|  1.76k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  24.6k|yy3:
  175|  24.6k|	YYSKIP();
  ------------------
  |  |   35|  24.6k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  24.6k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  24.6k|	yych = YYPEEK();
  ------------------
  |  |   33|  24.6k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 24.6k, False: 13]
  |  |  ------------------
  ------------------
  177|  24.6k|	switch (yych) {
  178|  24.6k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 24.6k, False: 42]
  ------------------
  179|     42|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 42, False: 24.6k]
  ------------------
  180|  24.6k|	}
  181|  1.60k|yy4:
  182|  1.60k|	YYSKIP();
  ------------------
  |  |   35|  1.60k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.60k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  1.60k|	YYBACKUP();
  ------------------
  |  |   36|  1.60k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.60k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.60k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  1.60k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.60k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.60k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.59k, False: 3]
  |  |  ------------------
  ------------------
  185|  1.60k|	switch (yych) {
  186|  1.58k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 1.58k, False: 15]
  ------------------
  187|     15|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 15, False: 1.58k]
  ------------------
  188|  1.60k|	}
  189|  26.0k|yy5:
  190|  26.0k|	YYSKIP();
  ------------------
  |  |   35|  26.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  26.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  26.0k|	nsu = context.yyt2;
  192|  26.0k|	ns = context.yyt1;
  193|  26.0k|	YYSTAGP(body);
  ------------------
  |  |   38|  26.0k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  26.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  26.0k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  26.0k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  26.0k|	{ goto match; }
  196|  1.58k|yy6:
  197|  1.58k|	YYSKIP();
  ------------------
  |  |   35|  1.58k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.58k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  1.58k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.58k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.58k, False: 5]
  |  |  ------------------
  ------------------
  199|  1.58k|	switch (yych) {
  200|    628|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 628, False: 958]
  ------------------
  201|    952|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 952, False: 634]
  ------------------
  202|      6|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 6, False: 1.58k]
  ------------------
  203|  1.58k|	}
  204|    200|yy7:
  205|    200|	YYRESTORE();
  ------------------
  |  |   37|    200|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    200|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    200|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    200|	goto yy2;
  207|    628|yy8:
  208|    628|	YYSKIP();
  ------------------
  |  |   35|    628|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    628|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|    628|	yych = YYPEEK();
  ------------------
  |  |   33|    628|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    628|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    625|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 625, False: 3]
  |  |  ------------------
  ------------------
  210|    628|	switch (yych) {
  211|    253|		case '0':
  ------------------
  |  Branch (211:3): [True: 253, False: 375]
  ------------------
  212|    297|		case '1':
  ------------------
  |  Branch (212:3): [True: 44, False: 584]
  ------------------
  213|    340|		case '2':
  ------------------
  |  Branch (213:3): [True: 43, False: 585]
  ------------------
  214|    370|		case '3':
  ------------------
  |  Branch (214:3): [True: 30, False: 598]
  ------------------
  215|    399|		case '4':
  ------------------
  |  Branch (215:3): [True: 29, False: 599]
  ------------------
  216|    466|		case '5':
  ------------------
  |  Branch (216:3): [True: 67, False: 561]
  ------------------
  217|    547|		case '6':
  ------------------
  |  Branch (217:3): [True: 81, False: 547]
  ------------------
  218|    582|		case '7':
  ------------------
  |  Branch (218:3): [True: 35, False: 593]
  ------------------
  219|    613|		case '8':
  ------------------
  |  Branch (219:3): [True: 31, False: 597]
  ------------------
  220|    619|		case '9':
  ------------------
  |  Branch (220:3): [True: 6, False: 622]
  ------------------
  221|    619|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    619|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    619|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|    619|			goto yy10;
  223|      9|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 9, False: 619]
  ------------------
  224|    628|	}
  225|    952|yy9:
  226|    952|	YYSKIP();
  ------------------
  |  |   35|    952|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    952|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|    952|	yych = YYPEEK();
  ------------------
  |  |   33|    952|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    952|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    948|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 948, False: 4]
  |  |  ------------------
  ------------------
  228|    952|	switch (yych) {
  229|    944|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 944, False: 8]
  ------------------
  230|      8|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 8, False: 944]
  ------------------
  231|    952|	}
  232|  3.55k|yy10:
  233|  3.55k|	YYSKIP();
  ------------------
  |  |   35|  3.55k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.55k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  3.55k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.55k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.55k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.44k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.44k, False: 106]
  |  |  ------------------
  ------------------
  235|  3.55k|	switch (yych) {
  236|    499|		case '0':
  ------------------
  |  Branch (236:3): [True: 499, False: 3.05k]
  ------------------
  237|    776|		case '1':
  ------------------
  |  Branch (237:3): [True: 277, False: 3.27k]
  ------------------
  238|  1.01k|		case '2':
  ------------------
  |  Branch (238:3): [True: 242, False: 3.30k]
  ------------------
  239|  1.31k|		case '3':
  ------------------
  |  Branch (239:3): [True: 293, False: 3.25k]
  ------------------
  240|  1.54k|		case '4':
  ------------------
  |  Branch (240:3): [True: 232, False: 3.31k]
  ------------------
  241|  1.76k|		case '5':
  ------------------
  |  Branch (241:3): [True: 223, False: 3.32k]
  ------------------
  242|  2.01k|		case '6':
  ------------------
  |  Branch (242:3): [True: 251, False: 3.29k]
  ------------------
  243|  2.26k|		case '7':
  ------------------
  |  Branch (243:3): [True: 252, False: 3.29k]
  ------------------
  244|  2.59k|		case '8':
  ------------------
  |  Branch (244:3): [True: 324, False: 3.22k]
  ------------------
  245|  2.93k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 338, False: 3.21k]
  ------------------
  246|    509|		case ';':
  ------------------
  |  Branch (246:3): [True: 509, False: 3.04k]
  ------------------
  247|    509|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    509|#define YYSTAGN(t) t = NULL
  ------------------
  248|    509|			goto yy12;
  249|    110|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 110, False: 3.44k]
  ------------------
  250|  3.55k|	}
  251|    944|yy11:
  252|    944|	YYSKIP();
  ------------------
  |  |   35|    944|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    944|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|    944|	yych = YYPEEK();
  ------------------
  |  |   33|    944|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    944|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    939|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 939, False: 5]
  |  |  ------------------
  ------------------
  254|    944|	switch (yych) {
  255|      5|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 5, False: 939]
  ------------------
  256|    599|		case ';':
  ------------------
  |  Branch (256:3): [True: 599, False: 345]
  ------------------
  257|    599|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    599|#define YYSTAGN(t) t = NULL
  ------------------
  258|    599|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    599|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    599|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|    599|			goto yy12;
  260|    340|		default:
  ------------------
  |  Branch (260:3): [True: 340, False: 604]
  ------------------
  261|    340|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    340|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    340|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    340|			goto yy13;
  263|    944|	}
  264|  1.43k|yy12:
  265|  1.43k|	YYSKIP();
  ------------------
  |  |   35|  1.43k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.43k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  1.43k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.43k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.43k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.42k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.42k, False: 15]
  |  |  ------------------
  ------------------
  267|  1.43k|	switch (yych) {
  268|    204|		case 'b':
  ------------------
  |  Branch (268:3): [True: 204, False: 1.23k]
  ------------------
  269|    406|		case 'g':
  ------------------
  |  Branch (269:3): [True: 202, False: 1.23k]
  ------------------
  270|    610|		case 'i':
  ------------------
  |  Branch (270:3): [True: 204, False: 1.23k]
  ------------------
  271|  1.41k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 809, False: 626]
  ------------------
  272|     16|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 16, False: 1.41k]
  ------------------
  273|  1.43k|	}
  274|  1.23k|yy13:
  275|  1.23k|	YYSKIP();
  ------------------
  |  |   35|  1.23k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|  1.23k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.23k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.21k, False: 13]
  |  |  ------------------
  ------------------
  277|  1.23k|	switch (yych) {
  278|     13|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 13, False: 1.21k]
  ------------------
  279|    327|		case ';':
  ------------------
  |  Branch (279:3): [True: 327, False: 903]
  ------------------
  280|    327|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    327|#define YYSTAGN(t) t = NULL
  ------------------
  281|    327|			goto yy12;
  282|    890|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 890, False: 340]
  ------------------
  283|  1.23k|	}
  284|  1.41k|yy14:
  285|  1.41k|	YYSKIP();
  ------------------
  |  |   35|  1.41k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.41k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  1.41k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.41k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.41k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.39k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.39k, False: 28]
  |  |  ------------------
  ------------------
  287|  1.41k|	switch (yych) {
  288|  1.38k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 1.38k, False: 33]
  ------------------
  289|     33|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 33, False: 1.38k]
  ------------------
  290|  1.41k|	}
  291|  1.41k|}
  292|       |
  293|       |
  294|  26.0k| match:
  295|  26.0k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 892, False: 25.1k]
  ------------------
  296|       |        /* NamespaceUri */
  297|    892|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|    892|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|    892|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    892|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 892, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|    892|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|    892|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|    892|            return UA_String_copy(&total, &id->identifier.string);
  304|    892|        }
  305|  25.1k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 494, False: 24.6k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|    494|        UA_UInt32 tmp;
  308|    494|        size_t len = (size_t)(body - 1 - ns);
  309|    494|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 494]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|    494|        id->namespaceIndex = (UA_UInt16)tmp;
  312|    494|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 494]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|    494|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  25.1k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  26.0k|}
ua_types_lex.c:escapedUri2Index:
   95|  1.81k|                 const UA_NamespaceMapping *nsMapping) {
   96|  1.81k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 1.81k, False: 0]
  ------------------
   97|  1.81k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  1.81k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   98|      0|    UA_String tmp = uri; 
   99|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
  100|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (100:8): [True: 0, False: 0]
  ------------------
  101|      0|        return res;
  102|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  103|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (103:8): [True: 0, False: 0]
  ------------------
  104|      0|        UA_String_clear(&uri);
  105|      0|    return res;
  106|      0|}
ua_types_lex.c:parse_nodeid_body:
  109|  27.4k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  27.4k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  27.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  27.4k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  27.4k|    switch(*body) {
  113|  19.8k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 19.8k, False: 7.57k]
  ------------------
  114|  19.8k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  19.8k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 37, False: 19.8k]
  ------------------
  116|     37|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  19.8k|        break;
  118|  6.47k|    case 's':
  ------------------
  |  Branch (118:5): [True: 6.47k, False: 20.9k]
  ------------------
  119|  6.47k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  6.47k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  6.47k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  6.47k|        break;
  123|     25|    case 'g':
  ------------------
  |  Branch (123:5): [True: 25, False: 27.3k]
  ------------------
  124|     25|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     25|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     25|        break;
  127|  1.08k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 1.08k, False: 26.3k]
  ------------------
  128|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  129|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  130|       |         * the NodeId identifier part. */
  131|  1.08k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  1.08k|        id->identifier.byteString.data =
  133|  1.08k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  1.08k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 26, False: 1.05k]
  ------------------
  135|     26|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  399|     26|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 26, False: 0]
  ------------------
  136|     26|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     26|        }
  138|  1.08k|        break;
  139|  1.08k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 27.4k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  27.4k|    }
  143|  27.4k|    return res;
  144|  27.4k|}
ua_types_lex.c:parse_expandednodeid:
  339|  3.82k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  3.82k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  3.82k|    LexContext context;
  342|  3.82k|    memset(&context, 0, sizeof(LexContext));
  343|  3.82k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  3.82k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  3.82k|{
  348|  3.82k|	u8 yych;
  349|  3.82k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.82k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.82k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.82k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.82k, False: 5]
  |  |  ------------------
  ------------------
  350|  3.82k|	switch (yych) {
  351|    225|		case 'b':
  ------------------
  |  Branch (351:3): [True: 225, False: 3.60k]
  ------------------
  352|    229|		case 'g':
  ------------------
  |  Branch (352:3): [True: 4, False: 3.82k]
  ------------------
  353|    439|		case 'i':
  ------------------
  |  Branch (353:3): [True: 210, False: 3.61k]
  ------------------
  354|    439|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    439|#define YYSTAGN(t) t = NULL
  ------------------
  355|    439|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    439|#define YYSTAGN(t) t = NULL
  ------------------
  356|    439|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    439|#define YYSTAGN(t) t = NULL
  ------------------
  357|    439|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    439|#define YYSTAGN(t) t = NULL
  ------------------
  358|    439|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    439|#define YYSTAGN(t) t = NULL
  ------------------
  359|    439|			goto yy18;
  360|  1.31k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 1.31k, False: 2.51k]
  ------------------
  361|  1.31k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.31k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  1.31k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.31k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  1.31k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.31k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  1.31k|			goto yy19;
  365|  2.06k|		case 's':
  ------------------
  |  Branch (365:3): [True: 2.06k, False: 1.75k]
  ------------------
  366|  2.06k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  2.06k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  2.06k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  2.06k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  2.06k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  2.06k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  2.06k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  2.06k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  2.06k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  2.06k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  2.06k|			goto yy20;
  372|      6|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 6, False: 3.82k]
  ------------------
  373|  3.82k|	}
  374|      6|yy16:
  375|      6|	YYSKIP();
  ------------------
  |  |   35|      6|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    445|yy17:
  377|    445|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    445|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|    439|yy18:
  379|    439|	YYSKIP();
  ------------------
  |  |   35|    439|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    439|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|    439|	yych = YYPEEK();
  ------------------
  |  |   33|    439|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    439|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    428|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 428, False: 11]
  |  |  ------------------
  ------------------
  381|    439|	switch (yych) {
  382|    414|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 414, False: 25]
  ------------------
  383|     25|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 25, False: 414]
  ------------------
  384|    439|	}
  385|  1.31k|yy19:
  386|  1.31k|	YYSKIP();
  ------------------
  |  |   35|  1.31k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.31k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  1.31k|	YYBACKUP();
  ------------------
  |  |   36|  1.31k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.31k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.31k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  1.31k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.31k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.31k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.31k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.31k, False: 1]
  |  |  ------------------
  ------------------
  389|  1.31k|	switch (yych) {
  390|  1.30k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 1.30k, False: 12]
  ------------------
  391|     12|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 12, False: 1.30k]
  ------------------
  392|  1.31k|	}
  393|  2.06k|yy20:
  394|  2.06k|	YYSKIP();
  ------------------
  |  |   35|  2.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  2.06k|	YYBACKUP();
  ------------------
  |  |   36|  2.06k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  2.06k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  2.06k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.06k, False: 3]
  |  |  ------------------
  ------------------
  397|  2.06k|	switch (yych) {
  398|    217|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 217, False: 1.85k]
  ------------------
  399|  1.84k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.84k, False: 220]
  ------------------
  400|      3|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 3, False: 2.06k]
  ------------------
  401|  2.06k|	}
  402|  3.38k|yy21:
  403|  3.38k|	YYSKIP();
  ------------------
  |  |   35|  3.38k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.38k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  3.38k|	svr = context.yyt5;
  405|  3.38k|	svu = context.yyt1;
  406|  3.38k|	sve = context.yyt2;
  407|  3.38k|	ns = context.yyt3;
  408|  3.38k|	nsu = context.yyt4;
  409|  3.38k|	YYSTAGP(body);
  ------------------
  |  |   38|  3.38k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.38k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  3.38k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  3.38k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  3.38k|	{ goto match; }
  412|  1.76k|yy22:
  413|  1.76k|	YYSKIP();
  ------------------
  |  |   35|  1.76k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.76k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  1.76k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.76k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.76k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.75k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.75k, False: 8]
  |  |  ------------------
  ------------------
  415|  1.76k|	switch (yych) {
  416|    520|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 520, False: 1.24k]
  ------------------
  417|  1.23k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 1.23k, False: 533]
  ------------------
  418|     13|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 13, False: 1.75k]
  ------------------
  419|  1.76k|	}
  420|    399|yy23:
  421|    399|	YYRESTORE();
  ------------------
  |  |   37|    399|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    399|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    399|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    399|	goto yy17;
  423|  1.84k|yy24:
  424|  1.84k|	YYSKIP();
  ------------------
  |  |   35|  1.84k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.84k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.84k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.84k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.84k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.84k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.84k, False: 1]
  |  |  ------------------
  ------------------
  426|  1.84k|	switch (yych) {
  427|    657|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 657, False: 1.19k]
  ------------------
  428|  1.18k|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 1.18k, False: 661]
  ------------------
  429|      4|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 4, False: 1.84k]
  ------------------
  430|  1.84k|	}
  431|    520|yy25:
  432|    520|	YYSKIP();
  ------------------
  |  |   35|    520|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    520|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|    520|	yych = YYPEEK();
  ------------------
  |  |   33|    520|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    520|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    518|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 518, False: 2]
  |  |  ------------------
  ------------------
  434|    520|	switch (yych) {
  435|    159|		case '0':
  ------------------
  |  Branch (435:3): [True: 159, False: 361]
  ------------------
  436|    197|		case '1':
  ------------------
  |  Branch (436:3): [True: 38, False: 482]
  ------------------
  437|    215|		case '2':
  ------------------
  |  Branch (437:3): [True: 18, False: 502]
  ------------------
  438|    240|		case '3':
  ------------------
  |  Branch (438:3): [True: 25, False: 495]
  ------------------
  439|    254|		case '4':
  ------------------
  |  Branch (439:3): [True: 14, False: 506]
  ------------------
  440|    279|		case '5':
  ------------------
  |  Branch (440:3): [True: 25, False: 495]
  ------------------
  441|    495|		case '6':
  ------------------
  |  Branch (441:3): [True: 216, False: 304]
  ------------------
  442|    503|		case '7':
  ------------------
  |  Branch (442:3): [True: 8, False: 512]
  ------------------
  443|    513|		case '8':
  ------------------
  |  Branch (443:3): [True: 10, False: 510]
  ------------------
  444|    516|		case '9':
  ------------------
  |  Branch (444:3): [True: 3, False: 517]
  ------------------
  445|    516|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    516|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    516|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    516|			goto yy29;
  447|      4|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 4, False: 516]
  ------------------
  448|    520|	}
  449|  1.23k|yy26:
  450|  1.23k|	YYSKIP();
  ------------------
  |  |   35|  1.23k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  1.23k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.23k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.23k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.22k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.22k, False: 1]
  |  |  ------------------
  ------------------
  452|  1.23k|	switch (yych) {
  453|  1.21k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 1.21k, False: 13]
  ------------------
  454|     13|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 13, False: 1.21k]
  ------------------
  455|  1.23k|	}
  456|    657|yy27:
  457|    657|	YYSKIP();
  ------------------
  |  |   35|    657|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    657|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|    657|	yych = YYPEEK();
  ------------------
  |  |   33|    657|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    657|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    656|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 656, False: 1]
  |  |  ------------------
  ------------------
  459|    657|	switch (yych) {
  460|    643|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 643, False: 14]
  ------------------
  461|     14|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 14, False: 643]
  ------------------
  462|    657|	}
  463|  1.18k|yy28:
  464|  1.18k|	YYSKIP();
  ------------------
  |  |   35|  1.18k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.18k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|  1.18k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.18k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.18k, False: 2]
  |  |  ------------------
  ------------------
  466|  1.18k|	switch (yych) {
  467|  1.17k|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 1.17k, False: 13]
  ------------------
  468|     13|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 13, False: 1.17k]
  ------------------
  469|  1.18k|	}
  470|  3.46k|yy29:
  471|  3.46k|	YYSKIP();
  ------------------
  |  |   35|  3.46k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.46k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  3.46k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.46k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.46k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.38k, False: 86]
  |  |  ------------------
  ------------------
  473|  3.46k|	switch (yych) {
  474|    550|		case '0':
  ------------------
  |  Branch (474:3): [True: 550, False: 2.91k]
  ------------------
  475|    787|		case '1':
  ------------------
  |  Branch (475:3): [True: 237, False: 3.23k]
  ------------------
  476|  1.03k|		case '2':
  ------------------
  |  Branch (476:3): [True: 249, False: 3.22k]
  ------------------
  477|  1.32k|		case '3':
  ------------------
  |  Branch (477:3): [True: 288, False: 3.18k]
  ------------------
  478|  1.58k|		case '4':
  ------------------
  |  Branch (478:3): [True: 261, False: 3.20k]
  ------------------
  479|  1.82k|		case '5':
  ------------------
  |  Branch (479:3): [True: 239, False: 3.23k]
  ------------------
  480|  2.11k|		case '6':
  ------------------
  |  Branch (480:3): [True: 294, False: 3.17k]
  ------------------
  481|  2.38k|		case '7':
  ------------------
  |  Branch (481:3): [True: 270, False: 3.19k]
  ------------------
  482|  2.66k|		case '8':
  ------------------
  |  Branch (482:3): [True: 276, False: 3.19k]
  ------------------
  483|  2.95k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 289, False: 3.18k]
  ------------------
  484|    427|		case ';':
  ------------------
  |  Branch (484:3): [True: 427, False: 3.04k]
  ------------------
  485|    427|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    427|#define YYSTAGN(t) t = NULL
  ------------------
  486|    427|			goto yy33;
  487|     89|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 89, False: 3.38k]
  ------------------
  488|  3.46k|	}
  489|  1.21k|yy30:
  490|  1.21k|	YYSKIP();
  ------------------
  |  |   35|  1.21k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  1.21k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.21k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.21k, False: 1]
  |  |  ------------------
  ------------------
  492|  1.21k|	switch (yych) {
  493|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 1, False: 1.21k]
  ------------------
  494|    550|		case ';':
  ------------------
  |  Branch (494:3): [True: 550, False: 667]
  ------------------
  495|    550|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    550|#define YYSTAGN(t) t = NULL
  ------------------
  496|    550|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    550|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    550|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    550|			goto yy33;
  498|    666|		default:
  ------------------
  |  Branch (498:3): [True: 666, False: 551]
  ------------------
  499|    666|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    666|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    666|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    666|			goto yy34;
  501|  1.21k|	}
  502|    643|yy31:
  503|    643|	YYSKIP();
  ------------------
  |  |   35|    643|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    643|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|    643|	yych = YYPEEK();
  ------------------
  |  |   33|    643|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    643|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    642|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 642, False: 1]
  |  |  ------------------
  ------------------
  505|    643|	switch (yych) {
  506|    227|		case '0':
  ------------------
  |  Branch (506:3): [True: 227, False: 416]
  ------------------
  507|    327|		case '1':
  ------------------
  |  Branch (507:3): [True: 100, False: 543]
  ------------------
  508|    348|		case '2':
  ------------------
  |  Branch (508:3): [True: 21, False: 622]
  ------------------
  509|    404|		case '3':
  ------------------
  |  Branch (509:3): [True: 56, False: 587]
  ------------------
  510|    430|		case '4':
  ------------------
  |  Branch (510:3): [True: 26, False: 617]
  ------------------
  511|    494|		case '5':
  ------------------
  |  Branch (511:3): [True: 64, False: 579]
  ------------------
  512|    547|		case '6':
  ------------------
  |  Branch (512:3): [True: 53, False: 590]
  ------------------
  513|    605|		case '7':
  ------------------
  |  Branch (513:3): [True: 58, False: 585]
  ------------------
  514|    627|		case '8':
  ------------------
  |  Branch (514:3): [True: 22, False: 621]
  ------------------
  515|    634|		case '9':
  ------------------
  |  Branch (515:3): [True: 7, False: 636]
  ------------------
  516|    634|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|    634|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    634|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|    634|			goto yy35;
  518|      9|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 9, False: 634]
  ------------------
  519|    643|	}
  520|  1.17k|yy32:
  521|  1.17k|	YYSKIP();
  ------------------
  |  |   35|  1.17k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.17k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|  1.17k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.17k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.17k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.17k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.17k, False: 2]
  |  |  ------------------
  ------------------
  523|  1.17k|	switch (yych) {
  524|      2|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 2, False: 1.17k]
  ------------------
  525|    805|		case ';':
  ------------------
  |  Branch (525:3): [True: 805, False: 369]
  ------------------
  526|    805|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    805|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    805|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|    805|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    805|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    805|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    805|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    805|#define YYSTAGN(t) t = NULL
  ------------------
  529|    805|			goto yy37;
  530|    367|		default:
  ------------------
  |  Branch (530:3): [True: 367, False: 807]
  ------------------
  531|    367|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    367|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    367|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    367|			goto yy36;
  533|  1.17k|	}
  534|  1.63k|yy33:
  535|  1.63k|	YYSKIP();
  ------------------
  |  |   35|  1.63k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.63k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  1.63k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.63k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.63k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.61k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.61k, False: 15]
  |  |  ------------------
  ------------------
  537|  1.63k|	switch (yych) {
  538|    219|		case 'b':
  ------------------
  |  Branch (538:3): [True: 219, False: 1.41k]
  ------------------
  539|    426|		case 'g':
  ------------------
  |  Branch (539:3): [True: 207, False: 1.42k]
  ------------------
  540|    904|		case 'i':
  ------------------
  |  Branch (540:3): [True: 478, False: 1.15k]
  ------------------
  541|  1.61k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 711, False: 923]
  ------------------
  542|     19|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 19, False: 1.61k]
  ------------------
  543|  1.63k|	}
  544|  1.73k|yy34:
  545|  1.73k|	YYSKIP();
  ------------------
  |  |   35|  1.73k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.73k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|  1.73k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.73k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.73k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.72k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.72k, False: 9]
  |  |  ------------------
  ------------------
  547|  1.73k|	switch (yych) {
  548|      9|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 9, False: 1.72k]
  ------------------
  549|    657|		case ';':
  ------------------
  |  Branch (549:3): [True: 657, False: 1.07k]
  ------------------
  550|    657|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    657|#define YYSTAGN(t) t = NULL
  ------------------
  551|    657|			goto yy33;
  552|  1.06k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 1.06k, False: 666]
  ------------------
  553|  1.73k|	}
  554|  87.4k|yy35:
  555|  87.4k|	YYSKIP();
  ------------------
  |  |   35|  87.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  87.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  87.4k|	yych = YYPEEK();
  ------------------
  |  |   33|  87.4k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  87.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  87.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 87.3k, False: 83]
  |  |  ------------------
  ------------------
  557|  87.4k|	switch (yych) {
  558|  83.9k|		case '0':
  ------------------
  |  Branch (558:3): [True: 83.9k, False: 3.53k]
  ------------------
  559|  84.2k|		case '1':
  ------------------
  |  Branch (559:3): [True: 267, False: 87.2k]
  ------------------
  560|  84.5k|		case '2':
  ------------------
  |  Branch (560:3): [True: 294, False: 87.1k]
  ------------------
  561|  84.7k|		case '3':
  ------------------
  |  Branch (561:3): [True: 271, False: 87.2k]
  ------------------
  562|  85.0k|		case '4':
  ------------------
  |  Branch (562:3): [True: 274, False: 87.2k]
  ------------------
  563|  85.5k|		case '5':
  ------------------
  |  Branch (563:3): [True: 515, False: 86.9k]
  ------------------
  564|  85.8k|		case '6':
  ------------------
  |  Branch (564:3): [True: 263, False: 87.2k]
  ------------------
  565|  86.3k|		case '7':
  ------------------
  |  Branch (565:3): [True: 487, False: 86.9k]
  ------------------
  566|  86.5k|		case '8':
  ------------------
  |  Branch (566:3): [True: 251, False: 87.2k]
  ------------------
  567|  86.8k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 275, False: 87.2k]
  ------------------
  568|    512|		case ';':
  ------------------
  |  Branch (568:3): [True: 512, False: 86.9k]
  ------------------
  569|    512|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    512|#define YYSTAGN(t) t = NULL
  ------------------
  570|    512|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    512|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    512|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|    512|			goto yy37;
  572|    122|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 122, False: 87.3k]
  ------------------
  573|  87.4k|	}
  574|  3.17M|yy36:
  575|  3.17M|	YYSKIP();
  ------------------
  |  |   35|  3.17M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.17M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  3.17M|	yych = YYPEEK();
  ------------------
  |  |   33|  3.17M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.17M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.17M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.17M, False: 25]
  |  |  ------------------
  ------------------
  577|  3.17M|	switch (yych) {
  578|     25|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 25, False: 3.17M]
  ------------------
  579|    342|		case ';':
  ------------------
  |  Branch (579:3): [True: 342, False: 3.17M]
  ------------------
  580|    342|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    342|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    342|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    342|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    342|#define YYSTAGN(t) t = NULL
  ------------------
  582|    342|			goto yy37;
  583|  3.17M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 3.17M, False: 367]
  ------------------
  584|  3.17M|	}
  585|  1.65k|yy37:
  586|  1.65k|	YYSKIP();
  ------------------
  |  |   35|  1.65k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.65k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.65k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.65k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.65k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.64k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.64k, False: 10]
  |  |  ------------------
  ------------------
  588|  1.65k|	switch (yych) {
  589|    198|		case 'b':
  ------------------
  |  Branch (589:3): [True: 198, False: 1.46k]
  ------------------
  590|    591|		case 'g':
  ------------------
  |  Branch (590:3): [True: 393, False: 1.26k]
  ------------------
  591|    795|		case 'i':
  ------------------
  |  Branch (591:3): [True: 204, False: 1.45k]
  ------------------
  592|  1.17k|		case 's':
  ------------------
  |  Branch (592:3): [True: 384, False: 1.27k]
  ------------------
  593|  1.17k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.17k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.17k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.17k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.17k|			goto yy38;
  596|    466|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 466, False: 1.19k]
  ------------------
  597|     14|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 14, False: 1.64k]
  ------------------
  598|  1.65k|	}
  599|  2.79k|yy38:
  600|  2.79k|	YYSKIP();
  ------------------
  |  |   35|  2.79k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.79k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  2.79k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.79k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.79k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.75k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.75k, False: 40]
  |  |  ------------------
  ------------------
  602|  2.79k|	switch (yych) {
  603|  2.75k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 2.75k, False: 44]
  ------------------
  604|     44|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 44, False: 2.75k]
  ------------------
  605|  2.79k|	}
  606|    466|yy39:
  607|    466|	YYSKIP();
  ------------------
  |  |   35|    466|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    466|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|    466|	yych = YYPEEK();
  ------------------
  |  |   33|    466|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    466|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    465|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 465, False: 1]
  |  |  ------------------
  ------------------
  609|    466|	switch (yych) {
  610|    462|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 462, False: 4]
  ------------------
  611|      4|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 4, False: 462]
  ------------------
  612|    466|	}
  613|    466|}
  614|       |
  615|       |
  616|  3.38k| match:
  617|  3.38k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 1.10k, False: 2.27k]
  ------------------
  618|       |        /* ServerUri */
  619|  1.10k|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|  1.10k|        size_t i = 0;
  621|  1.10k|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 1.10k]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|  1.10k|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 1.10k, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|  1.10k|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|  1.10k|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|  1.10k|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|  1.10k|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  2.27k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 500, False: 1.77k]
  ------------------
  634|       |        /* ServerIndex */
  635|    500|        size_t len = (size_t)(sve - svr);
  636|    500|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 500]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|    500|    }
  639|       |
  640|  2.27k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 978, False: 1.29k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    978|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    978|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    978|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  644|       |        /* Try to map the NamespaceUri to its NamespaceIndex for ServerIndex == 0.
  645|       |         * If this fails, keep the full NamespaceUri. */
  646|    978|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 725, False: 253]
  ------------------
  647|    725|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    978|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    978|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 978, False: 0]
  ------------------
  649|    978|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    978|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    978|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 1, False: 977]
  ------------------
  651|      1|            return res;
  652|  1.29k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 419, False: 878]
  ------------------
  653|       |        /* NamespaceIndex */
  654|    419|        UA_UInt32 tmp;
  655|    419|        size_t len = (size_t)(body - 1 - ns);
  656|    419|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 419]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|    419|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|    419|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 419]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|    419|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  2.27k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  2.27k|}
ua_types_lex.c:parse_qn:
  707|  12.5k|         UA_UInt16 defaultNamespaceIndex) {
  708|  12.5k|    size_t len;
  709|  12.5k|    UA_UInt32 tmp;
  710|  12.5k|    UA_String str;
  711|  12.5k|    UA_StatusCode res;
  712|       |
  713|  12.5k|    LexContext context;
  714|  12.5k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  12.5k|    const u8 *begin = pos;
  717|  12.5k|    UA_QualifiedName_init(qn);
  718|  12.5k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  12.5k|{
  722|  12.5k|	u8 yych;
  723|  12.5k|	yych = YYPEEK();
  ------------------
  |  |   33|  12.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  12.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  11.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 11.6k, False: 878]
  |  |  ------------------
  ------------------
  724|  12.5k|	switch (yych) {
  725|    878|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 878, False: 11.6k]
  ------------------
  726|  1.08k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 202, False: 12.3k]
  ------------------
  727|    397|		case '0':
  ------------------
  |  Branch (727:3): [True: 397, False: 12.1k]
  ------------------
  728|    685|		case '1':
  ------------------
  |  Branch (728:3): [True: 288, False: 12.2k]
  ------------------
  729|  1.56k|		case '2':
  ------------------
  |  Branch (729:3): [True: 881, False: 11.6k]
  ------------------
  730|  1.85k|		case '3':
  ------------------
  |  Branch (730:3): [True: 293, False: 12.2k]
  ------------------
  731|  3.78k|		case '4':
  ------------------
  |  Branch (731:3): [True: 1.92k, False: 10.6k]
  ------------------
  732|  4.77k|		case '5':
  ------------------
  |  Branch (732:3): [True: 993, False: 11.5k]
  ------------------
  733|  8.49k|		case '6':
  ------------------
  |  Branch (733:3): [True: 3.71k, False: 8.85k]
  ------------------
  734|  8.95k|		case '7':
  ------------------
  |  Branch (734:3): [True: 462, False: 12.1k]
  ------------------
  735|  9.77k|		case '8':
  ------------------
  |  Branch (735:3): [True: 824, False: 11.7k]
  ------------------
  736|  10.0k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 288, False: 12.2k]
  ------------------
  737|  1.41k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 1.41k, False: 11.1k]
  ------------------
  738|  12.5k|	}
  739|  1.08k|yy41:
  740|  1.08k|	YYSKIP();
  ------------------
  |  |   35|  1.08k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.08k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  12.0k|yy42:
  742|  12.0k|	{ pos = begin; goto match_name; }
  743|  1.41k|yy43:
  744|  1.41k|	YYSKIP();
  ------------------
  |  |   35|  1.41k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.41k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  1.41k|	YYBACKUP();
  ------------------
  |  |   36|  1.41k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.41k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.41k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  1.41k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.41k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.41k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    968|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 968, False: 451]
  |  |  ------------------
  ------------------
  747|  1.41k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 451, False: 968]
  ------------------
  748|    968|	goto yy46;
  749|  10.0k|yy44:
  750|  10.0k|	YYSKIP();
  ------------------
  |  |   35|  10.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  10.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  10.0k|	YYBACKUP();
  ------------------
  |  |   36|  10.0k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  10.0k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  10.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  10.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  10.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.63k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.63k, False: 8.42k]
  |  |  ------------------
  ------------------
  753|  10.0k|	switch (yych) {
  754|    140|		case '0':
  ------------------
  |  Branch (754:3): [True: 140, False: 9.92k]
  ------------------
  755|    204|		case '1':
  ------------------
  |  Branch (755:3): [True: 64, False: 10.0k]
  ------------------
  756|    254|		case '2':
  ------------------
  |  Branch (756:3): [True: 50, False: 10.0k]
  ------------------
  757|    273|		case '3':
  ------------------
  |  Branch (757:3): [True: 19, False: 10.0k]
  ------------------
  758|    378|		case '4':
  ------------------
  |  Branch (758:3): [True: 105, False: 9.96k]
  ------------------
  759|    439|		case '5':
  ------------------
  |  Branch (759:3): [True: 61, False: 10.0k]
  ------------------
  760|    508|		case '6':
  ------------------
  |  Branch (760:3): [True: 69, False: 9.99k]
  ------------------
  761|    569|		case '7':
  ------------------
  |  Branch (761:3): [True: 61, False: 10.0k]
  ------------------
  762|    732|		case '8':
  ------------------
  |  Branch (762:3): [True: 163, False: 9.90k]
  ------------------
  763|    779|		case '9':
  ------------------
  |  Branch (763:3): [True: 47, False: 10.0k]
  ------------------
  764|  1.11k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 332, False: 9.73k]
  ------------------
  765|  8.95k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 8.95k, False: 1.11k]
  ------------------
  766|  10.0k|	}
  767|  21.4k|yy45:
  768|  21.4k|	YYSKIP();
  ------------------
  |  |   35|  21.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  21.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  21.4k|	yych = YYPEEK();
  ------------------
  |  |   33|  21.4k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  21.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  20.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 20.6k, False: 773]
  |  |  ------------------
  ------------------
  770|  22.4k|yy46:
  771|  22.4k|	switch (yych) {
  772|    773|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 773, False: 21.6k]
  ------------------
  773|    195|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 195, False: 22.2k]
  ------------------
  774|  21.4k|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 21.4k, False: 968]
  ------------------
  775|  22.4k|	}
  776|  1.53k|yy47:
  777|  1.53k|	YYRESTORE();
  ------------------
  |  |   37|  1.53k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  1.53k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  1.53k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  1.53k|	goto yy42;
  779|    195|yy48:
  780|    195|	YYSKIP();
  ------------------
  |  |   35|    195|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    195|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    195|	{ goto match_uri; }
  782|  7.55k|yy49:
  783|  7.55k|	YYSKIP();
  ------------------
  |  |   35|  7.55k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.55k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|  7.55k|	yych = YYPEEK();
  ------------------
  |  |   33|  7.55k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.55k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.94k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.94k, False: 606]
  |  |  ------------------
  ------------------
  785|  8.66k|yy50:
  786|  8.66k|	switch (yych) {
  787|  3.20k|		case '0':
  ------------------
  |  Branch (787:3): [True: 3.20k, False: 5.45k]
  ------------------
  788|  3.57k|		case '1':
  ------------------
  |  Branch (788:3): [True: 366, False: 8.29k]
  ------------------
  789|  3.85k|		case '2':
  ------------------
  |  Branch (789:3): [True: 282, False: 8.38k]
  ------------------
  790|  4.18k|		case '3':
  ------------------
  |  Branch (790:3): [True: 328, False: 8.33k]
  ------------------
  791|  4.56k|		case '4':
  ------------------
  |  Branch (791:3): [True: 385, False: 8.27k]
  ------------------
  792|  5.84k|		case '5':
  ------------------
  |  Branch (792:3): [True: 1.28k, False: 7.38k]
  ------------------
  793|  6.14k|		case '6':
  ------------------
  |  Branch (793:3): [True: 295, False: 8.36k]
  ------------------
  794|  6.45k|		case '7':
  ------------------
  |  Branch (794:3): [True: 312, False: 8.35k]
  ------------------
  795|  7.18k|		case '8':
  ------------------
  |  Branch (795:3): [True: 734, False: 7.92k]
  ------------------
  796|  7.55k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 364, False: 8.29k]
  ------------------
  797|    347|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 347, False: 8.31k]
  ------------------
  798|    764|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 764, False: 7.89k]
  ------------------
  799|  8.66k|	}
  800|    347|yy51:
  801|    347|	YYSKIP();
  ------------------
  |  |   35|    347|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    347|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    347|	{ goto match_index; }
  803|  8.66k|}
  804|       |
  805|       |
  806|    347| match_index:
  807|    347|    len = (size_t)(pos - 1 - begin);
  808|    347|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 347]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    347|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    347|    if(nsMapping)
  ------------------
  |  Branch (811:8): [True: 0, False: 347]
  ------------------
  812|      0|        qn->namespaceIndex =
  813|      0|            UA_NamespaceMapping_remote2Local(nsMapping, qn->namespaceIndex);
  814|    347|    goto match_name;
  815|       |
  816|    195| match_uri:
  817|    195|    str.length = (size_t)(pos - 1 - begin);
  818|    195|    str.data = (UA_Byte*)(uintptr_t)begin;
  819|    195|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  820|    195|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    195|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (820:8): [True: 195, False: 0]
  ------------------
  821|    195|        pos = begin; /* Use the entire string for the name */
  822|       |
  823|  12.5k| match_name:
  824|  12.5k|    str.length = (size_t)(end - pos);
  825|  12.5k|    str.data = (UA_Byte*)(uintptr_t)pos;
  826|  12.5k|    res = UA_String_copy(&str, &qn->name);
  827|  12.5k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  578|  12.5k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (578:23): [True: 12.5k, False: 2]
  |  |  ------------------
  ------------------
  828|  12.5k|        res = UA_String_unescape(&qn->name, false, escName);
  829|  12.5k|    return res;
  830|    195|}

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

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

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

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

ua_types.c:UA_ByteString_init:
  243|  8.37k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  243|  22.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  243|  1.84k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  243|    457|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_clear:
  243|      2|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  243|  12.5k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  243|  45.3k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  243|  1.50k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  243|  45.1k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  243|  35.5k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  243|  16.2k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  243|     85|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  243|    477|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_clear:
  243|  25.2k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_DataValue_clear:
  243|  19.3k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_equal:
  243|    127|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_ByteString_clear:
  243|  6.86k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_String_clear:
  243|  6.89k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

